mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
metal: fix shader:send with fields in an array-of-structs.
This commit is contained in:
@@ -288,8 +288,19 @@ void Shader::buildLocalUniforms(const spirv_cross::CompilerMSL &msl, const spirv
|
|||||||
switch (membertype.basetype)
|
switch (membertype.basetype)
|
||||||
{
|
{
|
||||||
case SPIRType::Struct:
|
case SPIRType::Struct:
|
||||||
name += ".";
|
if (membertype.op == spv::OpTypeArray)
|
||||||
buildLocalUniforms(msl, membertype, offset, name);
|
{
|
||||||
|
for (uint32 i = 0; i < membertype.array[0]; i++)
|
||||||
|
{
|
||||||
|
std::string structname = name + "[" + std::to_string(i) + "].";
|
||||||
|
buildLocalUniforms(msl, membertype, offset, structname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::string structname = name = ".";
|
||||||
|
buildLocalUniforms(msl, membertype, offset, structname);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
case SPIRType::Int:
|
case SPIRType::Int:
|
||||||
case SPIRType::UInt:
|
case SPIRType::UInt:
|
||||||
|
|||||||
Reference in New Issue
Block a user