This repository has been archived by the owner on Jan 29, 2025. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR attempts to close gfx-rs/wgpu#4491
Progress
In its current state, this PR can parse WGSL and generate Metal shaders that, when run with the corresponding PR of wgpu, work correctly in most use cases, with two known exceptions:
When complete, this work should simplify the Metal backend significantly as it allows the binding layout to be driven by the shader itself, obviating the need for hacks like
fake_missing_bindings
. In addition, it enables "bindless" features such as non-uniform indexing of very large arrays of textures.Further work required
While I believe the bulk of the work has been done, I have sadly run out of available time to fully test and resolve all the edge cases required to finish this issue.
In particular, the use cases of writable textures on devices below tier 1, buffers with dynamic offsets and other potential use cases that have not yet been discovered, will require falling back to the existing binding model. This should be possible by simply checking for the presence of these, or any other necessary conditions and emitting a member of the function argument table, as per the existing architecture.