GPUDevice: Fix binding deferred cleared textures

i.e. briefly flashing previous state after reset.
This commit is contained in:
Stenzek
2023-12-14 14:47:15 +10:00
parent 371c58dc72
commit 7e1276fbac
5 changed files with 30 additions and 6 deletions

View File

@ -940,7 +940,17 @@ void D3D11Device::SetRenderTargets(GPUTexture* const* rts, u32 num_rts, GPUTextu
void D3D11Device::SetTextureSampler(u32 slot, GPUTexture* texture, GPUSampler* sampler)
{
ID3D11ShaderResourceView* T = texture ? static_cast<D3D11Texture*>(texture)->GetD3DSRV() : nullptr;
ID3D11ShaderResourceView* T;
if (texture)
{
static_cast<D3D11Texture*>(texture)->CommitClear(m_context.Get());
T = static_cast<D3D11Texture*>(texture)->GetD3DSRV();
}
else
{
T = nullptr;
}
ID3D11SamplerState* S = sampler ? static_cast<D3D11Sampler*>(sampler)->GetSamplerState() : nullptr;
// Runtime will null these if we don't...