Handle OpAccessChain with zero indexes in SPIRV Reflection

It is legal to have zero indexes
This commit is contained in:
Jake Turner
2024-07-23 10:32:48 +01:00
parent fd0062572b
commit 742886b1b6
@@ -1128,8 +1128,10 @@ void Reflector::MakeReflection(const GraphicsAPI sourceAPI, const ShaderStage st
if(topLevelChildChain.find(access.base) != topLevelChildChain.end())
globalId = topLevelChildChain[access.base];
usedStructChildren[globalId].insert(
EvaluateConstant(access.indexes[0], specInfo).value.u32v[0]);
// It is legal to have zero indexes
if(!access.indexes.empty())
usedStructChildren[globalId].insert(
EvaluateConstant(access.indexes[0], specInfo).value.u32v[0]);
}
}