Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/SPIRV-Cross.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <hans-kristian.arntzen@arm.com>2018-11-22 13:55:57 +0300
committerHans-Kristian Arntzen <hans-kristian.arntzen@arm.com>2018-11-22 13:55:57 +0300
commit816c1167cefc237df751b677b3544200a0beb907 (patch)
tree01d83d707f4bb83e4446a1a69df4e7e5ea15b2eb /shaders
parentf247b05ffd4cfa50bad5b4ce7581832c5fa88b9b (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.vert13
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;
+}