mirrored from https://chromium.googlesource.com/angle/angle
-
Notifications
You must be signed in to change notification settings - Fork 625
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WGSL: support small stride arrays in uniforms
WGSL requires arrays in the uniform address space to have a stride a multiple of 16. This CL makes WGSL translator emit wrapper structs for array element types used in the uniform address space, when the array stride is not a multiple of 16. The exception is for structs that aren't an aligned size of 16n, and for any types matCx2, since they are (or will be) handled in different ways that ensure alignment to 16. This should leave only f32, i32, u32, and vec2. See https://www.w3.org/TR/WGSL/#example-67da5de6 for an example of using a wrapper struct. This requires converting arrays with a wrapper struct element type to arrays with an unwrapped element type when they are first used; this can be "optimized" later for the common case of accessing a single array element, which can then be unwrapped immediately. This CL generates WGSL conversion functions when necessary. After this, the only types that can't yet be used in a uniform are matCx2 and bools. This is #2 in https://docs.google.com/document/d/17Qku1QEbLDhvJS-JJ9lPQAbnuZtLxWhG-ha5eCUhtEY/edit?tab=t.0#bookmark=id.rt3slgehd4te Bug: angleproject:376553328 Change-Id: I1edfa7f481a6cbf5b595643aae8728e67bc4b770 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6092038 Reviewed-by: Shahbaz Youssefi <[email protected]> Reviewed-by: Liza Burakova <[email protected]> Reviewed-by: Matt Denton <[email protected]> Commit-Queue: Matt Denton <[email protected]>
- Loading branch information
Showing
15 changed files
with
572 additions
and
60 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
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
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
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.