static std::vector<std::string> getExtensions (const glw::Functions& gl, ApiType apiType) { using std::vector; using std::string; if (apiType.getProfile() == PROFILE_ES && apiType.getMajorVersion() == 2) { TCU_CHECK(gl.getString); const char* extStr = (const char*)gl.getString(GL_EXTENSIONS); GLU_EXPECT_NO_ERROR(gl.getError(), "glGetString(GL_EXTENSIONS)"); if (extStr) return de::splitString(extStr); else throw tcu::TestError("glGetString(GL_EXTENSIONS) returned null pointer", DE_NULL, __FILE__, __LINE__); } else { int numExtensions = 0; vector<string> extensions; TCU_CHECK(gl.getIntegerv && gl.getStringi); gl.getIntegerv(GL_NUM_EXTENSIONS, &numExtensions); GLU_EXPECT_NO_ERROR(gl.getError(), "glGetIntegerv(GL_NUM_EXTENSIONS)"); if (numExtensions > 0) { extensions.resize(numExtensions); for (int ndx = 0; ndx < numExtensions; ndx++) { const char* const ext = (const char*)gl.getStringi(GL_EXTENSIONS, ndx); GLU_EXPECT_NO_ERROR(gl.getError(), "glGetStringi(GL_EXTENSIONS)"); if (ext) extensions[ndx] = ext; else throw tcu::TestError("glGetStringi(GL_EXTENSIONS) returned null pointer", DE_NULL, __FILE__, __LINE__); } } return extensions; } }
/** Verify if get* queries for GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT pname works as expected. * * @param gl OpenGL functions wrapper * * @return Returns true if queries test passed, false otherwise. */ bool TextureFilterAnisotropicQueriesTestCase::verifyGet(const glw::Functions& gl) { GLboolean bValue; GLint iValue; GLfloat fValue; GLdouble dValue; gl.getBooleanv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &bValue); GLU_EXPECT_NO_ERROR(gl.getError(), "getBooleanv"); gl.getIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &iValue); GLU_EXPECT_NO_ERROR(gl.getError(), "getIntegerv"); gl.getFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &fValue); GLU_EXPECT_NO_ERROR(gl.getError(), "getFloatv"); if (glu::isContextTypeGLCore(m_context.getRenderContext().getType())) { gl.getDoublev(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &dValue); GLU_EXPECT_NO_ERROR(gl.getError(), "getDoublev"); } return true; }