[Piglit] [PATCH 2/2] texunits: don't test glTexEnv with unusable texture units

Marek Olšák maraeo at gmail.com
Fri Feb 9 00:59:19 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

The GL limit is MaxTextureCombinedUnits, but the real usable limit is
MaxTextureCoordUnits. This is probably a spec bug.

Mesa will ignore glTexEnv calls where unit >= MaxTextureCoordUnits.
---
 tests/general/texunits.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/general/texunits.c b/tests/general/texunits.c
index b68dcf7..c6fbcb1 100644
--- a/tests/general/texunits.c
+++ b/tests/general/texunits.c
@@ -276,30 +276,30 @@ test_texture_params(void)
 
 static GLboolean
 test_texture_env(void)
 {
    /* Texture Environment state is fixed-function; not used by shaders */
    int i;
 
    clear_errors();
 
    /* set per-unit state */
-   for (i = 0; i < MaxTextureCombinedUnits; i++) {
+   for (i = 0; i < MaxTextureCoordUnits; i++) {
       glActiveTexture(GL_TEXTURE0 + i);
       glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, Random[i]);
       if (!piglit_check_gl_error(GL_NO_ERROR)) {
          return GL_FALSE;
       }
    }
 
    /* check per-unit state */
-   for (i = 0; i < MaxTextureCombinedUnits; i++) {
+   for (i = 0; i < MaxTextureCoordUnits; i++) {
       GLfloat v[4];
       glActiveTexture(GL_TEXTURE0 + i);
       glGetTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, v);
       if (!equal4v(v, Random[i])) {
          printf("Setting per-unit env state failed for unit %d\n", i);
          report4v(Random[i], v);
          return GL_FALSE;
       }
    }
 
-- 
2.7.4



More information about the Piglit mailing list