From 4f2ecd53a9daaf88bb7d075745eefb6e2e4741e0 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 11 Jul 2018 18:11:13 +0200 Subject: Roll back to ANGLE/2845 --- gfx/angle/src/tests/gl_tests/GLSLTest.cpp | 188 ------------------------------ 1 file changed, 188 deletions(-) (limited to 'gfx/angle/src/tests/gl_tests/GLSLTest.cpp') diff --git a/gfx/angle/src/tests/gl_tests/GLSLTest.cpp b/gfx/angle/src/tests/gl_tests/GLSLTest.cpp index 00000612d..bdcbc5d20 100755 --- a/gfx/angle/src/tests/gl_tests/GLSLTest.cpp +++ b/gfx/angle/src/tests/gl_tests/GLSLTest.cpp @@ -1063,37 +1063,6 @@ TEST_P(GLSLTest_ES3, MissingReturnArrayOfStructs) EXPECT_NE(0u, program); } -// Verify that functions without return statements still compile -TEST_P(GLSLTest_ES3, MissingReturnStructOfArrays) -{ - // TODO(cwallez) remove the suppression once NVIDIA removes the restriction for - // GLSL >= 300. It was defined only in GLSL 2.0, section 6.1. - if (IsNVIDIA() && IsOpenGLES()) - { - std::cout << "Test skipped on NVIDIA OpenGL ES because it disallows returning " - "structure of arrays" - << std::endl; - return; - } - - const std::string vertexShaderSource = - "#version 300 es\n" - "in float v_varying;\n" - "struct s { float a[2]; int b[2]; vec2 c[2]; };\n" - "s f() { if (v_varying > 0.0) { return s(float[2](1.0, 1.0), int[2](1, 1)," - "vec2[2](vec2(1.0, 1.0), vec2(1.0, 1.0))); } }\n" - "void main() { gl_Position = vec4(f().a[0], 0, 0, 1); }\n"; - - const std::string fragmentShaderSource = - "#version 300 es\n" - "precision mediump float;\n" - "out vec4 my_FragColor;\n" - "void main() { my_FragColor = vec4(0, 0, 0, 1); }\n"; - - GLuint program = CompileProgram(vertexShaderSource, fragmentShaderSource); - EXPECT_NE(0u, program); -} - // Verify that using invariant(all) in both shaders fails in ESSL 3.00. TEST_P(GLSLTest_ES3, InvariantAllBoth) { @@ -2241,104 +2210,6 @@ TEST_P(GLSLTest, NestedPowStatements) EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green); } -// Convers a bug with the unary minus operator on signed integer workaround. -TEST_P(GLSLTest_ES3, UnaryMinusOperatorSignedInt) -{ - const std::string &vert = - "#version 300 es\n" - "in highp vec4 position;\n" - "out mediump vec4 v_color;\n" - "uniform int ui_one;\n" - "uniform int ui_two;\n" - "uniform int ui_three;\n" - "void main() {\n" - " int s[3];\n" - " s[0] = ui_one;\n" - " s[1] = -(-(-ui_two + 1) + 1);\n" // s[1] = -ui_two - " s[2] = ui_three;\n" - " int result = 0;\n" - " for (int i = 0; i < ui_three; i++) {\n" - " result += s[i];\n" - " }\n" - " v_color = (result == 2) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);\n" - " gl_Position = position;\n" - "}\n"; - const std::string &frag = - "#version 300 es\n" - "in mediump vec4 v_color;\n" - "layout(location=0) out mediump vec4 o_color;\n" - "void main() {\n" - " o_color = v_color;\n" - "}\n"; - - ANGLE_GL_PROGRAM(prog, vert, frag); - - gl::Context *context = reinterpret_cast(getEGLWindow()->getContext()); - gl::Program *glProgram = context->getProgram(prog.get()); - GLint oneIndex = glProgram->getUniformLocation("ui_one"); - ASSERT_NE(-1, oneIndex); - GLint twoIndex = glProgram->getUniformLocation("ui_two"); - ASSERT_NE(-1, twoIndex); - GLint threeIndex = glProgram->getUniformLocation("ui_three"); - ASSERT_NE(-1, threeIndex); - glUseProgram(prog.get()); - glUniform1i(oneIndex, 1); - glUniform1i(twoIndex, 2); - glUniform1i(threeIndex, 3); - - drawQuad(prog.get(), "position", 0.5f); - EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green); -} - -// Convers a bug with the unary minus operator on unsigned integer workaround. -TEST_P(GLSLTest_ES3, UnaryMinusOperatorUnsignedInt) -{ - const std::string &vert = - "#version 300 es\n" - "in highp vec4 position;\n" - "out mediump vec4 v_color;\n" - "uniform uint ui_one;\n" - "uniform uint ui_two;\n" - "uniform uint ui_three;\n" - "void main() {\n" - " uint s[3];\n" - " s[0] = ui_one;\n" - " s[1] = -(-(-ui_two + 1u) + 1u);\n" // s[1] = -ui_two - " s[2] = ui_three;\n" - " uint result = 0u;\n" - " for (uint i = 0u; i < ui_three; i++) {\n" - " result += s[i];\n" - " }\n" - " v_color = (result == 2u) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);\n" - " gl_Position = position;\n" - "}\n"; - const std::string &frag = - "#version 300 es\n" - "in mediump vec4 v_color;\n" - "layout(location=0) out mediump vec4 o_color;\n" - "void main() {\n" - " o_color = v_color;\n" - "}\n"; - - ANGLE_GL_PROGRAM(prog, vert, frag); - - gl::Context *context = reinterpret_cast(getEGLWindow()->getContext()); - gl::Program *glProgram = context->getProgram(prog.get()); - GLint oneIndex = glProgram->getUniformLocation("ui_one"); - ASSERT_NE(-1, oneIndex); - GLint twoIndex = glProgram->getUniformLocation("ui_two"); - ASSERT_NE(-1, twoIndex); - GLint threeIndex = glProgram->getUniformLocation("ui_three"); - ASSERT_NE(-1, threeIndex); - glUseProgram(prog.get()); - glUniform1ui(oneIndex, 1u); - glUniform1ui(twoIndex, 2u); - glUniform1ui(threeIndex, 3u); - - drawQuad(prog.get(), "position", 0.5f); - EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green); -} - // Test a nested sequence operator with a ternary operator inside. The ternary operator is // intended to be such that it gets converted to an if statement on the HLSL backend. TEST_P(GLSLTest, NestedSequenceOperatorWithTernaryInside) @@ -2368,65 +2239,6 @@ TEST_P(GLSLTest, NestedSequenceOperatorWithTernaryInside) EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green); } -// Test that using a sampler2D and samplerExternalOES in the same shader works (anglebug.com/1534) -TEST_P(GLSLTest, ExternalAnd2DSampler) -{ - if (!extensionEnabled("GL_OES_EGL_image_external")) - { - std::cout << "Test skipped because GL_OES_EGL_image_external is not available." - << std::endl; - return; - } - - const std::string fragmentShader = - "precision mediump float;\n" - "uniform samplerExternalOES tex0;\n" - "uniform sampler2D tex1;\n" - "void main(void)\n" - "{\n" - " vec2 uv = vec2(0.0, 0.0);" - " gl_FragColor = texture2D(tex0, uv) + texture2D(tex1, uv);\n" - "}\n"; - - ANGLE_GL_PROGRAM(program, mSimpleVSSource, fragmentShader); -} - -// Test that using an invalid constant right-shift produces an error. -TEST_P(GLSLTest_ES3, FoldedInvalidRightShift) -{ - const std::string &fragmentShader = - "#version 300 es\n" - "precision mediump float;\n" - "out vec4 color;\n" - "void main(void)\n" - "{\n" - " int diff = -100 >> -100;\n" - " color = vec4(float(diff));\n" - "}\n"; - - GLuint program = CompileProgram(mSimpleVSSource, fragmentShader); - EXPECT_EQ(0u, program); - glDeleteProgram(program); -} - -// Test that using an invalid constant left-shift produces an error. -TEST_P(GLSLTest_ES3, FoldedInvalidLeftShift) -{ - const std::string &fragmentShader = - "#version 300 es\n" - "precision mediump float;\n" - "out vec4 color;\n" - "void main(void)\n" - "{\n" - " int diff = -100 << -100;\n" - " color = vec4(float(diff));\n" - "}\n"; - - GLuint program = CompileProgram(mSimpleVSSource, fragmentShader); - EXPECT_EQ(0u, program); - glDeleteProgram(program); -} - } // anonymous namespace // Use this to select which configurations (e.g. which renderer, which GLES major version) these tests should be run against. -- cgit v1.2.3