From: Tim Rowley Date: Mon, 2 May 2016 20:09:39 +0000 (-0600) Subject: swr: [rasterizer core] Faster modulo operator in ProcessVerts X-Git-Tag: upstream/17.1.0~10217 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ff8c0c9a35458532519721ced82bc8d4b1ed8cac;p=platform%2Fupstream%2Fmesa.git swr: [rasterizer core] Faster modulo operator in ProcessVerts Avoid % operator, since we know that curVertex is always incrementing. Reviewed-by: Bruce Cherniak --- diff --git a/src/gallium/drivers/swr/rasterizer/core/pa.h b/src/gallium/drivers/swr/rasterizer/core/pa.h index d3ed279..eb8403c 100644 --- a/src/gallium/drivers/swr/rasterizer/core/pa.h +++ b/src/gallium/drivers/swr/rasterizer/core/pa.h @@ -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--; }