mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 08:27:05 +00:00
Add transform/PadArrayElements
Replaces arrays with an explicit stride with an array to a structure holding the element padded with a `[[size]]` decoration. Note that the HLSL writer is still not correctly emitting structure fields with a `[[size]]`, which will be fixed in a follow up change. Bug: tint:182 Bug: tint:895 Fixed: tint:180 Fixed: tint:649 Change-Id: Ic135dfc89309ac805507e9f39392577c7f82d154 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/54582 Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: David Neto <dneto@google.com> Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
@@ -2922,7 +2922,7 @@ sem::Array* Resolver::Array(const ast::Array* arr) {
|
||||
// records an element count of 0 for it.
|
||||
auto size = std::max<uint32_t>(arr->size(), 1) * stride;
|
||||
auto* sem = builder_->create<sem::Array>(el_ty, arr->size(), el_align, size,
|
||||
stride, stride == implicit_stride);
|
||||
stride, implicit_stride);
|
||||
|
||||
if (!ValidateArray(sem, source)) {
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user