Commit Graph

2 Commits

Author SHA1 Message Date
James Price 960aa2ee75 msl: Add ArrayLengthFromUniform transform
Generate a uniform buffer that will receive the lengths of all storage
buffers, and use this to implement calls to arrayLength(). The
transform is provided with a set of mappings from storage buffer
binding points to the corresponding index into the array of buffer
lengths. The transform reports whether it generated the uniform
buffers or not.

Use this transform from the MSL sanitizer, using the binding number as
the index into the array. This matches the behavior of spirv-cross,
and so works with how Dawn already produces this uniform buffer.

Bug: tint:256
Change-Id: I2682d2d024e8daa30f78270b8cfb6bbb32632133
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54480
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: James Price <jrprice@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
2021-06-19 00:33:35 +00:00
Ben Clayton aba42ed362 Add arrayLength() intrinsic that accepts a pointer argument
The old non-pointer argument overload remains, but is now deprecated.

Bug: tint:806
Change-Id: Ic917ccec0f162414ce1b03df49e332ad84d8060f
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54061
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: David Neto <dneto@google.com>
2021-06-10 18:43:04 +00:00