nouveau: Enable extensions by just setting the flags
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 22 Aug 2011 22:58:01 +0000 (15:58 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 9 Sep 2011 21:02:20 +0000 (14:02 -0700)
Core Mesa already does the dispatch offset remapping for every
function that could possibly ever be supported.  There's no need to
continue using that cruft in the driver.

Since the call to _mesa_enable_imaging_extensions (via
driInitExtensions) is removed, EXT_blend_color, EXT_blend_minmax, and
EXT_blend_subtract are explicitly added to the list.

EXT_blend_logic_op is removed from the list of extensions because
blend factors and separate blend equations are not handled correctly.

Cc: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: Viktor Novotný <noviktor@seznam.cz>
src/mesa/drivers/dri/nouveau/nouveau_context.c
src/mesa/drivers/dri/nouveau/nv10_context.c
src/mesa/drivers/dri/nouveau/nv20_context.c

index 22b99571e738d539c3bf417ea9c584fcd952b1dc..33c0df6a3ffbbaaa2c46de455977bb008eaf2991 100644 (file)
@@ -24,6 +24,7 @@
  *
  */
 
+#include <stdbool.h>
 #include "nouveau_driver.h"
 #include "nouveau_context.h"
 #include "nouveau_bufferobj.h"
 #include "tnl/tnl.h"
 #include "tnl/t_context.h"
 
-#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_mirrored_repeat", 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_packed_depth_stencil", NULL},
-       { "GL_EXT_secondary_color",     GL_EXT_secondary_color_functions },
-       { "GL_EXT_stencil_wrap",        NULL },
-       { "GL_EXT_texture_env_combine", NULL },
-       { "GL_EXT_texture_filter_anisotropic", NULL },
-       { "GL_EXT_texture_lod_bias",    NULL },
-       { "GL_NV_blend_square",         NULL },
-       { "GL_NV_texture_env_combine4", NULL },
-       { NULL,                         NULL }
-};
-
 static void
 nouveau_channel_flush_notify(struct nouveau_channel *chan)
 {
@@ -140,7 +117,23 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
        nctx->hw.chan->user_private = nctx;
 
        /* Enable any supported extensions. */
-       driInitExtensions(ctx, nouveau_extensions, GL_TRUE);
+       ctx->Extensions.ARB_multitexture = true;
+       ctx->Extensions.ARB_texture_mirrored_repeat = true;
+       ctx->Extensions.EXT_blend_color = true;
+       ctx->Extensions.EXT_blend_minmax = true;
+       ctx->Extensions.EXT_blend_subtract = true;
+       ctx->Extensions.EXT_fog_coord = true;
+       ctx->Extensions.EXT_framebuffer_blit = true;
+       ctx->Extensions.EXT_framebuffer_object = true;
+       ctx->Extensions.EXT_packed_depth_stencil = true;
+       ctx->Extensions.EXT_secondary_color = true;
+       ctx->Extensions.EXT_stencil_wrap = true;
+       ctx->Extensions.EXT_texture_env_add = true;
+       ctx->Extensions.EXT_texture_env_combine = true;
+       ctx->Extensions.EXT_texture_filter_anisotropic = true;
+       ctx->Extensions.EXT_texture_lod_bias = true;
+       ctx->Extensions.NV_blend_square = true;
+       ctx->Extensions.NV_texture_env_combine4 = true;
 
        return GL_TRUE;
 }
index 8074b4bb472e109ab8a94a1a4e52d81932501266..da0ef2b3cf25b00a4dedf54f87fdf40a63ad6462 100644 (file)
@@ -24,6 +24,7 @@
  *
  */
 
+#include <stdbool.h>
 #include "main/state.h"
 #include "nouveau_driver.h"
 #include "nouveau_context.h"
 #include "nv04_driver.h"
 #include "nv10_driver.h"
 
-static const struct dri_extension nv10_extensions[] = {
-       { "GL_ARB_texture_env_crossbar", NULL },
-       { "GL_EXT_texture_rectangle",   NULL },
-       { "GL_ARB_texture_env_combine", NULL },
-       { "GL_ARB_texture_env_dot3",    NULL },
-       { NULL,                         NULL }
-};
-
 static GLboolean
 use_fast_zclear(struct gl_context *ctx, GLbitfield buffers)
 {
@@ -439,7 +432,10 @@ nv10_context_create(struct nouveau_screen *screen, const struct gl_config *visua
        if (!nouveau_context_init(ctx, screen, visual, share_ctx))
                goto fail;
 
-       driInitExtensions(ctx, nv10_extensions, GL_FALSE);
+       ctx->Extensions.ARB_texture_env_crossbar = true;
+       ctx->Extensions.ARB_texture_env_combine = true;
+       ctx->Extensions.ARB_texture_env_dot3 = true;
+       ctx->Extensions.NV_texture_rectangle = true;
 
        /* GL constants. */
        ctx->Const.MaxTextureLevels = 12;
index e0483b261ef35f504f8d1b63b4cb7ce895f3a828..27668516e6c6162897e6cb232f30ecb6cc741110 100644 (file)
@@ -24,6 +24,7 @@
  *
  */
 
+#include <stdbool.h>
 #include "nouveau_driver.h"
 #include "nouveau_context.h"
 #include "nouveau_fbo.h"
 #include "nv10_driver.h"
 #include "nv20_driver.h"
 
-static const struct dri_extension nv20_extensions[] = {
-       { "GL_ARB_texture_env_crossbar", NULL },
-       { "GL_EXT_texture_rectangle",   NULL },
-       { "GL_ARB_texture_env_combine", NULL },
-       { "GL_ARB_texture_env_dot3",    NULL },
-       { NULL,                         NULL }
-};
-
 static void
 nv20_clear(struct gl_context *ctx, GLbitfield buffers)
 {
@@ -453,7 +446,10 @@ nv20_context_create(struct nouveau_screen *screen, const struct gl_config *visua
        if (!nouveau_context_init(ctx, screen, visual, share_ctx))
                goto fail;
 
-       driInitExtensions(ctx, nv20_extensions, GL_FALSE);
+       ctx->Extensions.ARB_texture_env_crossbar = true;
+       ctx->Extensions.ARB_texture_env_combine = true;
+       ctx->Extensions.ARB_texture_env_dot3 = true;
+       ctx->Extensions.NV_texture_rectangle = true;
 
        /* GL constants. */
        ctx->Const.MaxTextureCoordUnits = NV20_TEXTURE_UNITS;