D3D11: Correct clearing samplers.

This commit is contained in:
Unknown W. Brackets 2021-09-11 18:13:43 -07:00
parent 1a603fedf5
commit 1e66a66ed7
2 changed files with 3 additions and 2 deletions

View File

@ -1347,7 +1347,7 @@ void D3D11DrawContext::BindSamplerStates(int start, int count, SamplerState **st
_assert_(start + count <= ARRAY_SIZE(samplers)); _assert_(start + count <= ARRAY_SIZE(samplers));
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
D3D11SamplerState *samp = (D3D11SamplerState *)states[i]; D3D11SamplerState *samp = (D3D11SamplerState *)states[i];
samplers[i] = samp->ss; samplers[i] = samp ? samp->ss : nullptr;
} }
context_->PSSetSamplers(start, count, samplers); context_->PSSetSamplers(start, count, samplers);
} }

View File

@ -530,7 +530,8 @@ public:
_assert_(start + count <= MAX_BOUND_TEXTURES); _assert_(start + count <= MAX_BOUND_TEXTURES);
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
D3D9SamplerState *s = static_cast<D3D9SamplerState *>(states[i]); D3D9SamplerState *s = static_cast<D3D9SamplerState *>(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 { void BindVertexBuffers(int start, int count, Buffer **buffers, const int *offsets) override {