aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main/get.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-11-15 22:02:51 +0100
committerMarek Olšák <[email protected]>2018-02-13 01:00:45 +0100
commit07c10cc59c164ddd0109e061dac8edf47437d8ca (patch)
treead38e5e0408a4fe07fb41a77b0bacef2e19a7100 /src/mesa/main/get.c
parent79aca14f5f37de32140fb710970133c72886a0f2 (diff)
mesa: separate legacy stuff from gl_texture_unit into gl_fixedfunc_texture_unit
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r--src/mesa/main/get.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 516e8d174ce..218801791e2 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -1390,7 +1390,6 @@ static const struct value_desc *
find_value(const char *func, GLenum pname, void **p, union value *v)
{
GET_CURRENT_CONTEXT(ctx);
- struct gl_texture_unit *unit;
int mask, hash;
const struct value_desc *d;
int api;
@@ -1445,8 +1444,10 @@ find_value(const char *func, GLenum pname, void **p, union value *v)
*p = ((char *) ctx->Array.VAO + d->offset);
return d;
case LOC_TEXUNIT:
- unit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit];
- *p = ((char *) unit + d->offset);
+ if (ctx->Texture.CurrentUnit < ARRAY_SIZE(ctx->Texture.FixedFuncUnit)) {
+ unsigned index = ctx->Texture.CurrentUnit;
+ *p = ((char *)&ctx->Texture.FixedFuncUnit[index] + d->offset);
+ }
return d;
case LOC_CUSTOM:
find_custom_value(ctx, d, v);