authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-10 15:25:41+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-12 08:59:47+02:00
logeb4539a27d72defc2f90a0b164a5d7f27df79ea7
treeefe3019b3c60c1b0199c689fb9ff158a473b1383
parent15a3ee19795dd9807107c2a45fa328b00e9edd10
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

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.

5 files changed, 17 insertions(+), 17 deletions(-)

lib/compiler/aro/aro/target.zig+1-1
......@@ -652,7 +652,7 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
652652 .shadermodel => "shadermodel",
653653 .liteos => "liteos",
654654 .opencl,
655 .glsl450,
655 .opengl,
656656 .vulkan,
657657 .plan9,
658658 .other,
lib/std/Target.zig+8-8
......@@ -63,10 +63,10 @@ pub const Os = struct {
6363 amdhsa,
6464 amdpal,
6565 cuda,
66 glsl450,
6766 mesa3d,
6867 nvcl,
6968 opencl,
69 opengl,
7070 shadermodel,
7171 vulkan,
7272
......@@ -171,7 +171,7 @@ pub const Os = struct {
171171 .liteos,
172172 .uefi,
173173 .opencl, // TODO: OpenCL versions
174 .glsl450, // TODO: GLSL versions
174 .opengl, // TODO: GLSL versions
175175 .vulkan,
176176 .plan9,
177177 .illumos,
......@@ -402,7 +402,7 @@ pub const Os = struct {
402402 .liteos,
403403 .uefi,
404404 .opencl, // TODO: OpenCL versions
405 .glsl450, // TODO: GLSL versions
405 .opengl, // TODO: GLSL versions
406406 .vulkan,
407407 .plan9,
408408 .illumos,
......@@ -601,7 +601,7 @@ pub const Os = struct {
601601 .liteos,
602602 .uefi,
603603 .opencl,
604 .glsl450,
604 .opengl,
605605 .vulkan,
606606 .plan9,
607607 .other,
......@@ -715,7 +715,7 @@ pub const Abi = enum {
715715 => .musl,
716716 .liteos => .ohos,
717717 .opencl, // TODO: SPIR-V ABIs with Linkage capability
718 .glsl450,
718 .opengl,
719719 .vulkan,
720720 .plan9, // TODO specify abi
721721 .macos,
......@@ -1661,7 +1661,7 @@ pub inline fn hasDynamicLinker(target: Target) bool {
16611661 .windows,
16621662 .emscripten,
16631663 .opencl,
1664 .glsl450,
1664 .opengl,
16651665 .vulkan,
16661666 .plan9,
16671667 .other,
......@@ -1829,7 +1829,7 @@ pub const DynamicLinker = struct {
18291829 .emscripten,
18301830 .wasi,
18311831 .opencl,
1832 .glsl450,
1832 .opengl,
18331833 .vulkan,
18341834 .other,
18351835 .plan9,
......@@ -2346,7 +2346,7 @@ pub fn c_type_bit_size(target: Target, c_type: CType) u16 {
23462346 .contiki,
23472347 .hermit,
23482348 .hurd,
2349 .glsl450,
2349 .opengl,
23502350 .driverkit,
23512351 .shadermodel,
23522352 .liteos,
src/codegen/llvm.zig+2-2
......@@ -140,7 +140,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 {
140140 .serenity => "serenity",
141141 .vulkan => "vulkan",
142142
143 .glsl450,
143 .opengl,
144144 .plan9,
145145 .minix,
146146 .contiki,
......@@ -210,7 +210,7 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType {
210210 .freestanding,
211211 .other,
212212 .opencl,
213 .glsl450,
213 .opengl,
214214 .plan9,
215215 .minix,
216216 .contiki,
src/link/SpirV.zig+4-4
......@@ -85,7 +85,7 @@ pub fn createEmpty(
8585 }
8686
8787 switch (target.os.tag) {
88 .opencl, .glsl450, .vulkan => {},
88 .opencl, .opengl, .vulkan => {},
8989 else => unreachable, // Caught by Compilation.Config.resolve.
9090 }
9191
......@@ -290,7 +290,7 @@ fn writeCapabilities(spv: *SpvModule, target: std.Target) !void {
290290 // TODO: Integrate with a hypothetical feature system
291291 const caps: []const spec.Capability = switch (target.os.tag) {
292292 .opencl => &.{ .Kernel, .Addresses, .Int8, .Int16, .Int64, .Float64, .Float16, .Vector16, .GenericPointer },
293 .glsl450 => &.{.Shader},
293 .opengl => &.{.Shader},
294294 .vulkan => &.{ .Shader, .VariablePointersStorageBuffer, .Int8, .Int16, .Int64, .Float64, .Float16 },
295295 else => unreachable, // TODO
296296 };
......@@ -311,13 +311,13 @@ fn writeMemoryModel(spv: *SpvModule, target: std.Target) !void {
311311 .spirv64 => spec.AddressingModel.Physical64,
312312 else => unreachable, // TODO
313313 },
314 .glsl450, .vulkan => spec.AddressingModel.Logical,
314 .opengl, .vulkan => spec.AddressingModel.Logical,
315315 else => unreachable, // TODO
316316 };
317317
318318 const memory_model: spec.MemoryModel = switch (target.os.tag) {
319319 .opencl => .OpenCL,
320 .glsl450 => .GLSL450,
320 .opengl => .GLSL450,
321321 .vulkan => .GLSL450,
322322 else => unreachable,
323323 };
test/llvm_targets.zig+2-2
......@@ -90,10 +90,10 @@ const targets = [_]std.Target.Query{
9090 .{ .cpu_arch = .sparc64, .os_tag = .freestanding, .abi = .none },
9191 .{ .cpu_arch = .sparc64, .os_tag = .linux, .abi = .gnu },
9292 //.{ .cpu_arch = .spirv32, .os_tag = .opencl, .abi = .none },
93 //.{ .cpu_arch = .spirv32, .os_tag = .glsl450, .abi = .none },
93 //.{ .cpu_arch = .spirv32, .os_tag = .opengl, .abi = .none },
9494 //.{ .cpu_arch = .spirv32, .os_tag = .vulkan, .abi = .none },
9595 //.{ .cpu_arch = .spirv64, .os_tag = .opencl, .abi = .none },
96 //.{ .cpu_arch = .spirv64, .os_tag = .glsl450, .abi = .none },
96 //.{ .cpu_arch = .spirv64, .os_tag = .opengl, .abi = .none },
9797 //.{ .cpu_arch = .spirv64, .os_tag = .vulkan, .abi = .none },
9898 .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .none },
9999 .{ .cpu_arch = .thumbeb, .os_tag = .freestanding, .abi = .none },