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: Pad array elements in Metal argument buffer when shader declares scalar. #2406

Merged

Conversation

billhollings
Copy link
Contributor

A shader may declare and access the first element of a descriptor array as a scalar, which throws off the remaining structure of a Metal Argument Buffer. Add a padding member to the shader Metal argument buffer struct to consume the descriptor elements beyond the first.

  • CompilerMSL::analyze_argument_buffers(): Track when a descriptor array is declared as a scalar in shader, and add a subsequent member to the Metal argument buffer struct to consume the elements beyond the first.
  • CompilerMSL::get_resource_array_size(): Ensure variable id is valid.

… scalar.

A shader may declare and access the first element of a descriptor array
as a scalar, which throws off the remaining structure of a Metal Argument
Buffer. Add a padding member to the shader Metal argument buffer struct
to consume the descriptor elements beyond the first.

- CompilerMSL::analyze_argument_buffers(): Track when a descriptor array
  is declared as a scalar in shader, and add a subsequent member to the
  Metal argument buffer struct to consume the elements beyond the first.
- CompilerMSL::get_resource_array_size(): Ensure variable id is valid.
spirv_msl.cpp Outdated Show resolved Hide resolved
@HansKristian-Work HansKristian-Work merged commit cc62898 into KhronosGroup:main Nov 13, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants