Mesa (master): i915: Use _tnl_RenderClippedPolygon and _tnl_RenderClippedLine

Ian Romanick idr at kemper.freedesktop.org
Tue Oct 6 19:19:47 UTC 2015


Module: Mesa
Branch: master
Commit: bcf650496f22961fb66975aba3c8a982dbc72c9e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bcf650496f22961fb66975aba3c8a982dbc72c9e

Author: Ville Syrjälä <ville.syrjala at linux.intel.com>
Date:   Mon Mar 23 14:47:27 2015 +0200

i915: Use _tnl_RenderClippedPolygon and _tnl_RenderClippedLine

_tnl_RenderClippedPolygon and _tnl_RenderClippedLine already do most of
what we want so use them.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/mesa/drivers/dri/i915/intel_tris.c |   19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c
index 6133c23..6407ea9 100644
--- a/src/mesa/drivers/dri/i915/intel_tris.c
+++ b/src/mesa/drivers/dri/i915/intel_tris.c
@@ -891,18 +891,11 @@ intelRenderClippedPoly(struct gl_context * ctx, const GLuint * elts, GLuint n)
 {
    struct intel_context *intel = intel_context(ctx);
    TNLcontext *tnl = TNL_CONTEXT(ctx);
-   struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
    GLuint prim = intel->render_primitive;
 
    /* Render the new vertices as an unclipped polygon.
     */
-   {
-      GLuint *tmp = VB->Elts;
-      VB->Elts = (GLuint *) elts;
-      tnl->Driver.Render.PrimTabElts[GL_POLYGON] (ctx, 0, n,
-                                                  PRIM_BEGIN | PRIM_END);
-      VB->Elts = tmp;
-   }
+   _tnl_RenderClippedPolygon(ctx, elts, n);
 
    /* Restore the render primitive
     */
@@ -911,14 +904,6 @@ intelRenderClippedPoly(struct gl_context * ctx, const GLuint * elts, GLuint n)
 }
 
 static void
-intelRenderClippedLine(struct gl_context * ctx, GLuint ii, GLuint jj)
-{
-   TNLcontext *tnl = TNL_CONTEXT(ctx);
-
-   tnl->Driver.Render.Line(ctx, ii, jj);
-}
-
-static void
 intelFastRenderClippedPoly(struct gl_context * ctx, const GLuint * elts, GLuint n)
 {
    struct intel_context *intel = intel_context(ctx);
@@ -1044,7 +1029,7 @@ intelChooseRenderState(struct gl_context * ctx)
       else {
          tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
          tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
-         tnl->Driver.Render.ClippedLine = intelRenderClippedLine;
+         tnl->Driver.Render.ClippedLine = _tnl_RenderClippedLine;
          tnl->Driver.Render.ClippedPolygon = intelRenderClippedPoly;
       }
    }




More information about the mesa-commit mailing list