Fix crash on some games using DX11.

The line: "ctx->PSGetSamplers(0, 1, &old.PSSampler);" will fail silently (no return code) but will not modify old.PSSampler making the game crash when accessing uninitialized memory.
merge-requests/38/merge
Nemirtingas 2020-11-17 17:15:16 +00:00
parent fc76b2d53f
commit 145cbfdffd
1 changed files with 1 additions and 1 deletions

View File

@ -194,7 +194,7 @@ void ImGui_ImplDX11_RenderDrawData(ImDrawData* draw_data)
DXGI_FORMAT IndexBufferFormat; DXGI_FORMAT IndexBufferFormat;
ID3D11InputLayout* InputLayout; ID3D11InputLayout* InputLayout;
}; };
BACKUP_DX11_STATE old; BACKUP_DX11_STATE old = {};
old.ScissorRectsCount = old.ViewportsCount = D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE; old.ScissorRectsCount = old.ViewportsCount = D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE;
ctx->RSGetScissorRects(&old.ScissorRectsCount, old.ScissorRects); ctx->RSGetScissorRects(&old.ScissorRectsCount, old.ScissorRects);
ctx->RSGetViewports(&old.ViewportsCount, old.Viewports); ctx->RSGetViewports(&old.ViewportsCount, old.Viewports);