mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
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.
This commit is contained in:
parent
6a364b4a5e
commit
9b42bc1ce5
1 changed files with 2 additions and 3 deletions
|
|
@ -19,8 +19,7 @@ pub const simplified_logic =
|
||||||
builtin.zig_backend == .stage2_aarch64 or
|
builtin.zig_backend == .stage2_aarch64 or
|
||||||
builtin.zig_backend == .stage2_arm or
|
builtin.zig_backend == .stage2_arm or
|
||||||
builtin.zig_backend == .stage2_sparc64 or
|
builtin.zig_backend == .stage2_sparc64 or
|
||||||
builtin.cpu.arch == .spirv32 or
|
builtin.zig_backend == .stage2_spirv64;
|
||||||
builtin.cpu.arch == .spirv64;
|
|
||||||
|
|
||||||
comptime {
|
comptime {
|
||||||
// No matter what, we import the root file, so that any export, test, 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")) {
|
if (!@hasDecl(root, "wWinMainCRTStartup") and !@hasDecl(root, "mainCRTStartup")) {
|
||||||
@export(&wWinMainCRTStartup2, .{ .name = "wWinMainCRTStartup" });
|
@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"))
|
if (@hasDecl(root, "main"))
|
||||||
@export(&spirvMain2, .{ .name = "main" });
|
@export(&spirvMain2, .{ .name = "main" });
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue