diff --git a/src/codegen/spirv.zig b/src/codegen/spirv.zig index 2732a0a617..99f948e789 100644 --- a/src/codegen/spirv.zig +++ b/src/codegen/spirv.zig @@ -2972,6 +2972,46 @@ const NavGen = struct { .storage_class = storage_class, }); + if (nav.fqn.eqlSlice("position", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .Position } }); + } else if (nav.fqn.eqlSlice("point_size", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .PointSize } }); + } else if (nav.fqn.eqlSlice("vertex_id", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .VertexId } }); + } else if (nav.fqn.eqlSlice("instance_id", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .InstanceId } }); + } else if (nav.fqn.eqlSlice("invocation_id", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .InvocationId } }); + } else if (nav.fqn.eqlSlice("frag_coord", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .FragCoord } }); + } else if (nav.fqn.eqlSlice("point_coord", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .PointCoord } }); + } else if (nav.fqn.eqlSlice("front_facing", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .FrontFacing } }); + } else if (nav.fqn.eqlSlice("sample_mask", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .SampleMask } }); + } else if (nav.fqn.eqlSlice("sample_mask", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .SampleMask } }); + } else if (nav.fqn.eqlSlice("frag_depth", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .FragDepth } }); + } else if (nav.fqn.eqlSlice("num_workgroups", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .NumWorkgroups } }); + } else if (nav.fqn.eqlSlice("workgroup_size", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .WorkgroupSize } }); + } else if (nav.fqn.eqlSlice("workgroup_id", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .WorkgroupId } }); + } else if (nav.fqn.eqlSlice("local_invocation_id", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .LocalInvocationId } }); + } else if (nav.fqn.eqlSlice("global_invocation_id", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .GlobalInvocationId } }); + } else if (nav.fqn.eqlSlice("local_invocation_index", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .LocalInvocationIndex } }); + } else if (nav.fqn.eqlSlice("vertex_index", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .VertexIndex } }); + } else if (nav.fqn.eqlSlice("instance_index", ip)) { + try self.spv.decorate(result_id, .{ .BuiltIn = .{ .built_in = .InstanceIndex } }); + } + try self.spv.debugName(result_id, nav.fqn.toSlice(ip)); try self.spv.declareDeclDeps(spv_decl_index, &.{}); },