Test passing of highp vectors to struct constructors.
authorKenneth Russell <kbr@google.com>
Thu, 17 Dec 2015 23:12:43 +0000 (15:12 -0800)
committerKenneth Russell <kbr@google.com>
Mon, 21 Dec 2015 23:26:32 +0000 (15:26 -0800)
BUG: 25820555
Change-Id: Ib383d06d955f60a61869d32affcb9a7c26047142

android/cts/master/com.drawelements.deqp.gles2.xml
android/cts/master/com.drawelements.deqp.gles3.xml
android/cts/master/gles2-master.txt
android/cts/master/gles3-master.txt
data/gles2/shaders/functions.test
data/gles3/shaders/functions.test

index 076804f..939a048 100644 (file)
                                                <Test name="struct_nested_struct_fragment">
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
+                                               <Test name="struct_constructor_highp_in_fragment">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
                                        </TestCase>
                                        <TestCase name="qualifiers">
                                                <Test name="in_float_vertex">
index 7238e96..754998d 100644 (file)
                                                <Test name="struct_nested_struct_fragment">
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
+                                               <Test name="struct_constructor_highp_in_fragment">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
                                        </TestCase>
                                        <TestCase name="qualifiers">
                                                <Test name="in_float_vertex">
index c85cca6..f802da3 100644 (file)
@@ -1697,6 +1697,7 @@ dEQP-GLES2.functional.shaders.functions.datatypes.struct_struct_vertex
 dEQP-GLES2.functional.shaders.functions.datatypes.struct_struct_fragment
 dEQP-GLES2.functional.shaders.functions.datatypes.struct_nested_struct_vertex
 dEQP-GLES2.functional.shaders.functions.datatypes.struct_nested_struct_fragment
+dEQP-GLES2.functional.shaders.functions.datatypes.struct_constructor_highp_in_fragment
 dEQP-GLES2.functional.shaders.functions.qualifiers.in_float_vertex
 dEQP-GLES2.functional.shaders.functions.qualifiers.in_float_fragment
 dEQP-GLES2.functional.shaders.functions.qualifiers.out_float_vertex
index 11a2697..d724ffc 100644 (file)
@@ -3533,6 +3533,7 @@ dEQP-GLES3.functional.shaders.functions.datatypes.struct_struct_vertex
 dEQP-GLES3.functional.shaders.functions.datatypes.struct_struct_fragment
 dEQP-GLES3.functional.shaders.functions.datatypes.struct_nested_struct_vertex
 dEQP-GLES3.functional.shaders.functions.datatypes.struct_nested_struct_fragment
+dEQP-GLES3.functional.shaders.functions.datatypes.struct_constructor_highp_in_fragment
 dEQP-GLES3.functional.shaders.functions.qualifiers.in_float_vertex
 dEQP-GLES3.functional.shaders.functions.qualifiers.in_float_fragment
 dEQP-GLES3.functional.shaders.functions.qualifiers.out_float_vertex
index 6469b98..2890995 100644 (file)
@@ -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
 
index 767a035..89b9c57 100644 (file)
@@ -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