forked from gfx-rs/wgpu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an experimental vertex pulling flag to Metal pipelines.
This proves a flag in msl::PipelineOptions that attempts to write all metal vertex entry points to use a vertex pulling technique. It does this by: 1) Forcing the _buffer_sizes structure to be generated for all vertex entry points. 2) Adding new args to vertex entry points for the vertex id and for the bound buffers. 3) Adding code at the beginning of the function for vertex entry points to compare the vertex id against the lengths of all the bound buffers, and force an early-exit if the bounds are violated. 4) Extracting the raw bytes from the vertex buffer(s) and unpacking those bytes into the bound attributes with the expected types. 5) Replacing the varyings input and instead using the unpacked attributes to fill any structs-as-args that are rebuilt in the entry point. A new naga test is added which exercises this flag and demonstrates the effect of the transform. The msl generated by this test passes validation. Future work will add reftests confirming that transformed shaders produce the same result as untransformed shaders. Eventually this transformation will be the default behavior and the flag will be removed.
- Loading branch information
Showing
9 changed files
with
1,224 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.