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
parent
fc76b2d53f
commit
145cbfdffd
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue