dri: Add DRI entrypoints to create a context for a given API
[mesa.git] / src / mesa / drivers / dri / nouveau / nouveau_context.c
index e26ed36529a9e12691532aa55dbfa280ce34dd86..f481161d468e221b74af0cd2482faf16fd7a71a8 100644 (file)
 
 #define need_GL_EXT_framebuffer_object
 #define need_GL_EXT_fog_coord
+#define need_GL_EXT_secondary_color
 
 #include "main/remap_helper.h"
 
 static const struct dri_extension nouveau_extensions[] = {
        { "GL_ARB_multitexture",        NULL },
+       { "GL_ARB_texture_env_add",     NULL },
        { "GL_ARB_texture_env_combine", NULL },
        { "GL_ARB_texture_env_dot3",    NULL },
-       { "GL_ARB_texture_env_add",     NULL },
-       { "GL_EXT_texture_lod_bias",    NULL },
-       { "GL_EXT_framebuffer_object",  GL_EXT_framebuffer_object_functions },
        { "GL_ARB_texture_mirrored_repeat", NULL },
-       { "GL_EXT_stencil_wrap",        NULL },
        { "GL_EXT_fog_coord",           GL_EXT_fog_coord_functions },
+       { "GL_EXT_framebuffer_blit",    NULL },
+       { "GL_EXT_framebuffer_object",  GL_EXT_framebuffer_object_functions },
+       { "GL_EXT_secondary_color",     GL_EXT_secondary_color_functions },
+       { "GL_EXT_stencil_wrap",        NULL },
+       { "GL_EXT_texture_lod_bias",    NULL },
        { "GL_NV_blend_square",         NULL },
        { "GL_SGIS_generate_mipmap",    NULL },
        { NULL,                         NULL }
@@ -67,12 +70,13 @@ nouveau_channel_flush_notify(struct nouveau_channel *chan)
        struct nouveau_context *nctx = chan->user_private;
        GLcontext *ctx = &nctx->base;
 
-       if (nctx->fallback < SWRAST && ctx->DrawBuffer)
-               nouveau_state_emit(&nctx->base);
+       if (nctx->fallback < SWRAST)
+               nouveau_bo_state_emit(ctx);
 }
 
 GLboolean
-nouveau_context_create(const __GLcontextModes *visual, __DRIcontext *dri_ctx,
+nouveau_context_create(gl_api api,
+                      const __GLcontextModes *visual, __DRIcontext *dri_ctx,
                       void *share_ctx)
 {
        __DRIscreen *dri_screen = dri_ctx->driScreenPriv;
@@ -335,6 +339,8 @@ nouveau_validate_framebuffer(GLcontext *ctx)
                update_framebuffer(dri_ctx, dri_read,
                                   &dri_ctx->dri2.read_stamp);
 
-       if (nouveau_next_dirty_state(ctx) >= 0)
+       if (nouveau_next_dirty_state(ctx) >= 0) {
+               nouveau_state_emit(ctx);
                FIRE_RING(context_chan(ctx));
+       }
 }