[Mesa-dev] [PATCH v2 15/21] mesa: Make ARB_sampler_objects mandatory

Pauli Nieminen pauli.nieminen at linux.intel.com
Tue Jun 12 11:38:55 PDT 2012


To allow meta acceleration operations to use sampler objects the
ARB_sampler_objects extension needs to be mandatory for all drivers.
Because the extension doesn't have any hardware dependencies it is
trivial to implement.

Signed-off-by: Pauli Nieminen <pauli.nieminen at linux.intel.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
---
 src/mesa/drivers/dri/intel/intel_extensions.c |    1 -
 src/mesa/main/extensions.c                    |    2 +-
 src/mesa/main/get.c                           |    7 +------
 src/mesa/main/mtypes.h                        |    1 -
 src/mesa/main/version.c                       |    2 +-
 src/mesa/state_tracker/st_extensions.c        |    1 -
 6 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c
index 29da36c..7c9d9a8 100755
--- a/src/mesa/drivers/dri/intel/intel_extensions.c
+++ b/src/mesa/drivers/dri/intel/intel_extensions.c
@@ -49,7 +49,6 @@ intelInitExtensions(struct gl_context *ctx)
    ctx->Extensions.ARB_half_float_pixel = true;
    ctx->Extensions.ARB_map_buffer_range = true;
    ctx->Extensions.ARB_point_sprite = true;
-   ctx->Extensions.ARB_sampler_objects = true;
    ctx->Extensions.ARB_shader_objects = true;
    ctx->Extensions.ARB_shading_language_100 = true;
    ctx->Extensions.ARB_sync = true;
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 2688f7a..485782f 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -110,7 +110,7 @@ static const struct extension extension_table[] = {
    { "GL_ARB_point_sprite",                        o(ARB_point_sprite),                        GL,             2003 },
    { "GL_ARB_provoking_vertex",                    o(EXT_provoking_vertex),                    GL,             2009 },
    { "GL_ARB_robustness",                          o(dummy_true),                              GL,             2010 },
-   { "GL_ARB_sampler_objects",                     o(ARB_sampler_objects),                     GL,             2009 },
+   { "GL_ARB_sampler_objects",                     o(dummy_true),                              GL,             2009 },
    { "GL_ARB_seamless_cube_map",                   o(ARB_seamless_cube_map),                   GL,             2009 },
    { "GL_ARB_shader_bit_encoding",                 o(ARB_shader_bit_encoding),                 GL,             2010 },
    { "GL_ARB_shader_objects",                      o(ARB_shader_objects),                      GL,             2002 },
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 55dc205..f9f18fb 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -283,11 +283,6 @@ static const int extra_GLSL_130[] = {
    EXTRA_END
 };
 
-static const int extra_ARB_sampler_objects[] = {
-   EXT(ARB_sampler_objects),
-   EXTRA_END
-};
-
 
 EXTRA_EXT(ARB_ES2_compatibility);
 EXTRA_EXT(ARB_texture_cube_map);
@@ -1270,7 +1265,7 @@ static const struct value_desc values[] = {
 
    /* GL_ARB_sampler_objects / GL 3.3 */
    { GL_SAMPLER_BINDING,
-     LOC_CUSTOM, TYPE_INT, GL_SAMPLER_BINDING, extra_ARB_sampler_objects },
+     LOC_CUSTOM, TYPE_INT, GL_SAMPLER_BINDING, NO_EXTRA },
 
    /* GL 3.0 */
    { GL_NUM_EXTENSIONS, LOC_CUSTOM, TYPE_INT, 0, extra_version_30 },
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 6157fee..5018bbd 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -2892,7 +2892,6 @@ struct gl_extensions
    GLboolean ARB_occlusion_query;
    GLboolean ARB_occlusion_query2;
    GLboolean ARB_point_sprite;
-   GLboolean ARB_sampler_objects;
    GLboolean ARB_seamless_cube_map;
    GLboolean ARB_shader_bit_encoding;
    GLboolean ARB_shader_objects;
diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
index efaaf58..8aa5a64 100644
--- a/src/mesa/main/version.c
+++ b/src/mesa/main/version.c
@@ -170,12 +170,12 @@ compute_version(struct gl_context *ctx)
                               ctx->Extensions.ARB_explicit_attrib_location &&
                               ctx->Extensions.ARB_instanced_arrays &&
                               ctx->Extensions.ARB_occlusion_query2 &&
-                              ctx->Extensions.ARB_sampler_objects &&
                               ctx->Extensions.ARB_shader_bit_encoding &&
                               ctx->Extensions.ARB_texture_rgb10_a2ui &&
                               ctx->Extensions.ARB_timer_query &&
                               ctx->Extensions.ARB_vertex_type_2_10_10_10_rev &&
                               ctx->Extensions.EXT_texture_swizzle);
+                              /* ARB_sampler_objects is always enabled in mesa */
 
    if (ver_3_3) {
       major = 3;
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index a9071f5..2428085 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -483,7 +483,6 @@ void st_init_extensions(struct st_context *st)
    ctx->Extensions.ARB_half_float_pixel = GL_TRUE;
    ctx->Extensions.ARB_half_float_vertex = GL_TRUE;
    ctx->Extensions.ARB_map_buffer_range = GL_TRUE;
-   ctx->Extensions.ARB_sampler_objects = GL_TRUE;
    ctx->Extensions.ARB_shader_objects = GL_TRUE;
    ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
    ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; /* XXX temp */
-- 
1.7.9.5



More information about the mesa-dev mailing list