| author | |
| committer | |
| log | dda21a25ca12c1d974ace0cb3ce52aa75003da6f |
| tree | 982866a61d1dafc1329b7a852e67831dd205252a |
| parent | 175589fc713d0c706812508fb6bb566b77423b83 |
2 files changed, 5 insertions(+), 4 deletions(-)
src/Sema.zig+3-2| ... | ... | @@ -24966,8 +24966,9 @@ fn zirBuiltinExtern( |
| 24966 | 24966 | } |
| 24967 | 24967 | |
| 24968 | 24968 | if (options.decoration) |decoration| switch (decoration) { |
| 24969 | .flat => if (ptr_info.flags.address_space != .input) { | |
| 24970 | return sema.fail(block, options_src, "'flat' decoration requires 'input' address space", .{}); | |
| 24969 | .flat => switch (ptr_info.flags.address_space) { | |
| 24970 | .input, .output => {}, | |
| 24971 | else => return sema.fail(block, options_src, "\"flat\" decoration requires \"input\" or \"output\" address space", .{}), | |
| 24971 | 24972 | }, |
| 24972 | 24973 | .location, .descriptor => {}, |
| 24973 | 24974 | }; |
test/cases/compile_errors/extern_spirv_decoration_validation.zig+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | const x = @extern(*addrspace(.output) u32, .{ | |
| 1 | const x = @extern(*addrspace(.push_constant) u32, .{ | |
| 2 | 2 | .name = "x", |
| 3 | 3 | .decoration = .{ .flat = 0 }, |
| 4 | 4 | }); |
| ... | ... | @@ -10,4 +10,4 @@ comptime { |
| 10 | 10 | // backend=selfhosted |
| 11 | 11 | // target=spirv32-vulkan |
| 12 | 12 | // |
| 13 | // :1:45: error: 'flat' decoration requires 'input' address space | |
| 13 | // :1:45: error: "flat" decoration requires "input" or "output" address space |