Files
wgpu/tests/out/glsl/functions.main.Compute.glsl
T
Jay Oster 924ab17b62 Fixes for fma function (#1580)
* [hlsl-out] Write `mad` intrinsic for `fma` function

- This should be enough because we only support f32 for now.
- Adds a new test for WGSL functions, in the spirit of operators.wgsl.
- Closes #1579

* Add FMA feature to glsl backend

- I think this is right. Just iterate all known expressions in all
  functions and entry points to locate any `fma` function call.
  Should not need to walk the statement DAG.

* Transform GLSL fma function into an airthmetic expression when necessary

* Add tests for GLSL fma function tranformation

* Remove the hazard comment from the webgl test input

* Add helper method for fma function support checks

* Address review comment
2021-12-22 09:41:07 -05:00

22 lines
358 B
GLSL

#version 310 es
#extension GL_EXT_gpu_shader5 : require
precision highp float;
precision highp int;
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
vec2 test_fma() {
vec2 a = vec2(2.0, 2.0);
vec2 b = vec2(0.5, 0.5);
vec2 c = vec2(0.5, 0.5);
return fma(a, b, c);
}
void main() {
vec2 _e0 = test_fma();
return;
}