[Mesa-dev] [PATCH 4/8] radeon / r200: Pass the API into _mesa_initialize_context

Ian Romanick idr at freedesktop.org
Fri Jan 24 14:18:22 PST 2014


From: Ian Romanick <ian.d.romanick at intel.com>

Otherwise an application that requested an OpenGL ES 1.x context would
actually get a desktop OpenGL context.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: "9.1 9.2 10.0" <mesa-stable at lists.freedesktop.org>
---
 src/mesa/drivers/dri/r200/r200_context.c            | 2 +-
 src/mesa/drivers/dri/radeon/radeon_common_context.c | 3 ++-
 src/mesa/drivers/dri/radeon/radeon_common_context.h | 1 +
 src/mesa/drivers/dri/radeon/radeon_context.c        | 2 +-
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index a7021f2..637a263 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -271,7 +271,7 @@ GLboolean r200CreateContext( gl_api api,
    r200InitShaderFuncs(&functions);
    radeonInitQueryObjFunctions(&functions);
 
-   if (!radeonInitContext(&rmesa->radeon, &functions,
+   if (!radeonInitContext(&rmesa->radeon, api, &functions,
 			  glVisual, driContextPriv,
 			  sharedContextPrivate)) {
      free(rmesa);
diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c
index 925a077..54db9d5 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c
@@ -126,6 +126,7 @@ static void radeonInitDriverFuncs(struct dd_function_table *functions)
  * including the Mesa context itself.
  */
 GLboolean radeonInitContext(radeonContextPtr radeon,
+                            gl_api api,
 			    struct dd_function_table* functions,
 			    const struct gl_config * glVisual,
 			    __DRIcontext * driContextPriv,
@@ -147,7 +148,7 @@ GLboolean radeonInitContext(radeonContextPtr radeon,
 	else
 		shareCtx = NULL;
 
-	if (!_mesa_initialize_context(&radeon->glCtx, API_OPENGL_COMPAT,
+	if (!_mesa_initialize_context(&radeon->glCtx, api,
 				      glVisual, shareCtx,
 				      functions))
 		return GL_FALSE;
diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.h b/src/mesa/drivers/dri/radeon/radeon_common_context.h
index ab55071..ce1eb1e 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common_context.h
+++ b/src/mesa/drivers/dri/radeon/radeon_common_context.h
@@ -515,6 +515,7 @@ static inline __DRIdrawable* radeon_get_readable(radeonContextPtr radeon)
 }
 
 GLboolean radeonInitContext(radeonContextPtr radeon,
+                            gl_api api,
 			    struct dd_function_table* functions,
 			    const struct gl_config * glVisual,
 			    __DRIcontext * driContextPriv,
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c
index 73fd188..7d65e2e 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_context.c
@@ -234,7 +234,7 @@ r100CreateContext( gl_api api,
    radeonInitTextureFuncs( &rmesa->radeon, &functions );
    radeonInitQueryObjFunctions(&functions);
 
-   if (!radeonInitContext(&rmesa->radeon, &functions,
+   if (!radeonInitContext(&rmesa->radeon, api, &functions,
 			  glVisual, driContextPriv,
 			  sharedContextPrivate)) {
      free(rmesa);
-- 
1.8.1.4



More information about the mesa-dev mailing list