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 d3ed279dedf7745b853bc8aa40f7a4b3b8b13a10..eb8403c9261f801f824f971c60d5650dc54f89ba 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--;
         }