diff --git a/examples/custom-shader/shaders/noise.wgsl b/examples/custom-shader/shaders/noise.wgsl index 2f60c14..8f6c001 100644 --- a/examples/custom-shader/shaders/noise.wgsl +++ b/examples/custom-shader/shaders/noise.wgsl @@ -10,7 +10,7 @@ fn vs_main( [[location(0)]] position: vec2, ) -> VertexOutput { var out: VertexOutput; - out.tex_coord = position * vec2(0.5, -0.5) + 0.5; + out.tex_coord = fma(position, vec2(0.5, -0.5), vec2(0.5, 0.5)); out.position = vec4(position, 0.0, 1.0); return out; } diff --git a/shaders/scale.wgsl b/shaders/scale.wgsl index 6d782e8..166b5df 100644 --- a/shaders/scale.wgsl +++ b/shaders/scale.wgsl @@ -15,7 +15,7 @@ fn vs_main( [[location(0)]] position: vec2, ) -> VertexOutput { var out: VertexOutput; - out.tex_coord = position * vec2(0.5, -0.5) + 0.5; + out.tex_coord = fma(position, vec2(0.5, -0.5), vec2(0.5, 0.5)); out.position = r_locals.transform * vec4(position, 0.0, 1.0); return out; }