Skip to content

Commit

Permalink
Use Fused-Multiply-Add (#246)
Browse files Browse the repository at this point in the history
This reverts commit 598cf6c.
  • Loading branch information
parasyte committed Dec 31, 2021
1 parent c1962ae commit d3dbc8b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/custom-shader/shaders/noise.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn vs_main(
[[location(0)]] position: vec2<f32>,
) -> VertexOutput {
var out: VertexOutput;
out.tex_coord = position * vec2<f32>(0.5, -0.5) + 0.5;
out.tex_coord = fma(position, vec2<f32>(0.5, -0.5), vec2<f32>(0.5, 0.5));
out.position = vec4<f32>(position, 0.0, 1.0);
return out;
}
Expand Down
2 changes: 1 addition & 1 deletion shaders/scale.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn vs_main(
[[location(0)]] position: vec2<f32>,
) -> VertexOutput {
var out: VertexOutput;
out.tex_coord = position * vec2<f32>(0.5, -0.5) + 0.5;
out.tex_coord = fma(position, vec2<f32>(0.5, -0.5), vec2<f32>(0.5, 0.5));
out.position = r_locals.transform * vec4<f32>(position, 0.0, 1.0);
return out;
}
Expand Down

0 comments on commit d3dbc8b

Please sign in to comment.