| 1 | const RuntimeArray = @SpirvType(.{ .runtime_array = f32 }); |
| 2 | const Buffer = extern struct { |
| 3 | data: RuntimeArray, |
| 4 | }; |
| 5 | const buf = @extern(*addrspace(.storage_buffer) Buffer, .{ |
| 6 | .name = "buf", |
| 7 | .decoration = .{ .descriptor = .{ .set = 0, .binding = 0 } }, |
| 8 | }); |
| 9 | export fn main() callconv(.kernel) void { |
| 10 | const a = buf.data; |
| 11 | _ = a; |
| 12 | } |
| 13 | export fn main2() callconv(.kernel) void { |
| 14 | const p: *addrspace(.storage_buffer) const RuntimeArray = &buf.data; |
| 15 | _ = p.*; |
| 16 | } |
| 17 | |
| 18 | // error |
| 19 | // backend=selfhosted |
| 20 | // target=spirv32-vulkan |
| 21 | // |
| 22 | // :10:18: error: cannot load SPIR-V runtime array value |
| 23 | // :15:10: error: cannot load SPIR-V runtime array value |