Files
SPIRV-Interpreter/test/basics.zig
Kbz-8 7bf671d974
All checks were successful
Build / build (push) Successful in 2m31s
Test / build (push) Successful in 6m48s
improving tests
2026-03-06 22:34:47 +01:00

35 lines
848 B
Zig

const std = @import("std");
const root = @import("root.zig");
const compileNzsl = root.compileNzsl;
const case = root.case;
test "Simple fragment shader" {
const allocator = std.testing.allocator;
const shader =
\\ [nzsl_version("1.1")]
\\ module;
\\
\\ struct FragOut
\\ {
\\ [location(0)] color: vec4[f32]
\\ }
\\
\\ [entry(frag)]
\\ fn main() -> FragOut
\\ {
\\ let output: FragOut;
\\ output.color = vec4[f32](4.0, 3.0, 2.0, 1.0);
\\ return output;
\\ }
;
const code = try compileNzsl(allocator, shader);
defer allocator.free(code);
try case.expect(.{
.source = code,
.expected_outputs = &.{
std.mem.asBytes(&[_]f32{ 4, 3, 2, 1 }),
},
});
}