aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/spirv/Module.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen/spirv/Module.zig')
-rw-r--r--src/codegen/spirv/Module.zig12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/codegen/spirv/Module.zig b/src/codegen/spirv/Module.zig
index 317e32c878..30f9b0bc54 100644
--- a/src/codegen/spirv/Module.zig
+++ b/src/codegen/spirv/Module.zig
@@ -345,22 +345,30 @@ pub fn finalize(self: *Module, a: Allocator) ![]Word {
if (self.target.cpu.features.isEnabled(feature.index)) {
const feature_tag: std.Target.spirv.Feature = @enumFromInt(feature.index);
switch (feature_tag) {
+ // Versions
.v1_0, .v1_1, .v1_2, .v1_3, .v1_4, .v1_5, .v1_6 => {},
+ // Features with no dependencies
.int8 => try self.addCapability(.Int8),
.int16 => try self.addCapability(.Int16),
.int64 => try self.addCapability(.Int64),
.float16 => try self.addCapability(.Float16),
.float64 => try self.addCapability(.Float64),
+ .matrix => try self.addCapability(.Matrix),
+ .storage_push_constant16 => {
+ try self.addExtension("SPV_KHR_16bit_storage");
+ try self.addCapability(.StoragePushConstant16);
+ },
.addresses => if (self.hasFeature(.shader)) {
- try self.addCapability(.PhysicalStorageBufferAddresses);
try self.addExtension("SPV_KHR_physical_storage_buffer");
+ try self.addCapability(.PhysicalStorageBufferAddresses);
} else {
try self.addCapability(.Addresses);
},
- .matrix => try self.addCapability(.Matrix),
+ // Kernel
.kernel => try self.addCapability(.Kernel),
.generic_pointer => try self.addCapability(.GenericPointer),
.vector16 => try self.addCapability(.Vector16),
+ // Shader
.shader => try self.addCapability(.Shader),
}
}