aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorTim Rowley <[email protected]>2016-05-02 14:09:39 -0600
committerTim Rowley <[email protected]>2016-05-05 14:50:11 -0500
commitff8c0c9a35458532519721ced82bc8d4b1ed8cac (patch)
tree320124cf07ab3d3b54876287089950c4697967dc /src/gallium/drivers
parent2be7c3e780977678eb423e75cf063f92f7d03916 (diff)
swr: [rasterizer core] Faster modulo operator in ProcessVerts
Avoid % operator, since we know that curVertex is always incrementing. Reviewed-by: Bruce Cherniak <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/swr/rasterizer/core/pa.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/core/pa.h b/src/gallium/drivers/swr/rasterizer/core/pa.h
index d3ed279dedf..eb8403c9261 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--;
}