diff options
| author | Robin Voetter <robin@voetter.nl> | 2024-10-20 16:51:15 +0200 |
|---|---|---|
| committer | Robin Voetter <robin@voetter.nl> | 2024-10-27 14:20:52 +0100 |
| commit | 9b42bc1ce5a1d688aa2167a068a3b75d69888c12 (patch) | |
| tree | 0eb0a0d99f3d71ada06f4dd24b6a02dd4047ae63 /lib/std/start.zig | |
| parent | 6a364b4a5e71b971b753d2b62c7708ae1e76d707 (diff) | |
| download | zig-9b42bc1ce5a1d688aa2167a068a3b75d69888c12.tar.gz zig-9b42bc1ce5a1d688aa2167a068a3b75d69888c12.zip | |
spirv: start.zig support for vulkan
* Use builtin.zig_backend instead of builtin.cpu.arch, the latter
does not yet compile under VK.
* Don't call regular _start for either opencl or vulkan. We might
even want to disable these completely.
Diffstat (limited to 'lib/std/start.zig')
| -rw-r--r-- | lib/std/start.zig | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/std/start.zig b/lib/std/start.zig index a70d9e609e..c5664cbf0f 100644 --- a/lib/std/start.zig +++ b/lib/std/start.zig @@ -19,8 +19,7 @@ pub const simplified_logic = builtin.zig_backend == .stage2_aarch64 or builtin.zig_backend == .stage2_arm or builtin.zig_backend == .stage2_sparc64 or - builtin.cpu.arch == .spirv32 or - builtin.cpu.arch == .spirv64; + builtin.zig_backend == .stage2_spirv64; comptime { // No matter what, we import the root file, so that any export, test, comptime @@ -37,7 +36,7 @@ comptime { if (!@hasDecl(root, "wWinMainCRTStartup") and !@hasDecl(root, "mainCRTStartup")) { @export(&wWinMainCRTStartup2, .{ .name = "wWinMainCRTStartup" }); } - } else if (builtin.os.tag == .opencl) { + } else if (builtin.os.tag == .opencl or builtin.os.tag == .vulkan) { if (@hasDecl(root, "main")) @export(&spirvMain2, .{ .name = "main" }); } else { |
