gallium: Enable ARB_clip_control for gallium drivers.
authorMathias Fröhlich <Mathias.Froehlich@gmx.net>
Sun, 21 Sep 2014 16:09:22 +0000 (18:09 +0200)
committerMathias Fröhlich <Mathias.Froehlich@gmx.net>
Fri, 24 Oct 2014 17:21:21 +0000 (19:21 +0200)
Gallium should be prepared fine for ARB_clip_control.
So enable this and mention it in the release notes.

v2:
Only enable for drivers announcing the freshly introduced
PIPE_CAP_CLIP_HALFZ capability.

v3:
Use extension enable infrastructure to connect PIPE_CAP_CLIP_HALFZ
with ARB_clip_control.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
docs/GL3.txt
docs/relnotes/10.4.html
src/mesa/state_tracker/st_atom_rasterizer.c
src/mesa/state_tracker/st_extensions.c

index 07d1d2c493f912f022c86069966e4555e12a337b..6a988d5e7102c5d67cb9f664840cfc4e05bee46c 100644 (file)
@@ -187,7 +187,7 @@ GL 4.4, GLSL 4.40:
 GL 4.5, GLSL 4.50:
 
   GL_ARB_ES3_1_compatibility                           not started
-  GL_ARB_clip_control                                  not started
+  GL_ARB_clip_control                                  DONE (llvmpipe, softpipe, r300, r600, radeonsi)
   GL_ARB_conditional_render_inverted                   DONE (i965, nvc0, llvmpipe, softpipe)
   GL_ARB_cull_distance                                 not started
   GL_ARB_derivative_control                            DONE (i965, nv50, nvc0, r600)
index 64cbfaefa6f45dd60b35ef2c3fa2a8db0997e625..67c3087ee447c7501d97d67f1c8a08437c7e382e 100644 (file)
@@ -46,6 +46,7 @@ Note: some of the new features are only available with certain drivers.
 <ul>
 <li>GL_ARB_sample_shading on r600</li>
 <li>GL_ARB_texture_view on nv50, nvc0</li>
+<li>GL_ARB_clip_control on llvmpipe, softpipe, r300, r600, radeonsi</li>
 </ul>
 
 
index dfa728b19ec54548d9ad50d754d7b266253a5a6f..50209788bcd0210d172f1e9c499056f2e91dc9dd 100644 (file)
@@ -72,6 +72,11 @@ static void update_raster_state( struct st_context *st )
    {
       raster->front_ccw = (ctx->Polygon.FrontFace == GL_CCW);
 
+      /* _NEW_VIEWPORT */
+      if (ctx->Transform.ClipOrigin == GL_UPPER_LEFT) {
+         raster->front_ccw ^= 1;
+      }
+
       /*
        * Gallium's surfaces are Y=0=TOP orientation.  OpenGL is the
        * opposite.  Window system surfaces are Y=0=TOP.  Mesa's FBOs
@@ -241,6 +246,12 @@ static void update_raster_state( struct st_context *st )
    raster->half_pixel_center = 1;
    if (st_fb_orientation(ctx->DrawBuffer) == Y_0_TOP)
       raster->bottom_edge_rule = 1;
+   /* _NEW_VIEWPORT */
+   if (ctx->Transform.ClipOrigin == GL_UPPER_LEFT)
+      raster->bottom_edge_rule ^= 1;
+
+   /* _NEW_VIEWPORT */
+   raster->clip_halfz = (ctx->Transform.ClipDepthMode == GL_ZERO_TO_ONE);
 
    /* ST_NEW_RASTERIZER */
    raster->rasterizer_discard = ctx->RasterDiscard;
@@ -272,7 +283,8 @@ const struct st_tracked_state st_update_rasterizer = {
        _NEW_PROGRAM |
        _NEW_SCISSOR |
        _NEW_FRAG_CLAMP |
-       _NEW_TRANSFORM),      /* mesa state dependencies*/
+       _NEW_TRANSFORM |
+       _NEW_VIEWPORT),      /* mesa state dependencies*/
       (ST_NEW_VERTEX_PROGRAM |
        ST_NEW_RASTERIZER),  /* state tracker dependencies */
    },
index 78bfe30735f287ac8a2c26e7431fa492c71010aa..aff3ddebe132258a57de5b2db9139658263e7b19 100644 (file)
@@ -463,6 +463,7 @@ void st_init_extensions(struct pipe_screen *screen,
       { o(ARB_derivative_control),           PIPE_CAP_TGSI_FS_FINE_DERIVATIVE          },
       { o(ARB_conditional_render_inverted),  PIPE_CAP_CONDITIONAL_RENDER_INVERTED      },
       { o(ARB_texture_view),                 PIPE_CAP_SAMPLER_VIEW_TARGET              },
+      { o(ARB_clip_control),                 PIPE_CAP_CLIP_HALFZ                       },
    };
 
    /* Required: render target and sampler support */