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: Ensure discrete runtime arrays of buffers have known length. #2248

Merged
merged 1 commit into from
Jan 3, 2024
Merged

MSL: Ensure discrete runtime arrays of buffers have known length. #2248

merged 1 commit into from
Jan 3, 2024

Conversation

billhollings
Copy link
Contributor

An entry-point array of buffers, that is not part of a Metal argument buffer, requires a known length, so it can be emitted as discrete buffers. For runtime arrays of resources, this can be retrieved from the resource binding information added via add_msl_resource_binding().

  • Redefine get_resource_array_size() to consolidate array sizing using both var type, and runtime array sizing from resource bindings, if not found in type.
  • Use get_resource_array_size() to fix issue for runtime arrays of buffers.
  • Update runtime arrays of images and samplers to use get_resource_array_size().
  • Add .DS_Store to .gitignore (unrelated).

This has been tested in MoltenVK, but I couldn't think of a way of defining a SPRIV-Cross unit test for this, as it would involve calling add_msl_resource_binding() with some complex input.

Found as a regression during testing for the next Vulkan SDK release. If possible, this PR should be merged before Jan 5 when a MoltenVK release for the next Vulkan SDK is required.

An entry-point array of buffers, that is not part of a Metal argument
buffer, requires a known length, so it can be emitted as discrete buffers.
For runtime arrays of resources, this can be retrieved from the resource
binding information added via add_msl_resource_binding().

- Redefine get_resource_array_size() to consolidate array sizing using both var
  type, and runtime array sizing from resource bindings, if not found in type.
- Use get_resource_array_size() to fix issue for runtime arrays of buffers.
- Update runtime arrays of images and samplers to use get_resource_array_size().
- Add .DS_Store to .gitignore (unrelated).
@billhollings billhollings changed the base branch from main to MoltenVK-1.2.7-for-vulkan-sdk-1.3.273 January 3, 2024 20:34
@billhollings billhollings merged commit b093d27 into KhronosGroup:MoltenVK-1.2.7-for-vulkan-sdk-1.3.273 Jan 3, 2024
6 checks passed
@billhollings billhollings deleted the msl-fix-discrete-runtime-arrays-of-buffers branch January 3, 2024 20:34
@billhollings billhollings removed the request for review from HansKristian-Work January 3, 2024 20:34
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.

1 participant