The expression
mediump vec2 v = mediump vec2(...);
is not legal GLSL because of the "mediump" in the initializer.
Many implementations accept it, though. This test verifies that they
catch the syntax error correctly.
Bug:
13881278
Test: Ran this on X11 GLX, saw the test case fail as desired
Change-Id: I12e59ce2d813e72f878ae5c8eaf384063b362cdf
dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.geometric.normalize_vec3_fragment
dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.geometric.normalize_vec4_vertex
dEQP-GLES2.functional.shaders.constant_expressions.builtin_functions.geometric.normalize_vec4_fragment
+dEQP-GLES2.functional.shaders.constant_expressions.invalid.precision_specifier
dEQP-GLES2.functional.shaders.random.basic_expression.vertex.0
dEQP-GLES2.functional.shaders.random.basic_expression.vertex.1
dEQP-GLES2.functional.shaders.random.basic_expression.vertex.2
--- /dev/null
+case precision_specifier
+ expect compile_fail
+ values {}
+
+ vertex ""
+ ${VERTEX_DECLARATIONS}
+ uniform lowp sampler2D s;
+
+ void main()
+ {
+ mediump vec2 v = mediump vec2(1.0, 1.0);
+ ${VERTEX_OUTPUT}
+ }
+ ""
+ fragment ""
+ void main()
+ {
+ gl_FragColor = vec4(1.0);
+ }
+ ""
+end
addChild(children[i]);
addChild(new ShaderConstExprBuiltinTests(m_context));
+
+ // Negative cases.
+ {
+ gls::ShaderLibrary library(m_testCtx, m_context.getRenderContext(), m_context.getContextInfo());
+ std::vector<tcu::TestNode*> negativeCases = library.loadShaderFile("shaders/invalid_constant_expressions.test");
+
+ tcu::TestCaseGroup* group = new tcu::TestCaseGroup(m_testCtx, "invalid", "Invalid constant expressions", negativeCases);
+ addChild(group);
+ }
}
} // Functional