Browse Source

Backends: DX11: Fixed GSGetShader() call not passing an initialized instance count, would generally make the debug layer complain (Added in 1.72).

omar 6 years ago
parent
commit
6cf4743f17
2 changed files with 5 additions and 1 deletions
  1. 3 0
      docs/CHANGELOG.txt
  2. 2 1
      examples/imgui_impl_dx11.cpp

+ 3 - 0
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)

+ 2 - 1
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);