Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSL: Support a runtime array with dynamic offset in an argument buffer. #2347

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions spirv_msl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1361,14 +1361,14 @@ void CompilerMSL::emit_entry_point_declarations()

if (is_array(type))
{
if (!type.array[type.array.size() - 1])
SPIRV_CROSS_THROW("Runtime arrays with dynamic offsets are not supported yet.");

is_using_builtin_array = true;
statement(get_argument_address_space(var), " ", type_to_glsl(type), "* ", to_restrict(var_id, true), name,
type_to_array_glsl(type, var_id), " =");

uint32_t array_size = to_array_size_literal(type);
uint32_t array_size = get_resource_array_size(type, var_id);
if (array_size == 0)
SPIRV_CROSS_THROW("Size of runtime array with dynamic offset could not be determined from resource bindings.");

begin_scope();

for (uint32_t i = 0; i < array_size; i++)
Expand Down
Loading