adding branching and conversions
All checks were successful
Build / build (push) Successful in 1m53s
Test / build (push) Successful in 5m16s

This commit is contained in:
2026-01-16 23:41:11 +01:00
parent 5466cbcced
commit 076abf5d6a
11 changed files with 609 additions and 183 deletions

View File

@@ -1,17 +1,24 @@
[nzsl_version("1.1")]
module;
[nzsl_version("1.1")]
[feature(float64)]
module;
struct FragOut
{
[location(0)] color: vec4[f32]
}
struct FragOut
{
[location(0)] color: vec4[f32]
}
[entry(frag)]
fn main() -> FragOut
{
let op1: f64 = 0.0;
let op2: f64 = 9.0;
let color: f32;
if (op1 == op2)
color = f32(op1);
else
color = f32(op2);
[entry(frag)]
fn main() -> FragOut
{
let ratio = vec4[f32](2.0, 2.0, 8.0, 0.25);
let output: FragOut;
output.color = vec4[f32](4.0, 3.0, 2.0, 1.0) * ratio;
return output;
}
let output: FragOut;
output.color = vec4[f32](color, color, color, color);
return output;
}