summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2014-01-25 15:23:41 +0000
committerCarl Worth <cworth@cworth.org>2014-03-04 13:13:26 -0800
commita4719eff1af9e459a0714c1932f49ab4451bcdb5 (patch)
tree02ce52c2b6f7d6892ef9ce248beb7911cb9150ca
parent5f35078700b24cdead1e8f9372fdb14e748c05bc (diff)
downloadmesa-a4719eff1af9e459a0714c1932f49ab4451bcdb5.tar.gz
dri/nouveau: Pass the API into _mesa_initialize_context
Currently we create a OPENGL_COMPAT context regardless of what was requested by the program. Correct that by retaining the program's request and passing it into _mesa_initialize_context. Based on a similar commit for radeon/r200 by Ian Romanick. Cc: "9.1 9.2 10.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> (cherry picked from commit 76d9f6d9729db1c999317a6b44818aa90c30a0b3)
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_context.c7
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_context.h3
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_driver.h1
-rw-r--r--src/mesa/drivers/dri/nouveau/nv04_context.c5
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_context.c5
-rw-r--r--src/mesa/drivers/dri/nouveau/nv20_context.c5
6 files changed, 16 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
index 18c6e776f2b..3c39de035a0 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
@@ -72,7 +72,7 @@ nouveau_context_create(gl_api api,
return false;
}
- ctx = screen->driver->context_create(screen, visual, share_ctx);
+ ctx = screen->driver->context_create(screen, api, visual, share_ctx);
if (!ctx) {
*error = __DRI_CTX_ERROR_NO_MEMORY;
return GL_FALSE;
@@ -107,7 +107,8 @@ nouveau_context_create(gl_api api,
}
GLboolean
-nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
+nouveau_context_init(struct gl_context *ctx, gl_api api,
+ struct nouveau_screen *screen,
const struct gl_config *visual, struct gl_context *share_ctx)
{
struct nouveau_context *nctx = to_nouveau_context(ctx);
@@ -125,7 +126,7 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
nouveau_fbo_functions_init(&functions);
/* Initialize the mesa context. */
- _mesa_initialize_context(ctx, API_OPENGL_COMPAT, visual,
+ _mesa_initialize_context(ctx, api, visual,
share_ctx, &functions);
nouveau_state_init(ctx);
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h b/src/mesa/drivers/dri/nouveau/nouveau_context.h
index 07d9605b886..8ea431bfa48 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h
@@ -115,7 +115,8 @@ nouveau_context_create(gl_api api,
void *share_ctx);
GLboolean
-nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
+nouveau_context_init(struct gl_context *ctx, gl_api api,
+ struct nouveau_screen *screen,
const struct gl_config *visual, struct gl_context *share_ctx);
void
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.h b/src/mesa/drivers/dri/nouveau/nouveau_driver.h
index e03b2c1f98d..b6a827634c8 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_driver.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.h
@@ -48,6 +48,7 @@
struct nouveau_driver {
struct gl_context *(*context_create)(struct nouveau_screen *screen,
+ gl_api api,
const struct gl_config *visual,
struct gl_context *share_ctx);
void (*context_destroy)(struct gl_context *ctx);
diff --git a/src/mesa/drivers/dri/nouveau/nv04_context.c b/src/mesa/drivers/dri/nouveau/nv04_context.c
index c198c03f095..82c0bba5386 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_context.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_context.c
@@ -138,7 +138,8 @@ nv04_context_destroy(struct gl_context *ctx)
}
static struct gl_context *
-nv04_context_create(struct nouveau_screen *screen, const struct gl_config *visual,
+nv04_context_create(struct nouveau_screen *screen, gl_api api,
+ const struct gl_config *visual,
struct gl_context *share_ctx)
{
struct nv04_context *nctx;
@@ -153,7 +154,7 @@ nv04_context_create(struct nouveau_screen *screen, const struct gl_config *visua
ctx = &nctx->base.base;
hw = &nctx->base.hw;
- if (!nouveau_context_init(ctx, screen, visual, share_ctx))
+ if (!nouveau_context_init(ctx, api, screen, visual, share_ctx))
goto fail;
/* GL constants. */
diff --git a/src/mesa/drivers/dri/nouveau/nv10_context.c b/src/mesa/drivers/dri/nouveau/nv10_context.c
index 1918f12238d..be0a3a529d2 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_context.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_context.c
@@ -427,7 +427,8 @@ nv10_context_destroy(struct gl_context *ctx)
}
static struct gl_context *
-nv10_context_create(struct nouveau_screen *screen, const struct gl_config *visual,
+nv10_context_create(struct nouveau_screen *screen, gl_api api,
+ const struct gl_config *visual,
struct gl_context *share_ctx)
{
struct nouveau_context *nctx;
@@ -441,7 +442,7 @@ nv10_context_create(struct nouveau_screen *screen, const struct gl_config *visua
ctx = &nctx->base;
- if (!nouveau_context_init(ctx, screen, visual, share_ctx))
+ if (!nouveau_context_init(ctx, api, screen, visual, share_ctx))
goto fail;
ctx->Extensions.ARB_texture_env_crossbar = true;
diff --git a/src/mesa/drivers/dri/nouveau/nv20_context.c b/src/mesa/drivers/dri/nouveau/nv20_context.c
index 1d77132db11..4eaac8e4c20 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_context.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_context.c
@@ -438,7 +438,8 @@ nv20_context_destroy(struct gl_context *ctx)
}
static struct gl_context *
-nv20_context_create(struct nouveau_screen *screen, const struct gl_config *visual,
+nv20_context_create(struct nouveau_screen *screen, gl_api api,
+ const struct gl_config *visual,
struct gl_context *share_ctx)
{
struct nouveau_context *nctx;
@@ -452,7 +453,7 @@ nv20_context_create(struct nouveau_screen *screen, const struct gl_config *visua
ctx = &nctx->base;
- if (!nouveau_context_init(ctx, screen, visual, share_ctx))
+ if (!nouveau_context_init(ctx, api, screen, visual, share_ctx))
goto fail;
ctx->Extensions.ARB_texture_env_crossbar = true;