Fix DX12 imgui assert by using new API #588
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With PR #581, samples on Windows hit the following assert:
When PR #581 updated imgui from 1.90.3 to 1.92.4, it pulled in an API change from 1.91.6: the DX12 backend should now be initialized with the
ImGui_ImplDX12_InitInfostruct. The legacy function setsImGuiBackendFlags_RendererHasTexturesto false, whereas the new function sets it to true.The new API is largely the same as the old one, except it now wants:
Based on
example_win32_directx12/main.cpp, the last requirement seems complicated. However, we can continue to use the single SRV Descriptor by populating theLegacySingleSrv*fields. This lines up well with the legacy API parameters. Despite being "legacy" parameters, this still uses the new API and avoids the assert. I've created #587 to shift away from the legacy API entirely since it's unknown how using the legacy API could break things in the future.Fixes #586