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.
This commit is contained in:
baldurk
2026-06-22 13:52:14 +01:00
parent 06e8f370ba
commit 20b908968f
+17 -5
View File
@@ -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
{