[Mesa-dev] [PATCH 4/6] gallium: remove PIPE_CAP_GLSL and enable GLSL unconditionally

Marek Olšák maraeo at gmail.com
Fri Nov 18 11:27:50 PST 2011


Only i965g does not enable GLSL, but that driver has been unmaintained and
bitrotting for quite a while anyway.
---
 src/gallium/auxiliary/util/u_caps.c        |    1 -
 src/gallium/docs/source/screen.rst         |    1 -
 src/gallium/drivers/cell/ppu/cell_screen.c |    2 -
 src/gallium/drivers/i915/i915_screen.c     |    1 -
 src/gallium/drivers/i965/brw_screen.c      |    2 -
 src/gallium/drivers/llvmpipe/lp_screen.c   |    2 -
 src/gallium/drivers/nv50/nv50_screen.c     |    1 -
 src/gallium/drivers/nvc0/nvc0_screen.c     |    1 -
 src/gallium/drivers/nvfx/nvfx_screen.c     |    2 -
 src/gallium/drivers/r300/r300_screen.c     |   16 --------------
 src/gallium/drivers/r600/r600_pipe.c       |    1 -
 src/gallium/drivers/softpipe/sp_screen.c   |    2 -
 src/gallium/drivers/svga/svga_screen.c     |    2 -
 src/gallium/include/pipe/p_defines.h       |    1 -
 src/mesa/state_tracker/st_extensions.c     |   31 +++++++++++----------------
 15 files changed, 13 insertions(+), 53 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_caps.c b/src/gallium/auxiliary/util/u_caps.c
index 75677b2..6230707 100644
--- a/src/gallium/auxiliary/util/u_caps.c
+++ b/src/gallium/auxiliary/util/u_caps.c
@@ -182,7 +182,6 @@ static unsigned caps_dx_11[] = {
 
 /* OpenGL 2.1 */
 static unsigned caps_opengl_2_1[] = {
-   UTIL_CHECK_CAP(GLSL),
    UTIL_CHECK_CAP(OCCLUSION_QUERY),
    UTIL_CHECK_CAP(TWO_SIDED_STENCIL),
    UTIL_CHECK_CAP(BLEND_EQUATION_SEPARATE),
diff --git a/src/gallium/docs/source/screen.rst b/src/gallium/docs/source/screen.rst
index 0679240..d2f0f9d 100644
--- a/src/gallium/docs/source/screen.rst
+++ b/src/gallium/docs/source/screen.rst
@@ -26,7 +26,6 @@ The integer capabilities:
   normalized coordinates, and mipmaps.
 * ``PIPE_CAP_TWO_SIDED_STENCIL``: Whether the stencil test can also affect back-facing
   polygons.
-* ``PIPE_CAP_GLSL``: Deprecated.
 * ``PIPE_CAP_DUAL_SOURCE_BLEND``: Whether dual-source blend factors are supported. See
   :ref:`Blend` for more information.
 * ``PIPE_CAP_ANISOTROPIC_FILTER``: Whether textures can be filtered anisotropically.
diff --git a/src/gallium/drivers/cell/ppu/cell_screen.c b/src/gallium/drivers/cell/ppu/cell_screen.c
index 86acbc7..a4677fd 100644
--- a/src/gallium/drivers/cell/ppu/cell_screen.c
+++ b/src/gallium/drivers/cell/ppu/cell_screen.c
@@ -64,8 +64,6 @@ cell_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 1;
    case PIPE_CAP_TWO_SIDED_STENCIL:
       return 1;
-   case PIPE_CAP_GLSL:
-      return 1;
    case PIPE_CAP_ANISOTROPIC_FILTER:
       return 0;
    case PIPE_CAP_POINT_SPRITE:
diff --git a/src/gallium/drivers/i915/i915_screen.c b/src/gallium/drivers/i915/i915_screen.c
index 75545f4..9e46afa 100644
--- a/src/gallium/drivers/i915/i915_screen.c
+++ b/src/gallium/drivers/i915/i915_screen.c
@@ -200,7 +200,6 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
       return 0;
 
    /* Features we can lie about (boolean caps). */
-   case PIPE_CAP_GLSL:
    case PIPE_CAP_OCCLUSION_QUERY:
       return is->debug.lie ? 1 : 0;
 
diff --git a/src/gallium/drivers/i965/brw_screen.c b/src/gallium/drivers/i965/brw_screen.c
index deafd4b..f4abd0f 100644
--- a/src/gallium/drivers/i965/brw_screen.c
+++ b/src/gallium/drivers/i965/brw_screen.c
@@ -160,8 +160,6 @@ brw_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 1;
    case PIPE_CAP_TWO_SIDED_STENCIL:
       return 1;
-   case PIPE_CAP_GLSL:
-      return 0;
    case PIPE_CAP_ANISOTROPIC_FILTER:
       return 0;
    case PIPE_CAP_POINT_SPRITE:
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index fac13e7..9d77cf8 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -110,8 +110,6 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 1;
    case PIPE_CAP_TWO_SIDED_STENCIL:
       return 1;
-   case PIPE_CAP_GLSL:
-      return 1;
    case PIPE_CAP_SM3:
       return 1;
    case PIPE_CAP_ANISOTROPIC_FILTER:
diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c
index 1270c83..278b3ee 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -107,7 +107,6 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE:
    case PIPE_CAP_POINT_SPRITE:
       return 1;
-   case PIPE_CAP_GLSL:
    case PIPE_CAP_SM3:
       return 1;
    case PIPE_CAP_MAX_RENDER_TARGETS:
diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c b/src/gallium/drivers/nvc0/nvc0_screen.c
index 0da7be4..8b109a9 100644
--- a/src/gallium/drivers/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nvc0/nvc0_screen.c
@@ -96,7 +96,6 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE:
    case PIPE_CAP_POINT_SPRITE:
       return 1;
-   case PIPE_CAP_GLSL:
    case PIPE_CAP_SM3:
       return 1;
    case PIPE_CAP_MAX_RENDER_TARGETS:
diff --git a/src/gallium/drivers/nvfx/nvfx_screen.c b/src/gallium/drivers/nvfx/nvfx_screen.c
index 6086d43..ce23144 100644
--- a/src/gallium/drivers/nvfx/nvfx_screen.c
+++ b/src/gallium/drivers/nvfx/nvfx_screen.c
@@ -31,8 +31,6 @@ nvfx_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
 		return screen->advertise_npot;
 	case PIPE_CAP_TWO_SIDED_STENCIL:
 		return 1;
-	case PIPE_CAP_GLSL:
-		return 1;
 	case PIPE_CAP_SM3:
 		/* TODO: >= nv4x support Shader Model 3.0 */
 		return 0;
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index ab1cec5..aa7005c 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -89,22 +89,6 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         /* Supported features (boolean caps). */
         case PIPE_CAP_NPOT_TEXTURES:
         case PIPE_CAP_TWO_SIDED_STENCIL:
-        case PIPE_CAP_GLSL:
-            /* I'll be frank. This is a lie.
-             *
-             * We don't truly support GLSL on any of this driver's chipsets.
-             * To be fair, no chipset supports the full GLSL specification
-             * to the best of our knowledge, but some of the less esoteric
-             * features are still missing here.
-             *
-             * Rather than cripple ourselves intentionally, I'm going to set
-             * this flag, and as Gallium's interface continues to change, I
-             * hope that this single monolithic GLSL enable can slowly get
-             * split down into many different pieces and the state tracker
-             * will handle fallbacks transparently, like it should.
-             *
-             * ~ C.
-             */
         case PIPE_CAP_ANISOTROPIC_FILTER:
         case PIPE_CAP_POINT_SPRITE:
         case PIPE_CAP_OCCLUSION_QUERY:
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 243de14..50f1f48 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -357,7 +357,6 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
 	/* Supported features (boolean caps). */
 	case PIPE_CAP_NPOT_TEXTURES:
 	case PIPE_CAP_TWO_SIDED_STENCIL:
-	case PIPE_CAP_GLSL:
 	case PIPE_CAP_DUAL_SOURCE_BLEND:
 	case PIPE_CAP_ANISOTROPIC_FILTER:
 	case PIPE_CAP_POINT_SPRITE:
diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
index 4851049..4b71a35 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -70,8 +70,6 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 1;
    case PIPE_CAP_TWO_SIDED_STENCIL:
       return 1;
-   case PIPE_CAP_GLSL:
-      return 1;
    case PIPE_CAP_SM3:
       return 1;
    case PIPE_CAP_ANISOTROPIC_FILTER:
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index 7c4aa31..b6061ab 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -128,8 +128,6 @@ svga_get_paramf(struct pipe_screen *screen, enum pipe_cap param)
       return 1;
    case PIPE_CAP_TWO_SIDED_STENCIL:
       return 1;
-   case PIPE_CAP_GLSL:
-      return 1;
    case PIPE_CAP_ANISOTROPIC_FILTER:
       return 1;
    case PIPE_CAP_POINT_SPRITE:
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 5196591..3e55d22 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -424,7 +424,6 @@ enum pipe_transfer_usage {
 enum pipe_cap {
    PIPE_CAP_NPOT_TEXTURES = 1,
    PIPE_CAP_TWO_SIDED_STENCIL = 2,
-   PIPE_CAP_GLSL = 3,  /* XXX need something better */
    PIPE_CAP_DUAL_SOURCE_BLEND = 4,
    PIPE_CAP_ANISOTROPIC_FILTER = 5,
    PIPE_CAP_POINT_SPRITE = 6,
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 3563e1d..544f0b6 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -213,15 +213,10 @@ void st_init_limits(struct st_context *st)
    c->MaxVarying = screen->get_shader_param(screen, PIPE_SHADER_FRAGMENT, PIPE_SHADER_CAP_MAX_INPUTS) - 2;
    c->MaxVarying = MIN2(c->MaxVarying, MAX_VARYING);
 
-   /* XXX we'll need a better query here someday */
-   if (screen->get_param(screen, PIPE_CAP_GLSL)) {
-      c->MinProgramTexelOffset = screen->get_param(screen, PIPE_CAP_MIN_TEXEL_OFFSET);
-      c->MaxProgramTexelOffset = screen->get_param(screen, PIPE_CAP_MAX_TEXEL_OFFSET);
+   c->MinProgramTexelOffset = screen->get_param(screen, PIPE_CAP_MIN_TEXEL_OFFSET);
+   c->MaxProgramTexelOffset = screen->get_param(screen, PIPE_CAP_MAX_TEXEL_OFFSET);
 
-      c->GLSLVersion = 120;
-      _mesa_override_glsl_version(st->ctx);
-      c->UniformBooleanTrue = ~0;
-   }
+   c->UniformBooleanTrue = ~0;
 
    c->StripTextureBorder = GL_TRUE;
 }
@@ -249,16 +244,23 @@ void st_init_extensions(struct st_context *st)
    struct gl_context *ctx = st->ctx;
    int i;
 
+   ctx->Const.GLSLVersion = 120;
+   _mesa_override_glsl_version(st->ctx);
+
    /*
     * Extensions that are supported by all Gallium drivers:
     */
    ctx->Extensions.ARB_copy_buffer = GL_TRUE;
    ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE;
+   ctx->Extensions.ARB_explicit_attrib_location = GL_TRUE;
    ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE;
    ctx->Extensions.ARB_fragment_program = GL_TRUE;
+   ctx->Extensions.ARB_fragment_shader = GL_TRUE;
    ctx->Extensions.ARB_half_float_pixel = 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 */
    ctx->Extensions.ARB_texture_cube_map = GL_TRUE;
    ctx->Extensions.ARB_texture_env_combine = GL_TRUE;
@@ -267,6 +269,7 @@ void st_init_extensions(struct st_context *st)
    ctx->Extensions.ARB_texture_storage = GL_TRUE;
    ctx->Extensions.ARB_vertex_array_object = GL_TRUE;
    ctx->Extensions.ARB_vertex_program = GL_TRUE;
+   ctx->Extensions.ARB_vertex_shader = GL_TRUE;
    ctx->Extensions.ARB_window_pos = GL_TRUE;
 
    ctx->Extensions.EXT_blend_color = GL_TRUE;
@@ -281,6 +284,7 @@ void st_init_extensions(struct st_context *st)
    ctx->Extensions.EXT_point_parameters = GL_TRUE;
    ctx->Extensions.EXT_provoking_vertex = GL_TRUE;
    ctx->Extensions.EXT_secondary_color = GL_TRUE;
+   ctx->Extensions.EXT_separate_shader_objects = GL_TRUE;
    ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE;
    ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE;
 
@@ -317,15 +321,6 @@ void st_init_extensions(struct st_context *st)
       ctx->Extensions.EXT_texture_swizzle = GL_TRUE;
    }
 
-   if (screen->get_param(screen, PIPE_CAP_GLSL)) {
-      ctx->Extensions.ARB_fragment_shader = GL_TRUE;
-      ctx->Extensions.ARB_vertex_shader = GL_TRUE;
-      ctx->Extensions.ARB_shader_objects = GL_TRUE;
-      ctx->Extensions.ARB_shading_language_100 = GL_TRUE;
-      ctx->Extensions.ARB_explicit_attrib_location = GL_TRUE;
-      ctx->Extensions.EXT_separate_shader_objects = GL_TRUE;
-   }
-
    if (screen->get_param(screen, PIPE_CAP_BLEND_EQUATION_SEPARATE)) {
       ctx->Extensions.EXT_blend_equation_separate = GL_TRUE;
    }
-- 
1.7.5.4



More information about the mesa-dev mailing list