summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
authorImre Deak <[email protected]>2012-09-10 08:45:56 +0300
committerOliver McFadden <[email protected]>2012-10-10 12:43:05 +0300
commit2ad4a4754744e71aca472f77e64168dd1a962422 (patch)
treef49d9c3ed47bcc8c87cb68d52fe25861ac3d2a4b /src/mesa/main/context.c
parent7182a1fc5ea49dffb7678f6248d5c13a003aca62 (diff)
mesa: glGet: fix parameter lookup for apps using multiple APIs
The glGet hash was initialized only once for a single GL API, even if the application later created a context for a different API. This resulted in glGet failing for otherwise valid parameters in a context if that parameter was invalid in another context created earlier. Fix this by using a separate hash table for each API. Signed-off-by: Imre Deak <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Oliver McFadden <[email protected]>
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index d3fced9460b..29f28bd1887 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -404,9 +404,6 @@ one_time_init( struct gl_context *ctx )
_mesa_get_cpu_features();
- /* context dependence is never a one-time thing... */
- _mesa_init_get_hash(ctx);
-
for (i = 0; i < 256; i++) {
_mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F;
}
@@ -425,6 +422,8 @@ one_time_init( struct gl_context *ctx )
/* per-API one-time init */
if (!(api_init_mask & (1 << ctx->API))) {
+ _mesa_init_get_hash(ctx);
+
/*
* This is fine as ES does not use the remap table, but it may not be
* future-proof. We cannot always initialize the remap table because