From dd3c1e9bf560d4490d4aad5763e0180b098dbb0e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jarkko=20P=C3=B6yry?= Date: Mon, 10 Nov 2014 10:58:55 -0800 Subject: [PATCH] Fix some dEQP GLES2 issues. - Convert broken negative preprocessor case to a positive one. - Improve logging in negative shader matrix cases. Bug: 18290570 Change-Id: If7e1a67a46021740f1c930cdda684bd85dd813be --- data/gles2/shaders/preprocessor.test | 28 ++++++++++--------- .../functional/es2fNegativeShaderApiTests.cpp | 8 ++++++ 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/data/gles2/shaders/preprocessor.test b/data/gles2/shaders/preprocessor.test index 03f019344..593f37ffb 100644 --- a/data/gles2/shaders/preprocessor.test +++ b/data/gles2/shaders/preprocessor.test @@ -112,6 +112,21 @@ group basic "Basic Tests" "" end + case identifier_with_double_underscore + values { output float out0 = 1.0; } + both "" + precision mediump float; + ${DECLARATIONS} + # define __VALUE__ 1 + + void main() + { + // __VALUE__ not used since it might be set by an "underlying software layer" + out0 = float(1.0); + ${OUTPUT} + } + "" + end end # basic group definitions "Symbol Definition Tests" @@ -559,19 +574,6 @@ end # object_redefinitions group invalid_redefinitions "Invalid Redefinitions Tests" - case invalid_identifier_1 - expect compile_fail - both "" - precision mediump float; - # define __VALUE__ 1 - - void main() - { - ${POSITION_FRAG_COLOR} = vec4(__VALUE__); - } - "" - end - case invalid_identifier_2 expect compile_fail both "" diff --git a/modules/gles2/functional/es2fNegativeShaderApiTests.cpp b/modules/gles2/functional/es2fNegativeShaderApiTests.cpp index a273bca69..51cffc641 100644 --- a/modules/gles2/functional/es2fNegativeShaderApiTests.cpp +++ b/modules/gles2/functional/es2fNegativeShaderApiTests.cpp @@ -898,6 +898,8 @@ void NegativeShaderApiTests::init (void) GLint vMatUnif = glGetUniformLocation(program.getProgram(), "vMatrix"); // mat4 GLint fSamplerUnif = glGetUniformLocation(program.getProgram(), "fSampler"); // sampler2D + m_log << program; + if (vMatUnif == -1 || fSamplerUnif == -1) { m_log << TestLog::Message << "// ERROR: Failed to retrieve uniform location" << TestLog::EndMessage; @@ -929,6 +931,8 @@ void NegativeShaderApiTests::init (void) glu::ShaderProgram program(m_context.getRenderContext(), glu::makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); glUseProgram(program.getProgram()); + m_log << program; + std::vector data(16); m_log << tcu::TestLog::Section("", "GL_INVALID_OPERATION is generated if location is an invalid uniform location for the current program object and location is not equal to -1."); @@ -957,6 +961,8 @@ void NegativeShaderApiTests::init (void) glUseProgram(program.getProgram()); GLint vMatUnif = glGetUniformLocation(program.getProgram(), "vMatrix"); // mat4 + m_log << program; + if (vMatUnif == -1) { m_log << TestLog::Message << "// ERROR: Failed to retrieve uniform location" << TestLog::EndMessage; @@ -983,6 +989,8 @@ void NegativeShaderApiTests::init (void) glu::ShaderProgram program(m_context.getRenderContext(), glu::makeVtxFragSources(uniformTestVertSource, uniformTestFragSource)); glUseProgram(program.getProgram()); + m_log << program; + std::vector data(16); m_log << tcu::TestLog::Section("", "GL_INVALID_VALUE is generated if transpose is not GL_FALSE."); -- 2.34.1