summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl_dd
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2015-09-14 17:29:50 -0700
committerIan Romanick <[email protected]>2015-09-23 09:57:38 -0700
commitd830965057bc01734dcca415969ebb6950f2e58c (patch)
treea4fb24d480f97430b3ac0b3050494fcddbeeb089 /src/mesa/tnl_dd
parent8e9968f184dd1f9727d1095aa45936d5c6ec9f16 (diff)
t_dd_dmatmp: Constify dmasz
Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/tnl_dd')
-rw-r--r--src/mesa/tnl_dd/t_dd_dmatmp.h22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/mesa/tnl_dd/t_dd_dmatmp.h b/src/mesa/tnl_dd/t_dd_dmatmp.h
index 8f25797bc46..b229f42c164 100644
--- a/src/mesa/tnl_dd/t_dd_dmatmp.h
+++ b/src/mesa/tnl_dd/t_dd_dmatmp.h
@@ -69,7 +69,7 @@ static void TAG(render_points_verts)(struct gl_context *ctx,
{
if (HAVE_POINTS) {
LOCAL_VARS;
- unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
+ const unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
unsigned currentsz;
GLuint j, nr;
@@ -96,7 +96,7 @@ static void TAG(render_lines_verts)(struct gl_context *ctx,
GLuint flags)
{
LOCAL_VARS;
- unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
+ const unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS() & ~1;
unsigned currentsz;
GLuint j, nr;
@@ -107,7 +107,6 @@ static void TAG(render_lines_verts)(struct gl_context *ctx,
count -= count & 1;
currentsz = GET_CURRENT_VB_MAX_VERTS();
currentsz -= currentsz & 1;
- dmasz -= dmasz & 1;
if (currentsz < 8)
currentsz = dmasz;
@@ -126,7 +125,7 @@ static void TAG(render_line_strip_verts)(struct gl_context *ctx,
GLuint flags)
{
LOCAL_VARS;
- unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
+ const unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
unsigned currentsz;
GLuint j, nr;
@@ -152,7 +151,7 @@ static void TAG(render_line_loop_verts)(struct gl_context *ctx,
GLuint flags)
{
LOCAL_VARS;
- unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
+ const unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS() - 1;
unsigned currentsz;
GLuint j, nr;
@@ -164,7 +163,6 @@ static void TAG(render_line_loop_verts)(struct gl_context *ctx,
*/
currentsz = GET_CURRENT_VB_MAX_VERTS();
currentsz--;
- dmasz--;
if (currentsz < 8)
currentsz = dmasz;
@@ -204,7 +202,7 @@ static void TAG(render_triangles_verts)(struct gl_context *ctx,
GLuint flags)
{
LOCAL_VARS;
- unsigned dmasz = (GET_SUBSEQUENT_VB_MAX_VERTS() / 3) * 3;
+ const unsigned dmasz = (GET_SUBSEQUENT_VB_MAX_VERTS() / 3) * 3;
unsigned currentsz;
GLuint j, nr;
@@ -236,7 +234,7 @@ static void TAG(render_tri_strip_verts)(struct gl_context *ctx,
{
LOCAL_VARS;
GLuint j, nr;
- unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
+ const unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS() & ~1;
unsigned currentsz;
INIT(GL_TRIANGLE_STRIP);
@@ -248,7 +246,6 @@ static void TAG(render_tri_strip_verts)(struct gl_context *ctx,
/* From here on emit even numbers of tris when wrapping over buffers:
*/
- dmasz -= (dmasz & 1);
currentsz -= (currentsz & 1);
for (j = 0; j + 2 < count; j += nr - 2) {
@@ -267,7 +264,7 @@ static void TAG(render_tri_fan_verts)(struct gl_context *ctx,
{
LOCAL_VARS;
GLuint j, nr;
- unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
+ const unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
unsigned currentsz;
INIT(GL_TRIANGLE_FAN);
@@ -298,7 +295,7 @@ static void TAG(render_poly_verts)(struct gl_context *ctx,
if (HAVE_POLYGONS) {
LOCAL_VARS;
GLuint j, nr;
- unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
+ const unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
unsigned currentsz;
INIT(GL_POLYGON);
@@ -343,7 +340,7 @@ static void TAG(render_quad_strip_verts)(struct gl_context *ctx,
return;
} else {
LOCAL_VARS;
- unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
+ const unsigned dmasz = GET_SUBSEQUENT_VB_MAX_VERTS() & ~1;
unsigned currentsz;
/* Emit smooth-shaded quadstrips as tristrips:
@@ -353,7 +350,6 @@ static void TAG(render_quad_strip_verts)(struct gl_context *ctx,
/* Emit whole number of quads in total, and in each buffer.
*/
- dmasz -= dmasz & 1;
currentsz = GET_CURRENT_VB_MAX_VERTS();
currentsz -= currentsz & 1;
count -= count & 1;