Update SSO tests to follow new spec language
authorPyry Haulos <phaulos@google.com>
Mon, 6 Oct 2014 22:13:09 +0000 (15:13 -0700)
committerPyry Haulos <phaulos@google.com>
Mon, 6 Oct 2014 22:13:09 +0000 (15:13 -0700)
Upcoming ES3.1 spec revision will change the interface matching rules
slightly by disallowing flat/smooth mismatch. This change removes cases
that assumed that mismatch should work, and adds additional validation
cases to check that driver indeed gives validation and draw time errors
on such mismatch.

See Khronos bug 12630.

Change-Id: I0c77c80aa7779443df4c1dac71048f0d2a380600

data/gles31/shaders/separate_shader_validation.test
modules/gles31/functional/es31fSeparateShaderTests.cpp

index a93768e..690fcd8 100644 (file)
@@ -629,6 +629,166 @@ group varying "Default block varying matching"
                        ""
                end
        end
+
+       case mismatch_qualifier_vertex_flat_fragment_none
+               version 310 es
+               desc "Interpolation qualifier mismatch"
+               expect validation_fail
+
+               pipeline_program
+                       active_stages {vertex}
+                       vertex ""
+                               #version 310 es
+                               ${VERTEX_DECLARATIONS}
+                               out flat highp vec4 v_val;
+                               void main()
+                               {
+                                       v_val = vec4(float(gl_VertexID));
+                                       ${VERTEX_OUTPUT}
+                               }
+                       ""
+               end
+               pipeline_program
+                       active_stages {fragment}
+                       fragment ""
+                               #version 310 es
+                               ${FRAGMENT_DECLARATIONS}
+                               in highp vec4 v_val;
+                               void main()
+                               {
+                                       ${FRAG_COLOR} = v_val;
+                               }
+                       ""
+               end
+       end
+
+       case mismatch_qualifier_vertex_flat_fragment_smooth
+               version 310 es
+               desc "Interpolation qualifier mismatch"
+               expect validation_fail
+
+               pipeline_program
+                       active_stages {vertex}
+                       vertex ""
+                               #version 310 es
+                               ${VERTEX_DECLARATIONS}
+                               out flat highp vec4 v_val;
+                               void main()
+                               {
+                                       v_val = vec4(float(gl_VertexID));
+                                       ${VERTEX_OUTPUT}
+                               }
+                       ""
+               end
+               pipeline_program
+                       active_stages {fragment}
+                       fragment ""
+                               #version 310 es
+                               ${FRAGMENT_DECLARATIONS}
+                               in smooth highp vec4 v_val;
+                               void main()
+                               {
+                                       ${FRAG_COLOR} = v_val;
+                               }
+                       ""
+               end
+       end
+
+       case mismatch_qualifier_vertex_flat_fragment_centroid
+               version 310 es
+               desc "Interpolation qualifier mismatch"
+               expect validation_fail
+
+               pipeline_program
+                       active_stages {vertex}
+                       vertex ""
+                               #version 310 es
+                               ${VERTEX_DECLARATIONS}
+                               out flat highp vec4 v_val;
+                               void main()
+                               {
+                                       v_val = vec4(float(gl_VertexID));
+                                       ${VERTEX_OUTPUT}
+                               }
+                       ""
+               end
+               pipeline_program
+                       active_stages {fragment}
+                       fragment ""
+                               #version 310 es
+                               ${FRAGMENT_DECLARATIONS}
+                               in centroid highp vec4 v_val;
+                               void main()
+                               {
+                                       ${FRAG_COLOR} = v_val;
+                               }
+                       ""
+               end
+       end
+
+       case mismatch_qualifier_vertex_smooth_fragment_flat
+               version 310 es
+               desc "Interpolation qualifier mismatch"
+               expect validation_fail
+
+               pipeline_program
+                       active_stages {vertex}
+                       vertex ""
+                               #version 310 es
+                               ${VERTEX_DECLARATIONS}
+                               out smooth highp vec4 v_val;
+                               void main()
+                               {
+                                       v_val = vec4(float(gl_VertexID));
+                                       ${VERTEX_OUTPUT}
+                               }
+                       ""
+               end
+               pipeline_program
+                       active_stages {fragment}
+                       fragment ""
+                               #version 310 es
+                               ${FRAGMENT_DECLARATIONS}
+                               in flat highp vec4 v_val;
+                               void main()
+                               {
+                                       ${FRAG_COLOR} = v_val;
+                               }
+                       ""
+               end
+       end
+
+       case mismatch_qualifier_vertex_centroid_fragment_flat
+               version 310 es
+               desc "Interpolation qualifier mismatch"
+               expect validation_fail
+
+               pipeline_program
+                       active_stages {vertex}
+                       vertex ""
+                               #version 310 es
+                               ${VERTEX_DECLARATIONS}
+                               out centroid highp vec4 v_val;
+                               void main()
+                               {
+                                       v_val = vec4(float(gl_VertexID));
+                                       ${VERTEX_OUTPUT}
+                               }
+                       ""
+               end
+               pipeline_program
+                       active_stages {fragment}
+                       fragment ""
+                               #version 310 es
+                               ${FRAGMENT_DECLARATIONS}
+                               in flat highp vec4 v_val;
+                               void main()
+                               {
+                                       ${FRAG_COLOR} = v_val;
+                               }
+                       ""
+               end
+       end
 end
 
 group io_blocks "shader io blocks"
index 9de1a37..e73ac09 100644 (file)
@@ -692,6 +692,10 @@ bool paramsValid (const TestParams& params)
                  params.varyings.frgInterp == INTERPOLATION_LAST))
                return false;
 
+       // Mismatch by flat / smooth is not allowed. See Khronos bug #12630
+       if ((params.varyings.vtxInterp == INTERPOLATION_FLAT) != (params.varyings.frgInterp == INTERPOLATION_FLAT))
+               return false;
+
        return true;
 }