Skip to content

Commit

Permalink
Fix Metal argument buffer array members reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
egorodet committed Jan 1, 2025
1 parent 51d56c3 commit e9e63ce
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static uint32_t GetBindingBufferSize(id<MTLBinding> mtl_binding)
switch(mtl_struct_member.dataType)
{
case MTLDataTypeArray:
return GetResourceTypeByMetalDataType(static_cast<MTLArrayType*>(mtl_struct_member).elementType);
return GetResourceTypeByMetalDataType(mtl_struct_member.arrayType.elementType);

default:
return GetResourceTypeByMetalDataType(mtl_struct_member.dataType);
Expand All @@ -129,7 +129,7 @@ static uint32_t GetBindingBufferSize(id<MTLBinding> mtl_binding)
static uint32_t GetArraySizeOfStructMember(MTLStructMember* mtl_struct_member)
{
return mtl_struct_member.dataType == MTLDataTypeArray
? static_cast<MTLArrayType*>(mtl_struct_member).arrayLength
? mtl_struct_member.arrayType.arrayLength
: 1U;
}

Expand Down

0 comments on commit e9e63ce

Please sign in to comment.