Zig Version
0.17.0-dev.1150+175589fc7
Steps to Reproduce, Observed Behavior, and Expected Behavior
apply #35974 to zig compiler
git clone https://codeberg.org/andrewrk/daw
git checkout 664e79055ad88481b81d94c9db2a5f6299b89209
zig build run
warning(validation): vkCreateShaderModule(): pCreateInfo->pCode (spirv-val produced an error):
Capability Linkage is not allowed by Vulkan 1.3 specification (or requires extension)
OpCapability Linkage
Command to reproduce:
spirv-val <input.spv> --relax-block-layout --target-env vulkan1.3
The Vulkan spec states: If pCode is a pointer to SPIR-V code, pCode must adhere to the validation rules described by the Validation Rules within a Module section of the SPIR-V Environment appendix (https://docs.vulkan.org/spec/latest/chapters/shaders.html#VUID-VkShaderModuleCreateInfo-pCode-08737)
warning(validation): vkCreateShaderModule(): SPIR-V has Capability (Linkage) declared, but this is not supported by Vulkan.
The Vulkan spec states: If pCode is a pointer to SPIR-V code, pCode must not declare any capability that is not supported by the API, as described by the Capabilities section of the SPIR-V Environment appendix (https://docs.vulkan.org/spec/latest/chapters/shaders.html#VUID-VkShaderModuleCreateInfo-pCode-08739)
Why is capability linkage required? Is that a design limitation of SPIR-V backend?
Either way, there is a bug because @import("builtin") should show the correct CPU feature for linkage:
andy@bark ~/d/daw (main)> zig-dev build-obj --show-builtin -target spirv64-vulkan -mcpu generic+int64+float64+float16
...
pub const cpu: std.Target.Cpu = .{
.arch = .spirv64,
.model = &std.Target.spirv.cpu.generic,
.features = std.Target.spirv.featureSet(&.{
.float16,
.float64,
.int64,
.v1_0,
}),
};
...
linkage is missing from this list. Furthermore, if linkage is a requirement of the zig spir-v backend then it should be part of generic and baseline, and attempting to remove it should give a compile error since the compiler cannot fulfill that request.
### Zig Version
0.17.0-dev.1150+175589fc7
### Steps to Reproduce, Observed Behavior, and Expected Behavior
apply https://codeberg.org/ziglang/zig/pulls/35974 to zig compiler
```
git clone https://codeberg.org/andrewrk/daw
git checkout 664e79055ad88481b81d94c9db2a5f6299b89209
zig build run
```
```
warning(validation): vkCreateShaderModule(): pCreateInfo->pCode (spirv-val produced an error):
Capability Linkage is not allowed by Vulkan 1.3 specification (or requires extension)
OpCapability Linkage
Command to reproduce:
spirv-val <input.spv> --relax-block-layout --target-env vulkan1.3
The Vulkan spec states: If pCode is a pointer to SPIR-V code, pCode must adhere to the validation rules described by the Validation Rules within a Module section of the SPIR-V Environment appendix (https://docs.vulkan.org/spec/latest/chapters/shaders.html#VUID-VkShaderModuleCreateInfo-pCode-08737)
warning(validation): vkCreateShaderModule(): SPIR-V has Capability (Linkage) declared, but this is not supported by Vulkan.
The Vulkan spec states: If pCode is a pointer to SPIR-V code, pCode must not declare any capability that is not supported by the API, as described by the Capabilities section of the SPIR-V Environment appendix (https://docs.vulkan.org/spec/latest/chapters/shaders.html#VUID-VkShaderModuleCreateInfo-pCode-08739)
```
Why is capability linkage required? Is that a design limitation of SPIR-V backend?
Either way, there is a bug because `@import("builtin")` should show the correct CPU feature for `linkage`:
```
andy@bark ~/d/daw (main)> zig-dev build-obj --show-builtin -target spirv64-vulkan -mcpu generic+int64+float64+float16
...
pub const cpu: std.Target.Cpu = .{
.arch = .spirv64,
.model = &std.Target.spirv.cpu.generic,
.features = std.Target.spirv.featureSet(&.{
.float16,
.float64,
.int64,
.v1_0,
}),
};
...
```
`linkage` is missing from this list. Furthermore, if `linkage` is a requirement of the zig spir-v backend then it should be part of generic and baseline, and attempting to remove it should give a compile error since the compiler cannot fulfill that request.