commit c07b3c8279def54c0cea5b12f5970c44cd2562dd (tree)
parent a1cb9563f6a421220f87692f16251f3628c8cf6c
Author: Ali Cheraghi <alichraghi@proton.me>
Date: Thu, 31 Oct 2024 01:42:00 +0330
spirv: decorate arrays stride
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig
@@ -1640,7 +1640,9 @@ const NavGen = struct {
// can be lowered to ptrAccessChain instead of manually performing the math.
return try self.arrayType(1, elem_ty_id);
} else {
- return try self.arrayType(total_len, elem_ty_id);
+ const result_id = try self.arrayType(total_len, elem_ty_id);
+ try self.spv.decorate(result_id, .{ .ArrayStride = .{ .array_stride = @intCast(elem_ty.abiSize(zcu)) } });
+ return result_id;
}
},
.@"fn" => switch (repr) {