vulkan: fix shader:send with fields in an array-of-structs.

This commit is contained in:
Sasha Szpakowski
2024-03-30 12:20:52 -03:00
parent b5b6d07108
commit c764626a6a
+13 -2
View File
@@ -411,8 +411,19 @@ void Shader::buildLocalUniforms(spirv_cross::Compiler &comp, const spirv_cross::
switch (memberType.basetype)
{
case SPIRType::Struct:
name += ".";
buildLocalUniforms(comp, memberType, offset, name);
if (memberType.op == spv::OpTypeArray)
{
for (uint32 i = 0; i < memberType.array[0]; i++)
{
std::string structname = name + "[" + std::to_string(i) + "].";
buildLocalUniforms(comp, memberType, offset, structname);
}
}
else
{
std::string structname = name = ".";
buildLocalUniforms(comp, memberType, offset, structname);
}
continue;
case SPIRType::Int:
case SPIRType::UInt: