std.Target: Rename glsl450 Arch tag to opengl.

Versions can simply use the normal version range mechanism, or alternatively an
Abi tag if that makes more sense. For now, we only care about 4.5 anyway.
This commit is contained in:
Alex Rønne Petersen 2024-08-10 15:25:41 +02:00
parent 15a3ee1979
commit eb4539a27d
No known key found for this signature in database
5 changed files with 17 additions and 17 deletions

View file

@ -652,7 +652,7 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
.shadermodel => "shadermodel", .shadermodel => "shadermodel",
.liteos => "liteos", .liteos => "liteos",
.opencl, .opencl,
.glsl450, .opengl,
.vulkan, .vulkan,
.plan9, .plan9,
.other, .other,

View file

@ -63,10 +63,10 @@ pub const Os = struct {
amdhsa, amdhsa,
amdpal, amdpal,
cuda, cuda,
glsl450,
mesa3d, mesa3d,
nvcl, nvcl,
opencl, opencl,
opengl,
shadermodel, shadermodel,
vulkan, vulkan,
@ -171,7 +171,7 @@ pub const Os = struct {
.liteos, .liteos,
.uefi, .uefi,
.opencl, // TODO: OpenCL versions .opencl, // TODO: OpenCL versions
.glsl450, // TODO: GLSL versions .opengl, // TODO: GLSL versions
.vulkan, .vulkan,
.plan9, .plan9,
.illumos, .illumos,
@ -402,7 +402,7 @@ pub const Os = struct {
.liteos, .liteos,
.uefi, .uefi,
.opencl, // TODO: OpenCL versions .opencl, // TODO: OpenCL versions
.glsl450, // TODO: GLSL versions .opengl, // TODO: GLSL versions
.vulkan, .vulkan,
.plan9, .plan9,
.illumos, .illumos,
@ -601,7 +601,7 @@ pub const Os = struct {
.liteos, .liteos,
.uefi, .uefi,
.opencl, .opencl,
.glsl450, .opengl,
.vulkan, .vulkan,
.plan9, .plan9,
.other, .other,
@ -715,7 +715,7 @@ pub const Abi = enum {
=> .musl, => .musl,
.liteos => .ohos, .liteos => .ohos,
.opencl, // TODO: SPIR-V ABIs with Linkage capability .opencl, // TODO: SPIR-V ABIs with Linkage capability
.glsl450, .opengl,
.vulkan, .vulkan,
.plan9, // TODO specify abi .plan9, // TODO specify abi
.macos, .macos,
@ -1661,7 +1661,7 @@ pub inline fn hasDynamicLinker(target: Target) bool {
.windows, .windows,
.emscripten, .emscripten,
.opencl, .opencl,
.glsl450, .opengl,
.vulkan, .vulkan,
.plan9, .plan9,
.other, .other,
@ -1829,7 +1829,7 @@ pub const DynamicLinker = struct {
.emscripten, .emscripten,
.wasi, .wasi,
.opencl, .opencl,
.glsl450, .opengl,
.vulkan, .vulkan,
.other, .other,
.plan9, .plan9,
@ -2346,7 +2346,7 @@ pub fn c_type_bit_size(target: Target, c_type: CType) u16 {
.contiki, .contiki,
.hermit, .hermit,
.hurd, .hurd,
.glsl450, .opengl,
.driverkit, .driverkit,
.shadermodel, .shadermodel,
.liteos, .liteos,

View file

@ -140,7 +140,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
.serenity => "serenity", .serenity => "serenity",
.vulkan => "vulkan", .vulkan => "vulkan",
.glsl450, .opengl,
.plan9, .plan9,
.minix, .minix,
.contiki, .contiki,
@ -210,7 +210,7 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
.freestanding, .freestanding,
.other, .other,
.opencl, .opencl,
.glsl450, .opengl,
.plan9, .plan9,
.minix, .minix,
.contiki, .contiki,

View file

@ -85,7 +85,7 @@ pub fn createEmpty(
} }
switch (target.os.tag) { switch (target.os.tag) {
.opencl, .glsl450, .vulkan => {}, .opencl, .opengl, .vulkan => {},
else => unreachable, // Caught by Compilation.Config.resolve. else => unreachable, // Caught by Compilation.Config.resolve.
} }
@ -290,7 +290,7 @@ fn writeCapabilities(spv: *SpvModule, target: std.Target) !void {
// TODO: Integrate with a hypothetical feature system // TODO: Integrate with a hypothetical feature system
const caps: []const spec.Capability = switch (target.os.tag) { const caps: []const spec.Capability = switch (target.os.tag) {
.opencl => &.{ .Kernel, .Addresses, .Int8, .Int16, .Int64, .Float64, .Float16, .Vector16, .GenericPointer }, .opencl => &.{ .Kernel, .Addresses, .Int8, .Int16, .Int64, .Float64, .Float16, .Vector16, .GenericPointer },
.glsl450 => &.{.Shader}, .opengl => &.{.Shader},
.vulkan => &.{ .Shader, .VariablePointersStorageBuffer, .Int8, .Int16, .Int64, .Float64, .Float16 }, .vulkan => &.{ .Shader, .VariablePointersStorageBuffer, .Int8, .Int16, .Int64, .Float64, .Float16 },
else => unreachable, // TODO else => unreachable, // TODO
}; };
@ -311,13 +311,13 @@ fn writeMemoryModel(spv: *SpvModule, target: std.Target) !void {
.spirv64 => spec.AddressingModel.Physical64, .spirv64 => spec.AddressingModel.Physical64,
else => unreachable, // TODO else => unreachable, // TODO
}, },
.glsl450, .vulkan => spec.AddressingModel.Logical, .opengl, .vulkan => spec.AddressingModel.Logical,
else => unreachable, // TODO else => unreachable, // TODO
}; };
const memory_model: spec.MemoryModel = switch (target.os.tag) { const memory_model: spec.MemoryModel = switch (target.os.tag) {
.opencl => .OpenCL, .opencl => .OpenCL,
.glsl450 => .GLSL450, .opengl => .GLSL450,
.vulkan => .GLSL450, .vulkan => .GLSL450,
else => unreachable, else => unreachable,
}; };

View file

@ -90,10 +90,10 @@ const targets = [_]std.Target.Query{
.{ .cpu_arch = .sparc64, .os_tag = .freestanding, .abi = .none }, .{ .cpu_arch = .sparc64, .os_tag = .freestanding, .abi = .none },
.{ .cpu_arch = .sparc64, .os_tag = .linux, .abi = .gnu }, .{ .cpu_arch = .sparc64, .os_tag = .linux, .abi = .gnu },
//.{ .cpu_arch = .spirv32, .os_tag = .opencl, .abi = .none }, //.{ .cpu_arch = .spirv32, .os_tag = .opencl, .abi = .none },
//.{ .cpu_arch = .spirv32, .os_tag = .glsl450, .abi = .none }, //.{ .cpu_arch = .spirv32, .os_tag = .opengl, .abi = .none },
//.{ .cpu_arch = .spirv32, .os_tag = .vulkan, .abi = .none }, //.{ .cpu_arch = .spirv32, .os_tag = .vulkan, .abi = .none },
//.{ .cpu_arch = .spirv64, .os_tag = .opencl, .abi = .none }, //.{ .cpu_arch = .spirv64, .os_tag = .opencl, .abi = .none },
//.{ .cpu_arch = .spirv64, .os_tag = .glsl450, .abi = .none }, //.{ .cpu_arch = .spirv64, .os_tag = .opengl, .abi = .none },
//.{ .cpu_arch = .spirv64, .os_tag = .vulkan, .abi = .none }, //.{ .cpu_arch = .spirv64, .os_tag = .vulkan, .abi = .none },
.{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .none }, .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .none },
.{ .cpu_arch = .thumbeb, .os_tag = .freestanding, .abi = .none }, .{ .cpu_arch = .thumbeb, .os_tag = .freestanding, .abi = .none },