From 9cf17d92880bc81fc5b1b3b8939e537c8f98d64a Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 11 Nov 2017 08:11:10 -0800 Subject: [PATCH] D3D11: Clear input layouts on shader clear. When we do clear shaders, make sure to also clear input layouts so we don't have corrupt keys. --- GPU/D3D11/DrawEngineD3D11.h | 4 ++-- GPU/D3D11/GPU_D3D11.cpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/GPU/D3D11/DrawEngineD3D11.h b/GPU/D3D11/DrawEngineD3D11.h index 48b52063bf..7838c79cea 100644 --- a/GPU/D3D11/DrawEngineD3D11.h +++ b/GPU/D3D11/DrawEngineD3D11.h @@ -146,6 +146,8 @@ public: void Resized() override; + void ClearInputLayoutMap(); + private: void DecodeVerts(); void DoFlush(); @@ -154,8 +156,6 @@ private: void ApplyDrawStateLate(bool applyStencilRef, uint8_t stencilRef); void ResetShaderBlending(); - void ClearInputLayoutMap(); - ID3D11InputLayout *SetupDecFmtForDraw(D3D11VertexShader *vshader, const DecVtxFormat &decFmt, u32 pspFmt); void MarkUnreliable(VertexArrayInfoD3D11 *vai); diff --git a/GPU/D3D11/GPU_D3D11.cpp b/GPU/D3D11/GPU_D3D11.cpp index 24cbde0ca4..3c402a2025 100644 --- a/GPU/D3D11/GPU_D3D11.cpp +++ b/GPU/D3D11/GPU_D3D11.cpp @@ -278,6 +278,7 @@ void GPU_D3D11::DeviceLost() { // Simply drop all caches and textures. // FBOs appear to survive? Or no? shaderManagerD3D11_->ClearShaders(); + drawEngine_.ClearInputLayoutMap(); textureCacheD3D11_->Clear(false); framebufferManagerD3D11_->DeviceLost(); } @@ -742,6 +743,7 @@ void GPU_D3D11::ClearCacheNextFrame() { void GPU_D3D11::ClearShaderCache() { shaderManagerD3D11_->ClearShaders(); + drawEngine_.ClearInputLayoutMap(); } void GPU_D3D11::DoState(PointerWrap &p) {