diff --git a/src/d3d11/d3d11_video.cpp b/src/d3d11/d3d11_video.cpp index 4561f6d4..b8fd949f 100644 --- a/src/d3d11/d3d11_video.cpp +++ b/src/d3d11/d3d11_video.cpp @@ -1055,8 +1055,10 @@ namespace dxvk { BlitStream(streamState, &pStreams[i]); } - if (hasStreamsEnabled) + if (hasStreamsEnabled) { + UnbindResources(); m_ctx->RestoreCommandListState(); + } return S_OK; } @@ -1299,6 +1301,23 @@ namespace dxvk { ctx->bindResourceView(VK_SHADER_STAGE_FRAGMENT_BIT, 2 + i, Rc(cViews[i]), nullptr); 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()); }); } diff --git a/src/d3d11/d3d11_video.h b/src/d3d11/d3d11_video.h index 435b7c57..e883bbb0 100644 --- a/src/d3d11/d3d11_video.h +++ b/src/d3d11/d3d11_video.h @@ -608,6 +608,8 @@ namespace dxvk { const D3D11VideoProcessorStreamState* pStreamState, const D3D11_VIDEO_PROCESSOR_STREAM* pStream); + void UnbindResources(); + }; }