summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Bieler <fabianbieler@fastmail.fm>2017-11-14 14:47:00 -0700
committerBrian Paul <brianp@vmware.com>2017-11-15 16:06:49 -0700
commitb6aee208234287380d2e55c17dc2d236931284fa (patch)
treebef4b29d9ddff1bf90ed1ae79520b0d784dec9ab
parent8ba0734d9176feddfd4d463b78b43838f4d11e53 (diff)
Remove texture unit Glean test
Reviewed-by: Brian Paul <brianp@vmware.com>
-rw-r--r--tests/all.py1
-rw-r--r--tests/glean/CMakeLists.gl.txt1
-rw-r--r--tests/glean/ttexunits.cpp319
-rw-r--r--tests/glean/ttexunits.h75
4 files changed, 0 insertions, 396 deletions
diff --git a/tests/all.py b/tests/all.py
index ace4ac04f..36661be8f 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -384,7 +384,6 @@ with profile.test_list.group_manager(GleanTest, 'glean') as g:
g('shaderAPI')
g('texCube')
g('texture_srgb')
- g('texUnits')
g('vertArrayBGRA')
g('vertattrib')
diff --git a/tests/glean/CMakeLists.gl.txt b/tests/glean/CMakeLists.gl.txt
index 16a0d461d..dd5002558 100644
--- a/tests/glean/CMakeLists.gl.txt
+++ b/tests/glean/CMakeLists.gl.txt
@@ -38,7 +38,6 @@ piglit_add_executable (glean
tshaderapi.cpp
ttexcube.cpp
ttexture_srgb.cpp
- ttexunits.cpp
tvertarraybgra.cpp
tvertattrib.cpp
tvertprog1.cpp
diff --git a/tests/glean/ttexunits.cpp b/tests/glean/ttexunits.cpp
deleted file mode 100644
index 6cdcea535..000000000
--- a/tests/glean/ttexunits.cpp
+++ /dev/null
@@ -1,319 +0,0 @@
-// BEGIN_COPYRIGHT -*- glean -*-
-//
-// Copyright (C) 2008 VMware, Inc. All Rights Reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the
-// Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-// KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ALLEN AKIN BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-// OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-// DEALINGS IN THE SOFTWARE.
-//
-// END_COPYRIGHT
-
-// Test texture unit things
-// We're generally just testing API-related things, not rendering.
-// Brian Paul 31 Dec 2008
-
-#define GL_GLEXT_PROTOTYPES
-
-#include <cstring>
-#include <cassert>
-#include <math.h>
-#include "ttexunits.h"
-
-
-namespace GLEAN {
-
-void
-TexUnitsTest::reportFailure(const char *msg) const
-{
- env->log << "FAILURE:\n";
- env->log << "\t" << msg << "\n";
-}
-
-
-void
-TexUnitsTest::reportFailure(const char *msg, GLint unit) const
-{
- char s[100];
-#if defined(_MSC_VER)
- _snprintf(s, sizeof(s), msg, unit);
-#else
- snprintf(s, sizeof(s), msg, unit);
-#endif
- env->log << "FAILURE:\n";
- env->log << "\t" << s << "\n";
-}
-
-
-bool
-TexUnitsTest::setup(void)
-{
- // check that we have at least OpenGL 2.0
- if (GLUtils::getVersion() < 2.0) {
- env->log << "OpenGL >= 2.0 not supported\n";
- return false;
- }
-
- glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxCombinedUnits);
- glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &maxImageUnits);
- glGetIntegerv(GL_MAX_TEXTURE_COORDS, &maxCoordUnits);
- glGetIntegerv(GL_MAX_TEXTURE_UNITS, &maxUnits);
-
- return true;
-}
-
-
-bool
-TexUnitsTest::testLimits(void)
-{
- if (maxImageUnits < maxUnits) {
- reportFailure("GL_MAX_TEXTURE_IMAGE_UNITS < GL_MAX_TEXTURE_UNITS");
- return false;
- }
- if (maxCoordUnits < maxUnits) {
- reportFailure("GL_MAX_TEXTURE_COORD_UNITS < GL_MAX_TEXTURE_UNITS");
- return false;
- }
- return true;
-}
-
-
-bool
-TexUnitsTest::testActiveTexture(void)
-{
- GLint i;
-
- // clear any error state
- while (glGetError())
- ;
-
- // test glActiveTexture()
- for (i = 0; i < maxCombinedUnits; i++) {
- glActiveTexture(GL_TEXTURE0 + i);
- if (glGetError()) {
- reportFailure("glActiveTexture(GL_TEXTURE%d) failed", i);
- return false;
- }
-
- GLint unit;
- glGetIntegerv(GL_ACTIVE_TEXTURE, &unit);
- if (unit != GL_TEXTURE0 + i || glGetError()) {
- reportFailure("glGetIntegerv(GL_ACTIVE_TEXTURE) failed");
- return false;
- }
- }
-
- // this should fail:
- glActiveTexture(GL_TEXTURE0 + maxCombinedUnits);
- if (glGetError() != GL_INVALID_ENUM) {
- reportFailure("glActiveTexture(GL_TEXTURE%d) failed to generate an error",
- maxCombinedUnits);
- return false;
- }
-
-
- // test glClientActiveTexture()
- for (i = 0; i < maxCoordUnits; i++) {
- glClientActiveTexture(GL_TEXTURE0 + i);
- if (glGetError()) {
- reportFailure("glClientActiveTexture(GL_TEXTURE%d) failed", i);
- return false;
- }
-
- GLint unit;
- glGetIntegerv(GL_CLIENT_ACTIVE_TEXTURE, &unit);
- if (unit != GL_TEXTURE0 + i || glGetError()) {
- reportFailure("glGetIntegerv(GL_CLIENT_ACTIVE_TEXTURE) failed");
- return false;
- }
- }
-
- // this should fail:
- glClientActiveTexture(GL_TEXTURE0 + maxCoordUnits);
- if (glGetError() != GL_INVALID_ENUM) {
- reportFailure("glClientActiveTexture(GL_TEXTURE%d) failed to generate an error", maxCoordUnits);
- return false;
- }
-
- return true;
-}
-
-
-bool
-TexUnitsTest::testTextureMatrices(void)
-{
- GLint i;
-
- glActiveTexture(GL_TEXTURE0);
- glMatrixMode(GL_TEXTURE);
-
- // set texture matrices
- for (i = 0; i < maxCoordUnits; i++) {
- glActiveTexture(GL_TEXTURE0 + i);
-
- // generate matrix
- GLfloat m[16];
- for (int j = 0; j < 16; j++) {
- m[j] = float(i * 100 + j);
- }
-
- glLoadMatrixf(m);
- }
-
- // query texture matrices
- for (i = 0; i < maxCoordUnits; i++) {
- glActiveTexture(GL_TEXTURE0 + i);
-
- // get matrix and check it
- GLfloat m[16];
- memset(m, 0, sizeof(m));
- glGetFloatv(GL_TEXTURE_MATRIX, m);
-
- if (glGetError()) {
- reportFailure("Query of texture matrix %d raised an error", i);
- return false;
- }
-
- for (int j = 0; j < 16; j++) {
- if (m[j] != float(i * 100 + j)) {
- reportFailure("Query of texture matrix %d failed", i);
- return false;
- }
- }
- }
-
- if (glGetError()) {
- reportFailure("GL error was generated while testing texture matrices");
- return false;
- }
-
- return true;
-}
-
-
-bool
-TexUnitsTest::testTextureCoordGen(void)
-{
- GLint i;
-
- glActiveTexture(GL_TEXTURE0);
- glMatrixMode(GL_TEXTURE);
-
- // test texgen enable/disable
- for (i = 0; i < maxCombinedUnits; i++) {
- glActiveTexture(GL_TEXTURE0 + i);
-
- glEnable(GL_TEXTURE_GEN_S);
- glEnable(GL_TEXTURE_GEN_T);
- glEnable(GL_TEXTURE_GEN_R);
- glEnable(GL_TEXTURE_GEN_Q);
- if (i < maxCoordUnits) {
- // should be no error
- if (glGetError()) {
- reportFailure("GL error was generated by enabling GL_TEXTURE_GEN_x, unit %d", i);
- return false;
- }
- glDisable(GL_TEXTURE_GEN_S);
- glDisable(GL_TEXTURE_GEN_T);
- glDisable(GL_TEXTURE_GEN_R);
- glDisable(GL_TEXTURE_GEN_Q);
- }
- else {
- // should be an error
- if (glGetError() != GL_INVALID_OPERATION) {
- reportFailure("GL error not generated by invalid enable of GL_TEXTURE_GEN_x, unit %d", i);
- return false;
- }
- }
- }
-
- return true;
-}
-
-
-bool
-TexUnitsTest::testTexcoordArrays(void)
-{
- GLint i;
-
- for (i = 0; i < maxCoordUnits; i++) {
- glClientActiveTexture(GL_TEXTURE0 + i);
-
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- if (glGetError()) {
- reportFailure("GL error was generated by glEnableClientState for unit %d", i);
- return false;
- }
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
-
- }
-
- return true;
-}
-
-
-void
-TexUnitsTest::runOne(MultiTestResult &r, Window &w)
-{
- (void) w;
-
- if (!setup()) {
- r.pass = false;
- return;
- }
-
- if (testLimits())
- r.numPassed++;
- else
- r.numFailed++;
-
- if (testActiveTexture())
- r.numPassed++;
- else
- r.numFailed++;
-
- if (testTextureMatrices())
- r.numPassed++;
- else
- r.numFailed++;
-
- if (testTextureCoordGen())
- r.numPassed++;
- else
- r.numFailed++;
-
- if (testTexcoordArrays())
- r.numPassed++;
- else
- r.numFailed++;
-
- r.pass = (r.numFailed == 0);
-}
-
-
-// The test object itself:
-TexUnitsTest texUnitTest("texUnits", "window, rgb",
- "", // no extension filter
- "texUnits: test texture units.\n"
- );
-
-
-
-} // namespace GLEAN
diff --git a/tests/glean/ttexunits.h b/tests/glean/ttexunits.h
deleted file mode 100644
index 699796017..000000000
--- a/tests/glean/ttexunits.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// BEGIN_COPYRIGHT -*- glean -*-
-//
-// Copyright (C) 2008 VMware, Inc. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person
-// obtaining a copy of this software and associated documentation
-// files (the "Software"), to deal in the Software without
-// restriction, including without limitation the rights to use,
-// copy, modify, merge, publish, distribute, sublicense, and/or
-// sell copies of the Software, and to permit persons to whom the
-// Software is furnished to do so, subject to the following
-// conditions:
-//
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the
-// Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-// KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-// WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ALLEN AKIN BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-// AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
-// OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-// DEALINGS IN THE SOFTWARE.
-//
-// END_COPYRIGHT
-
-
-#ifndef __ttexunits_h__
-#define __ttexunits_h__
-
-#include "tmultitest.h"
-
-namespace GLEAN {
-
-#define windowSize 100
-
-
-class TexUnitsTest: public MultiTest
-{
-public:
- TexUnitsTest(const char* testName, const char* filter,
- const char *extensions, const char* description):
- MultiTest(testName, filter, extensions, description),
- maxCombinedUnits(0),
- maxImageUnits(0),
- maxCoordUnits(0),
- maxUnits(0)
- {
- }
-
- virtual void runOne(MultiTestResult &r, Window &w);
-
-private:
- GLint maxCombinedUnits;
- GLint maxImageUnits;
- GLint maxCoordUnits;
- GLint maxUnits;
-
- void reportFailure(const char *msg) const;
- void reportFailure(const char *msg, GLint unit) const;
-
- bool setup(void);
- bool testLimits(void);
- bool testActiveTexture(void);
- bool testTextureMatrices(void);
- bool testTextureCoordGen(void);
- bool testTexcoordArrays(void);
-};
-
-
-} // namespace GLEAN
-
-#endif // __ttexunits_h__