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

DX11 Windows crash when some features are unsupported. #4045

Closed
Nemirtingas opened this issue Apr 15, 2021 · 2 comments
Closed

DX11 Windows crash when some features are unsupported. #4045

Nemirtingas opened this issue Apr 15, 2021 · 2 comments
Labels

Comments

@Nemirtingas
Copy link

Version/Branch of Dear ImGui:

Version: Any
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_dx11.cpp + imgui_impl_win32.cpp
Compiler: MSVC (VS Community 2019), C++14
Operating System: Windows 10

My Issue/Question:
When using my game overlay, some DX11 games crash when using the DX11 renderer at

ctx->PSSetSamplers(0, 1, &old.PSSampler); if (old.PSSampler) old.PSSampler->Release();

because
ctx->PSGetSamplers(0, 1, &old.PSSampler);

failed silently (this function has no return code) and the content of old.PSSampler will then be uninitialized (some random stuff in it).

My quick fix is just to initialize old like so:

BACKUP_DX11_STATE old = {};

All pointers will be nulled and not used because there are already if(old.thing != NULL) checks in the code.

Its an old issue I fixed on my project, I'll see if I can remember on what game it crashed.

ocornut added a commit that referenced this issue Apr 15, 2021
…state if nothing is bound when entering the rendering function. (#4045)
@ocornut
Copy link
Owner

ocornut commented Apr 15, 2021

That makes sense. Merged the fix: 858ea17
Thanks a lot!

@ocornut ocornut closed this as completed Apr 15, 2021
@Nemirtingas
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants