t_dd_dmatmp: Use '& 3' instead of '% 4' everywhere
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 14 Sep 2015 18:50:28 +0000 (11:50 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 23 Sep 2015 16:56:36 +0000 (09:56 -0700)
No piglit regressions on i915 (G33) or radeon (Radeon 7500).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.6 11.0" <mesa-stable@lists.freedesktop.org>
src/mesa/tnl_dd/t_dd_dmatmp.h

index b6f6e84e5404f54877beedfb326b05c4252a0313..a7cabc24977a2b9eee4482e7b95ff42d18338262 100644 (file)
@@ -553,7 +553,7 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
       /* Emit whole number of quads in total.  dmasz is already a multiple
        * of 4.
        */
-      count -= count % 4;
+      count -= count & 3;
 
       currentsz = (GET_CURRENT_VB_MAX_VERTS()/4) * 4;
       if (currentsz < 8)
@@ -1082,7 +1082,7 @@ static void TAG(render_quads_elts)( struct gl_context *ctx,
 
       currentsz = GET_CURRENT_VB_MAX_ELTS()/4*4;
 
-      count -= count % 4;
+      count -= count & 3;
 
       if (currentsz < 8)
         currentsz = dmasz;