aboutsummaryrefslogtreecommitdiff
path: root/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2-ivec.shader_test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2-ivec.shader_test')
-rw-r--r--tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2-ivec.shader_test54
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2-ivec.shader_test b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2-ivec.shader_test
new file mode 100644
index 00000000..c6925f40
--- /dev/null
+++ b/tests/spec/glsl-es-1.00/execution/1.20/fs-outerProduct-const-mat2-ivec.shader_test
@@ -0,0 +1,54 @@
+[require]
+GLSL >= 1.00 es
+GL >= 2.0 es
+
+[vertex shader]
+attribute vec4 vertex;
+mat4 proj = mat4(
+ 2.0/250.0, 0.0, 0.0, -1.0,
+ 0.0, 2.0/250.0, 0.0, -1.0,
+ 0.0, 0.0, -1.0, 0.0,
+ 0.0, 0.0, 0.0, 1.0);
+
+void main() { gl_Position = vertex;
+ gl_Position *= proj; }
+
+[fragment shader]
+/* From page 43 (page 49 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "If an exact match is found, the other signatures are ignored, and the
+ * exact match is used. Otherwise, if no exact match is found, then the
+ * implicit conversions in Section 4.1.10 "Implicit Conversions" will be
+ * applied to the calling arguments if this can make their types match a
+ * signature."
+ *
+ * From page 20 (page 26 of the PDF) of the GLSL 1.20 spec:
+ *
+ * "In some situations, an expression and its type will be implicitly
+ * converted to a different type. The following table shows all allowed
+ * implicit conversions:
+ *
+ * Type of expression Can be implicitly converted to
+ * int float
+ * ivec2 vec2
+ * ivec3 vec3
+ * ivec4 vec4"
+ */
+
+
+const ivec2 c = ivec2(2, 3);
+const ivec2 r = ivec2(4, 5);
+uniform mat2 expected = mat2(8, 12, 10, 15);
+
+void main() {
+ mat2 result = outerProduct(c, r);
+ gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+
+
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0