-
Notifications
You must be signed in to change notification settings - Fork 2k
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
d3d11: samplerstate hashing fix #2500
base: master
Are you sure you want to change the base?
Conversation
sorry the git history is all weird I am super weak git-foo. If you have a quick tip on how to fix it I'll do it otherwise feel free to just yoink this and paste it |
Ok, I looked into your PR, but doesn't make sense why passing just addressing modes would fix this. I'll need to investigate. |
Btw, if you syncing branches with latest, use rebase instead of merge. |
… that only differ in cmpfunc would have collided
I'm trying to repro this but it's not triggering the error you have. |
I just repro'd the assert on another machine with that patch against latest. Here's all the debug output up to hitting the assert if that gives any hints |
genie command |
there's a case where you can request two different sampler states and they end up resolving down to the same sampler state in d3d11 internally, causing
DX_CHECK_REFCOUNT(sampler, 1);
to trigger.Namely if you do
BGFX_SAMPLER_MIN_ANISOTROPIC | BGFX_SAMPLER_MAG_ANISOTROPIC
and
BGFX_SAMPLER_MIN_ANISOTROPIC | BGFX_SAMPLER_MAG_ANISOTROPIC | BGFX_SAMPLER_MIP_POINT
it'll trigger that assert.
you can repro the assert with this patch to bump.cpp example
this PR fixes things so these two requests do end up hashing to the same value. I'm hashing more memory than before, there's probably a way to compact the D3D11_TEXTURE_ADDRESS_MODE's better I didn't explore it much.