From 38d771c0539a087db42d8d940bb2e920bb64598c Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 22 Apr 2010 09:32:11 -0400 Subject: st/mesa: Use API-aware context constructor The mesa state tracker is currently the only place where we create a context and expect it to implement GLES1/2. Use the API-aware constructor to communicate this to core mesa. --- src/mesa/state_tracker/st_context.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/mesa/state_tracker/st_context.c') diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 5fcb6b9dcf..48fc86cd52 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -199,7 +199,16 @@ struct st_context *st_create_context(struct pipe_context *pipe, memset(&funcs, 0, sizeof(funcs)); st_init_driver_functions(&funcs); - ctx = _mesa_create_context(visual, shareCtx, &funcs, NULL); +#if FEATURE_ES1 + ctx = _mesa_create_context_for_api(API_OPENGLES, + visual, shareCtx, &funcs, NULL); +#elif FEATURE_ES2 + ctx = _mesa_create_context_for_api(API_OPENGLES2, + visual, shareCtx, &funcs, NULL); +#else + ctx = _mesa_create_context_for_api(API_OPENGL, + visual, shareCtx, &funcs, NULL); +#endif /* XXX: need a capability bit in gallium to query if the pipe * driver prefers DP4 or MUL/MAD for vertex transformation. -- cgit v1.2.3 From a804af2a1ea184ecc2c6a5e77335fae1e7730242 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Sun, 2 May 2010 09:27:51 -0400 Subject: st/mesa: Create context for API_OPENGL as first priority --- src/mesa/state_tracker/st_context.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa/state_tracker/st_context.c') diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 48fc86cd52..2b1174a504 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -199,15 +199,15 @@ struct st_context *st_create_context(struct pipe_context *pipe, memset(&funcs, 0, sizeof(funcs)); st_init_driver_functions(&funcs); -#if FEATURE_ES1 +#if FEATURE_GL + ctx = _mesa_create_context_for_api(API_OPENGL, + visual, shareCtx, &funcs, NULL); +#elif FEATURE_ES1 ctx = _mesa_create_context_for_api(API_OPENGLES, visual, shareCtx, &funcs, NULL); #elif FEATURE_ES2 ctx = _mesa_create_context_for_api(API_OPENGLES2, visual, shareCtx, &funcs, NULL); -#else - ctx = _mesa_create_context_for_api(API_OPENGL, - visual, shareCtx, &funcs, NULL); #endif /* XXX: need a capability bit in gallium to query if the pipe -- cgit v1.2.3