mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-10-28 10:45:48 +08:00
gen_spirv_spec, update_cpu_features: omit provisional spirv features
This commit is contained in:
4 files changed
+3
-38
No files matched your search
@@ -105,7 +105,6 @@ pub const Feature = enum {
|
||||
opt_none_ext,
|
||||
pipe_storage,
|
||||
pipes,
|
||||
poison_freeze_khr,
|
||||
quad_control_khr,
|
||||
ray_cull_mask_khr,
|
||||
ray_query_khr,
|
||||
@@ -178,7 +177,6 @@ pub const Feature = enum {
|
||||
SPV_KHR_integer_dot_product,
|
||||
SPV_KHR_multiview,
|
||||
SPV_KHR_opacity_micromap,
|
||||
SPV_KHR_poison_freeze,
|
||||
SPV_KHR_post_depth_coverage,
|
||||
SPV_KHR_quad_control,
|
||||
SPV_KHR_ray_cull_mask,
|
||||
@@ -903,13 +901,6 @@ pub const all_features = blk: {
|
||||
.description = "Enable pipes capability",
|
||||
.dependencies = featureSet(&[_]Feature{}),
|
||||
};
|
||||
result[@backingInt(Feature.poison_freeze_khr)] = .{
|
||||
.llvm_name = null,
|
||||
.description = "Enable poison_freeze_khr capability",
|
||||
.dependencies = featureSet(&[_]Feature{
|
||||
.SPV_KHR_poison_freeze,
|
||||
}),
|
||||
};
|
||||
result[@backingInt(Feature.quad_control_khr)] = .{
|
||||
.llvm_name = null,
|
||||
.description = "Enable quad_control_khr capability",
|
||||
@@ -1320,11 +1311,6 @@ pub const all_features = blk: {
|
||||
.description = "Enable SPV_KHR_opacity_micromap extension",
|
||||
.dependencies = featureSet(&[_]Feature{}),
|
||||
};
|
||||
result[@backingInt(Feature.SPV_KHR_poison_freeze)] = .{
|
||||
.llvm_name = null,
|
||||
.description = "Enable SPV_KHR_poison_freeze extension",
|
||||
.dependencies = featureSet(&[_]Feature{}),
|
||||
};
|
||||
result[@backingInt(Feature.SPV_KHR_post_depth_coverage)] = .{
|
||||
.llvm_name = null,
|
||||
.description = "Enable SPV_KHR_post_depth_coverage extension",
|
||||
|
||||
@@ -491,7 +491,6 @@ pub const OperandKind = enum {
|
||||
.{ .name = "StencilRefLessBackAMD", .value = 5084, .parameters = &.{} },
|
||||
.{ .name = "QuadDerivativesKHR", .value = 5088, .parameters = &.{} },
|
||||
.{ .name = "RequireFullQuadsKHR", .value = 5089, .parameters = &.{} },
|
||||
.{ .name = "ArithmeticPoisonKHR", .value = 5157, .parameters = &.{} },
|
||||
.{ .name = "OutputLinesEXT", .value = 5269, .parameters = &.{} },
|
||||
.{ .name = "OutputPrimitivesEXT", .value = 5270, .parameters = &.{.{ .kind = .literal_integer }} },
|
||||
.{ .name = "DerivativeGroupQuadsKHR", .value = 5289, .parameters = &.{} },
|
||||
@@ -957,7 +956,6 @@ pub const OperandKind = enum {
|
||||
.{ .name = "DenormPreserve", .value = 4464, .parameters = &.{} },
|
||||
.{ .name = "DenormFlushToZero", .value = 4465, .parameters = &.{} },
|
||||
.{ .name = "SignedZeroInfNanPreserve", .value = 4466, .parameters = &.{} },
|
||||
.{ .name = "RayQueryProvisionalKHR", .value = 4471, .parameters = &.{} },
|
||||
.{ .name = "RayQueryKHR", .value = 4472, .parameters = &.{} },
|
||||
.{ .name = "UntypedPointersKHR", .value = 4473, .parameters = &.{} },
|
||||
.{ .name = "RayTraversalPrimitiveCullingKHR", .value = 4478, .parameters = &.{} },
|
||||
@@ -972,7 +970,6 @@ pub const OperandKind = enum {
|
||||
.{ .name = "AbortKHR", .value = 5120, .parameters = &.{} },
|
||||
.{ .name = "DescriptorHeapEXT", .value = 5128, .parameters = &.{} },
|
||||
.{ .name = "ConstantDataKHR", .value = 5146, .parameters = &.{} },
|
||||
.{ .name = "PoisonFreezeKHR", .value = 5156, .parameters = &.{} },
|
||||
.{ .name = "ShaderViewportIndexLayerEXT", .value = 5254, .parameters = &.{} },
|
||||
.{ .name = "FragmentFullyCoveredEXT", .value = 5265, .parameters = &.{} },
|
||||
.{ .name = "MeshShadingEXT", .value = 5283, .parameters = &.{} },
|
||||
@@ -997,7 +994,6 @@ pub const OperandKind = enum {
|
||||
.{ .name = "VulkanMemoryModelDeviceScope", .value = 5346, .parameters = &.{} },
|
||||
.{ .name = "PhysicalStorageBufferAddresses", .value = 5347, .parameters = &.{} },
|
||||
.{ .name = "ComputeDerivativeGroupLinearKHR", .value = 5350, .parameters = &.{} },
|
||||
.{ .name = "RayTracingProvisionalKHR", .value = 5353, .parameters = &.{} },
|
||||
.{ .name = "FragmentShaderSampleInterlockEXT", .value = 5363, .parameters = &.{} },
|
||||
.{ .name = "FragmentShaderShadingRateInterlockEXT", .value = 5372, .parameters = &.{} },
|
||||
.{ .name = "FragmentShaderPixelInterlockEXT", .value = 5378, .parameters = &.{} },
|
||||
@@ -1634,8 +1630,6 @@ pub const Opcode = enum(u16) {
|
||||
OpConstantSizeOfEXT = 5129,
|
||||
OpConstantDataKHR = 5147,
|
||||
OpSpecConstantDataKHR = 5148,
|
||||
OpPoisonKHR = 5158,
|
||||
OpFreezeKHR = 5159,
|
||||
OpTypeVectorIdEXT = 5288,
|
||||
OpCooperativeMatrixConvertUseEXT = 5293,
|
||||
OpEmitMeshTasksEXT = 5294,
|
||||
@@ -2129,8 +2123,6 @@ pub const Opcode = enum(u16) {
|
||||
.OpConstantSizeOfEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
|
||||
.OpConstantDataKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .literal_integer, .quantifier = .variadic } },
|
||||
.OpSpecConstantDataKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .literal_integer, .quantifier = .variadic } },
|
||||
.OpPoisonKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result } },
|
||||
.OpFreezeKHR => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
|
||||
.OpTypeVectorIdEXT => &.{ .{ .kind = .id_result }, .{ .kind = .id_ref }, .{ .kind = .id_ref } },
|
||||
.OpCooperativeMatrixConvertUseEXT => &.{ .{ .kind = .id_result_type }, .{ .kind = .id_result }, .{ .kind = .id_ref } },
|
||||
.OpEmitMeshTasksEXT => &.{ .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref }, .{ .kind = .id_ref, .quantifier = .optional } },
|
||||
@@ -2626,8 +2618,6 @@ pub const Opcode = enum(u16) {
|
||||
.OpConstantSizeOfEXT => struct { id_result_type: Id, id_result: Id, type: Id },
|
||||
.OpConstantDataKHR => struct { id_result_type: Id, id_result: Id, data: []const LiteralInteger = &.{} },
|
||||
.OpSpecConstantDataKHR => struct { id_result_type: Id, id_result: Id, data: []const LiteralInteger = &.{} },
|
||||
.OpPoisonKHR => struct { id_result_type: Id, id_result: Id },
|
||||
.OpFreezeKHR => struct { id_result_type: Id, id_result: Id, value: Id },
|
||||
.OpTypeVectorIdEXT => struct { id_result: Id, component_type: Id, component_count: Id },
|
||||
.OpCooperativeMatrixConvertUseEXT => struct { id_result_type: Id, id_result: Id, matrix: Id },
|
||||
.OpEmitMeshTasksEXT => struct { group_count_x: Id, group_count_y: Id, group_count_z: Id, payload: ?Id = null },
|
||||
@@ -2786,7 +2776,6 @@ pub const Opcode = enum(u16) {
|
||||
5126 => .memory,
|
||||
5127 => .annotation,
|
||||
5129...5148 => .constant_creation,
|
||||
5158...5159 => .miscellaneous,
|
||||
5288 => .type_declaration,
|
||||
5293 => .conversion,
|
||||
5294...5295 => .reserved,
|
||||
@@ -3750,7 +3739,6 @@ pub const ExecutionMode = enum(u32) {
|
||||
stencil_ref_less_back_amd = 5084,
|
||||
quad_derivatives_khr = 5088,
|
||||
require_full_quads_khr = 5089,
|
||||
arithmetic_poison_khr = 5157,
|
||||
output_lines_ext = 5269,
|
||||
output_primitives_ext = 5270,
|
||||
derivative_group_quads_khr = 5289,
|
||||
@@ -3825,7 +3813,6 @@ pub const ExecutionMode = enum(u32) {
|
||||
stencil_ref_less_back_amd,
|
||||
quad_derivatives_khr,
|
||||
require_full_quads_khr,
|
||||
arithmetic_poison_khr,
|
||||
output_lines_ext,
|
||||
output_primitives_ext: struct { primitive_count: LiteralInteger },
|
||||
derivative_group_quads_khr,
|
||||
@@ -4357,7 +4344,6 @@ pub const Capability = enum(u32) {
|
||||
denorm_preserve = 4464,
|
||||
denorm_flush_to_zero = 4465,
|
||||
signed_zero_inf_nan_preserve = 4466,
|
||||
ray_query_provisional_khr = 4471,
|
||||
ray_query_khr = 4472,
|
||||
untyped_pointers_khr = 4473,
|
||||
ray_traversal_primitive_culling_khr = 4478,
|
||||
@@ -4372,7 +4358,6 @@ pub const Capability = enum(u32) {
|
||||
abort_khr = 5120,
|
||||
descriptor_heap_ext = 5128,
|
||||
constant_data_khr = 5146,
|
||||
poison_freeze_khr = 5156,
|
||||
shader_viewport_index_layer_ext = 5254,
|
||||
fragment_fully_covered_ext = 5265,
|
||||
mesh_shading_ext = 5283,
|
||||
@@ -4397,7 +4382,6 @@ pub const Capability = enum(u32) {
|
||||
vulkan_memory_model_device_scope = 5346,
|
||||
physical_storage_buffer_addresses = 5347,
|
||||
compute_derivative_group_linear_khr = 5350,
|
||||
ray_tracing_provisional_khr = 5353,
|
||||
fragment_shader_sample_interlock_ext = 5363,
|
||||
fragment_shader_shading_rate_interlock_ext = 5372,
|
||||
fragment_shader_pixel_interlock_ext = 5378,
|
||||
@@ -4538,7 +4522,6 @@ pub const Capability = enum(u32) {
|
||||
.denorm_preserve => &.{ .v1_4, .SPV_KHR_float_controls },
|
||||
.denorm_flush_to_zero => &.{ .v1_4, .SPV_KHR_float_controls },
|
||||
.signed_zero_inf_nan_preserve => &.{ .v1_4, .SPV_KHR_float_controls },
|
||||
.ray_query_provisional_khr => &.{.SPV_KHR_ray_query},
|
||||
.ray_query_khr => &.{.SPV_KHR_ray_query},
|
||||
.untyped_pointers_khr => &.{.SPV_KHR_untyped_pointers},
|
||||
.ray_traversal_primitive_culling_khr => &.{ .SPV_KHR_ray_query, .SPV_KHR_ray_tracing },
|
||||
@@ -4553,7 +4536,6 @@ pub const Capability = enum(u32) {
|
||||
.abort_khr => &.{.SPV_KHR_abort},
|
||||
.descriptor_heap_ext => &.{.SPV_EXT_descriptor_heap},
|
||||
.constant_data_khr => &.{.SPV_KHR_constant_data},
|
||||
.poison_freeze_khr => &.{.SPV_KHR_poison_freeze},
|
||||
.shader_viewport_index_layer_ext => &.{.SPV_EXT_shader_viewport_index_layer},
|
||||
.fragment_fully_covered_ext => &.{.SPV_EXT_fragment_fully_covered},
|
||||
.mesh_shading_ext => &.{.SPV_EXT_mesh_shader},
|
||||
@@ -4578,7 +4560,6 @@ pub const Capability = enum(u32) {
|
||||
.vulkan_memory_model_device_scope => &.{ .v1_5, .SPV_KHR_vulkan_memory_model },
|
||||
.physical_storage_buffer_addresses => &.{ .v1_5, .SPV_EXT_physical_storage_buffer, .SPV_KHR_physical_storage_buffer },
|
||||
.compute_derivative_group_linear_khr => &.{.SPV_KHR_compute_shader_derivatives},
|
||||
.ray_tracing_provisional_khr => &.{.SPV_KHR_ray_tracing},
|
||||
.fragment_shader_sample_interlock_ext => &.{.SPV_EXT_fragment_shader_interlock},
|
||||
.fragment_shader_shading_rate_interlock_ext => &.{.SPV_EXT_fragment_shader_interlock},
|
||||
.fragment_shader_pixel_interlock_ext => &.{.SPV_EXT_fragment_shader_interlock},
|
||||
@@ -4854,7 +4835,6 @@ pub const Extension = enum {
|
||||
SPV_KHR_abort,
|
||||
SPV_EXT_descriptor_heap,
|
||||
SPV_KHR_constant_data,
|
||||
SPV_KHR_poison_freeze,
|
||||
SPV_EXT_shader_viewport_index_layer,
|
||||
SPV_EXT_fragment_fully_covered,
|
||||
SPV_EXT_mesh_shader,
|
||||
|
||||
@@ -1062,6 +1062,7 @@ fn renderFieldName(writer: *std.Io.Writer, operands: []const Operand, field_inde
|
||||
}
|
||||
|
||||
fn isAllowedCapability(name: []const u8) bool {
|
||||
if (std.mem.indexOf(u8, name, "Provisional") != null) return false;
|
||||
const last = name[name.len - 1];
|
||||
if (std.ascii.isLower(last) or std.ascii.isDigit(last)) return true;
|
||||
for (allowed_vendors) |vendor| {
|
||||
@@ -1096,6 +1097,7 @@ fn isEnabled(version: ?[]const u8, capabilities: []const []const u8, extensions:
|
||||
fn keepEnabled(instructions: *[]Instruction, kinds: []OperandKind) void {
|
||||
var kept: usize = 0;
|
||||
for (instructions.*) |inst| {
|
||||
if (inst.provisional) continue;
|
||||
if (!isEnabled(inst.version, inst.capabilities, inst.extensions)) continue;
|
||||
instructions.*[kept] = inst;
|
||||
kept += 1;
|
||||
@@ -1105,6 +1107,7 @@ fn keepEnabled(instructions: *[]Instruction, kinds: []OperandKind) void {
|
||||
const enumerants = kind.enumerants orelse continue;
|
||||
var kept_enumerants: usize = 0;
|
||||
for (enumerants) |enumerant| {
|
||||
if (enumerant.provisional) continue;
|
||||
const enabled = if (std.mem.eql(u8, kind.kind, "Capability"))
|
||||
isAllowedCapability(enumerant.enumerant)
|
||||
else
|
||||
|
||||
@@ -67,10 +67,6 @@ const spirv_omitted_capabilities = [_][]const u8{
|
||||
"matrix", // implied by shader
|
||||
"physical_storage_buffer_addresses", // implied by spirv64-vulkan
|
||||
"linkage", // automatically emitted when externs need linkage decorations
|
||||
|
||||
// Legacy leftovers:
|
||||
"ray_query_provisional_khr",
|
||||
"ray_tracing_provisional_khr",
|
||||
};
|
||||
const spirv_omitted_extensions = [_][]const u8{
|
||||
"SPV_KHR_physical_storage_buffer", // paired with physical_storage_buffer_addresses
|
||||
|
||||
Reference in new issue
Block a user