| ... | ... | @@ -1639,7 +1639,11 @@ const NavGen = struct { |
| 1639 | 1639 | return try self.arrayType(1, elem_ty_id); |
| 1640 | 1640 | } else { |
| 1641 | 1641 | const result_id = try self.arrayType(total_len, elem_ty_id); |
| 1642 | | try self.spv.decorate(result_id, .{ .ArrayStride = .{ .array_stride = @intCast(elem_ty.abiSize(zcu)) } }); |
| 1642 | if (target.os.tag == .vulkan) { |
| 1643 | try self.spv.decorate(result_id, .{ .ArrayStride = .{ |
| 1644 | .array_stride = @intCast(elem_ty.abiSize(zcu)), |
| 1645 | } }); |
| 1646 | } |
| 1643 | 1647 | return result_id; |
| 1644 | 1648 | } |
| 1645 | 1649 | }, |
| ... | ... | @@ -1694,8 +1698,15 @@ const NavGen = struct { |
| 1694 | 1698 | .pointer => { |
| 1695 | 1699 | const ptr_info = ty.ptrInfo(zcu); |
| 1696 | 1700 | |
| 1701 | const child_ty = Type.fromInterned(ptr_info.child); |
| 1697 | 1702 | const storage_class = self.spvStorageClass(ptr_info.flags.address_space); |
| 1698 | | const ptr_ty_id = try self.ptrType(Type.fromInterned(ptr_info.child), storage_class); |
| 1703 | const ptr_ty_id = try self.ptrType(child_ty, storage_class); |
| 1704 | |
| 1705 | if (target.os.tag == .vulkan and ptr_info.flags.size == .Many) { |
| 1706 | try self.spv.decorate(ptr_ty_id, .{ .ArrayStride = .{ |
| 1707 | .array_stride = @intCast(child_ty.abiSize(zcu)), |
| 1708 | } }); |
| 1709 | } |
| 1699 | 1710 | |
| 1700 | 1711 | if (ptr_info.flags.size != .Slice) { |
| 1701 | 1712 | return ptr_ty_id; |