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;
}
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);
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);
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
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);
}
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;
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. */
}
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;
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;
}
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;
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;