From 1e66a66ed7cf87c461454648fc32f2c18f00ac4f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 11 Sep 2021 18:13:43 -0700 Subject: [PATCH] D3D11: Correct clearing samplers. --- Common/GPU/D3D11/thin3d_d3d11.cpp | 2 +- Common/GPU/D3D9/thin3d_d3d9.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Common/GPU/D3D11/thin3d_d3d11.cpp b/Common/GPU/D3D11/thin3d_d3d11.cpp index b927382c62..e239fcc395 100644 --- a/Common/GPU/D3D11/thin3d_d3d11.cpp +++ b/Common/GPU/D3D11/thin3d_d3d11.cpp @@ -1347,7 +1347,7 @@ void D3D11DrawContext::BindSamplerStates(int start, int count, SamplerState **st _assert_(start + count <= ARRAY_SIZE(samplers)); for (int i = 0; i < count; i++) { D3D11SamplerState *samp = (D3D11SamplerState *)states[i]; - samplers[i] = samp->ss; + samplers[i] = samp ? samp->ss : nullptr; } context_->PSSetSamplers(start, count, samplers); } diff --git a/Common/GPU/D3D9/thin3d_d3d9.cpp b/Common/GPU/D3D9/thin3d_d3d9.cpp index 449b74b05c..f277d6ae95 100644 --- a/Common/GPU/D3D9/thin3d_d3d9.cpp +++ b/Common/GPU/D3D9/thin3d_d3d9.cpp @@ -530,7 +530,8 @@ public: _assert_(start + count <= MAX_BOUND_TEXTURES); for (int i = 0; i < count; ++i) { D3D9SamplerState *s = static_cast(states[i]); - s->Apply(device_, start + i); + if (s) + s->Apply(device_, start + i); } } void BindVertexBuffers(int start, int count, Buffer **buffers, const int *offsets) override {