Zig Version
0.16.0
Steps to Reproduce and Observed Behavior
Add and use a variable defined like so:
constsome_uniform=@extern(*addrspace(.uniform)SomeBlock,.{.name="uniform_name",.decoration=.{.descriptor=.{.set=1,.binding=0}},}Compile it with Spir-V backend
Then analyse the generated code
For that, I loaded it in a vulkan based library (in my case, SDL3), and analysed the generated code in renderdoc
The result will appear like so:
Uniform basic.vert.MyUniformBlock* u_transform : [[DescriptorSet(0), Binding(1)]];
Expected Behavior
It should be:
Uniform basic.vert.MyUniformBlock* u_transform : [[DescriptorSet(1), Binding(0)]];
I'll note that I have searched through the PRs, and I believe this is where it happens:
src/InternPool.zig , function getExtern , line 9080-9083:
constdecoration_type,constlocation_or_descriptor_set,constdescriptor_binding=if(key.decoration)|decoration|switch(decoration){.location=>|location|.{Tag.Extern.Flags.DecorationType.location,location,undefined},.descriptor=>|descriptor|.{Tag.Extern.Flags.DecorationType.descriptor,descriptor.binding,descriptor.set},}else.{Tag.Extern.Flags.DecorationType.none,undefined,undefined};
### Zig Version
0.16.0
### Steps to Reproduce and Observed Behavior
Add and use a variable defined like so:
```zig
const some_uniform = @extern(*addrspace(.uniform) SomeBlock, .{
.name = "uniform_name",
.decoration = .{ .descriptor = .{ .set = 1, .binding = 0 } },
}
```
Compile it with Spir-V backend
Then analyse the generated code
> For that, I loaded it in a vulkan based library (in my case, SDL3), and analysed the generated code in renderdoc
The result will appear like so:
```spv
Uniform basic.vert.MyUniformBlock* u_transform : [[DescriptorSet(0), Binding(1)]];
```
### Expected Behavior
It should be:
```spv
Uniform basic.vert.MyUniformBlock* u_transform : [[DescriptorSet(1), Binding(0)]];
```
I'll note that I have searched through the PRs, and I believe this is where it happens:
src/InternPool.zig , function getExtern , line 9080-9083:
```zig
const decoration_type, const location_or_descriptor_set, const descriptor_binding = if (key.decoration) |decoration| switch (decoration) {
.location => |location| .{ Tag.Extern.Flags.DecorationType.location, location, undefined },
.descriptor => |descriptor| .{ Tag.Extern.Flags.DecorationType.descriptor, descriptor.binding, descriptor.set },
} else .{ Tag.Extern.Flags.DecorationType.none, undefined, undefined };
```