- Check GL_OES_fbo_render_mipmap extension in framebuffer_texture2d negative
test.
- Check GL_EXT_draw_buffers in builtin_variable.max_draw_buffers_* tests.
- Fix invalid uniform location check in get_uniformfv negative state test.
Bug:
18620565
Change-Id: I2158a10ca859e3c40219bd324e7a02c0ff10e42b
#include "es2fNegativeBufferApiTests.hpp"
#include "es2fApiCase.hpp"
+#include "gluContextInfo.hpp"
#include "glwEnums.hpp"
#include "glwDefs.hpp"
expectError(GL_INVALID_ENUM);
m_log << TestLog::EndSection;
- m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if level is not 0.");
- glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2D, 3);
- expectError(GL_INVALID_VALUE);
- m_log << TestLog::EndSection;
+ if (!m_context.getContextInfo().isExtensionSupported("GL_OES_fbo_render_mipmap"))
+ {
+ m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if level is not 0.");
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2D, 3);
+ expectError(GL_INVALID_VALUE);
+ m_log << TestLog::EndSection;
+ }
m_log << TestLog::Section("", "GL_INVALID_OPERATION is generated if texture is neither 0 nor the name of an existing texture object.");
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, -1, 0);
GLint vUnif = glGetUniformLocation(program.getProgram(), "vTest"); // vec4
GLint fUnif = glGetUniformLocation(program.getProgram(), "fTest"); // ivec4
- if (vUnif == -1 || fUnif)
+ if (vUnif == -1 || fUnif == -1)
m_testCtx.setTestResult(QP_TEST_RESULT_FAIL, "Failed to retrieve uniform location");
GLuint shader = glCreateShader(GL_VERTEX_SHADER);
ShaderBuiltinConstantCase (Context& context, const char* name, const char* desc, const char* varName, deUint32 paramName, bool isVertexCase);
~ShaderBuiltinConstantCase (void);
+ int getRefValue (void);
void init (void);
private:
- std::string m_varName;
- deUint32 m_paramName;
+ const std::string m_varName;
+ const deUint32 m_paramName;
};
ShaderBuiltinConstantCase::ShaderBuiltinConstantCase (Context& context, const char* name, const char* desc, const char* varName, deUint32 paramName, bool isVertexCase)
{
}
-static int getConstRefValue (const char* varName)
+int ShaderBuiltinConstantCase::getRefValue (void)
{
- if (deStringEqual(varName, "gl_MaxDrawBuffers"))
- return 1;
+ if (m_varName == "gl_MaxDrawBuffers")
+ {
+ if (m_ctxInfo.isExtensionSupported("GL_EXT_draw_buffers"))
+ return m_ctxInfo.getInt(GL_MAX_DRAW_BUFFERS);
+ else
+ return 1;
+ }
else
{
- DE_ASSERT(DE_FALSE);
- return 0;
+ DE_ASSERT(m_paramName != GL_NONE);
+ return m_ctxInfo.getInt(m_paramName);
}
}
void ShaderBuiltinConstantCase::init (void)
{
- int refValue = m_paramName != GL_NONE ? m_ctxInfo.getInt(m_paramName) : getConstRefValue(m_varName.c_str());
+ const int refValue = getRefValue();
m_testCtx.getLog() << tcu::TestLog::Message << m_varName << " = " << refValue << tcu::TestLog::EndMessage;
static const char* defaultVertSrc =