diff options
author | Hans-Kristian Arntzen <hans-kristian.arntzen@arm.com> | 2018-11-22 13:55:57 +0300 |
---|---|---|
committer | Hans-Kristian Arntzen <hans-kristian.arntzen@arm.com> | 2018-11-22 13:55:57 +0300 |
commit | 816c1167cefc237df751b677b3544200a0beb907 (patch) | |
tree | 01d83d707f4bb83e4446a1a69df4e7e5ea15b2eb /shaders | |
parent | f247b05ffd4cfa50bad5b4ce7581832c5fa88b9b (diff) |
Handle invariant decoration more robustly.
Avoids certain cases of variance between translation units by forcing
every dependent expression of a store to be temporary.
Should avoid the major failure cases where invariance matters.
Diffstat (limited to 'shaders')
-rw-r--r-- | shaders/vert/invariant.vert | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/shaders/vert/invariant.vert b/shaders/vert/invariant.vert new file mode 100644 index 00000000..239b985d --- /dev/null +++ b/shaders/vert/invariant.vert @@ -0,0 +1,13 @@ +#version 310 es + +invariant gl_Position; +layout(location = 0) invariant out vec4 vColor; +layout(location = 0) in vec4 vInput0; +layout(location = 1) in vec4 vInput1; +layout(location = 2) in vec4 vInput2; + +void main() +{ + gl_Position = vInput0 + vInput1 * vInput2; + vColor = (vInput0 - vInput1) * vInput2; +} |