aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2011-08-22 15:58:01 -0700
committerIan Romanick <[email protected]>2011-09-09 14:02:20 -0700
commit8a99ec8e05ef541c586c2f8b427220d036589870 (patch)
tree42649333d005d3b465ce503626941a8c27f4a388 /src
parent0a5478c1d9f9a892371d9ff004976e783a086694 (diff)
nouveau: Enable extensions by just setting the flags
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 <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Cc: Viktor Novotný <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_context.c43
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_context.c14
-rw-r--r--src/mesa/drivers/dri/nouveau/nv20_context.c14
3 files changed, 28 insertions, 43 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
index 22b99571e73..33c0df6a3ff 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
@@ -24,6 +24,7 @@
*
*/
+#include <stdbool.h>
#include "nouveau_driver.h"
#include "nouveau_context.h"
#include "nouveau_bufferobj.h"
@@ -41,30 +42,6 @@
#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;
}
diff --git a/src/mesa/drivers/dri/nouveau/nv10_context.c b/src/mesa/drivers/dri/nouveau/nv10_context.c
index 8074b4bb472..da0ef2b3cf2 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_context.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_context.c
@@ -24,6 +24,7 @@
*
*/
+#include <stdbool.h>
#include "main/state.h"
#include "nouveau_driver.h"
#include "nouveau_context.h"
@@ -34,14 +35,6 @@
#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;
diff --git a/src/mesa/drivers/dri/nouveau/nv20_context.c b/src/mesa/drivers/dri/nouveau/nv20_context.c
index e0483b261ef..27668516e6c 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_context.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_context.c
@@ -24,6 +24,7 @@
*
*/
+#include <stdbool.h>
#include "nouveau_driver.h"
#include "nouveau_context.h"
#include "nouveau_fbo.h"
@@ -34,14 +35,6 @@
#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;