swr: [rasterizer core] Faster modulo operator in ProcessVerts
authorTim Rowley <timothy.o.rowley@intel.com>
Mon, 2 May 2016 20:09:39 +0000 (14:09 -0600)
committerTim Rowley <timothy.o.rowley@intel.com>
Thu, 5 May 2016 19:50:11 +0000 (14:50 -0500)
Avoid % operator, since we know that curVertex is always incrementing.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
src/gallium/drivers/swr/rasterizer/core/pa.h

index d3ed279..eb8403c 100644 (file)
@@ -508,7 +508,10 @@ struct PA_STATE_CUT : public PA_STATE
                 (this->*pfnPa)(this->curVertex, false);
             }
 
-            this->curVertex = (this->curVertex + 1) % this->numVerts;
+           this->curVertex++;
+           if (this->curVertex >= this->numVerts) {
+               this->curVertex = 0;
+           }
             this->numRemainingVerts--;
         }