1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-13 16:08:50 +01:00

[d3d11] Clean up after performing video blit

Otherwise, with the upcoming clear/restore optimizations,
we'd possibly leave some resources bound.
This commit is contained in:
Philip Rebohle 2022-08-04 17:29:24 +02:00
parent 9f07bc6532
commit ebbb77518a
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 22 additions and 1 deletions

View File

@ -1055,8 +1055,10 @@ namespace dxvk {
BlitStream(streamState, &pStreams[i]); BlitStream(streamState, &pStreams[i]);
} }
if (hasStreamsEnabled) if (hasStreamsEnabled) {
UnbindResources();
m_ctx->RestoreCommandListState(); m_ctx->RestoreCommandListState();
}
return S_OK; return S_OK;
} }
@ -1299,6 +1301,23 @@ namespace dxvk {
ctx->bindResourceView(VK_SHADER_STAGE_FRAGMENT_BIT, 2 + i, Rc<DxvkImageView>(cViews[i]), nullptr); ctx->bindResourceView(VK_SHADER_STAGE_FRAGMENT_BIT, 2 + i, Rc<DxvkImageView>(cViews[i]), nullptr);
ctx->draw(3, 1, 0, 0); ctx->draw(3, 1, 0, 0);
ctx->bindResourceSampler(VK_SHADER_STAGE_FRAGMENT_BIT, 1, nullptr);
for (uint32_t i = 0; i < cViews.size(); i++)
ctx->bindResourceView(VK_SHADER_STAGE_FRAGMENT_BIT, 2 + i, nullptr, nullptr);
});
}
void D3D11VideoContext::UnbindResources() {
m_ctx->EmitCs([this] (DxvkContext* ctx) {
ctx->bindRenderTargets(DxvkRenderTargets());
ctx->bindShader(VK_SHADER_STAGE_VERTEX_BIT, nullptr);
ctx->bindShader(VK_SHADER_STAGE_FRAGMENT_BIT, nullptr);
ctx->bindResourceBuffer(VK_SHADER_STAGE_FRAGMENT_BIT, 0, DxvkBufferSlice());
}); });
} }

View File

@ -608,6 +608,8 @@ namespace dxvk {
const D3D11VideoProcessorStreamState* pStreamState, const D3D11VideoProcessorStreamState* pStreamState,
const D3D11_VIDEO_PROCESSOR_STREAM* pStream); const D3D11_VIDEO_PROCESSOR_STREAM* pStream);
void UnbindResources();
}; };
} }