From 20b908968fcc5da0208263a33262501e5891be7c Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 22 Jun 2026 13:48:55 +0100 Subject: [PATCH] Force declaration of bool helpers to be uint. Closes #3856 * Reflection here is inconsistent, with descrepancies between GL and SPIR-V reflection. To be safe and consistent we force uint in all cases. --- renderdoc/driver/gl/gl_shaderdebug.cpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/renderdoc/driver/gl/gl_shaderdebug.cpp b/renderdoc/driver/gl/gl_shaderdebug.cpp index 4a55be48f..b55201d7f 100644 --- a/renderdoc/driver/gl/gl_shaderdebug.cpp +++ b/renderdoc/driver/gl/gl_shaderdebug.cpp @@ -1927,13 +1927,25 @@ static bool DeclareSignatureElement(const ShaderReflection *refl, size_t i, rdcs if(name.beginsWith("gl_")) name.insert(0, '_'); - char prefix = (sig.varType == VarType::Float) ? ' ' - : (sig.varType == VarType::UInt) ? 'u' - : (sig.varType == VarType::SInt) ? 'i' - : 'x'; + VarType varType = sig.varType; + + // bool in/out variables are not allowed in GLSL but these two builtins may come back as bool from + // SPIR-V reflection (GL reflection will type them as ints). Ensure this matches the uint-coerced + // value in CreateInputFetcher() + if(varType == VarType::Bool) + { + RDCASSERT(sig.systemValue == ShaderBuiltin::IsFrontFace || + sig.systemValue == ShaderBuiltin::IsHelper); + varType = VarType::UInt; + } + + char prefix = (varType == VarType::Float) ? ' ' + : (varType == VarType::UInt) ? 'u' + : (varType == VarType::SInt) ? 'i' + : 'x'; if(sig.compCount == 1) { - sigDecl += ToStr(sig.varType); + sigDecl += ToStr(varType); } else {