summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorKenneth Russell <kbr@google.com>2015-12-22 00:42:12 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-12-22 00:42:12 +0000
commit696d99ce41805aea1fb942fdcf7fea210ea50d45 (patch)
tree964fcf12546c96a5f2dc91293cabe24db4bb2bcd /data
parent669a39f9c1b02bc3bff369c06f2085c359df6f0c (diff)
parentf6bb0d77f32c997ff3750ddc55164d9b82eb566c (diff)
downloadVK-GL-CTS-696d99ce41805aea1fb942fdcf7fea210ea50d45.tar.gz
VK-GL-CTS-696d99ce41805aea1fb942fdcf7fea210ea50d45.tar.bz2
VK-GL-CTS-696d99ce41805aea1fb942fdcf7fea210ea50d45.zip
Merge "Test passing of highp vectors to struct constructors."
Diffstat (limited to 'data')
-rw-r--r--data/gles2/shaders/functions.test26
-rw-r--r--data/gles3/shaders/functions.test31
2 files changed, 57 insertions, 0 deletions
diff --git a/data/gles2/shaders/functions.test b/data/gles2/shaders/functions.test
index 6469b9893..2890995d6 100644
--- a/data/gles2/shaders/functions.test
+++ b/data/gles2/shaders/functions.test
@@ -547,6 +547,32 @@ group datatypes "Function Parameter Data Types"
""
end
+ case struct_constructor_highp_in_fragment
+ desc "passing highp vector to struct constructor in fragment shader yields all zeros"
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #ifdef GL_FRAGMENT_PRECISION_HIGH
+ #define PRECISION highp
+ #else
+ #define PRECISION mediump
+ #endif
+ struct Test {
+ PRECISION vec3 color;
+ } ;
+ void main() {
+ PRECISION vec3 color = vec3(0.2, 2.0, 0.1);
+ Test test = Test(color);
+ // Bias the color so all components are guaranteed > 1.0.
+ gl_FragColor = vec4(vec3(0.25, 0.55, 0.65) + vec3(4.0, 0.25, 4.0) * test.color, 1.0);
+ }
+ ""
+ end
end # datatypes
diff --git a/data/gles3/shaders/functions.test b/data/gles3/shaders/functions.test
index 767a03599..89b9c57d5 100644
--- a/data/gles3/shaders/functions.test
+++ b/data/gles3/shaders/functions.test
@@ -869,6 +869,37 @@ group datatypes "Function Parameter Data Types"
""
end
+ case struct_constructor_highp_in_fragment
+ version 300 es
+ desc "passing highp vector to struct constructor in fragment shader yields all zeros"
+ vertex ""
+ #version 300 es
+ ${VERTEX_DECLARATIONS}
+ void main()
+ {
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ #version 300 es
+ ${FRAGMENT_DECLARATIONS}
+ #ifdef GL_FRAGMENT_PRECISION_HIGH
+ #define PRECISION highp
+ #else
+ #define PRECISION mediump
+ #endif
+ struct Test {
+ PRECISION vec3 color;
+ } ;
+ void main() {
+ PRECISION vec3 color = vec3(0.2, 2.0, 0.1);
+ Test test = Test(color);
+ // Bias the color so all components are guaranteed > 1.0.
+ ${FRAG_COLOR} = vec4(vec3(0.25, 0.55, 0.65) + vec3(4.0, 0.25, 4.0) * test.color, 1.0);
+ }
+ ""
+ end
+
end # datatypes