diff --git a/src/dxil/emit.zig b/src/dxil/emit.zig index c28f5df..fa05987 100644 --- a/src/dxil/emit.zig +++ b/src/dxil/emit.zig @@ -1382,6 +1382,7 @@ const Emitter = struct { .constant => |c| return e.list(&.{try e.constant(i.ty, c)}), .param => |p| return frame.params[p], .spec_constant => return e.unsupported("specialization constants outside SPIR-V", .{}), + .spirv_inst => return e.unsupported("inline SPIR-V outside SPIR-V", .{}), .ray_incoming => |k| { // The shader's payload / attribute / parameter argument. const idx: usize = if (k == .attributes) 1 else 0; diff --git a/src/ir/ir.zig b/src/ir/ir.zig index 0a61d81..cb68eb6 100644 --- a/src/ir/ir.zig +++ b/src/ir/ir.zig @@ -131,6 +131,9 @@ pub const Op = union(enum) { ray_incoming: RayIncoming, /// SPIR-V specialization constant (index into Module.spec_constants). spec_constant: u32, + /// Inline SPIR-V (`[[vk::ext_instruction]]` functions): an instruction + /// of `set` (null: core), with the capabilities and extensions it needs. + spirv_inst: *const SpirvInst, patch_output: struct { element: u32, value: Ref }, output_vertex: struct { element: u32, vertex: u32 }, /// Geometry shaders: emit the vertex written to the outputs of a stream, @@ -311,6 +314,11 @@ pub const Global = struct { shader_record: bool = false, /// `[[vk::push_constant]]` buffers (SPIR-V PushConstant storage). push_constant: bool = false, + /// [[vk::input_attachment_index(n)]] (SubpassInput). + input_attachment: ?u32 = null, + /// [[vk::image_format("...")]]: the SPIR-V ImageFormat. + image_format: ?u32 = null, + ext: SpirvExt = .{}, }; pub const Stage = enum { @@ -355,6 +363,7 @@ pub const SigElement = struct { vk_location: ?u32 = null, vk_index: ?u32 = null, vk_builtin: ?[]const u8 = null, + ext_decorations: []const ExtDecoration = &.{}, }; pub const Primitive = enum(u8) { point = 1, line = 2, triangle = 3, line_adj = 6, triangle_adj = 7 }; @@ -418,11 +427,43 @@ pub const Entry = struct { patch_func: ?u32 = null, /// `[RootSignature("...")]`: the root signature text. root_signature: ?[]const u8 = null, + /// Inline SPIR-V capabilities / extensions of the entry function. + ext: SpirvExt = .{}, /// The wrapper with no parameters that reads `inputs`, calls `func` /// and writes `outputs`. wrapper: u32 = 0, }; +/// `[[vk::ext_decorate(...)]]`, `ext_decorate_id`, `ext_decorate_string`. +pub const ExtDecoration = struct { + decoration: u32, + kind: enum { literal, id, string }, + /// Literal words, or the constants for `id`. + ints: []const u32 = &.{}, + strings: []const []const u8 = &.{}, +}; + +/// Inline SPIR-V attributes of a declaration. +pub const SpirvExt = struct { + decorations: []const ExtDecoration = &.{}, + capabilities: []const u32 = &.{}, + extensions: []const []const u8 = &.{}, + /// `[[vk::ext_builtin_input(n)]]` / `ext_builtin_output(n)`. + builtin: ?u32 = null, + builtin_output: bool = false, + /// `[[vk::ext_storage_class(n)]]`. + storage_class: ?u32 = null, +}; + +pub const SpirvInst = struct { + opcode: u32, + set: ?[]const u8 = null, + /// Values, pointers (`[[vk::ext_reference]]`) or literal words. + operands: []const union(enum) { value: Ref, literal: u32 }, + capabilities: []const u32 = &.{}, + extensions: []const []const u8 = &.{}, +}; + /// A ray tracing state object subobject (DXIL::SubobjectKind values). pub const Subobject = struct { name: []const u8, @@ -625,6 +666,7 @@ fn dumpInst(m: *const Module, f: *const Function, r: Ref, w: *std.Io.Writer) !vo .mesh_payload => try w.print("mesh payload", .{}), .ray_incoming => |k| try w.print("ray incoming {s}", .{@tagName(k)}), .spec_constant => |k| try w.print("spec constant {d}", .{k}), + .spirv_inst => |x| try w.print("spirv op {d}", .{x.opcode}), .heap_resource => |h| try w.print("{s}[%{d}]", .{ if (h.sampler) "SamplerDescriptorHeap" else "ResourceDescriptorHeap", h.index.index() }), .patch_output => |x| try w.print("patch output {d} = %{d}", .{ x.element, x.value.index() }), .output_vertex => |x| try w.print("output {d} vertex {d}", .{ x.element, x.vertex }), diff --git a/src/ir/lower.zig b/src/ir/lower.zig index da3fe0c..97bc10e 100644 --- a/src/ir/lower.zig +++ b/src/ir/lower.zig @@ -134,6 +134,54 @@ const Lowerer = struct { try l.buildEntry(f, main, .{ .entry = name, .stage = stage }); } + /// The inline SPIR-V attributes among `attrs` (SPIR-V only). + fn spirvExt(l: *Lowerer, attrs: []const ast.Attribute) Error!ir.SpirvExt { + if (!l.s.opts.spirv) return .{}; + var x: ir.SpirvExt = .{}; + var decs: std.ArrayList(ir.ExtDecoration) = .empty; + var caps: std.ArrayList(u32) = .empty; + var exts: std.ArrayList([]const u8) = .empty; + for (attrs) |a| { + const eq = std.mem.eql; + const int = struct { + fn f(ll: *Lowerer, e: *const ast.Expr) ?u32 { + const v = ll.s.evalInt(e) orelse return null; + return @truncate(@as(u64, @bitCast(v))); + } + }.f; + if (eq(u8, a.name, "vk::ext_capability")) { + for (a.args) |arg| if (int(l, arg)) |c| try caps.append(l.arena, c); + } else if (eq(u8, a.name, "vk::ext_extension")) { + for (a.args) |arg| if (arg.kind == .string_lit) try exts.append(l.arena, try stringContents(l.arena, arg.kind.string_lit)); + } else if (eq(u8, a.name, "vk::ext_builtin_input") or eq(u8, a.name, "vk::ext_builtin_output")) { + if (a.args.len == 1) x.builtin = int(l, a.args[0]); + x.builtin_output = eq(u8, a.name, "vk::ext_builtin_output"); + } else if (eq(u8, a.name, "vk::ext_storage_class")) { + if (a.args.len == 1) x.storage_class = int(l, a.args[0]); + } else if ((eq(u8, a.name, "vk::ext_decorate") or eq(u8, a.name, "vk::ext_decorate_id") or eq(u8, a.name, "vk::ext_decorate_string")) and a.args.len >= 1) { + var d: ir.ExtDecoration = .{ .decoration = int(l, a.args[0]) orelse continue, .kind = if (eq(u8, a.name, "vk::ext_decorate")) .literal else if (eq(u8, a.name, "vk::ext_decorate_id")) .id else .string }; + var ints: std.ArrayList(u32) = .empty; + var strs: std.ArrayList([]const u8) = .empty; + var ok = true; + for (a.args[1..]) |arg| { + if (arg.kind == .string_lit) { + try strs.append(l.arena, try stringContents(l.arena, arg.kind.string_lit)); + } else if (int(l, arg)) |v| { + try ints.append(l.arena, v); + } else ok = false; + } + if (!ok) continue; + d.ints = ints.items; + d.strings = strs.items; + try decs.append(l.arena, d); + } + } + x.decorations = decs.items; + x.capabilities = caps.items; + x.extensions = exts.items; + return x; + } + /// `[[vk::constant_id(n)]] const T x = v;` (SPIR-V only). fn isSpecConstant(l: *Lowerer, v: *const Variable) bool { if (!l.s.opts.spirv or v.storage != .global_uniform) return false; @@ -190,7 +238,7 @@ const Lowerer = struct { .resource => |r| r, else => null, }; - if (r) |res| if (res.kind == .other) continue; + if (r) |res| if (res.kind == .other and !std.mem.startsWith(u8, res.name, "SubpassInput")) continue; const d = v.decl orelse continue; if (isShaderRecord(d.attrs) or hasAttr(d.attrs, "vk::push_constant")) continue; var bd = try l.bindingDecl(d.semantics, d.attrs, l.globals.get(v)); @@ -388,7 +436,7 @@ const Lowerer = struct { }; const shader_record = if (v.decl) |d| isShaderRecord(d.attrs) else false; const push_constant = if (v.decl) |d| hasAttr(d.attrs, "vk::push_constant") else false; - try l.m.globals.append(l.arena, .{ .name = v.name, .ty = v.type, .space = space, .binding = binding, .shader_record = shader_record, .push_constant = push_constant }); + try l.m.globals.append(l.arena, .{ .name = v.name, .ty = v.type, .space = space, .binding = binding, .shader_record = shader_record, .push_constant = push_constant, .input_attachment = if (v.decl) |d| l.s.vkAttrInt(d.attrs, "vk::input_attachment_index") else null, .image_format = if (v.decl) |d| imageFormatNamed(semamod.Sema.vkAttrString(d.attrs, "vk::image_format")) else null, .ext = if (v.decl) |d| try l.spirvExt(d.attrs) else .{} }); const i: u32 = @intCast(l.m.globals.items.len - 1); try l.globals.put(l.arena, v, i); return i; @@ -1175,11 +1223,54 @@ const Lowerer = struct { } } + /// A call of a `[[vk::ext_instruction(opcode[, set])]]` function: the + /// instruction itself (SPIR-V only). + fn spirvInstCall(l: *Lowerer, e: *ast.Expr, f: *const semamod.Function, args: []const *ast.Expr, ret_ty: TypeId) Error!Ref { + if (!l.s.opts.spirv) return l.fail(e, "inline SPIR-V outside SPIR-V"); + var inst: ir.SpirvInst = .{ .opcode = 0, .operands = &.{} }; + var caps: std.ArrayList(u32) = .empty; + var exts: std.ArrayList([]const u8) = .empty; + for (f.decl.attrs) |a| { + if (std.mem.eql(u8, a.name, "vk::ext_instruction") and a.args.len >= 1) { + inst.opcode = @intCast(l.s.evalInt(a.args[0]) orelse return l.fail(e, "this inline SPIR-V instruction")); + if (a.args.len >= 2 and a.args[1].kind == .string_lit) inst.set = try stringContents(l.arena, a.args[1].kind.string_lit); + } + if (std.mem.eql(u8, a.name, "vk::ext_capability")) for (a.args) |x| { + try caps.append(l.arena, @intCast(l.s.evalInt(x) orelse continue)); + }; + if (std.mem.eql(u8, a.name, "vk::ext_extension")) for (a.args) |x| if (x.kind == .string_lit) { + try exts.append(l.arena, try stringContents(l.arena, x.kind.string_lit)); + }; + } + const Operand = @typeInfo(@TypeOf(inst.operands)).pointer.child; + var ops: std.ArrayList(Operand) = .empty; + for (args, 0..) |a, i| { + const pd = if (i < f.decl.params.len) f.decl.params[i] else null; + const pattrs: []const ast.Attribute = if (pd) |x| x.attrs else &.{}; + if (hasAttr(pattrs, "vk::ext_literal")) { + const v = l.s.evalInt(a) orelse return l.fail(a, "a non-constant [[vk::ext_literal]] argument"); + try ops.append(l.arena, .{ .literal = @truncate(@as(u64, @bitCast(v))) }); + } else if (hasAttr(pattrs, "vk::ext_reference")) { + try ops.append(l.arena, .{ .value = try l.lvalue(a) }); + } else { + const pt = if (i < f.params.len) f.params[i].type else a.ty; + try ops.append(l.arena, .{ .value = try l.converted(a, pt) }); + } + } + inst.operands = ops.items; + inst.capabilities = caps.items; + inst.extensions = exts.items; + const p = try l.arena.create(ir.SpirvInst); + p.* = inst; + return l.b.add(.{ .op = .{ .spirv_inst = p }, .ty = ret_ty }); + } + fn call(l: *Lowerer, e: *ast.Expr, callee: *ast.Expr, args: []const *ast.Expr) Error!Ref { const r = l.s.resolution(e) orelse return l.fail(e, "this call"); const ret_ty = try l.concrete(e.ty); switch (r) { .function => |f| { + if (!f.defined and hasAttr(f.decl.attrs, "vk::ext_instruction")) return l.spirvInstCall(e, f, args, ret_ty); const fi = try l.functionIndex(f); // Missing trailing arguments take the parameters' defaults. var full = args; @@ -1600,6 +1691,7 @@ const Lowerer = struct { vk_location: ?u32 = null, vk_index: ?u32 = null, vk_builtin: ?[]const u8 = null, + ext_decorations: []const ir.ExtDecoration = &.{}, /// A field's modifiers, inheriting the enclosing interpolation. fn field(outer: SigAttrs, fld: Field) SigAttrs { @@ -1615,6 +1707,7 @@ const Lowerer = struct { r.vk_location = attrs.vk_location; r.vk_index = attrs.vk_index; r.vk_builtin = attrs.vk_builtin; + r.ext_decorations = attrs.ext_decorations; return r; } @@ -1628,6 +1721,7 @@ const Lowerer = struct { const lit = at.args[0].kind.string_lit; a.vk_builtin = lit[1 .. lit.len - 1]; }; + a.ext_decorations = (l.spirvExt(attrs) catch ir.SpirvExt{}).decorations; return a; } @@ -2008,7 +2102,7 @@ const Lowerer = struct { fn buildEntry(l: *Lowerer, f: *const semamod.Function, main: u32, opts: Options) Error!void { const inits = try l.staticInits(); - var entry: ir.Entry = .{ .func = main, .name = opts.entry, .stage = opts.stage }; + var entry: ir.Entry = .{ .func = main, .name = opts.entry, .stage = opts.stage, .ext = try l.spirvExt(f.decl.attrs) }; entry.outputs = l.early_outputs; for (f.decl.attrs) |a| { if (std.ascii.eqlIgnoreCase(a.name, "numthreads") and a.args.len == 3) { @@ -2223,6 +2317,21 @@ fn packOffset(v: *const Variable) ?u32 { return null; } +/// The SPIR-V ImageFormat a `[[vk::image_format]]` names. +fn imageFormatNamed(name: ?[]const u8) ?u32 { + const n = name orelse return null; + const names = [_][]const u8{ + "unknown", "rgba32f", "rgba16f", "r32f", "rgba8", "rgba8snorm", "rg32f", "rg16f", + "r11g11b10f", "r16f", "rgba16", "rgb10a2", "rg16", "rg8", "r16", "r8", + "rgba16snorm", "rg16snorm", "rg8snorm", "r16snorm", "r8snorm", "rgba32i", "rgba16i", "rgba8i", + "r32i", "rg32i", "rg16i", "rg8i", "r16i", "r8i", "rgba32ui", "rgba16ui", + "rgba8ui", "r32ui", "rgb10a2ui", "rg32ui", "rg16ui", "rg8ui", "r16ui", "r8ui", + "r64ui", "r64i", + }; + for (names, 0..) |x, k| if (std.ascii.eqlIgnoreCase(x, n)) return @intCast(k); + return null; +} + fn hasAttr(attrs: []const ast.Attribute, name: []const u8) bool { for (attrs) |a| if (std.mem.eql(u8, a.name, name)) return true; return false; diff --git a/src/ir/opt.zig b/src/ir/opt.zig index 8d424b7..dfb6e76 100644 --- a/src/ir/opt.zig +++ b/src/ir/opt.zig @@ -203,6 +203,17 @@ fn mapOp(a: Allocator, op: Op, ctx: anytype) Allocator.Error!Op { .method => |x| .{ .method = .{ .name = x.name, .res = ctx.map(x.res), .args = try mapRefs(a, x.args, ctx) } }, .output => |x| .{ .output = .{ .element = x.element, .value = ctx.map(x.value) } }, .heap_resource => |h| .{ .heap_resource = .{ .index = ctx.map(h.index), .sampler = h.sampler } }, + .spirv_inst => |x| blk: { + const ops = try a.dupe(@typeInfo(@TypeOf(x.operands)).pointer.child, x.operands); + for (ops) |*o| switch (o.*) { + .value => |*v| v.* = ctx.map(v.*), + .literal => {}, + }; + const n = try a.create(ir.SpirvInst); + n.* = x.*; + n.operands = ops; + break :blk .{ .spirv_inst = n }; + }, .patch_output => |x| .{ .patch_output = .{ .element = x.element, .value = ctx.map(x.value) } }, .phi => |ps| blk: { const out = try a.alloc(@typeInfo(@TypeOf(ps)).pointer.child, ps.len); diff --git a/src/sema/sema.zig b/src/sema/sema.zig index ad874ad..78c5a21 100644 --- a/src/sema/sema.zig +++ b/src/sema/sema.zig @@ -1067,6 +1067,8 @@ pub const Sema = struct { return s.types.intern(.{ .resource = .{ .kind = vn[1], .elem = elem, .name = n } }); }; // Any other builtin object (RayQuery, node records, vk:: types...). + // vk::ext_result_id: a T (an inline instruction's result). + if (eql(n, "ext_result_id") and args.len == 1) return try s.typeArg(args[0]) orelse TypeTable.error_type; if (isOtherBuiltinObject(n)) { var elem: TypeId = TypeTable.void_type; if (eql(n, "RayQuery")) { @@ -1075,6 +1077,8 @@ pub const Sema = struct { return s.types.intern(.{ .resource = .{ .kind = .other, .elem = elem, .name = n, .flags = flags, .flags2 = flags2 } }); } if (args.len > 0) elem = try s.typeArg(args[0]) orelse TypeTable.void_type; + // SubpassInput / SubpassInputMS default to float4. + if (elem == TypeTable.void_type and std.mem.startsWith(u8, n, "SubpassInput")) elem = try s.types.vector(.float, 4); return s.types.intern(.{ .resource = .{ .kind = .other, .elem = elem, .name = n } }); } // The parser already reported unknown type names. @@ -3592,7 +3596,7 @@ fn methodNamespace(t: types.Type) ?[]const u8 { .sampled_texture_cube => "VkSampledTextureCUBEMethods", .sampled_texture_cube_array => "VkSampledTextureCUBEArrayMethods", .constant_buffer, .texture_buffer, .raytracing_acceleration_structure => null, - .other => if (std.mem.eql(u8, r.name, "RayQuery")) "RayQueryMethods" else null, + .other => if (std.mem.eql(u8, r.name, "RayQuery")) "RayQueryMethods" else if (std.mem.eql(u8, r.name, "SubpassInput")) "VkSubpassInputMethods" else if (std.mem.eql(u8, r.name, "SubpassInputMS")) "VkSubpassInputMSMethods" else null, }, else => null, }; diff --git a/src/spirv/builder.zig b/src/spirv/builder.zig index 3c610d1..a0070a5 100644 --- a/src/spirv/builder.zig +++ b/src/spirv/builder.zig @@ -38,6 +38,7 @@ pub const Op = enum(u16) { spec_constant_false = 49, spec_constant = 50, decorate_id = 332, + execution_mode_id = 331, decorate_string = 5632, constant_false = 42, constant = 43, @@ -245,6 +246,8 @@ pub const Op = enum(u16) { end_primitive = 219, emit_stream_vertex = 220, end_stream_primitive = 221, + /// (Inline SPIR-V may use any value.) + _, }; pub const Section = enum { diff --git a/src/spirv/emit.zig b/src/spirv/emit.zig index eb4c8ed..412f2c5 100644 --- a/src/spirv/emit.zig +++ b/src/spirv/emit.zig @@ -8,6 +8,7 @@ const Allocator = std.mem.Allocator; const ir = @import("../ir/ir.zig"); const types = @import("../sema/types.zig"); const texture = @import("../ir/texture.zig"); +const op_caps = @import("op_caps.zig"); const builder = @import("builder.zig"); const diag = @import("../diag.zig"); const layout = @import("../ir/layout.zig"); @@ -46,6 +47,8 @@ const Capability = enum(u32) { cull_distance = 33, draw_parameters = 4427, device_group = 4437, + input_attachment = 40, + int64_image_ext = 5016, multi_view = 4439, fragment_shading_rate_khr = 4422, stencil_export_ext = 5013, @@ -89,6 +92,8 @@ const Capability = enum(u32) { sampled_image_array_non_uniform_indexing = 5307, storage_buffer_array_non_uniform_indexing = 5308, storage_image_array_non_uniform_indexing = 5309, + /// (Inline SPIR-V may use any value.) + _, }; /// A Vulkan (or universal) target and the SPIR-V version it implies. @@ -161,6 +166,7 @@ const Emitter = struct { counter_slots: []?Slot = &.{}, used_bindings: std.AutoHashMapUnmanaged(struct { u32, u32 }, void) = .empty, spec_ids: std.AutoHashMapUnmanaged(u32, Id) = .empty, + ext_imports: std.StringHashMapUnmanaged(Id) = .empty, /// Flattened resource arrays: a variable per element. flat_vars: std.AutoHashMapUnmanaged(u32, []const Id) = .empty, flat_iface: std.ArrayList(Id) = .empty, @@ -171,6 +177,10 @@ const Emitter = struct { sampler_type: Id = 0, accel_type: Id = 0, ray_query_type: Id = 0, + /// [[vk::image_format]] of the image type being made. + format_override: ?u32 = null, + /// int2(0, 0), the coordinate of subpass reads. + subpass_coord: Id = 0, counter_vars: []Id = &.{}, builtin_inputs: std.AutoHashMapUnmanaged(u32, Id) = .empty, /// Per instruction (current function): texel places (`tex[i]`). @@ -232,6 +242,9 @@ const Emitter = struct { iface: std.ArrayList(Id) = .empty, /// Compute derivatives' execution mode (0: none). derivative_mode: u32 = 0, + /// vk::ext_execution_mode(...): mode and operands (ids for + /// ext_execution_mode_id). + ext_modes: std.ArrayList(struct { words: []const u32, id: bool }) = .empty, /// Mesh shaders: the primitive indices builtin and the payload /// variable (both made on first use); amplification shaders: the /// groupshared variable sent by DispatchMesh. @@ -599,6 +612,93 @@ const Emitter = struct { } } + /// The storage class `[[vk::ext_builtin_*]]` / `[[vk::ext_storage_class]]` + /// give a global, if any. + fn extStorage(g: ir.Global) ?StorageClass { + if (g.ext.builtin != null) return if (g.ext.builtin_output) .output else .input; + if (g.ext.storage_class) |c| return @enumFromInt(c); + return null; + } + + /// Inline SPIR-V decorations, capabilities and extensions of a + /// declaration (decorations on `v` when non-zero). + fn applyExt(e: *Emitter, v: Id, x: ir.SpirvExt) Error!void { + for (x.capabilities) |c| try e.capabilities.put(e.arena, @enumFromInt(c), {}); + for (x.extensions) |name| try e.extension(name); + if (v != 0) try e.extDecorate(v, x.decorations); + } + + /// What an enumerant used by inline SPIR-V needs (as dxc infers). + fn requireNeed(e: *Emitter, n: ?op_caps.Need) Error!void { + const x = n orelse return; + switch (x.cap) { + // (Not kernel capabilities: Addresses, Linkage, Kernel, + // SubgroupDispatch.) + 0, 4, 5, 6, 58 => {}, + else => try e.capabilities.put(e.arena, @enumFromInt(x.cap), {}), + } + if (x.ext.len > 0 and x.core > 100 + @as(u32, e.spv_minor)) try e.extension(x.ext); + } + + fn extDecorate(e: *Emitter, v: Id, decs: []const ir.ExtDecoration) Error!void { + for (decs) |d| { + if (d.decoration == 11 and d.ints.len > 0) try e.requireNeed(op_caps.need(&op_caps.builtins, d.ints[0])) else try e.requireNeed(op_caps.need(&op_caps.decorations, d.decoration)); + } + for (decs) |d| switch (d.kind) { + .literal => { + var words: std.ArrayList(u32) = .empty; + try words.appendSlice(e.arena, &.{ v, d.decoration }); + try words.appendSlice(e.arena, d.ints); + try e.b.emit(.annotations, .decorate, words.items); + }, + .id => { + var words: std.ArrayList(u32) = .empty; + try words.appendSlice(e.arena, &.{ v, d.decoration }); + for (d.ints) |x| try words.append(e.arena, try e.constUint(x)); + try e.b.emit(.annotations, .decorate_id, words.items); + }, + .string => for (d.strings) |str| try e.b.emitWithString(.annotations, .decorate_string, &.{ v, d.decoration }, str, &.{}), + }; + } + + /// Inline SPIR-V: the instruction with its operands (OpExtInst for an + /// instruction set). + fn spirvInst(e: *Emitter, x: *const ir.SpirvInst, ty: TypeId) Error!Id { + for (x.capabilities) |c| try e.capabilities.put(e.arena, @enumFromInt(c), {}); + for (x.extensions) |name| try e.extension(name); + // The capability the grammar gives the instruction (not ones for + // kernels). + if (x.set == null) if (op_caps.get(x.opcode)) |c| switch (c) { + 4, 5, 6 => {}, + else => try e.capabilities.put(e.arena, @enumFromInt(c), {}), + }; + var words: std.ArrayList(u32) = .empty; + const has_result = ty != TypeTable.void_type or x.set != null; + const id: Id = if (has_result) e.b.newId() else 0; + if (has_result) try words.appendSlice(e.arena, &.{ try e.typeId(ty), id }); + if (x.set) |set| try words.appendSlice(e.arena, &.{ try e.extInstImport(set), x.opcode }); + for (x.operands) |o| try words.append(e.arena, switch (o) { + .value => |r| e.val(r), + .literal => |w| w, + }); + const op: Op = if (x.set != null) .ext_inst else @enumFromInt(@as(u16, @intCast(x.opcode))); + try e.b.emit(.functions, op, words.items); + return id; + } + + /// An OpExtInstImport of `name` (made once). + fn extInstImport(e: *Emitter, name: []const u8) Error!Id { + if (std.mem.eql(u8, name, "GLSL.std.450")) { + if (e.glsl == 0) e.glsl = e.b.newId(); + return e.glsl; + } + if (e.ext_imports.get(name)) |id| return id; + const id = e.b.newId(); + try e.b.emitWithString(.ext_inst_imports, .ext_inst_import, &.{id}, name, &.{}); + try e.ext_imports.put(e.arena, name, id); + return id; + } + /// A [[vk::constant_id]] constant: OpSpecConstant* with its SpecId. fn specConstant(e: *Emitter, k: u32) Error!Id { if (e.spec_ids.get(k)) |id| return id; @@ -665,6 +765,7 @@ const Emitter = struct { if (m.entries.items.len == 0 and !link) return e.unsupported("libraries without entry points need a universal target environment (-fspv-target-env=universal1.5)", .{}); if (link) try e.cap(.linkage); for (m.entries.items) |*entry| { + try e.applyExt(0, entry.ext); if (entry.stage == .geometry) try e.cap(.geometry); if (entry.stage == .mesh or entry.stage == .amplification) { if (e.spv_minor < 4) return e.unsupported("mesh and amplification shaders need SPIR-V 1.4 or later (-fspv-target-env=vulkan1.2 or later)", .{}); @@ -847,6 +948,13 @@ const Emitter = struct { else => {}, } if (e.st.derivative_mode != 0) try e.b.emit(.execution_modes, .execution_mode, &.{ wrapper, e.st.derivative_mode }); + // vk::ext_execution_mode(...) / ext_execution_mode_id(...). + for (e.st.ext_modes.items) |em| { + var words: std.ArrayList(u32) = .empty; + try words.append(e.arena, wrapper); + try words.appendSlice(e.arena, em.words); + try e.b.emit(.execution_modes, if (em.id) .execution_mode_id else .execution_mode, words.items); + } } fn domainMode(d: ir.Domain) u32 { @@ -904,13 +1012,16 @@ const Emitter = struct { continue; } const var_id = e.b.newId(); + e.format_override = g.image_format; const p = try e.resourcePointee(g.ty); + e.format_override = null; try e.b.emit(.types_globals, .variable, &.{ try e.pointerType(p.sc, p.ty), var_id, @backingInt(p.sc) }); const slot = try e.slotOf(@intCast(gi), false); try e.b.emit(.annotations, .decorate, &.{ var_id, 34, slot.set }); // DescriptorSet try e.b.emit(.annotations, .decorate, &.{ var_id, 33, slot.binding }); // Binding try e.b.emitWithString(.debug_names, .name, &.{var_id}, g.name, &.{}); try e.userType(var_id, g.ty, g); + if (g.input_attachment) |ia| try e.b.emit(.annotations, .decorate, &.{ var_id, 43, ia }); // InputAttachmentIndex e.global_vars[gi] = var_id; }, .cbuffer => { @@ -935,15 +1046,23 @@ const Emitter = struct { }, .groupshared, .private => { const ty = try e.typeId(g.ty); - const sc: StorageClass = if (e.payload_global == @as(u32, @intCast(gi))) .task_payload_workgroup else if (g.space == .groupshared) .workgroup else .private; + const sc: StorageClass = if (extStorage(g)) |x| x else if (e.payload_global == @as(u32, @intCast(gi))) .task_payload_workgroup else if (g.space == .groupshared) .workgroup else .private; const ptr = try e.pointerType(sc, ty); const var_id = e.b.newId(); try e.b.emit(.types_globals, .variable, &.{ ptr, var_id, @backingInt(sc) }); try e.b.emitWithString(.debug_names, .name, &.{var_id}, g.name, &.{}); + if (g.ext.builtin) |bi| { + try e.b.emit(.annotations, .decorate, &.{ var_id, 11, bi }); // BuiltIn + try e.requireNeed(op_caps.need(&op_caps.builtins, bi)); + // Integer pixel shader inputs are flat. + const c = e.t.component(g.ty); + if (!g.ext.builtin_output and c != null and !c.?.isFloat() and e.entry.stage == .pixel) try e.b.emit(.annotations, .decorate, &.{ var_id, 14 }); // Flat + } e.global_vars[gi] = var_id; }, else => return e.unsupported("global '{s}' is not supported yet", .{g.name}), } + if (e.global_vars[gi] != 0) try e.applyExt(e.global_vars[gi], g.ext); } // Descriptor heaps: the next free bindings of set 0 (resources, @@ -1539,6 +1658,7 @@ const Emitter = struct { const name = if (el.spelling) |sp| try std.fmt.allocPrint(e.arena, "{s}.var.{s}", .{ if (input) "in" else "out", sp }) else try std.fmt.allocPrint(e.arena, "{s}.var.{s}{d}", .{ if (input) "in" else "out", el.semantic, el.semantic_index }); try e.b.emitWithString(.debug_names, .name, &.{var_id}, name, &.{}); try e.userSemantic(var_id, el); + try e.extDecorate(var_id, el.ext_decorations); iface.* = .{ .var_id = var_id, .ty = vty, .elem_array = bi != null and e.t.get(bi.?.ty) == .array, .builtin = if (bi) |x| x.id else std.math.maxInt(u32) }; try e.useVar(var_id); } @@ -1898,6 +2018,7 @@ const Emitter = struct { switch (i.op) { .constant, .param, .local_var => {}, .spec_constant => |k| e.vals[ri] = try e.specConstant(k), + .spirv_inst => |x| e.vals[ri] = try e.spirvInst(x, i.ty), .ray_incoming => |k| e.vals[ri] = try e.rayVar(switch (k) { .payload => .incoming_ray_payload_khr, .attributes => .hit_attribute_khr, @@ -1905,6 +2026,7 @@ const Emitter = struct { }, i.ty), .global => |g| { e.vals[ri] = e.global_vars[g]; + if (extStorage(e.m.globals.items[g])) |sc| if (sc == .input or sc == .output or e.spv_minor >= 4) try e.useVar(e.global_vars[g]); if (ownStorage(e.m.globals.items[g]) != null) { // (Interfaces list them from SPIR-V 1.4.) if (e.spv_minor >= 4) try e.useVar(e.global_vars[g]); @@ -2021,7 +2143,7 @@ const Emitter = struct { const shader_record = own != null; const sc: StorageClass = if (own) |x| x else if (into_cb) .uniform else if (into_buffer or (base_pl != null and base_pl.?.buffer)) e.bufferSc() else if (base_pl != null) .uniform else switch (i.ptr) { .function => .function, - .private => .private, + .private => if (e.rootGlobal(a.base)) |rg| (extStorage(e.m.globals.items[rg]) orelse .private) else .private, .groupshared => if (e.payload_global != null and e.rootGlobal(a.base) == e.payload_global) .task_payload_workgroup else .workgroup, .cbuffer, .resource => .uniform, else => return e.unsupported("access into this storage is not supported yet", .{}), @@ -2686,6 +2808,7 @@ const Emitter = struct { .sampler => return .{ .sc = .uniform_constant, .ty = try e.samplerType() }, .resource => |r| switch (r.kind) { .raytracing_acceleration_structure => return .{ .sc = .uniform_constant, .ty = try e.accelType() }, + .other => if (std.mem.startsWith(u8, r.name, "SubpassInput")) return .{ .sc = .uniform_constant, .ty = try e.subpassType(ty) }, .structured_buffer, .rw_structured_buffer, .append_structured_buffer, .consume_structured_buffer, .byte_address_buffer, .rw_byte_address_buffer => return .{ .sc = e.bufferSc(), .ty = try e.bufferBlockType(ty) }, .constant_buffer => if (e.t.get(r.elem) == .@"struct") return .{ .sc = .uniform, .ty = try e.constantBufferBlock(r.elem) }, .texture_buffer => if (e.t.get(r.elem) == .@"struct") return .{ .sc = e.bufferSc(), .ty = try e.textureBufferBlock(r.elem) }, @@ -2770,7 +2893,9 @@ const Emitter = struct { e.vals[ri] = ids[k]; return; }; + e.format_override = e.formatFor(a.base); const p = try e.resourcePointee(ty); + e.format_override = null; var ops: std.ArrayList(u32) = .empty; const id = e.b.newId(); var nonuniform = false; @@ -2877,6 +3002,20 @@ const Emitter = struct { }; } + /// SubpassInput[MS]: an image of SubpassData dimension. + fn subpassType(e: *Emitter, ty: TypeId) Error!Id { + const r = e.t.get(ty).resource; + try e.cap(.input_attachment); + const ms: u32 = @intFromBool(std.mem.eql(u8, r.name, "SubpassInputMS")); + const st = try e.scalarType(storageScalar(e.t.component(r.elem).?)); + const key: [6]u32 = .{ st, 6, 0, ms, 2, 0 }; + if (e.image_types.get(key)) |id| return id; + const id = e.b.newId(); + try e.b.emit(.types_globals, .type_image, &.{ id, st, 6, 2, 0, ms, 2, 0 }); // SubpassData, Unknown + try e.image_types.put(e.arena, key, id); + return id; + } + fn accelType(e: *Emitter) Error!Id { if (e.accel_type == 0) { e.accel_type = e.b.newId(); @@ -2905,6 +3044,20 @@ const Emitter = struct { /// and the system values as builtins. Null for other names. fn rayIntrinsic(e: *Emitter, name: []const u8, ty: TypeId, args: []const Ref) Error!?Id { const eq = std.mem.eql; + if (eq(u8, name, "ext_execution_mode") or eq(u8, name, "ext_execution_mode_id")) { + const id = eq(u8, name, "ext_execution_mode_id"); + const words = try e.arena.alloc(u32, args.len); + for (words, args, 0..) |*w, a, k| { + const c = switch (e.f.inst(a).op) { + .constant => |c| c, + else => return e.unsupported("'{s}' with non-constant operands", .{name}), + }; + w.* = if (k > 0 and id) try e.constant(e.f.inst(a).ty, c) else @truncate(@as(u64, @bitCast(c.int))); + } + try e.st.ext_modes.append(e.arena, .{ .words = words, .id = id }); + if (words.len > 0) try e.requireNeed(op_caps.need(&op_caps.execution_modes, words[0])); + return 0; + } if (eq(u8, name, "TraceRay") or eq(u8, name, "CallShader")) { // Through the payload / callable data variable, copied in and // back out. @@ -3094,7 +3247,7 @@ const Emitter = struct { .buffer => 5, }; const sampled: u32 = if (sh.rw) 2 else 1; - const format: u32 = if (sh.rw or sh.dim == .buffer) e.imageFormat(elem) else 0; + const format: u32 = if (e.format_override) |f| f else if (sh.rw or sh.dim == .buffer) e.imageFormat(elem) else 0; const key: [6]u32 = .{ st, dim, @intFromBool(sh.array), @intFromBool(sh.ms), sampled, format }; if (e.image_types.get(key)) |id| return id; switch (sh.dim) { @@ -3105,7 +3258,11 @@ const Emitter = struct { } if (sh.rw and sh.ms) try e.cap(if (sh.array) .image_ms_array else .storage_image_multisample); switch (format) { - 6, 7, 9, 25, 26, 28, 35, 36, 38 => try e.cap(.storage_image_extended_formats), + 6...20, 25...29, 34...39 => try e.cap(.storage_image_extended_formats), + 40, 41 => { + try e.cap(.int64_image_ext); + try e.extension("SPV_EXT_shader_image_int64"); + }, else => {}, } const id = e.b.newId(); @@ -3124,9 +3281,20 @@ const Emitter = struct { fn imageTypeOf(e: *Emitter, r: Ref) Error!Id { const rk = e.resourceInfo(r); + e.format_override = e.formatFor(r); + defer e.format_override = null; return e.imageType(texture.shape(rk.kind).?, rk.elem); } + /// The [[vk::image_format]] of the variable image value `r` comes + /// from, if any. + fn formatFor(e: *Emitter, r: Ref) ?u32 { + var x = r; + while (e.f.inst(x).op == .access) x = e.f.inst(x).op.access.base; + const g = e.globalOf(x) orelse return null; + return e.m.globals.items[g].image_format; + } + fn loadImage(e: *Emitter, r: Ref) Error!Id { if (texture.shape(e.resourceInfo(r).kind)) |sh| if (sh.combined) { // A combined image sampler: its image. @@ -3167,7 +3335,7 @@ const Emitter = struct { const img = try e.loadImage(res); var v: Id = undefined; if (sh.rw) { - if (e.imageFormat(r.elem) == 0) try e.cap(.storage_image_read_without_format); + if ((e.formatFor(res) orelse e.imageFormat(r.elem)) == 0) try e.cap(.storage_image_read_without_format); v = if (sh.ms) try e.opRaw(.image_read, try e.vec4Of(s), &.{ img, coord, 0x40, try e.constInt(0) }) else @@ -3184,7 +3352,7 @@ const Emitter = struct { fn imageWrite(e: *Emitter, res: Ref, coord: Id, value: Id) Error!void { const r = e.resourceInfo(res); _ = try e.texelScalar(r.elem); - if (e.imageFormat(r.elem) == 0) try e.cap(.storage_image_write_without_format); + if ((e.formatFor(res) orelse e.imageFormat(r.elem)) == 0) try e.cap(.storage_image_write_without_format); const img = try e.loadImage(res); try e.b.emit(.functions, .image_write, &.{ img, coord, value }); } @@ -3213,6 +3381,25 @@ const Emitter = struct { const eq = std.mem.eql; if (e.t.get(e.f.inst(res).ty) != .resource) return e.unsupported("method '{s}' is not supported yet", .{name}); if (isRayQuery(e.t, e.f.inst(res).ty)) return e.rayQueryMethod(name, res, args, ty); + if (e.t.get(e.f.inst(res).ty).resource.kind == .other and std.mem.eql(u8, name, "SubpassLoad")) { + // OpImageRead at (0, 0) (relative to the fragment), with the + // sample for SubpassInputMS. + var it = e.f.inst(res).ty; + while (e.t.get(it) == .array) it = e.t.get(it).array.elem; + const r = e.t.get(it).resource; + const img = try e.opRaw(.load, try e.subpassType(it), &.{e.val(res)}); + const v4 = try e.t.vector(e.t.component(r.elem).?, 4); + if (e.subpass_coord == 0) { + e.subpass_coord = e.b.newId(); + try e.b.emit(.types_globals, .constant_composite, &.{ try e.typeId(try e.t.vector(.int, 2)), e.subpass_coord, try e.constInt(0), try e.constInt(0) }); + } + const coord = e.subpass_coord; + const texel = if (args.len == 1) + try e.op1(.image_read, v4, &.{ img, coord, 0x40, e.val(args[0]) }) // Sample + else + try e.op1(.image_read, v4, &.{ img, coord, 0 }); + return e.reshape(texel, v4, ty); + } const r = e.resourceInfo(res); if (eq(u8, name, "GetDimensions")) { try e.getDimensions(res, r, args); @@ -3322,7 +3509,7 @@ const Emitter = struct { } var ops: std.ArrayList(u32) = .empty; if (call.op == .load) { - if (sh.rw and e.imageFormat(r.elem) == 0) try e.cap(.storage_image_read_without_format); + if (sh.rw and (e.formatFor(res) orelse e.imageFormat(r.elem)) == 0) try e.cap(.storage_image_read_without_format); try ops.appendSlice(e.arena, &.{ img, coord_id }); if (mask != 0) { try ops.append(e.arena, mask); diff --git a/src/spirv/op_caps.zig b/src/spirv/op_caps.zig new file mode 100644 index 0000000..ce3a242 --- /dev/null +++ b/src/spirv/op_caps.zig @@ -0,0 +1,1090 @@ +//! What SPIR-V instructions and enumerants need (the first capability / +//! extension the grammar lists), for inline SPIR-V. Generated from +//! SPIRV-Headers' spirv.core.grammar.json in the DXC tree +//! (external/SPIRV-Headers). + +const ops = [_][2]u32{ + .{ 24, 0 }, // OpTypeMatrix + .{ 29, 1 }, // OpTypeRuntimeArray + .{ 31, 6 }, // OpTypeOpaque + .{ 34, 6 }, // OpTypeEvent + .{ 35, 19 }, // OpTypeDeviceEvent + .{ 36, 17 }, // OpTypeReserveId + .{ 37, 19 }, // OpTypeQueue + .{ 38, 17 }, // OpTypePipe + .{ 39, 4 }, // OpTypeForwardPointer + .{ 45, 20 }, // OpConstantSampler + .{ 64, 4 }, // OpCopyMemorySized + .{ 67, 4 }, // OpPtrAccessChain + .{ 68, 1 }, // OpArrayLength + .{ 69, 6 }, // OpGenericPtrMemSemantics + .{ 70, 4 }, // OpInBoundsPtrAccessChain + .{ 84, 0 }, // OpTranspose + .{ 87, 1 }, // OpImageSampleImplicitLod + .{ 89, 1 }, // OpImageSampleDrefImplicitLod + .{ 90, 1 }, // OpImageSampleDrefExplicitLod + .{ 91, 1 }, // OpImageSampleProjImplicitLod + .{ 92, 1 }, // OpImageSampleProjExplicitLod + .{ 93, 1 }, // OpImageSampleProjDrefImplicitLod + .{ 94, 1 }, // OpImageSampleProjDrefExplicitLod + .{ 96, 1 }, // OpImageGather + .{ 97, 1 }, // OpImageDrefGather + .{ 101, 6 }, // OpImageQueryFormat + .{ 102, 6 }, // OpImageQueryOrder + .{ 103, 6 }, // OpImageQuerySizeLod + .{ 104, 6 }, // OpImageQuerySize + .{ 105, 50 }, // OpImageQueryLod + .{ 106, 6 }, // OpImageQueryLevels + .{ 107, 6 }, // OpImageQuerySamples + .{ 116, 1 }, // OpQuantizeToF16 + .{ 117, 4 }, // OpConvertPtrToU + .{ 118, 6 }, // OpSatConvertSToU + .{ 119, 6 }, // OpSatConvertUToS + .{ 120, 4 }, // OpConvertUToPtr + .{ 121, 6 }, // OpPtrCastToGeneric + .{ 122, 6 }, // OpGenericCastToPtr + .{ 123, 6 }, // OpGenericCastToPtrExplicit + .{ 143, 0 }, // OpMatrixTimesScalar + .{ 144, 0 }, // OpVectorTimesMatrix + .{ 145, 0 }, // OpMatrixTimesVector + .{ 146, 0 }, // OpMatrixTimesMatrix + .{ 147, 0 }, // OpOuterProduct + .{ 158, 6 }, // OpIsFinite + .{ 159, 6 }, // OpIsNormal + .{ 160, 6 }, // OpSignBitSet + .{ 161, 6 }, // OpLessOrGreater + .{ 162, 6 }, // OpOrdered + .{ 163, 6 }, // OpUnordered + .{ 201, 1 }, // OpBitFieldInsert + .{ 202, 1 }, // OpBitFieldSExtract + .{ 203, 1 }, // OpBitFieldUExtract + .{ 204, 1 }, // OpBitReverse + .{ 207, 1 }, // OpDPdx + .{ 208, 1 }, // OpDPdy + .{ 209, 1 }, // OpFwidth + .{ 210, 51 }, // OpDPdxFine + .{ 211, 51 }, // OpDPdyFine + .{ 212, 51 }, // OpFwidthFine + .{ 213, 51 }, // OpDPdxCoarse + .{ 214, 51 }, // OpDPdyCoarse + .{ 215, 51 }, // OpFwidthCoarse + .{ 218, 2 }, // OpEmitVertex + .{ 219, 2 }, // OpEndPrimitive + .{ 220, 54 }, // OpEmitStreamVertex + .{ 221, 54 }, // OpEndStreamPrimitive + .{ 231, 6 }, // OpAtomicCompareExchangeWeak + .{ 252, 1 }, // OpKill + .{ 256, 6 }, // OpLifetimeStart + .{ 257, 6 }, // OpLifetimeStop + .{ 259, 6 }, // OpGroupAsyncCopy + .{ 260, 6 }, // OpGroupWaitEvents + .{ 261, 18 }, // OpGroupAll + .{ 262, 18 }, // OpGroupAny + .{ 263, 18 }, // OpGroupBroadcast + .{ 264, 18 }, // OpGroupIAdd + .{ 265, 18 }, // OpGroupFAdd + .{ 266, 18 }, // OpGroupFMin + .{ 267, 18 }, // OpGroupUMin + .{ 268, 18 }, // OpGroupSMin + .{ 269, 18 }, // OpGroupFMax + .{ 270, 18 }, // OpGroupUMax + .{ 271, 18 }, // OpGroupSMax + .{ 274, 17 }, // OpReadPipe + .{ 275, 17 }, // OpWritePipe + .{ 276, 17 }, // OpReservedReadPipe + .{ 277, 17 }, // OpReservedWritePipe + .{ 278, 17 }, // OpReserveReadPipePackets + .{ 279, 17 }, // OpReserveWritePipePackets + .{ 280, 17 }, // OpCommitReadPipe + .{ 281, 17 }, // OpCommitWritePipe + .{ 282, 17 }, // OpIsValidReserveId + .{ 283, 17 }, // OpGetNumPipePackets + .{ 284, 17 }, // OpGetMaxPipePackets + .{ 285, 17 }, // OpGroupReserveReadPipePackets + .{ 286, 17 }, // OpGroupReserveWritePipePackets + .{ 287, 17 }, // OpGroupCommitReadPipe + .{ 288, 17 }, // OpGroupCommitWritePipe + .{ 291, 19 }, // OpEnqueueMarker + .{ 292, 19 }, // OpEnqueueKernel + .{ 293, 19 }, // OpGetKernelNDrangeSubGroupCount + .{ 294, 19 }, // OpGetKernelNDrangeMaxSubGroupSize + .{ 295, 19 }, // OpGetKernelWorkGroupSize + .{ 296, 19 }, // OpGetKernelPreferredWorkGroupSizeMultiple + .{ 297, 19 }, // OpRetainEvent + .{ 298, 19 }, // OpReleaseEvent + .{ 299, 19 }, // OpCreateUserEvent + .{ 300, 19 }, // OpIsValidEvent + .{ 301, 19 }, // OpSetUserEventStatus + .{ 302, 19 }, // OpCaptureEventProfilingInfo + .{ 303, 19 }, // OpGetDefaultQueue + .{ 304, 19 }, // OpBuildNDRange + .{ 305, 41 }, // OpImageSparseSampleImplicitLod + .{ 306, 41 }, // OpImageSparseSampleExplicitLod + .{ 307, 41 }, // OpImageSparseSampleDrefImplicitLod + .{ 308, 41 }, // OpImageSparseSampleDrefExplicitLod + .{ 309, 41 }, // OpImageSparseSampleProjImplicitLod + .{ 310, 41 }, // OpImageSparseSampleProjExplicitLod + .{ 311, 41 }, // OpImageSparseSampleProjDrefImplicitLod + .{ 312, 41 }, // OpImageSparseSampleProjDrefExplicitLod + .{ 313, 41 }, // OpImageSparseFetch + .{ 314, 41 }, // OpImageSparseGather + .{ 315, 41 }, // OpImageSparseDrefGather + .{ 316, 41 }, // OpImageSparseTexelsResident + .{ 318, 6 }, // OpAtomicFlagTestAndSet + .{ 319, 6 }, // OpAtomicFlagClear + .{ 320, 41 }, // OpImageSparseRead + .{ 321, 4 }, // OpSizeOf + .{ 322, 60 }, // OpTypePipeStorage + .{ 323, 60 }, // OpConstantPipeStorage + .{ 324, 60 }, // OpCreatePipeFromPipeStorage + .{ 325, 58 }, // OpGetKernelLocalSizeForSubgroupCount + .{ 326, 58 }, // OpGetKernelMaxNumSubgroups + .{ 327, 59 }, // OpTypeNamedBarrier + .{ 328, 59 }, // OpNamedBarrierInitialize + .{ 329, 59 }, // OpMemoryNamedBarrier + .{ 333, 61 }, // OpGroupNonUniformElect + .{ 334, 62 }, // OpGroupNonUniformAll + .{ 335, 62 }, // OpGroupNonUniformAny + .{ 336, 62 }, // OpGroupNonUniformAllEqual + .{ 337, 64 }, // OpGroupNonUniformBroadcast + .{ 338, 64 }, // OpGroupNonUniformBroadcastFirst + .{ 339, 64 }, // OpGroupNonUniformBallot + .{ 340, 64 }, // OpGroupNonUniformInverseBallot + .{ 341, 64 }, // OpGroupNonUniformBallotBitExtract + .{ 342, 64 }, // OpGroupNonUniformBallotBitCount + .{ 343, 64 }, // OpGroupNonUniformBallotFindLSB + .{ 344, 64 }, // OpGroupNonUniformBallotFindMSB + .{ 345, 65 }, // OpGroupNonUniformShuffle + .{ 346, 65 }, // OpGroupNonUniformShuffleXor + .{ 347, 66 }, // OpGroupNonUniformShuffleUp + .{ 348, 66 }, // OpGroupNonUniformShuffleDown + .{ 349, 63 }, // OpGroupNonUniformIAdd + .{ 350, 63 }, // OpGroupNonUniformFAdd + .{ 351, 63 }, // OpGroupNonUniformIMul + .{ 352, 63 }, // OpGroupNonUniformFMul + .{ 353, 63 }, // OpGroupNonUniformSMin + .{ 354, 63 }, // OpGroupNonUniformUMin + .{ 355, 63 }, // OpGroupNonUniformFMin + .{ 356, 63 }, // OpGroupNonUniformSMax + .{ 357, 63 }, // OpGroupNonUniformUMax + .{ 358, 63 }, // OpGroupNonUniformFMax + .{ 359, 63 }, // OpGroupNonUniformBitwiseAnd + .{ 360, 63 }, // OpGroupNonUniformBitwiseOr + .{ 361, 63 }, // OpGroupNonUniformBitwiseXor + .{ 362, 63 }, // OpGroupNonUniformLogicalAnd + .{ 363, 63 }, // OpGroupNonUniformLogicalOr + .{ 364, 63 }, // OpGroupNonUniformLogicalXor + .{ 365, 68 }, // OpGroupNonUniformQuadBroadcast + .{ 366, 68 }, // OpGroupNonUniformQuadSwap + .{ 403, 4 }, // OpPtrDiff + .{ 4160, 4166 }, // OpColorAttachmentReadEXT + .{ 4161, 4167 }, // OpDepthAttachmentReadEXT + .{ 4162, 4168 }, // OpStencilAttachmentReadEXT + .{ 4163, 4174 }, // OpTypeTensorARM + .{ 4164, 4174 }, // OpTensorReadARM + .{ 4165, 4174 }, // OpTensorWriteARM + .{ 4166, 4174 }, // OpTensorQuerySizeARM + .{ 4181, 4191 }, // OpGraphConstantARM + .{ 4182, 4191 }, // OpGraphEntryPointARM + .{ 4183, 4191 }, // OpGraphARM + .{ 4184, 4191 }, // OpGraphInputARM + .{ 4185, 4191 }, // OpGraphSetOutputARM + .{ 4186, 4191 }, // OpGraphEndARM + .{ 4190, 4191 }, // OpTypeGraphARM + .{ 4195, 4232 }, // OpBitcastExtractEXT + .{ 4416, 1 }, // OpTerminateInvocation + .{ 4417, 4473 }, // OpTypeUntypedPointerKHR + .{ 4418, 4473 }, // OpUntypedVariableKHR + .{ 4419, 4473 }, // OpUntypedAccessChainKHR + .{ 4420, 4473 }, // OpUntypedInBoundsAccessChainKHR + .{ 4421, 4423 }, // OpSubgroupBallotKHR + .{ 4422, 4423 }, // OpSubgroupFirstInvocationKHR + .{ 4423, 4473 }, // OpUntypedPtrAccessChainKHR + .{ 4424, 4473 }, // OpUntypedInBoundsPtrAccessChainKHR + .{ 4425, 4473 }, // OpUntypedArrayLengthKHR + .{ 4426, 4473 }, // OpUntypedPrefetchKHR + .{ 4427, 6030 }, // OpFmaKHR + .{ 4428, 4431 }, // OpSubgroupAllKHR + .{ 4429, 4431 }, // OpSubgroupAnyKHR + .{ 4430, 4431 }, // OpSubgroupAllEqualKHR + .{ 4431, 6026 }, // OpGroupNonUniformRotateKHR + .{ 4432, 4423 }, // OpSubgroupReadInvocationKHR + .{ 4434, 4473 }, // OpUntypedGroupAsyncCopyKHR + .{ 4445, 4479 }, // OpTraceRayKHR + .{ 4446, 4479 }, // OpExecuteCallableKHR + .{ 4447, 4479 }, // OpConvertUToAccelerationStructureKHR + .{ 4448, 4479 }, // OpIgnoreIntersectionKHR + .{ 4449, 4479 }, // OpTerminateRayKHR + .{ 4450, 6019 }, // OpSDot + .{ 4451, 6019 }, // OpUDot + .{ 4452, 6019 }, // OpSUDot + .{ 4453, 6019 }, // OpSDotAccSat + .{ 4454, 6019 }, // OpUDotAccSat + .{ 4455, 6019 }, // OpSUDotAccSat + .{ 4456, 6022 }, // OpTypeCooperativeMatrixKHR + .{ 4457, 6022 }, // OpCooperativeMatrixLoadKHR + .{ 4458, 6022 }, // OpCooperativeMatrixStoreKHR + .{ 4459, 6022 }, // OpCooperativeMatrixMulAddKHR + .{ 4460, 6022 }, // OpCooperativeMatrixLengthKHR + .{ 4461, 6024 }, // OpConstantCompositeReplicateEXT + .{ 4462, 6024 }, // OpSpecConstantCompositeReplicateEXT + .{ 4463, 6024 }, // OpCompositeConstructReplicateEXT + .{ 4472, 4472 }, // OpTypeRayQueryKHR + .{ 4473, 4472 }, // OpRayQueryInitializeKHR + .{ 4474, 4472 }, // OpRayQueryTerminateKHR + .{ 4475, 4472 }, // OpRayQueryGenerateIntersectionKHR + .{ 4476, 4472 }, // OpRayQueryConfirmIntersectionKHR + .{ 4477, 4472 }, // OpRayQueryProceedKHR + .{ 4479, 4472 }, // OpRayQueryGetIntersectionTypeKHR + .{ 4480, 4484 }, // OpImageSampleWeightedQCOM + .{ 4481, 4485 }, // OpImageBoxFilterQCOM + .{ 4482, 4486 }, // OpImageBlockMatchSSDQCOM + .{ 4483, 4486 }, // OpImageBlockMatchSADQCOM + .{ 4497, 4496 }, // OpBitCastArrayQCOM + .{ 4500, 4498 }, // OpImageBlockMatchWindowSSDQCOM + .{ 4501, 4498 }, // OpImageBlockMatchWindowSADQCOM + .{ 4502, 4498 }, // OpImageBlockMatchGatherSSDQCOM + .{ 4503, 4498 }, // OpImageBlockMatchGatherSADQCOM + .{ 4540, 4496 }, // OpCompositeConstructCoopMatQCOM + .{ 4541, 4496 }, // OpCompositeExtractCoopMatQCOM + .{ 4542, 4496 }, // OpExtractSubArrayQCOM + .{ 4545, 4543 }, // OpImageGatherQCOM + .{ 5000, 18 }, // OpGroupIAddNonUniformAMD + .{ 5001, 18 }, // OpGroupFAddNonUniformAMD + .{ 5002, 18 }, // OpGroupFMinNonUniformAMD + .{ 5003, 18 }, // OpGroupUMinNonUniformAMD + .{ 5004, 18 }, // OpGroupSMinNonUniformAMD + .{ 5005, 18 }, // OpGroupFMaxNonUniformAMD + .{ 5006, 18 }, // OpGroupUMaxNonUniformAMD + .{ 5007, 18 }, // OpGroupSMaxNonUniformAMD + .{ 5011, 5010 }, // OpFragmentMaskFetchAMD + .{ 5012, 5010 }, // OpFragmentFetchAMD + .{ 5056, 5055 }, // OpReadClockKHR + .{ 5074, 5067 }, // OpAllocateNodePayloadsAMDX + .{ 5075, 5067 }, // OpEnqueueNodePayloadsAMDX + .{ 5076, 5067 }, // OpTypeNodePayloadArrayAMDX + .{ 5078, 5067 }, // OpFinishWritingNodePayloadAMDX + .{ 5090, 5067 }, // OpNodePayloadArrayLengthAMDX + .{ 5101, 5067 }, // OpIsNodePayloadValidAMDX + .{ 5103, 5067 }, // OpConstantStringAMDX + .{ 5104, 5067 }, // OpSpecConstantStringAMDX + .{ 5110, 5087 }, // OpGroupNonUniformQuadAllKHR + .{ 5111, 5087 }, // OpGroupNonUniformQuadAnyKHR + .{ 5115, 5128 }, // OpTypeBufferEXT + .{ 5119, 5128 }, // OpBufferPointerEXT + .{ 5121, 5120 }, // OpAbortKHR + .{ 5126, 5128 }, // OpUntypedImageTexelPointerEXT + .{ 5127, 5128 }, // OpMemberDecorateIdEXT + .{ 5129, 5128 }, // OpConstantSizeOfEXT + .{ 5147, 5146 }, // OpConstantDataKHR + .{ 5148, 5146 }, // OpSpecConstantDataKHR + .{ 5158, 5156 }, // OpPoisonKHR + .{ 5159, 5156 }, // OpFreezeKHR + .{ 5249, 5383 }, // OpHitObjectRecordHitMotionNV + .{ 5250, 5383 }, // OpHitObjectRecordHitWithIndexMotionNV + .{ 5251, 5383 }, // OpHitObjectRecordMissMotionNV + .{ 5252, 5383 }, // OpHitObjectGetWorldToObjectNV + .{ 5253, 5383 }, // OpHitObjectGetObjectToWorldNV + .{ 5254, 5383 }, // OpHitObjectGetObjectRayDirectionNV + .{ 5255, 5383 }, // OpHitObjectGetObjectRayOriginNV + .{ 5256, 5383 }, // OpHitObjectTraceRayMotionNV + .{ 5257, 5383 }, // OpHitObjectGetShaderRecordBufferHandleNV + .{ 5258, 5383 }, // OpHitObjectGetShaderBindingTableRecordIndexNV + .{ 5259, 5383 }, // OpHitObjectRecordEmptyNV + .{ 5260, 5383 }, // OpHitObjectTraceRayNV + .{ 5261, 5383 }, // OpHitObjectRecordHitNV + .{ 5262, 5383 }, // OpHitObjectRecordHitWithIndexNV + .{ 5263, 5383 }, // OpHitObjectRecordMissNV + .{ 5264, 5383 }, // OpHitObjectExecuteShaderNV + .{ 5265, 5383 }, // OpHitObjectGetCurrentTimeNV + .{ 5266, 5383 }, // OpHitObjectGetAttributesNV + .{ 5267, 5383 }, // OpHitObjectGetHitKindNV + .{ 5268, 5383 }, // OpHitObjectGetPrimitiveIndexNV + .{ 5269, 5383 }, // OpHitObjectGetGeometryIndexNV + .{ 5270, 5383 }, // OpHitObjectGetInstanceIdNV + .{ 5271, 5383 }, // OpHitObjectGetInstanceCustomIndexNV + .{ 5272, 5383 }, // OpHitObjectGetWorldRayDirectionNV + .{ 5273, 5383 }, // OpHitObjectGetWorldRayOriginNV + .{ 5274, 5383 }, // OpHitObjectGetRayTMaxNV + .{ 5275, 5383 }, // OpHitObjectGetRayTMinNV + .{ 5276, 5383 }, // OpHitObjectIsEmptyNV + .{ 5277, 5383 }, // OpHitObjectIsHitNV + .{ 5278, 5383 }, // OpHitObjectIsMissNV + .{ 5279, 5383 }, // OpReorderThreadWithHitObjectNV + .{ 5280, 5383 }, // OpReorderThreadWithHintNV + .{ 5281, 5383 }, // OpTypeHitObjectNV + .{ 5283, 5282 }, // OpImageSampleFootprintNV + .{ 5288, 5394 }, // OpTypeVectorIdEXT + .{ 5289, 5394 }, // OpCooperativeVectorMatrixMulNV + .{ 5290, 5435 }, // OpCooperativeVectorOuterProductAccumulateNV + .{ 5291, 5435 }, // OpCooperativeVectorReduceSumAccumulateNV + .{ 5292, 5394 }, // OpCooperativeVectorMatrixMulAddNV + .{ 5293, 5431 }, // OpCooperativeMatrixConvertNV + .{ 5294, 5283 }, // OpEmitMeshTasksEXT + .{ 5295, 5283 }, // OpSetMeshOutputsEXT + .{ 5296, 5297 }, // OpGroupNonUniformPartitionEXT + .{ 5299, 5266 }, // OpWritePackedPrimitiveIndices4x8NV + .{ 5300, 5380 }, // OpFetchMicroTriangleVertexPositionNV + .{ 5301, 5380 }, // OpFetchMicroTriangleVertexBarycentricNV + .{ 5302, 5394 }, // OpCooperativeVectorLoadNV + .{ 5303, 5394 }, // OpCooperativeVectorStoreNV + .{ 5304, 5388 }, // OpHitObjectRecordFromQueryEXT + .{ 5305, 5388 }, // OpHitObjectRecordMissEXT + .{ 5306, 5388 }, // OpHitObjectRecordMissMotionEXT + .{ 5307, 5388 }, // OpHitObjectGetIntersectionTriangleVertexPositionsEXT + .{ 5308, 5388 }, // OpHitObjectGetRayFlagsEXT + .{ 5309, 5388 }, // OpHitObjectSetShaderBindingTableRecordIndexEXT + .{ 5310, 5388 }, // OpHitObjectReorderExecuteShaderEXT + .{ 5311, 5388 }, // OpHitObjectTraceReorderExecuteEXT + .{ 5312, 5388 }, // OpHitObjectTraceMotionReorderExecuteEXT + .{ 5313, 5388 }, // OpTypeHitObjectEXT + .{ 5314, 5388 }, // OpReorderThreadWithHintEXT + .{ 5315, 5388 }, // OpReorderThreadWithHitObjectEXT + .{ 5316, 5388 }, // OpHitObjectTraceRayEXT + .{ 5317, 5388 }, // OpHitObjectTraceRayMotionEXT + .{ 5318, 5388 }, // OpHitObjectRecordEmptyEXT + .{ 5319, 5388 }, // OpHitObjectExecuteShaderEXT + .{ 5320, 5388 }, // OpHitObjectGetCurrentTimeEXT + .{ 5321, 5388 }, // OpHitObjectGetAttributesEXT + .{ 5322, 5388 }, // OpHitObjectGetHitKindEXT + .{ 5323, 5388 }, // OpHitObjectGetPrimitiveIndexEXT + .{ 5324, 5388 }, // OpHitObjectGetGeometryIndexEXT + .{ 5325, 5388 }, // OpHitObjectGetInstanceIdEXT + .{ 5326, 5388 }, // OpHitObjectGetInstanceCustomIndexEXT + .{ 5327, 5388 }, // OpHitObjectGetObjectRayOriginEXT + .{ 5328, 5388 }, // OpHitObjectGetObjectRayDirectionEXT + .{ 5329, 5388 }, // OpHitObjectGetWorldRayDirectionEXT + .{ 5330, 5388 }, // OpHitObjectGetWorldRayOriginEXT + .{ 5331, 5388 }, // OpHitObjectGetObjectToWorldEXT + .{ 5332, 5388 }, // OpHitObjectGetWorldToObjectEXT + .{ 5333, 5388 }, // OpHitObjectGetRayTMaxEXT + .{ 5334, 5340 }, // OpReportIntersectionKHR + .{ 5335, 5340 }, // OpIgnoreIntersectionNV + .{ 5336, 5340 }, // OpTerminateRayNV + .{ 5337, 5340 }, // OpTraceNV + .{ 5338, 5341 }, // OpTraceMotionNV + .{ 5339, 5341 }, // OpTraceRayMotionNV + .{ 5340, 5391 }, // OpRayQueryGetIntersectionTriangleVertexPositionsKHR + .{ 5341, 5340 }, // OpTypeAccelerationStructureKHR + .{ 5344, 5340 }, // OpExecuteCallableNV + .{ 5345, 5437 }, // OpRayQueryGetIntersectionClusterIdNV + .{ 5346, 5437 }, // OpHitObjectGetClusterIdNV + .{ 5347, 5388 }, // OpHitObjectGetRayTMinEXT + .{ 5348, 5388 }, // OpHitObjectGetShaderBindingTableRecordIndexEXT + .{ 5349, 5388 }, // OpHitObjectGetShaderRecordBufferHandleEXT + .{ 5350, 5388 }, // OpHitObjectIsEmptyEXT + .{ 5351, 5388 }, // OpHitObjectIsHitEXT + .{ 5352, 5388 }, // OpHitObjectIsMissEXT + .{ 5358, 5357 }, // OpTypeCooperativeMatrixNV + .{ 5359, 5357 }, // OpCooperativeMatrixLoadNV + .{ 5360, 5357 }, // OpCooperativeMatrixStoreNV + .{ 5361, 5357 }, // OpCooperativeMatrixMulAddNV + .{ 5362, 5357 }, // OpCooperativeMatrixLengthNV + .{ 5364, 5363 }, // OpBeginInvocationInterlockEXT + .{ 5365, 5363 }, // OpEndInvocationInterlockEXT + .{ 5366, 5430 }, // OpCooperativeMatrixReduceNV + .{ 5367, 5433 }, // OpCooperativeMatrixLoadTensorNV + .{ 5368, 5433 }, // OpCooperativeMatrixStoreTensorNV + .{ 5369, 5432 }, // OpCooperativeMatrixPerElementOpNV + .{ 5370, 5439 }, // OpTypeTensorLayoutNV + .{ 5371, 5439 }, // OpTypeTensorViewNV + .{ 5372, 5439 }, // OpCreateTensorLayoutNV + .{ 5373, 5439 }, // OpTensorLayoutSetDimensionNV + .{ 5374, 5439 }, // OpTensorLayoutSetStrideNV + .{ 5375, 5439 }, // OpTensorLayoutSliceNV + .{ 5376, 5439 }, // OpTensorLayoutSetClampValueNV + .{ 5377, 5439 }, // OpCreateTensorViewNV + .{ 5378, 5439 }, // OpTensorViewSetDimensionNV + .{ 5379, 5439 }, // OpTensorViewSetStrideNV + .{ 5380, 5379 }, // OpDemoteToHelperInvocation + .{ 5381, 5379 }, // OpIsHelperInvocationEXT + .{ 5382, 5439 }, // OpTensorViewSetClipNV + .{ 5384, 5439 }, // OpTensorLayoutSetBlockSizeNV + .{ 5390, 5431 }, // OpCooperativeMatrixTransposeNV + .{ 5391, 5390 }, // OpConvertUToImageNV + .{ 5392, 5390 }, // OpConvertUToSamplerNV + .{ 5393, 5390 }, // OpConvertImageToUNV + .{ 5394, 5390 }, // OpConvertSamplerToUNV + .{ 5395, 5390 }, // OpConvertUToSampledImageNV + .{ 5396, 5390 }, // OpConvertSampledImageToUNV + .{ 5397, 5390 }, // OpSamplerImageAddressingModeNV + .{ 5398, 5414 }, // OpRawAccessChainNV + .{ 5427, 5418 }, // OpRayQueryGetIntersectionSpherePositionNV + .{ 5428, 5418 }, // OpRayQueryGetIntersectionSphereRadiusNV + .{ 5429, 5419 }, // OpRayQueryGetIntersectionLSSPositionsNV + .{ 5430, 5419 }, // OpRayQueryGetIntersectionLSSRadiiNV + .{ 5431, 5419 }, // OpRayQueryGetIntersectionLSSHitValueNV + .{ 5432, 5418 }, // OpHitObjectGetSpherePositionNV + .{ 5433, 5418 }, // OpHitObjectGetSphereRadiusNV + .{ 5434, 5419 }, // OpHitObjectGetLSSPositionsNV + .{ 5435, 5419 }, // OpHitObjectGetLSSRadiiNV + .{ 5436, 5418 }, // OpHitObjectIsSphereHitNV + .{ 5437, 5419 }, // OpHitObjectIsLSSHitNV + .{ 5438, 5418 }, // OpRayQueryIsSphereHitNV + .{ 5439, 5419 }, // OpRayQueryIsLSSHitNV + .{ 5571, 5568 }, // OpSubgroupShuffleINTEL + .{ 5572, 5568 }, // OpSubgroupShuffleDownINTEL + .{ 5573, 5568 }, // OpSubgroupShuffleUpINTEL + .{ 5574, 5568 }, // OpSubgroupShuffleXorINTEL + .{ 5575, 5569 }, // OpSubgroupBlockReadINTEL + .{ 5576, 5569 }, // OpSubgroupBlockWriteINTEL + .{ 5577, 5570 }, // OpSubgroupImageBlockReadINTEL + .{ 5578, 5570 }, // OpSubgroupImageBlockWriteINTEL + .{ 5580, 5579 }, // OpSubgroupImageMediaBlockReadINTEL + .{ 5581, 5579 }, // OpSubgroupImageMediaBlockWriteINTEL + .{ 5585, 5584 }, // OpUCountLeadingZerosINTEL + .{ 5586, 5584 }, // OpUCountTrailingZerosINTEL + .{ 5587, 5584 }, // OpAbsISubINTEL + .{ 5588, 5584 }, // OpAbsUSubINTEL + .{ 5589, 5584 }, // OpIAddSatINTEL + .{ 5590, 5584 }, // OpUAddSatINTEL + .{ 5591, 5584 }, // OpIAverageINTEL + .{ 5592, 5584 }, // OpUAverageINTEL + .{ 5593, 5584 }, // OpIAverageRoundedINTEL + .{ 5594, 5584 }, // OpUAverageRoundedINTEL + .{ 5595, 5584 }, // OpISubSatINTEL + .{ 5596, 5584 }, // OpUSubSatINTEL + .{ 5597, 5584 }, // OpIMul32x16INTEL + .{ 5598, 5584 }, // OpUMul32x16INTEL + .{ 5600, 5603 }, // OpConstantFunctionPointerINTEL + .{ 5601, 5603 }, // OpFunctionPointerCallINTEL + .{ 5609, 5606 }, // OpAsmTargetINTEL + .{ 5610, 5606 }, // OpAsmINTEL + .{ 5611, 5606 }, // OpAsmCallINTEL + .{ 5614, 5616 }, // OpAtomicFMinEXT + .{ 5615, 5616 }, // OpAtomicFMaxEXT + .{ 5630, 5629 }, // OpAssumeTrueKHR + .{ 5631, 5629 }, // OpExpectKHR + .{ 5699, 5696 }, // OpVmeImageINTEL + .{ 5700, 5696 }, // OpTypeVmeImageINTEL + .{ 5701, 5696 }, // OpTypeAvcImePayloadINTEL + .{ 5702, 5696 }, // OpTypeAvcRefPayloadINTEL + .{ 5703, 5696 }, // OpTypeAvcSicPayloadINTEL + .{ 5704, 5696 }, // OpTypeAvcMcePayloadINTEL + .{ 5705, 5696 }, // OpTypeAvcMceResultINTEL + .{ 5706, 5696 }, // OpTypeAvcImeResultINTEL + .{ 5707, 5696 }, // OpTypeAvcImeResultSingleReferenceStreamoutINTEL + .{ 5708, 5696 }, // OpTypeAvcImeResultDualReferenceStreamoutINTEL + .{ 5709, 5696 }, // OpTypeAvcImeSingleReferenceStreaminINTEL + .{ 5710, 5696 }, // OpTypeAvcImeDualReferenceStreaminINTEL + .{ 5711, 5696 }, // OpTypeAvcRefResultINTEL + .{ 5712, 5696 }, // OpTypeAvcSicResultINTEL + .{ 5713, 5696 }, // OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL + .{ 5714, 5696 }, // OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL + .{ 5715, 5696 }, // OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL + .{ 5716, 5696 }, // OpSubgroupAvcMceSetInterShapePenaltyINTEL + .{ 5717, 5696 }, // OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL + .{ 5718, 5696 }, // OpSubgroupAvcMceSetInterDirectionPenaltyINTEL + .{ 5719, 5696 }, // OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL + .{ 5720, 5696 }, // OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL + .{ 5721, 5696 }, // OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL + .{ 5722, 5696 }, // OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL + .{ 5723, 5696 }, // OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL + .{ 5724, 5696 }, // OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL + .{ 5725, 5696 }, // OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL + .{ 5726, 5696 }, // OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL + .{ 5727, 5696 }, // OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL + .{ 5728, 5696 }, // OpSubgroupAvcMceSetAcOnlyHaarINTEL + .{ 5729, 5696 }, // OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL + .{ 5730, 5696 }, // OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL + .{ 5731, 5696 }, // OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL + .{ 5732, 5696 }, // OpSubgroupAvcMceConvertToImePayloadINTEL + .{ 5733, 5696 }, // OpSubgroupAvcMceConvertToImeResultINTEL + .{ 5734, 5696 }, // OpSubgroupAvcMceConvertToRefPayloadINTEL + .{ 5735, 5696 }, // OpSubgroupAvcMceConvertToRefResultINTEL + .{ 5736, 5696 }, // OpSubgroupAvcMceConvertToSicPayloadINTEL + .{ 5737, 5696 }, // OpSubgroupAvcMceConvertToSicResultINTEL + .{ 5738, 5696 }, // OpSubgroupAvcMceGetMotionVectorsINTEL + .{ 5739, 5696 }, // OpSubgroupAvcMceGetInterDistortionsINTEL + .{ 5740, 5696 }, // OpSubgroupAvcMceGetBestInterDistortionsINTEL + .{ 5741, 5696 }, // OpSubgroupAvcMceGetInterMajorShapeINTEL + .{ 5742, 5696 }, // OpSubgroupAvcMceGetInterMinorShapeINTEL + .{ 5743, 5696 }, // OpSubgroupAvcMceGetInterDirectionsINTEL + .{ 5744, 5696 }, // OpSubgroupAvcMceGetInterMotionVectorCountINTEL + .{ 5745, 5696 }, // OpSubgroupAvcMceGetInterReferenceIdsINTEL + .{ 5746, 5696 }, // OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL + .{ 5747, 5696 }, // OpSubgroupAvcImeInitializeINTEL + .{ 5748, 5696 }, // OpSubgroupAvcImeSetSingleReferenceINTEL + .{ 5749, 5696 }, // OpSubgroupAvcImeSetDualReferenceINTEL + .{ 5750, 5696 }, // OpSubgroupAvcImeRefWindowSizeINTEL + .{ 5751, 5696 }, // OpSubgroupAvcImeAdjustRefOffsetINTEL + .{ 5752, 5696 }, // OpSubgroupAvcImeConvertToMcePayloadINTEL + .{ 5753, 5696 }, // OpSubgroupAvcImeSetMaxMotionVectorCountINTEL + .{ 5754, 5696 }, // OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL + .{ 5755, 5696 }, // OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL + .{ 5756, 5696 }, // OpSubgroupAvcImeSetWeightedSadINTEL + .{ 5757, 5696 }, // OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL + .{ 5758, 5696 }, // OpSubgroupAvcImeEvaluateWithDualReferenceINTEL + .{ 5759, 5696 }, // OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL + .{ 5760, 5696 }, // OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL + .{ 5761, 5696 }, // OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL + .{ 5762, 5696 }, // OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL + .{ 5763, 5696 }, // OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL + .{ 5764, 5696 }, // OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL + .{ 5765, 5696 }, // OpSubgroupAvcImeConvertToMceResultINTEL + .{ 5766, 5696 }, // OpSubgroupAvcImeGetSingleReferenceStreaminINTEL + .{ 5767, 5696 }, // OpSubgroupAvcImeGetDualReferenceStreaminINTEL + .{ 5768, 5696 }, // OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL + .{ 5769, 5696 }, // OpSubgroupAvcImeStripDualReferenceStreamoutINTEL + .{ 5770, 5696 }, // OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL + .{ 5771, 5696 }, // OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL + .{ 5772, 5696 }, // OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL + .{ 5773, 5696 }, // OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL + .{ 5774, 5696 }, // OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL + .{ 5775, 5696 }, // OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL + .{ 5776, 5696 }, // OpSubgroupAvcImeGetBorderReachedINTEL + .{ 5777, 5696 }, // OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL + .{ 5778, 5696 }, // OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL + .{ 5779, 5696 }, // OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL + .{ 5780, 5696 }, // OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL + .{ 5781, 5696 }, // OpSubgroupAvcFmeInitializeINTEL + .{ 5782, 5696 }, // OpSubgroupAvcBmeInitializeINTEL + .{ 5783, 5696 }, // OpSubgroupAvcRefConvertToMcePayloadINTEL + .{ 5784, 5696 }, // OpSubgroupAvcRefSetBidirectionalMixDisableINTEL + .{ 5785, 5696 }, // OpSubgroupAvcRefSetBilinearFilterEnableINTEL + .{ 5786, 5696 }, // OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL + .{ 5787, 5696 }, // OpSubgroupAvcRefEvaluateWithDualReferenceINTEL + .{ 5788, 5696 }, // OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL + .{ 5789, 5696 }, // OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL + .{ 5790, 5696 }, // OpSubgroupAvcRefConvertToMceResultINTEL + .{ 5791, 5696 }, // OpSubgroupAvcSicInitializeINTEL + .{ 5792, 5696 }, // OpSubgroupAvcSicConfigureSkcINTEL + .{ 5793, 5696 }, // OpSubgroupAvcSicConfigureIpeLumaINTEL + .{ 5794, 5696 }, // OpSubgroupAvcSicConfigureIpeLumaChromaINTEL + .{ 5795, 5696 }, // OpSubgroupAvcSicGetMotionVectorMaskINTEL + .{ 5796, 5696 }, // OpSubgroupAvcSicConvertToMcePayloadINTEL + .{ 5797, 5696 }, // OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL + .{ 5798, 5696 }, // OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL + .{ 5799, 5696 }, // OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL + .{ 5800, 5696 }, // OpSubgroupAvcSicSetBilinearFilterEnableINTEL + .{ 5801, 5696 }, // OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL + .{ 5802, 5696 }, // OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL + .{ 5803, 5696 }, // OpSubgroupAvcSicEvaluateIpeINTEL + .{ 5804, 5696 }, // OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL + .{ 5805, 5696 }, // OpSubgroupAvcSicEvaluateWithDualReferenceINTEL + .{ 5806, 5696 }, // OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL + .{ 5807, 5696 }, // OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL + .{ 5808, 5696 }, // OpSubgroupAvcSicConvertToMceResultINTEL + .{ 5809, 5696 }, // OpSubgroupAvcSicGetIpeLumaShapeINTEL + .{ 5810, 5696 }, // OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL + .{ 5811, 5696 }, // OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL + .{ 5812, 5696 }, // OpSubgroupAvcSicGetPackedIpeLumaModesINTEL + .{ 5813, 5696 }, // OpSubgroupAvcSicGetIpeChromaModeINTEL + .{ 5814, 5696 }, // OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL + .{ 5815, 5696 }, // OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL + .{ 5816, 5696 }, // OpSubgroupAvcSicGetInterRawSadsINTEL + .{ 5818, 5817 }, // OpVariableLengthArrayINTEL + .{ 5819, 5817 }, // OpSaveMemoryINTEL + .{ 5820, 5817 }, // OpRestoreMemoryINTEL + .{ 5840, 5845 }, // OpArbitraryFloatSinCosPiALTERA + .{ 5841, 5845 }, // OpArbitraryFloatCastALTERA + .{ 5842, 5845 }, // OpArbitraryFloatCastFromIntALTERA + .{ 5843, 5845 }, // OpArbitraryFloatCastToIntALTERA + .{ 5846, 5845 }, // OpArbitraryFloatAddALTERA + .{ 5847, 5845 }, // OpArbitraryFloatSubALTERA + .{ 5848, 5845 }, // OpArbitraryFloatMulALTERA + .{ 5849, 5845 }, // OpArbitraryFloatDivALTERA + .{ 5850, 5845 }, // OpArbitraryFloatGTALTERA + .{ 5851, 5845 }, // OpArbitraryFloatGEALTERA + .{ 5852, 5845 }, // OpArbitraryFloatLTALTERA + .{ 5853, 5845 }, // OpArbitraryFloatLEALTERA + .{ 5854, 5845 }, // OpArbitraryFloatEQALTERA + .{ 5855, 5845 }, // OpArbitraryFloatRecipALTERA + .{ 5856, 5845 }, // OpArbitraryFloatRSqrtALTERA + .{ 5857, 5845 }, // OpArbitraryFloatCbrtALTERA + .{ 5858, 5845 }, // OpArbitraryFloatHypotALTERA + .{ 5859, 5845 }, // OpArbitraryFloatSqrtALTERA + .{ 5860, 5845 }, // OpArbitraryFloatLogINTEL + .{ 5861, 5845 }, // OpArbitraryFloatLog2INTEL + .{ 5862, 5845 }, // OpArbitraryFloatLog10INTEL + .{ 5863, 5845 }, // OpArbitraryFloatLog1pINTEL + .{ 5864, 5845 }, // OpArbitraryFloatExpINTEL + .{ 5865, 5845 }, // OpArbitraryFloatExp2INTEL + .{ 5866, 5845 }, // OpArbitraryFloatExp10INTEL + .{ 5867, 5845 }, // OpArbitraryFloatExpm1INTEL + .{ 5868, 5845 }, // OpArbitraryFloatSinINTEL + .{ 5869, 5845 }, // OpArbitraryFloatCosINTEL + .{ 5870, 5845 }, // OpArbitraryFloatSinCosINTEL + .{ 5871, 5845 }, // OpArbitraryFloatSinPiINTEL + .{ 5872, 5845 }, // OpArbitraryFloatCosPiINTEL + .{ 5873, 5845 }, // OpArbitraryFloatASinINTEL + .{ 5874, 5845 }, // OpArbitraryFloatASinPiINTEL + .{ 5875, 5845 }, // OpArbitraryFloatACosINTEL + .{ 5876, 5845 }, // OpArbitraryFloatACosPiINTEL + .{ 5877, 5845 }, // OpArbitraryFloatATanINTEL + .{ 5878, 5845 }, // OpArbitraryFloatATanPiINTEL + .{ 5879, 5845 }, // OpArbitraryFloatATan2INTEL + .{ 5880, 5845 }, // OpArbitraryFloatPowINTEL + .{ 5881, 5845 }, // OpArbitraryFloatPowRINTEL + .{ 5882, 5845 }, // OpArbitraryFloatPowNINTEL + .{ 5887, 5886 }, // OpLoopControlINTEL + .{ 5911, 5910 }, // OpAliasDomainDeclINTEL + .{ 5912, 5910 }, // OpAliasScopeDeclINTEL + .{ 5913, 5910 }, // OpAliasScopeListDeclINTEL + .{ 5923, 5922 }, // OpFixedSqrtALTERA + .{ 5924, 5922 }, // OpFixedRecipALTERA + .{ 5925, 5922 }, // OpFixedRsqrtALTERA + .{ 5926, 5922 }, // OpFixedSinALTERA + .{ 5927, 5922 }, // OpFixedCosALTERA + .{ 5928, 5922 }, // OpFixedSinCosALTERA + .{ 5929, 5922 }, // OpFixedSinPiALTERA + .{ 5930, 5922 }, // OpFixedCosPiALTERA + .{ 5931, 5922 }, // OpFixedSinCosPiALTERA + .{ 5932, 5922 }, // OpFixedLogALTERA + .{ 5933, 5922 }, // OpFixedExpALTERA + .{ 5934, 5935 }, // OpPtrCastToCrossWorkgroupALTERA + .{ 5938, 5935 }, // OpCrossWorkgroupCastToPtrALTERA + .{ 5946, 5945 }, // OpReadPipeBlockingALTERA + .{ 5947, 5945 }, // OpWritePipeBlockingALTERA + .{ 5949, 5948 }, // OpFPGARegALTERA + .{ 6016, 4472 }, // OpRayQueryGetRayTMinKHR + .{ 6017, 4472 }, // OpRayQueryGetRayFlagsKHR + .{ 6018, 4472 }, // OpRayQueryGetIntersectionTKHR + .{ 6019, 4472 }, // OpRayQueryGetIntersectionInstanceCustomIndexKHR + .{ 6020, 4472 }, // OpRayQueryGetIntersectionInstanceIdKHR + .{ 6021, 4472 }, // OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR + .{ 6022, 4472 }, // OpRayQueryGetIntersectionGeometryIndexKHR + .{ 6023, 4472 }, // OpRayQueryGetIntersectionPrimitiveIndexKHR + .{ 6024, 4472 }, // OpRayQueryGetIntersectionBarycentricsKHR + .{ 6025, 4472 }, // OpRayQueryGetIntersectionFrontFaceKHR + .{ 6026, 4472 }, // OpRayQueryGetIntersectionCandidateAABBOpaqueKHR + .{ 6027, 4472 }, // OpRayQueryGetIntersectionObjectRayDirectionKHR + .{ 6028, 4472 }, // OpRayQueryGetIntersectionObjectRayOriginKHR + .{ 6029, 4472 }, // OpRayQueryGetWorldRayDirectionKHR + .{ 6030, 4472 }, // OpRayQueryGetWorldRayOriginKHR + .{ 6031, 4472 }, // OpRayQueryGetIntersectionObjectToWorldKHR + .{ 6032, 4472 }, // OpRayQueryGetIntersectionWorldToObjectKHR + .{ 6035, 6095 }, // OpAtomicFAddEXT + .{ 6086, 5617 }, // OpTypeBufferSurfaceINTEL + .{ 6090, 6089 }, // OpTypeStructContinuedINTEL + .{ 6091, 6089 }, // OpConstantCompositeContinuedINTEL + .{ 6092, 6089 }, // OpSpecConstantCompositeContinuedINTEL + .{ 6096, 6089 }, // OpCompositeConstructContinuedINTEL + .{ 6116, 6115 }, // OpConvertFToBF16INTEL + .{ 6117, 6115 }, // OpConvertBF16ToFINTEL + .{ 6142, 6141 }, // OpControlBarrierArriveEXT + .{ 6143, 6141 }, // OpControlBarrierWaitEXT + .{ 6145, 6144 }, // OpArithmeticFenceEXT + .{ 6163, 6162 }, // OpTaskSequenceCreateALTERA + .{ 6164, 6162 }, // OpTaskSequenceAsyncALTERA + .{ 6165, 6162 }, // OpTaskSequenceGetALTERA + .{ 6166, 6162 }, // OpTaskSequenceReleaseALTERA + .{ 6199, 6162 }, // OpTypeTaskSequenceALTERA + .{ 6221, 6220 }, // OpSubgroupBlockPrefetchINTEL + .{ 6231, 6228 }, // OpSubgroup2DBlockLoadINTEL + .{ 6232, 6229 }, // OpSubgroup2DBlockLoadTransformINTEL + .{ 6233, 6230 }, // OpSubgroup2DBlockLoadTransposeINTEL + .{ 6234, 6228 }, // OpSubgroup2DBlockPrefetchINTEL + .{ 6235, 6228 }, // OpSubgroup2DBlockStoreINTEL + .{ 6237, 6236 }, // OpSubgroupMatrixMultiplyAccumulateINTEL + .{ 6242, 6241 }, // OpBitwiseFunctionINTEL + .{ 6244, 6243 }, // OpUntypedVariableLengthArrayINTEL + .{ 6248, 6245 }, // OpConditionalExtensionINTEL + .{ 6249, 6245 }, // OpConditionalEntryPointINTEL + .{ 6250, 6245 }, // OpConditionalCapabilityINTEL + .{ 6251, 6246 }, // OpSpecConstantTargetINTEL + .{ 6252, 6246 }, // OpSpecConstantArchitectureINTEL + .{ 6253, 6246 }, // OpSpecConstantCapabilitiesINTEL + .{ 6254, 6245 }, // OpConditionalCopyObjectINTEL + .{ 6258, 6257 }, // OpPredicatedLoadINTEL + .{ 6259, 6257 }, // OpPredicatedStoreINTEL + .{ 6401, 6400 }, // OpGroupIMulKHR + .{ 6402, 6400 }, // OpGroupFMulKHR + .{ 6403, 6400 }, // OpGroupBitwiseAndKHR + .{ 6404, 6400 }, // OpGroupBitwiseOrKHR + .{ 6405, 6400 }, // OpGroupBitwiseXorKHR + .{ 6406, 6400 }, // OpGroupLogicalAndKHR + .{ 6407, 6400 }, // OpGroupLogicalOrKHR + .{ 6408, 6400 }, // OpGroupLogicalXorKHR + .{ 6426, 6425 }, // OpRoundFToTF32INTEL + .{ 6428, 6427 }, // OpMaskedGatherINTEL + .{ 6429, 6427 }, // OpMaskedScatterINTEL + .{ 6529, 6528 }, // OpConvertHandleToImageINTEL + .{ 6530, 6528 }, // OpConvertHandleToSamplerINTEL + .{ 6531, 6528 }, // OpConvertHandleToSampledImageINTEL + .{ 6916, 6912 }, // OpFDot2MixAcc32VALVE + .{ 6917, 6913 }, // OpFDot2MixAcc16VALVE + .{ 6918, 6915 }, // OpFDot4MixAcc32VALVE +}; + +/// An enumerant's capability (0: none), extension ("" : none), and the +/// SPIR-V version (major * 100 + minor) that made the extension core. +pub const Need = struct { value: u32, cap: u32, ext: []const u8, core: u32 }; + +pub const builtins = [_]Need{ + .{ .value = 0, .cap = 1, .ext = "", .core = 100 }, // Position + .{ .value = 1, .cap = 1, .ext = "", .core = 100 }, // PointSize + .{ .value = 3, .cap = 32, .ext = "", .core = 100 }, // ClipDistance + .{ .value = 4, .cap = 33, .ext = "", .core = 100 }, // CullDistance + .{ .value = 5, .cap = 1, .ext = "", .core = 100 }, // VertexId + .{ .value = 6, .cap = 1, .ext = "", .core = 100 }, // InstanceId + .{ .value = 7, .cap = 2, .ext = "", .core = 100 }, // PrimitiveId + .{ .value = 8, .cap = 2, .ext = "", .core = 100 }, // InvocationId + .{ .value = 9, .cap = 2, .ext = "", .core = 100 }, // Layer + .{ .value = 10, .cap = 57, .ext = "", .core = 100 }, // ViewportIndex + .{ .value = 11, .cap = 3, .ext = "", .core = 100 }, // TessLevelOuter + .{ .value = 12, .cap = 3, .ext = "", .core = 100 }, // TessLevelInner + .{ .value = 13, .cap = 3, .ext = "", .core = 100 }, // TessCoord + .{ .value = 14, .cap = 3, .ext = "", .core = 100 }, // PatchVertices + .{ .value = 15, .cap = 1, .ext = "", .core = 100 }, // FragCoord + .{ .value = 16, .cap = 1, .ext = "", .core = 100 }, // PointCoord + .{ .value = 17, .cap = 1, .ext = "", .core = 100 }, // FrontFacing + .{ .value = 18, .cap = 35, .ext = "", .core = 100 }, // SampleId + .{ .value = 19, .cap = 35, .ext = "", .core = 100 }, // SamplePosition + .{ .value = 20, .cap = 1, .ext = "", .core = 100 }, // SampleMask + .{ .value = 22, .cap = 1, .ext = "", .core = 100 }, // FragDepth + .{ .value = 23, .cap = 1, .ext = "", .core = 100 }, // HelperInvocation + .{ .value = 30, .cap = 6, .ext = "", .core = 100 }, // WorkDim + .{ .value = 31, .cap = 6, .ext = "", .core = 100 }, // GlobalSize + .{ .value = 32, .cap = 6, .ext = "", .core = 100 }, // EnqueuedWorkgroupSize + .{ .value = 33, .cap = 6, .ext = "", .core = 100 }, // GlobalOffset + .{ .value = 34, .cap = 6, .ext = "", .core = 100 }, // GlobalLinearId + .{ .value = 36, .cap = 6, .ext = "", .core = 100 }, // SubgroupSize + .{ .value = 37, .cap = 6, .ext = "", .core = 100 }, // SubgroupMaxSize + .{ .value = 38, .cap = 6, .ext = "", .core = 100 }, // NumSubgroups + .{ .value = 39, .cap = 6, .ext = "", .core = 100 }, // NumEnqueuedSubgroups + .{ .value = 40, .cap = 6, .ext = "", .core = 100 }, // SubgroupId + .{ .value = 41, .cap = 6, .ext = "", .core = 100 }, // SubgroupLocalInvocationId + .{ .value = 42, .cap = 1, .ext = "", .core = 100 }, // VertexIndex + .{ .value = 43, .cap = 1, .ext = "", .core = 100 }, // InstanceIndex + .{ .value = 4160, .cap = 4165, .ext = "", .core = 100 }, // CoreIDARM + .{ .value = 4161, .cap = 4165, .ext = "", .core = 100 }, // CoreCountARM + .{ .value = 4162, .cap = 4165, .ext = "", .core = 100 }, // CoreMaxIDARM + .{ .value = 4163, .cap = 4165, .ext = "", .core = 100 }, // WarpIDARM + .{ .value = 4164, .cap = 4165, .ext = "", .core = 100 }, // WarpMaxIDARM + .{ .value = 4416, .cap = 4423, .ext = "SPV_KHR_shader_ballot", .core = 103 }, // SubgroupEqMask + .{ .value = 4417, .cap = 4423, .ext = "SPV_KHR_shader_ballot", .core = 103 }, // SubgroupGeMask + .{ .value = 4418, .cap = 4423, .ext = "SPV_KHR_shader_ballot", .core = 103 }, // SubgroupGtMask + .{ .value = 4419, .cap = 4423, .ext = "SPV_KHR_shader_ballot", .core = 103 }, // SubgroupLeMask + .{ .value = 4420, .cap = 4423, .ext = "SPV_KHR_shader_ballot", .core = 103 }, // SubgroupLtMask + .{ .value = 4424, .cap = 4427, .ext = "SPV_KHR_shader_draw_parameters", .core = 103 }, // BaseVertex + .{ .value = 4425, .cap = 4427, .ext = "SPV_KHR_shader_draw_parameters", .core = 103 }, // BaseInstance + .{ .value = 4426, .cap = 4427, .ext = "SPV_KHR_shader_draw_parameters", .core = 103 }, // DrawIndex + .{ .value = 4432, .cap = 4422, .ext = "SPV_KHR_fragment_shading_rate", .core = 999 }, // PrimitiveShadingRateKHR + .{ .value = 4438, .cap = 4437, .ext = "SPV_KHR_device_group", .core = 103 }, // DeviceIndex + .{ .value = 4440, .cap = 4439, .ext = "SPV_KHR_multiview", .core = 103 }, // ViewIndex + .{ .value = 4444, .cap = 4422, .ext = "SPV_KHR_fragment_shading_rate", .core = 999 }, // ShadingRateKHR + .{ .value = 4492, .cap = 4495, .ext = "", .core = 999 }, // TileOffsetQCOM + .{ .value = 4493, .cap = 4495, .ext = "", .core = 999 }, // TileDimensionQCOM + .{ .value = 4494, .cap = 4495, .ext = "", .core = 999 }, // TileApronSizeQCOM + .{ .value = 4992, .cap = 0, .ext = "SPV_AMD_shader_explicit_vertex_parameter", .core = 999 }, // BaryCoordNoPerspAMD + .{ .value = 4993, .cap = 0, .ext = "SPV_AMD_shader_explicit_vertex_parameter", .core = 999 }, // BaryCoordNoPerspCentroidAMD + .{ .value = 4994, .cap = 0, .ext = "SPV_AMD_shader_explicit_vertex_parameter", .core = 999 }, // BaryCoordNoPerspSampleAMD + .{ .value = 4995, .cap = 0, .ext = "SPV_AMD_shader_explicit_vertex_parameter", .core = 999 }, // BaryCoordSmoothAMD + .{ .value = 4996, .cap = 0, .ext = "SPV_AMD_shader_explicit_vertex_parameter", .core = 999 }, // BaryCoordSmoothCentroidAMD + .{ .value = 4997, .cap = 0, .ext = "SPV_AMD_shader_explicit_vertex_parameter", .core = 999 }, // BaryCoordSmoothSampleAMD + .{ .value = 4998, .cap = 0, .ext = "SPV_AMD_shader_explicit_vertex_parameter", .core = 999 }, // BaryCoordPullModelAMD + .{ .value = 5014, .cap = 5013, .ext = "SPV_EXT_shader_stencil_export", .core = 999 }, // FragStencilRefEXT + .{ .value = 5021, .cap = 5067, .ext = "", .core = 999 }, // RemainingRecursionLevelsAMDX + .{ .value = 5073, .cap = 5067, .ext = "", .core = 999 }, // ShaderIndexAMDX + .{ .value = 5122, .cap = 5128, .ext = "", .core = 999 }, // SamplerHeapEXT + .{ .value = 5123, .cap = 5128, .ext = "", .core = 999 }, // ResourceHeapEXT + .{ .value = 5253, .cap = 5255, .ext = "SPV_NV_viewport_array2", .core = 999 }, // ViewportMaskNV + .{ .value = 5257, .cap = 5259, .ext = "SPV_NV_stereo_view_rendering", .core = 999 }, // SecondaryPositionNV + .{ .value = 5258, .cap = 5259, .ext = "SPV_NV_stereo_view_rendering", .core = 999 }, // SecondaryViewportMaskNV + .{ .value = 5261, .cap = 5260, .ext = "SPV_NVX_multiview_per_view_attributes", .core = 999 }, // PositionPerViewNV + .{ .value = 5262, .cap = 5260, .ext = "SPV_NVX_multiview_per_view_attributes", .core = 999 }, // ViewportMaskPerViewNV + .{ .value = 5264, .cap = 5265, .ext = "SPV_EXT_fragment_fully_covered", .core = 999 }, // FullyCoveredEXT + .{ .value = 5274, .cap = 5266, .ext = "SPV_NV_mesh_shader", .core = 999 }, // TaskCountNV + .{ .value = 5275, .cap = 5266, .ext = "SPV_NV_mesh_shader", .core = 999 }, // PrimitiveCountNV + .{ .value = 5276, .cap = 5266, .ext = "SPV_NV_mesh_shader", .core = 999 }, // PrimitiveIndicesNV + .{ .value = 5277, .cap = 5266, .ext = "SPV_NV_mesh_shader", .core = 999 }, // ClipDistancePerViewNV + .{ .value = 5278, .cap = 5266, .ext = "SPV_NV_mesh_shader", .core = 999 }, // CullDistancePerViewNV + .{ .value = 5279, .cap = 5266, .ext = "SPV_NV_mesh_shader", .core = 999 }, // LayerPerViewNV + .{ .value = 5280, .cap = 5266, .ext = "SPV_NV_mesh_shader", .core = 999 }, // MeshViewCountNV + .{ .value = 5281, .cap = 5266, .ext = "SPV_NV_mesh_shader", .core = 999 }, // MeshViewIndicesNV + .{ .value = 5286, .cap = 5284, .ext = "SPV_NV_fragment_shader_barycentric", .core = 999 }, // BaryCoordKHR + .{ .value = 5287, .cap = 5284, .ext = "SPV_NV_fragment_shader_barycentric", .core = 999 }, // BaryCoordNoPerspKHR + .{ .value = 5292, .cap = 5291, .ext = "SPV_EXT_fragment_invocation_density", .core = 999 }, // FragSizeEXT + .{ .value = 5293, .cap = 5291, .ext = "SPV_EXT_fragment_invocation_density", .core = 999 }, // FragInvocationCountEXT + .{ .value = 5294, .cap = 5283, .ext = "SPV_EXT_mesh_shader", .core = 999 }, // PrimitivePointIndicesEXT + .{ .value = 5295, .cap = 5283, .ext = "SPV_EXT_mesh_shader", .core = 999 }, // PrimitiveLineIndicesEXT + .{ .value = 5296, .cap = 5283, .ext = "SPV_EXT_mesh_shader", .core = 999 }, // PrimitiveTriangleIndicesEXT + .{ .value = 5299, .cap = 5283, .ext = "SPV_EXT_mesh_shader", .core = 999 }, // CullPrimitiveEXT + .{ .value = 5319, .cap = 5340, .ext = "SPV_NV_ray_tracing", .core = 999 }, // LaunchIdKHR + .{ .value = 5320, .cap = 5340, .ext = "SPV_NV_ray_tracing", .core = 999 }, // LaunchSizeKHR + .{ .value = 5321, .cap = 5340, .ext = "SPV_NV_ray_tracing", .core = 999 }, // WorldRayOriginKHR + .{ .value = 5322, .cap = 5340, .ext = "SPV_NV_ray_tracing", .core = 999 }, // WorldRayDirectionKHR + .{ .value = 5323, .cap = 5340, .ext = "SPV_NV_ray_tracing", .core = 999 }, // ObjectRayOriginKHR + .{ .value = 5324, .cap = 5340, .ext = "SPV_NV_ray_tracing", .core = 999 }, // ObjectRayDirectionKHR + .{ .value = 5325, .cap = 5340, .ext = "SPV_NV_ray_tracing", .core = 999 }, // RayTminKHR + .{ .value = 5326, .cap = 5340, .ext = "SPV_NV_ray_tracing", .core = 999 }, // RayTmaxKHR + .{ .value = 5327, .cap = 5340, .ext = "SPV_NV_ray_tracing", .core = 999 }, // InstanceCustomIndexKHR + .{ .value = 5330, .cap = 5340, .ext = "SPV_NV_ray_tracing", .core = 999 }, // ObjectToWorldKHR + .{ .value = 5331, .cap = 5340, .ext = "SPV_NV_ray_tracing", .core = 999 }, // WorldToObjectKHR + .{ .value = 5332, .cap = 5340, .ext = "SPV_NV_ray_tracing", .core = 999 }, // HitTNV + .{ .value = 5333, .cap = 5340, .ext = "SPV_NV_ray_tracing", .core = 999 }, // HitKindKHR + .{ .value = 5334, .cap = 5341, .ext = "SPV_NV_ray_tracing_motion_blur", .core = 999 }, // CurrentRayTimeNV + .{ .value = 5335, .cap = 5336, .ext = "", .core = 999 }, // HitTriangleVertexPositionsKHR + .{ .value = 5337, .cap = 5409, .ext = "", .core = 999 }, // HitMicroTriangleVertexPositionsNV + .{ .value = 5344, .cap = 5409, .ext = "", .core = 999 }, // HitMicroTriangleVertexBarycentricsNV + .{ .value = 5351, .cap = 5340, .ext = "SPV_NV_ray_tracing", .core = 999 }, // IncomingRayFlagsKHR + .{ .value = 5352, .cap = 4479, .ext = "SPV_KHR_ray_tracing", .core = 999 }, // RayGeometryIndexKHR + .{ .value = 5359, .cap = 5418, .ext = "SPV_NV_linear_swept_spheres", .core = 999 }, // HitIsSphereNV + .{ .value = 5360, .cap = 5419, .ext = "SPV_NV_linear_swept_spheres", .core = 999 }, // HitIsLSSNV + .{ .value = 5361, .cap = 5418, .ext = "SPV_NV_linear_swept_spheres", .core = 999 }, // HitSpherePositionNV + .{ .value = 5374, .cap = 5373, .ext = "SPV_NV_shader_sm_builtins", .core = 999 }, // WarpsPerSMNV + .{ .value = 5375, .cap = 5373, .ext = "SPV_NV_shader_sm_builtins", .core = 999 }, // SMCountNV + .{ .value = 5376, .cap = 5373, .ext = "SPV_NV_shader_sm_builtins", .core = 999 }, // WarpIDNV + .{ .value = 5377, .cap = 5373, .ext = "SPV_NV_shader_sm_builtins", .core = 999 }, // SMIDNV + .{ .value = 5396, .cap = 5419, .ext = "SPV_NV_linear_swept_spheres", .core = 999 }, // HitLSSPositionsNV + .{ .value = 5405, .cap = 5409, .ext = "", .core = 999 }, // HitKindFrontFacingMicroTriangleNV + .{ .value = 5406, .cap = 5409, .ext = "", .core = 999 }, // HitKindBackFacingMicroTriangleNV + .{ .value = 5420, .cap = 5418, .ext = "SPV_NV_linear_swept_spheres", .core = 999 }, // HitSphereRadiusNV + .{ .value = 5421, .cap = 5419, .ext = "SPV_NV_linear_swept_spheres", .core = 999 }, // HitLSSRadiiNV + .{ .value = 5436, .cap = 5437, .ext = "SPV_NV_cluster_acceleration_structure", .core = 999 }, // ClusterIDNV + .{ .value = 6021, .cap = 6020, .ext = "SPV_KHR_ray_cull_mask", .core = 999 }, // CullMaskKHR +}; + +pub const decorations = [_]Need{ + .{ .value = 0, .cap = 1, .ext = "", .core = 100 }, // RelaxedPrecision + .{ .value = 1, .cap = 1, .ext = "", .core = 100 }, // SpecId + .{ .value = 2, .cap = 1, .ext = "", .core = 100 }, // Block + .{ .value = 3, .cap = 1, .ext = "", .core = 100 }, // BufferBlock + .{ .value = 6, .cap = 1, .ext = "", .core = 100 }, // ArrayStride + .{ .value = 8, .cap = 1, .ext = "", .core = 100 }, // GLSLShared + .{ .value = 9, .cap = 1, .ext = "", .core = 100 }, // GLSLPacked + .{ .value = 10, .cap = 6, .ext = "", .core = 100 }, // CPacked + .{ .value = 13, .cap = 1, .ext = "", .core = 100 }, // NoPerspective + .{ .value = 14, .cap = 1, .ext = "", .core = 100 }, // Flat + .{ .value = 15, .cap = 3, .ext = "", .core = 100 }, // Patch + .{ .value = 16, .cap = 1, .ext = "", .core = 100 }, // Centroid + .{ .value = 17, .cap = 35, .ext = "", .core = 100 }, // Sample + .{ .value = 18, .cap = 1, .ext = "", .core = 100 }, // Invariant + .{ .value = 22, .cap = 6, .ext = "", .core = 100 }, // Constant + .{ .value = 26, .cap = 1, .ext = "", .core = 100 }, // Uniform + .{ .value = 27, .cap = 1, .ext = "", .core = 104 }, // UniformId + .{ .value = 28, .cap = 6, .ext = "", .core = 100 }, // SaturatedConversion + .{ .value = 29, .cap = 54, .ext = "", .core = 100 }, // Stream + .{ .value = 30, .cap = 1, .ext = "", .core = 100 }, // Location + .{ .value = 31, .cap = 1, .ext = "", .core = 100 }, // Component + .{ .value = 32, .cap = 1, .ext = "", .core = 100 }, // Index + .{ .value = 33, .cap = 1, .ext = "", .core = 100 }, // Binding + .{ .value = 34, .cap = 1, .ext = "", .core = 100 }, // DescriptorSet + .{ .value = 35, .cap = 1, .ext = "", .core = 100 }, // Offset + .{ .value = 36, .cap = 53, .ext = "", .core = 100 }, // XfbBuffer + .{ .value = 37, .cap = 53, .ext = "", .core = 100 }, // XfbStride + .{ .value = 38, .cap = 6, .ext = "", .core = 100 }, // FuncParamAttr + .{ .value = 40, .cap = 6, .ext = "", .core = 100 }, // FPFastMathMode + .{ .value = 41, .cap = 5, .ext = "", .core = 100 }, // LinkageAttributes + .{ .value = 42, .cap = 1, .ext = "", .core = 100 }, // NoContraction + .{ .value = 43, .cap = 40, .ext = "", .core = 100 }, // InputAttachmentIndex + .{ .value = 44, .cap = 6, .ext = "", .core = 100 }, // Alignment + .{ .value = 45, .cap = 4, .ext = "", .core = 101 }, // MaxByteOffset + .{ .value = 46, .cap = 6, .ext = "", .core = 102 }, // AlignmentId + .{ .value = 47, .cap = 4, .ext = "", .core = 102 }, // MaxByteOffsetId + .{ .value = 4216, .cap = 4212, .ext = "", .core = 999 }, // SaturatedToLargestFloat8NormalConversionEXT + .{ .value = 4469, .cap = 0, .ext = "SPV_KHR_no_integer_wrap_decoration", .core = 104 }, // NoSignedWrap + .{ .value = 4470, .cap = 0, .ext = "SPV_KHR_no_integer_wrap_decoration", .core = 104 }, // NoUnsignedWrap + .{ .value = 4487, .cap = 0, .ext = "SPV_QCOM_image_processing", .core = 999 }, // WeightTextureQCOM + .{ .value = 4488, .cap = 0, .ext = "SPV_QCOM_image_processing", .core = 999 }, // BlockMatchTextureQCOM + .{ .value = 4499, .cap = 0, .ext = "SPV_QCOM_image_processing2", .core = 999 }, // BlockMatchSamplerQCOM + .{ .value = 4999, .cap = 0, .ext = "SPV_AMD_shader_explicit_vertex_parameter", .core = 999 }, // ExplicitInterpAMD + .{ .value = 5019, .cap = 5067, .ext = "", .core = 999 }, // NodeSharesPayloadLimitsWithAMDX + .{ .value = 5020, .cap = 5067, .ext = "", .core = 999 }, // NodeMaxPayloadsAMDX + .{ .value = 5078, .cap = 5067, .ext = "", .core = 999 }, // TrackFinishWritingAMDX + .{ .value = 5091, .cap = 5067, .ext = "", .core = 999 }, // PayloadNodeNameAMDX + .{ .value = 5098, .cap = 5067, .ext = "", .core = 999 }, // PayloadNodeBaseIndexAMDX + .{ .value = 5099, .cap = 5067, .ext = "", .core = 999 }, // PayloadNodeSparseArrayAMDX + .{ .value = 5100, .cap = 5067, .ext = "", .core = 999 }, // PayloadNodeArraySizeAMDX + .{ .value = 5105, .cap = 5067, .ext = "", .core = 999 }, // PayloadDispatchIndirectAMDX + .{ .value = 5124, .cap = 5128, .ext = "", .core = 999 }, // ArrayStrideIdEXT + .{ .value = 5125, .cap = 5128, .ext = "", .core = 999 }, // OffsetIdEXT + .{ .value = 5145, .cap = 5146, .ext = "", .core = 999 }, // UTFEncodedKHR + .{ .value = 5248, .cap = 5249, .ext = "SPV_NV_sample_mask_override_coverage", .core = 999 }, // OverrideCoverageNV + .{ .value = 5250, .cap = 5251, .ext = "SPV_NV_geometry_shader_passthrough", .core = 999 }, // PassthroughNV + .{ .value = 5252, .cap = 5255, .ext = "", .core = 999 }, // ViewportRelativeNV + .{ .value = 5256, .cap = 5259, .ext = "SPV_NV_stereo_view_rendering", .core = 999 }, // SecondaryViewportRelativeNV + .{ .value = 5271, .cap = 5266, .ext = "SPV_NV_mesh_shader", .core = 999 }, // PerPrimitiveEXT + .{ .value = 5272, .cap = 5266, .ext = "SPV_NV_mesh_shader", .core = 999 }, // PerViewNV + .{ .value = 5273, .cap = 5266, .ext = "SPV_NV_mesh_shader", .core = 999 }, // PerTaskNV + .{ .value = 5285, .cap = 5284, .ext = "SPV_NV_fragment_shader_barycentric", .core = 999 }, // PerVertexKHR + .{ .value = 5300, .cap = 5301, .ext = "SPV_EXT_descriptor_indexing", .core = 105 }, // NonUniform + .{ .value = 5355, .cap = 5347, .ext = "SPV_EXT_physical_storage_buffer", .core = 105 }, // RestrictPointer + .{ .value = 5356, .cap = 5347, .ext = "SPV_EXT_physical_storage_buffer", .core = 105 }, // AliasedPointer + .{ .value = 5358, .cap = 5423, .ext = "", .core = 999 }, // MemberOffsetNV + .{ .value = 5386, .cap = 5383, .ext = "", .core = 999 }, // HitObjectShaderRecordBufferNV + .{ .value = 5389, .cap = 5388, .ext = "", .core = 999 }, // HitObjectShaderRecordBufferEXT + .{ .value = 5397, .cap = 5423, .ext = "", .core = 999 }, // BankNV + .{ .value = 5398, .cap = 5390, .ext = "", .core = 999 }, // BindlessSamplerNV + .{ .value = 5399, .cap = 5390, .ext = "", .core = 999 }, // BindlessImageNV + .{ .value = 5400, .cap = 5390, .ext = "", .core = 999 }, // BoundSamplerNV + .{ .value = 5401, .cap = 5390, .ext = "", .core = 999 }, // BoundImageNV + .{ .value = 5599, .cap = 5617, .ext = "", .core = 999 }, // SIMTCallINTEL + .{ .value = 5602, .cap = 5604, .ext = "SPV_INTEL_function_pointers", .core = 999 }, // ReferencedIndirectlyINTEL + .{ .value = 5607, .cap = 5606, .ext = "", .core = 999 }, // ClobberINTEL + .{ .value = 5608, .cap = 5606, .ext = "", .core = 999 }, // SideEffectsINTEL + .{ .value = 5624, .cap = 5617, .ext = "", .core = 999 }, // VectorComputeVariableINTEL + .{ .value = 5625, .cap = 5617, .ext = "", .core = 999 }, // FuncParamIOKindINTEL + .{ .value = 5626, .cap = 5617, .ext = "", .core = 999 }, // VectorComputeFunctionINTEL + .{ .value = 5627, .cap = 5617, .ext = "", .core = 999 }, // StackCallINTEL + .{ .value = 5628, .cap = 5617, .ext = "", .core = 999 }, // GlobalVariableOffsetINTEL + .{ .value = 5634, .cap = 0, .ext = "SPV_GOOGLE_hlsl_functionality1", .core = 104 }, // CounterBuffer + .{ .value = 5635, .cap = 0, .ext = "SPV_GOOGLE_hlsl_functionality1", .core = 104 }, // UserSemantic + .{ .value = 5636, .cap = 0, .ext = "SPV_GOOGLE_user_type", .core = 999 }, // UserTypeGOOGLE + .{ .value = 5822, .cap = 5821, .ext = "", .core = 999 }, // FunctionRoundingModeINTEL + .{ .value = 5823, .cap = 5821, .ext = "", .core = 999 }, // FunctionDenormModeINTEL + .{ .value = 5825, .cap = 5824, .ext = "", .core = 999 }, // RegisterALTERA + .{ .value = 5826, .cap = 5824, .ext = "", .core = 999 }, // MemoryALTERA + .{ .value = 5827, .cap = 5824, .ext = "", .core = 999 }, // NumbanksALTERA + .{ .value = 5828, .cap = 5824, .ext = "", .core = 999 }, // BankwidthALTERA + .{ .value = 5829, .cap = 5824, .ext = "", .core = 999 }, // MaxPrivateCopiesALTERA + .{ .value = 5830, .cap = 5824, .ext = "", .core = 999 }, // SinglepumpALTERA + .{ .value = 5831, .cap = 5824, .ext = "", .core = 999 }, // DoublepumpALTERA + .{ .value = 5832, .cap = 5824, .ext = "", .core = 999 }, // MaxReplicatesALTERA + .{ .value = 5833, .cap = 5824, .ext = "", .core = 999 }, // SimpleDualPortALTERA + .{ .value = 5834, .cap = 5824, .ext = "", .core = 999 }, // MergeALTERA + .{ .value = 5835, .cap = 5824, .ext = "", .core = 999 }, // BankBitsALTERA + .{ .value = 5836, .cap = 5824, .ext = "", .core = 999 }, // ForcePow2DepthALTERA + .{ .value = 5883, .cap = 5824, .ext = "", .core = 999 }, // StridesizeALTERA + .{ .value = 5884, .cap = 5824, .ext = "", .core = 999 }, // WordsizeALTERA + .{ .value = 5885, .cap = 5824, .ext = "", .core = 999 }, // TrueDualPortALTERA + .{ .value = 5899, .cap = 5898, .ext = "", .core = 999 }, // BurstCoalesceALTERA + .{ .value = 5900, .cap = 5898, .ext = "", .core = 999 }, // CacheSizeALTERA + .{ .value = 5901, .cap = 5898, .ext = "", .core = 999 }, // DontStaticallyCoalesceALTERA + .{ .value = 5902, .cap = 5898, .ext = "", .core = 999 }, // PrefetchALTERA + .{ .value = 5905, .cap = 5904, .ext = "", .core = 999 }, // StallEnableALTERA + .{ .value = 5907, .cap = 5906, .ext = "", .core = 999 }, // FuseLoopsInFunctionALTERA + .{ .value = 5909, .cap = 5908, .ext = "", .core = 999 }, // MathOpDSPModeALTERA + .{ .value = 5914, .cap = 5910, .ext = "", .core = 999 }, // AliasScopeINTEL + .{ .value = 5915, .cap = 5910, .ext = "", .core = 999 }, // NoAliasINTEL + .{ .value = 5917, .cap = 5916, .ext = "", .core = 999 }, // InitiationIntervalALTERA + .{ .value = 5918, .cap = 5916, .ext = "", .core = 999 }, // MaxConcurrencyALTERA + .{ .value = 5919, .cap = 5916, .ext = "", .core = 999 }, // PipelineEnableALTERA + .{ .value = 5921, .cap = 5920, .ext = "", .core = 999 }, // BufferLocationALTERA + .{ .value = 5944, .cap = 5943, .ext = "", .core = 999 }, // IOPipeStorageALTERA + .{ .value = 6080, .cap = 5821, .ext = "", .core = 999 }, // FunctionFloatingPointModeINTEL + .{ .value = 6085, .cap = 5617, .ext = "", .core = 999 }, // SingleElementVectorINTEL + .{ .value = 6087, .cap = 5617, .ext = "", .core = 999 }, // VectorComputeCallableFunctionINTEL + .{ .value = 6140, .cap = 5617, .ext = "", .core = 999 }, // MediaBlockIOINTEL + .{ .value = 6151, .cap = 6150, .ext = "", .core = 999 }, // StallFreeALTERA + .{ .value = 6170, .cap = 6169, .ext = "", .core = 999 }, // FPMaxErrorDecorationINTEL + .{ .value = 6172, .cap = 6171, .ext = "", .core = 999 }, // LatencyControlLabelALTERA + .{ .value = 6173, .cap = 6171, .ext = "", .core = 999 }, // LatencyControlConstraintALTERA + .{ .value = 6175, .cap = 6174, .ext = "", .core = 999 }, // ConduitKernelArgumentALTERA + .{ .value = 6176, .cap = 6174, .ext = "", .core = 999 }, // RegisterMapKernelArgumentALTERA + .{ .value = 6177, .cap = 6174, .ext = "", .core = 999 }, // MMHostInterfaceAddressWidthALTERA + .{ .value = 6178, .cap = 6174, .ext = "", .core = 999 }, // MMHostInterfaceDataWidthALTERA + .{ .value = 6179, .cap = 6174, .ext = "", .core = 999 }, // MMHostInterfaceLatencyALTERA + .{ .value = 6180, .cap = 6174, .ext = "", .core = 999 }, // MMHostInterfaceReadWriteModeALTERA + .{ .value = 6181, .cap = 6174, .ext = "", .core = 999 }, // MMHostInterfaceMaxBurstALTERA + .{ .value = 6182, .cap = 6174, .ext = "", .core = 999 }, // MMHostInterfaceWaitRequestALTERA + .{ .value = 6183, .cap = 6174, .ext = "", .core = 999 }, // StableKernelArgumentALTERA + .{ .value = 6188, .cap = 6187, .ext = "", .core = 999 }, // HostAccessINTEL + .{ .value = 6190, .cap = 6189, .ext = "", .core = 999 }, // InitModeALTERA + .{ .value = 6191, .cap = 6189, .ext = "", .core = 999 }, // ImplementInRegisterMapALTERA + .{ .value = 6247, .cap = 6245, .ext = "", .core = 999 }, // ConditionalINTEL + .{ .value = 6442, .cap = 6441, .ext = "", .core = 999 }, // CacheControlLoadINTEL + .{ .value = 6443, .cap = 6441, .ext = "", .core = 999 }, // CacheControlStoreINTEL + .{ .value = 7040, .cap = 7041, .ext = "", .core = 999 }, // IntrinsicSAMSUNG +}; + +pub const execution_modes = [_]Need{ + .{ .value = 0, .cap = 2, .ext = "", .core = 100 }, // Invocations + .{ .value = 1, .cap = 3, .ext = "", .core = 100 }, // SpacingEqual + .{ .value = 2, .cap = 3, .ext = "", .core = 100 }, // SpacingFractionalEven + .{ .value = 3, .cap = 3, .ext = "", .core = 100 }, // SpacingFractionalOdd + .{ .value = 4, .cap = 3, .ext = "", .core = 100 }, // VertexOrderCw + .{ .value = 5, .cap = 3, .ext = "", .core = 100 }, // VertexOrderCcw + .{ .value = 6, .cap = 1, .ext = "", .core = 100 }, // PixelCenterInteger + .{ .value = 7, .cap = 1, .ext = "", .core = 100 }, // OriginUpperLeft + .{ .value = 8, .cap = 1, .ext = "", .core = 100 }, // OriginLowerLeft + .{ .value = 9, .cap = 1, .ext = "", .core = 100 }, // EarlyFragmentTests + .{ .value = 10, .cap = 3, .ext = "", .core = 100 }, // PointMode + .{ .value = 11, .cap = 53, .ext = "", .core = 100 }, // Xfb + .{ .value = 12, .cap = 1, .ext = "", .core = 100 }, // DepthReplacing + .{ .value = 14, .cap = 1, .ext = "", .core = 100 }, // DepthGreater + .{ .value = 15, .cap = 1, .ext = "", .core = 100 }, // DepthLess + .{ .value = 16, .cap = 1, .ext = "", .core = 100 }, // DepthUnchanged + .{ .value = 18, .cap = 6, .ext = "", .core = 100 }, // LocalSizeHint + .{ .value = 19, .cap = 2, .ext = "", .core = 100 }, // InputPoints + .{ .value = 20, .cap = 2, .ext = "", .core = 100 }, // InputLines + .{ .value = 21, .cap = 2, .ext = "", .core = 100 }, // InputLinesAdjacency + .{ .value = 22, .cap = 2, .ext = "", .core = 100 }, // Triangles + .{ .value = 23, .cap = 2, .ext = "", .core = 100 }, // InputTrianglesAdjacency + .{ .value = 24, .cap = 3, .ext = "", .core = 100 }, // Quads + .{ .value = 25, .cap = 3, .ext = "", .core = 100 }, // Isolines + .{ .value = 26, .cap = 2, .ext = "", .core = 100 }, // OutputVertices + .{ .value = 27, .cap = 2, .ext = "", .core = 100 }, // OutputPoints + .{ .value = 28, .cap = 2, .ext = "", .core = 100 }, // OutputLineStrip + .{ .value = 29, .cap = 2, .ext = "", .core = 100 }, // OutputTriangleStrip + .{ .value = 30, .cap = 6, .ext = "", .core = 100 }, // VecTypeHint + .{ .value = 31, .cap = 6, .ext = "", .core = 100 }, // ContractionOff + .{ .value = 33, .cap = 6, .ext = "", .core = 101 }, // Initializer + .{ .value = 34, .cap = 6, .ext = "", .core = 101 }, // Finalizer + .{ .value = 35, .cap = 58, .ext = "", .core = 101 }, // SubgroupSize + .{ .value = 36, .cap = 58, .ext = "", .core = 101 }, // SubgroupsPerWorkgroup + .{ .value = 37, .cap = 58, .ext = "", .core = 102 }, // SubgroupsPerWorkgroupId + .{ .value = 39, .cap = 6, .ext = "", .core = 102 }, // LocalSizeHintId + .{ .value = 4169, .cap = 4166, .ext = "", .core = 999 }, // NonCoherentColorAttachmentReadEXT + .{ .value = 4170, .cap = 4167, .ext = "", .core = 999 }, // NonCoherentDepthAttachmentReadEXT + .{ .value = 4171, .cap = 4168, .ext = "", .core = 999 }, // NonCoherentStencilAttachmentReadEXT + .{ .value = 4421, .cap = 1, .ext = "SPV_KHR_subgroup_uniform_control_flow", .core = 999 }, // SubgroupUniformControlFlowKHR + .{ .value = 4446, .cap = 4447, .ext = "SPV_KHR_post_depth_coverage", .core = 999 }, // PostDepthCoverage + .{ .value = 4459, .cap = 4464, .ext = "SPV_KHR_float_controls", .core = 104 }, // DenormPreserve + .{ .value = 4460, .cap = 4465, .ext = "SPV_KHR_float_controls", .core = 104 }, // DenormFlushToZero + .{ .value = 4461, .cap = 4466, .ext = "SPV_KHR_float_controls", .core = 104 }, // SignedZeroInfNanPreserve + .{ .value = 4462, .cap = 4467, .ext = "SPV_KHR_float_controls", .core = 104 }, // RoundingModeRTE + .{ .value = 4463, .cap = 4468, .ext = "SPV_KHR_float_controls", .core = 104 }, // RoundingModeRTZ + .{ .value = 4489, .cap = 4495, .ext = "", .core = 999 }, // NonCoherentTileAttachmentReadQCOM + .{ .value = 4490, .cap = 4495, .ext = "", .core = 999 }, // TileShadingRateQCOM + .{ .value = 5017, .cap = 1, .ext = "SPV_AMD_shader_early_and_late_fragment_tests", .core = 999 }, // EarlyAndLateFragmentTestsAMD + .{ .value = 5027, .cap = 5013, .ext = "SPV_EXT_shader_stencil_export", .core = 999 }, // StencilRefReplacingEXT + .{ .value = 5069, .cap = 5067, .ext = "", .core = 999 }, // CoalescingAMDX + .{ .value = 5070, .cap = 5067, .ext = "", .core = 999 }, // IsApiEntryAMDX + .{ .value = 5071, .cap = 5067, .ext = "", .core = 999 }, // MaxNodeRecursionAMDX + .{ .value = 5072, .cap = 5067, .ext = "", .core = 999 }, // StaticNumWorkgroupsAMDX + .{ .value = 5073, .cap = 5067, .ext = "", .core = 999 }, // ShaderIndexAMDX + .{ .value = 5077, .cap = 5067, .ext = "", .core = 999 }, // MaxNumWorkgroupsAMDX + .{ .value = 5079, .cap = 5013, .ext = "SPV_AMD_shader_early_and_late_fragment_tests", .core = 999 }, // StencilRefUnchangedFrontAMD + .{ .value = 5080, .cap = 5013, .ext = "SPV_AMD_shader_early_and_late_fragment_tests", .core = 999 }, // StencilRefGreaterFrontAMD + .{ .value = 5081, .cap = 5013, .ext = "SPV_AMD_shader_early_and_late_fragment_tests", .core = 999 }, // StencilRefLessFrontAMD + .{ .value = 5082, .cap = 5013, .ext = "SPV_AMD_shader_early_and_late_fragment_tests", .core = 999 }, // StencilRefUnchangedBackAMD + .{ .value = 5083, .cap = 5013, .ext = "SPV_AMD_shader_early_and_late_fragment_tests", .core = 999 }, // StencilRefGreaterBackAMD + .{ .value = 5084, .cap = 5013, .ext = "SPV_AMD_shader_early_and_late_fragment_tests", .core = 999 }, // StencilRefLessBackAMD + .{ .value = 5088, .cap = 5087, .ext = "", .core = 999 }, // QuadDerivativesKHR + .{ .value = 5089, .cap = 5087, .ext = "", .core = 999 }, // RequireFullQuadsKHR + .{ .value = 5102, .cap = 5067, .ext = "", .core = 999 }, // SharesInputWithAMDX + .{ .value = 5157, .cap = 5156, .ext = "", .core = 999 }, // ArithmeticPoisonKHR + .{ .value = 5269, .cap = 5266, .ext = "SPV_NV_mesh_shader", .core = 999 }, // OutputLinesEXT + .{ .value = 5270, .cap = 5266, .ext = "SPV_NV_mesh_shader", .core = 999 }, // OutputPrimitivesEXT + .{ .value = 5289, .cap = 5288, .ext = "SPV_NV_compute_shader_derivatives", .core = 999 }, // DerivativeGroupQuadsKHR + .{ .value = 5290, .cap = 5350, .ext = "SPV_NV_compute_shader_derivatives", .core = 999 }, // DerivativeGroupLinearKHR + .{ .value = 5298, .cap = 5266, .ext = "SPV_NV_mesh_shader", .core = 999 }, // OutputTrianglesEXT + .{ .value = 5366, .cap = 5378, .ext = "SPV_EXT_fragment_shader_interlock", .core = 999 }, // PixelInterlockOrderedEXT + .{ .value = 5367, .cap = 5378, .ext = "SPV_EXT_fragment_shader_interlock", .core = 999 }, // PixelInterlockUnorderedEXT + .{ .value = 5368, .cap = 5363, .ext = "SPV_EXT_fragment_shader_interlock", .core = 999 }, // SampleInterlockOrderedEXT + .{ .value = 5369, .cap = 5363, .ext = "SPV_EXT_fragment_shader_interlock", .core = 999 }, // SampleInterlockUnorderedEXT + .{ .value = 5370, .cap = 5372, .ext = "SPV_EXT_fragment_shader_interlock", .core = 999 }, // ShadingRateInterlockOrderedEXT + .{ .value = 5371, .cap = 5372, .ext = "SPV_EXT_fragment_shader_interlock", .core = 999 }, // ShadingRateInterlockUnorderedEXT + .{ .value = 5427, .cap = 5426, .ext = "", .core = 999 }, // Shader64BitIndexingEXT + .{ .value = 5618, .cap = 5617, .ext = "", .core = 999 }, // SharedLocalMemorySizeINTEL + .{ .value = 5620, .cap = 5582, .ext = "", .core = 999 }, // RoundingModeRTPINTEL + .{ .value = 5621, .cap = 5582, .ext = "", .core = 999 }, // RoundingModeRTNINTEL + .{ .value = 5622, .cap = 5582, .ext = "", .core = 999 }, // FloatingPointModeALTINTEL + .{ .value = 5623, .cap = 5582, .ext = "", .core = 999 }, // FloatingPointModeIEEEINTEL + .{ .value = 5893, .cap = 5892, .ext = "SPV_INTEL_kernel_attributes", .core = 999 }, // MaxWorkgroupSizeINTEL + .{ .value = 5894, .cap = 5892, .ext = "SPV_INTEL_kernel_attributes", .core = 999 }, // MaxWorkDimINTEL + .{ .value = 5895, .cap = 5892, .ext = "SPV_INTEL_kernel_attributes", .core = 999 }, // NoGlobalOffsetINTEL + .{ .value = 5896, .cap = 5897, .ext = "SPV_INTEL_kernel_attributes", .core = 999 }, // NumSIMDWorkitemsINTEL + .{ .value = 5903, .cap = 5897, .ext = "", .core = 999 }, // SchedulerTargetFmaxMhzINTEL + .{ .value = 6023, .cap = 1, .ext = "SPV_KHR_maximal_reconvergence", .core = 999 }, // MaximallyReconvergesKHR + .{ .value = 6028, .cap = 6029, .ext = "", .core = 999 }, // FPFastMathDefault + .{ .value = 6031, .cap = 6032, .ext = "", .core = 999 }, // OpacityMicromapIdKHR + .{ .value = 6154, .cap = 5897, .ext = "", .core = 999 }, // StreamingInterfaceINTEL + .{ .value = 6160, .cap = 6161, .ext = "", .core = 999 }, // RegisterMapInterfaceINTEL + .{ .value = 6417, .cap = 5617, .ext = "", .core = 999 }, // NamedBarrierCountINTEL + .{ .value = 6461, .cap = 6460, .ext = "", .core = 999 }, // MaximumRegistersINTEL + .{ .value = 6462, .cap = 6460, .ext = "", .core = 999 }, // MaximumRegistersIdINTEL + .{ .value = 6463, .cap = 6460, .ext = "", .core = 999 }, // NamedMaximumRegistersINTEL +}; + +pub fn get(opcode: u32) ?u32 { + for (ops) |t| if (t[0] == opcode) return t[1]; + return null; +} + +pub fn need(table: []const Need, value: u32) ?Need { + for (table) |n| if (n.value == value) return n; + return null; +}