From 6cf4743f1755408fd094a75cf1d7a6e5a2ae803e Mon Sep 17 00:00:00 2001 From: omar Date: Thu, 1 Aug 2019 10:58:41 -0700 Subject: [PATCH] Backends: DX11: Fixed GSGetShader() call not passing an initialized instance count, would generally make the debug layer complain (Added in 1.72). --- docs/CHANGELOG.txt | 3 +++ examples/imgui_impl_dx11.cpp | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 43ec4234a..7c251b31b 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -34,6 +34,9 @@ HOW TO UPDATE? ----------------------------------------------------------------------- Other Changes: +- Backends: DX11: Fixed GSGetShader() call not passing an initialized instance count, + would generally make the debug layer complain (Added in 1.72). + ----------------------------------------------------------------------- VERSION 1.72b (Released 2019-07-31) diff --git a/examples/imgui_impl_dx11.cpp b/examples/imgui_impl_dx11.cpp index 89b88dead..197bbe023 100644 --- a/examples/imgui_impl_dx11.cpp +++ b/examples/imgui_impl_dx11.cpp @@ -11,6 +11,7 @@ // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2019-08-01: DirectX11: Fixed code querying the Geometry Shader state (would generally error with Debug layer enabled). // 2019-07-21: DirectX11: Backup, clear and restore Geometry Shader is any is bound when calling ImGui_ImplDX10_RenderDrawData. Clearing Hull/Domain/Compute shaders without backup/restore. // 2019-05-29: DirectX11: Added support for large mesh (64K+ vertices), enable ImGuiBackendFlags_RendererHasVtxOffset flag. // 2019-04-30: DirectX11: Added support for special ImDrawCallback_ResetRenderState callback to reset render state. @@ -208,7 +209,7 @@ void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data) ctx->OMGetDepthStencilState(&old.DepthStencilState, &old.StencilRef); ctx->PSGetShaderResources(0, 1, &old.PSShaderResource); ctx->PSGetSamplers(0, 1, &old.PSSampler); - old.PSInstancesCount = old.VSInstancesCount = 256; + old.PSInstancesCount = old.VSInstancesCount = old.GSInstancesCount = 256; ctx->PSGetShader(&old.PS, old.PSInstances, &old.PSInstancesCount); ctx->VSGetShader(&old.VS, old.VSInstances, &old.VSInstancesCount); ctx->VSGetConstantBuffers(0, 1, &old.VSConstantBuffer);