Hash :
473798bf
Author :
Date :
2024-11-28T00:38:36
WGSL: @align appropriate struct members in uniforms. Structs used in the uniform address space need to have certain members aligned according to the uniform address space layout constraints (substantially similar to std140). This CL adds @align annotations where necessary, in structs used in the uniform address space. Strictly speaking, it's okay to apply @align annotations to all structs used in the WGSL program, but this CL uses a pre-pass AST traverser to records all the structs used in the uniform address space. This is to avoid more unreadable generated code, and when more transformations are applied to these structs in future CLs, less generated code overall. After this, the only types that can't yet be used in a uniform are matCx2, arrays with stride not divisble by 16 (except when the array element type is a struct), and bools. This is #1 in struct translation in https://docs.google.com/document/d/17Qku1QEbLDhvJS-JJ9lPQAbnuZtLxWhG-ha5eCUhtEY/edit?tab=t.0#bookmark=id.rudfrn2o6jv1 Bug: angleproject:376553328 Change-Id: Ibff3414043a6ecb4a01ef8e3e71dad9c1066ddfd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6056951 Commit-Queue: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>