From c392308e6fb612bb3cac08fa6146cf77babc09c9 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 8 Aug 2022 18:53:41 +0200 Subject: [PATCH] [dxvk] Fix spec constant selector test for compute shaders This isn't supported on compute. --- src/dxvk/dxvk_shader.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/dxvk/dxvk_shader.cpp b/src/dxvk/dxvk_shader.cpp index d6430565..71f8abc9 100644 --- a/src/dxvk/dxvk_shader.cpp +++ b/src/dxvk/dxvk_shader.cpp @@ -213,9 +213,13 @@ namespace dxvk { && !m_flags.test(DxvkShaderFlag::ExportsPosition)) return false; - // Ignore shaders that have user-defined spec constants - // and no selector to read their contents from elsewhere - return !m_specConstantMask || (m_specConstantMask & (1u << MaxNumSpecConstants)); + // Spec constant selectors are only supported in graphics + if (m_specConstantMask & (1u << MaxNumSpecConstants)) + return m_info.stage != VK_SHADER_STAGE_COMPUTE_BIT; + + // Always late-compile shaders with spec constants + // that don't use the spec constant selector + return !m_specConstantMask; }