Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On d3d12 it is too easy to hit the 2k sampler descriptor limit #4700

Closed
nical opened this issue Nov 16, 2023 · 7 comments
Closed

On d3d12 it is too easy to hit the 2k sampler descriptor limit #4700

nical opened this issue Nov 16, 2023 · 7 comments
Labels
api: dx12 Issues with DX12 or DXGI

Comments

@nical
Copy link
Contributor

nical commented Nov 16, 2023

Description

With the d3d12 backend there can be only a limited number of sampler descriptors alive for per device. See the 2k constant here, especially in the browser where the GC can hold texture views alive for arbitrarily long (and texture views don't have a destroy method).

We should eagerly destroy texture views when their textures are destroyed or dropped to free up descriptors faster.

Platform

d3d12 backend on windows

@nical nical added the api: dx12 Issues with DX12 or DXGI label Nov 16, 2023
@nical
Copy link
Contributor Author

nical commented Nov 16, 2023

@nical
Copy link
Contributor Author

nical commented Nov 16, 2023

Actually there is already an issue on file for the 2k sampler limit: #3350

I'll repurpose this one for the intermediate fix of eagerly destroying texture views.

@cwfitzgerald
Copy link
Member

How would eagerly destroying texture views help with sampler bindings?

@nical
Copy link
Contributor Author

nical commented Nov 17, 2023

Aren't the texture views holding sampler descriptors?

@cwfitzgerald
Copy link
Member

Nope, bind groups own them - the way I express the limit to people is "number of sampler bindings in live bind groups"

@nical
Copy link
Contributor Author

nical commented Nov 17, 2023

Ah yes indeed. That means we probably would benefit from eagerly destroying the bindgroups when a texture is destroyed or maybe destroy bindgroups pointing to destroyed resources when we get close to the sampler descriptor limit.

@jimblandy
Copy link
Member

Closed as dup of #3350.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: dx12 Issues with DX12 or DXGI
Projects
None yet
Development

No branches or pull requests

3 participants