summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstate.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-11-15 22:10:43 +0100
committerMarek Olšák <[email protected]>2018-02-13 01:00:45 +0100
commit78043a75f6c05c470da97d1f18615821d69177c0 (patch)
tree041ebf7ab6e8faf5c406913f22fd51533018c8a5 /src/mesa/main/texstate.h
parent07c10cc59c164ddd0109e061dac8edf47437d8ca (diff)
mesa: decrease the array size of ctx->Texture.FixedFuncUnit to 8
GL allows doing glTexEnv on 192 texture units, while in reality, only MaxTextureCoordUnits units are used by fixed-func shaders. There is a piglit patch that adjusts piglits/texunits to check only MaxTextureCoordUnits units. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/texstate.h')
-rw-r--r--src/mesa/main/texstate.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/main/texstate.h b/src/mesa/main/texstate.h
index cf3f7e5a216..c0b73b14e82 100644
--- a/src/mesa/main/texstate.h
+++ b/src/mesa/main/texstate.h
@@ -65,6 +65,9 @@ _mesa_get_current_fixedfunc_tex_unit(struct gl_context *ctx)
{
unsigned unit = ctx->Texture.CurrentUnit;
+ if (unit >= ARRAY_SIZE(ctx->Texture.FixedFuncUnit))
+ return NULL;
+
return &ctx->Texture.FixedFuncUnit[unit];
}