From 838a6ef0f112fab57334471ab28d3509f440324d Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Fri, 8 Jan 2021 00:55:38 +0000 Subject: [PATCH] [d3d11] Disallow mismatching shader bytecode and type Fixes a wine test which lead to a "refcounting bug" down the line. --- src/d3d11/d3d11_shader.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/d3d11/d3d11_shader.cpp b/src/d3d11/d3d11_shader.cpp index 3fe686cf..b3c3bfd6 100644 --- a/src/d3d11/d3d11_shader.cpp +++ b/src/d3d11/d3d11_shader.cpp @@ -34,7 +34,11 @@ namespace dxvk { // Decide whether we need to create a pass-through // geometry shader for vertex shader stream output bool passthroughShader = pDxbcModuleInfo->xfb != nullptr - && module.programInfo().type() != DxbcProgramType::GeometryShader; + && (module.programInfo().type() == DxbcProgramType::VertexShader + || module.programInfo().type() == DxbcProgramType::DomainShader); + + if (module.programInfo().shaderStage() != pShaderKey->type() && !passthroughShader) + throw DxvkError("Mismatching shader type."); m_shader = passthroughShader ? module.compilePassthroughShader(*pDxbcModuleInfo, name)