From b185d746eec638e28aa657bd8b9a8481da7c9b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 9 Nov 2026 11:28:25 +0100 Subject: [PATCH] D3D11: Unbind the GS/HS/DS stages at the start of each frame - Fixes #22748 thin3d never uses these stages, so it never set them. A libretro frontend shares the immediate context with us, and recent RetroArch leaves its sprite geometry shader bound after drawing its frame, so every one of our draws went through it and the core output was black (with threaded video off, where the core draws on the frontend's context). Co-Authored-By: Claude Opus 5.5 --- Common/GPU/D3D11/thin3d_d3d11.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Common/GPU/D3D11/thin3d_d3d11.cpp b/Common/GPU/D3D11/thin3d_d3d11.cpp index c7a3ec225b..6e10065514 100644 --- a/Common/GPU/D3D11/thin3d_d3d11.cpp +++ b/Common/GPU/D3D11/thin3d_d3d11.cpp @@ -1652,6 +1652,11 @@ void D3D11DrawContext::BeginFrame(DebugFlags debugFlags) { context_->IASetInputLayout(curInputLayout_.Get()); context_->VSSetShader(curVS_.Get(), nullptr, 0); context_->PSSetShader(curPS_.Get(), nullptr, 0); + // We never use these stages, but a libretro frontend sharing the context may leave a shader bound + // in them (RetroArch draws its sprites with a geometry shader). + context_->GSSetShader(nullptr, nullptr, 0); + context_->HSSetShader(nullptr, nullptr, 0); + context_->DSSetShader(nullptr, nullptr, 0); if (curTopology_ != D3D11_PRIMITIVE_TOPOLOGY_UNDEFINED) { context_->IASetPrimitiveTopology(curTopology_); }