mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-13 10:11:02 +00:00
Fix calculation of scalar offsets for task payload in SPIR-V reflection
This commit is contained in:
@@ -432,10 +432,10 @@ StructSizes CalculateStructProps(uint32_t emptyStructSize, const ShaderConstant
|
||||
if(matSize > 1)
|
||||
ret.extendedAlign = ret.baseAlign = c.type.matrixByteStride;
|
||||
|
||||
ret.scalarSize = ret.scalarAlign * RDCMAX(c.type.rows, (uint8_t)1) *
|
||||
RDCMAX(c.type.columns, (uint8_t)1) * RDCMAX(c.type.elements, 1U);
|
||||
ret.baseSize = ret.baseAlign * matSize * RDCMAX(c.type.elements, 1U);
|
||||
ret.extendedSize = ret.extendedAlign * matSize * RDCMAX(c.type.elements, 1U);
|
||||
ret.scalarSize =
|
||||
ret.scalarAlign * RDCMAX(c.type.rows, (uint8_t)1) * RDCMAX(c.type.columns, (uint8_t)1);
|
||||
ret.baseSize = ret.baseAlign * matSize;
|
||||
ret.extendedSize = ret.extendedAlign * matSize;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -483,6 +483,10 @@ StructSizes CalculateStructProps(uint32_t emptyStructSize, const ShaderConstant
|
||||
}
|
||||
}
|
||||
|
||||
ret.scalarSize *= RDCMAX(c.type.elements, 1U);
|
||||
ret.baseSize *= RDCMAX(c.type.elements, 1U);
|
||||
ret.extendedSize *= RDCMAX(c.type.elements, 1U);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1875,6 +1879,10 @@ void Reflector::MakeConstantBlockVariables(rdcspv::StorageClass storage, const D
|
||||
else if(capabilities.find(rdcspv::Capability::StoragePushConstant16) != capabilities.end())
|
||||
emptyStructSize = 2;
|
||||
}
|
||||
else if(storage == rdcspv::StorageClass::TaskPayloadWorkgroupEXT)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(size_t i = 0; i < cblock.size(); i++)
|
||||
{
|
||||
|
||||
@@ -1510,13 +1510,18 @@ static void LayOutStorageStruct(rdcspv::Editor &editor, const rdcarray<SpecConst
|
||||
if(childType.type == rdcspv::DataType::ArrayType)
|
||||
memberTypeId = childType.InnerType();
|
||||
|
||||
if(childType.type == rdcspv::DataType::StructType ||
|
||||
(childType.type == rdcspv::DataType::ArrayType &&
|
||||
editor.GetDataType(childType.InnerType()).type == rdcspv::DataType::StructType))
|
||||
if(childType.type == rdcspv::DataType::StructType)
|
||||
{
|
||||
offset = AlignUp16(offset);
|
||||
LayOutStorageStruct(editor, specInfo, outputTypeReplacements, childType, memberTypeId, size);
|
||||
}
|
||||
else if(childType.type == rdcspv::DataType::ArrayType &&
|
||||
editor.GetDataType(childType.InnerType()).type == rdcspv::DataType::StructType)
|
||||
{
|
||||
offset = AlignUp16(offset);
|
||||
LayOutStorageStruct(editor, specInfo, outputTypeReplacements,
|
||||
editor.GetDataType(childType.InnerType()), memberTypeId, size);
|
||||
}
|
||||
else if(childType.type == rdcspv::DataType::ArrayType)
|
||||
{
|
||||
const rdcspv::DataType &arrayInnerType = editor.GetDataType(childType.InnerType());
|
||||
|
||||
Reference in New Issue
Block a user