Merge pull request #190 from alichraghi/master

update zig shaders
This commit is contained in:
Robin Voetter
2025-06-05 22:00:02 +02:00
committed by GitHub
2 changed files with 2 additions and 5 deletions

View File

@@ -8,7 +8,7 @@
}, },
.vulkan_headers = .{ .vulkan_headers = .{
.url = "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.3.283.tar.gz", .url = "https://github.com/KhronosGroup/Vulkan-Headers/archive/v1.3.283.tar.gz",
.hash = "1220a7e73d72a0d56bc2a65f9d8999a7c019e42260a0744c408d1cded111bc205e10", .hash = "N-V-__8AAAkkoQGn5z1yoNVrwqZfnYmZp8AZ5CJgoHRMQI0c",
}, },
}, },
.paths = .{""}, .paths = .{""},

View File

@@ -4,16 +4,13 @@ const gpu = std.gpu;
extern const a_pos: @Vector(2, f32) addrspace(.input); extern const a_pos: @Vector(2, f32) addrspace(.input);
extern const a_color: @Vector(3, f32) addrspace(.input); extern const a_color: @Vector(3, f32) addrspace(.input);
extern var v_position: @Vector(4, f32) addrspace(.output);
extern var v_color: @Vector(3, f32) addrspace(.output); extern var v_color: @Vector(3, f32) addrspace(.output);
export fn main() callconv(.spirv_vertex) void { export fn main() callconv(.spirv_vertex) void {
gpu.location(&a_pos, 0); gpu.location(&a_pos, 0);
gpu.location(&a_color, 1); gpu.location(&a_color, 1);
gpu.location(&v_color, 0); gpu.location(&v_color, 0);
gpu.position(&v_position);
const temp: @Vector(4, f32) = .{ a_pos[0], a_pos[1], 0.0, 1.0 }; gpu.position_out.* = .{ a_pos[0], a_pos[1], 0.0, 1.0 };
v_position = temp;
v_color = a_color; v_color = a_color;
} }