Disallow shader debugging when unbounded cbuffers are used on SPIR-V

This commit is contained in:
baldurk
2026-05-11 13:35:42 +01:00
parent 2805fc68f8
commit 7f1e0040e5
@@ -962,6 +962,33 @@ void Reflector::CheckDebuggable(bool &debuggable, rdcstr &debugStatus) const
debugStatus += StringFormat::Fmt("Unsupported extended instruction set: '%s'\n", setname.c_str());
}
// we don't currently support debugging unbounded arrays of cbuffers
for(const Variable &v : globals)
{
if(v.storage == StorageClass::Uniform)
{
const DataType &type = dataTypes[v.type];
// global variables should all be pointers into opaque storage
RDCASSERT(type.type == DataType::PointerType);
const DataType *innertype = &dataTypes[type.InnerType()];
if(innertype->type == DataType::ArrayType)
{
if(innertype->length == Id())
{
debuggable = false;
rdcstr name = strings[v.id];
if(name.empty())
name = GetRawName(v.id);
debugStatus +=
StringFormat::Fmt("Unsupported unbounded uniform buffer array: '%s'\n", name.c_str());
}
}
}
}
debugStatus.trim();
}