Skip to content

Commit

Permalink
Updated spirv-cross.
Browse files Browse the repository at this point in the history
  • Loading branch information
bkaradzic committed Jul 30, 2023
1 parent efb7f66 commit 2d66d78
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions 3rdparty/spirv-cross/spirv_msl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17400,11 +17400,11 @@ void CompilerMSL::analyze_argument_buffers()
// member_index and next_arg_buff_index are incremented when padding members are added.
if (msl_options.pad_argument_buffer_resources)
{
auto &rez_bind = get_argument_buffer_resource(desc_set, next_arg_buff_index);
if (!resource.descriptor_alias)
{
while (resource.index > next_arg_buff_index)
{
auto &rez_bind = get_argument_buffer_resource(desc_set, next_arg_buff_index);
switch (rez_bind.basetype)
{
case SPIRType::Void:
Expand Down Expand Up @@ -17442,12 +17442,9 @@ void CompilerMSL::analyze_argument_buffers()
}

// Adjust the number of slots consumed by current member itself.
// If actual member is an array, allow runtime array resolution as well.
uint32_t elem_cnt = type.array.empty() ? 1 : to_array_size_literal(type);
if (elem_cnt == 0)
elem_cnt = get_resource_array_size(var.self);

next_arg_buff_index += elem_cnt;
// Use the count value from the app, instead of the shader, in case the
// shader is only accesing part, or even one element, of the array.
next_arg_buff_index += rez_bind.count;
}

string mbr_name = ensure_valid_name(resource.name, "m");
Expand Down Expand Up @@ -17599,8 +17596,7 @@ void CompilerMSL::add_argument_buffer_padding_buffer_type(SPIRType &struct_type,
argument_buffer_padding_buffer_type_id = ptr_type_id;
}

for (uint32_t rez_idx = 0; rez_idx < rez_bind.count; rez_idx++)
add_argument_buffer_padding_type(argument_buffer_padding_buffer_type_id, struct_type, mbr_idx, arg_buff_index, 1);
add_argument_buffer_padding_type(argument_buffer_padding_buffer_type_id, struct_type, mbr_idx, arg_buff_index, rez_bind.count);
}

// Adds an argument buffer padding argument image type as a member of the struct type at the member index.
Expand Down

0 comments on commit 2d66d78

Please sign in to comment.