t_dd_dmatmp: Indentation and formatting fixes after HAVE_LINE_STRIPS change

No piglit regressions on i915 (G33) or radeon (Radeon 7500).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
Ian Romanick 2015-09-14 14:14:08 -07:00
parent 1ecdf956ac
commit dcd8e49962
1 changed files with 125 additions and 139 deletions

View File

@ -167,24 +167,24 @@ static void TAG(render_lines_verts)(struct gl_context *ctx,
}
static void TAG(render_line_strip_verts)( struct gl_context *ctx,
static void TAG(render_line_strip_verts)(struct gl_context *ctx,
GLuint start,
GLuint count,
GLuint flags )
GLuint flags)
{
LOCAL_VARS;
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
int currentsz;
GLuint j, nr;
INIT( GL_LINE_STRIP );
INIT(GL_LINE_STRIP);
currentsz = GET_CURRENT_VB_MAX_VERTS();
if (currentsz < 8)
currentsz = dmasz;
for (j = 0; j + 1 < count; j += nr - 1 ) {
nr = MIN2( currentsz, count - j );
for (j = 0; j + 1 < count; j += nr - 1) {
nr = MIN2(currentsz, count - j);
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
currentsz = dmasz;
}
@ -193,17 +193,17 @@ static void TAG(render_line_strip_verts)( struct gl_context *ctx,
}
static void TAG(render_line_loop_verts)( struct gl_context *ctx,
static void TAG(render_line_loop_verts)(struct gl_context *ctx,
GLuint start,
GLuint count,
GLuint flags )
GLuint flags)
{
LOCAL_VARS;
int dmasz = GET_SUBSEQUENT_VB_MAX_VERTS();
int currentsz;
GLuint j, nr;
INIT( GL_LINE_STRIP );
INIT(GL_LINE_STRIP);
j = (flags & PRIM_BEGIN) ? 0 : 1;
@ -213,32 +213,27 @@ static void TAG(render_line_loop_verts)( struct gl_context *ctx,
currentsz--;
dmasz--;
if (currentsz < 8) {
if (currentsz < 8)
currentsz = dmasz;
}
if (j + 1 < count) {
for ( ; j + 1 < count; j += nr - 1 ) {
nr = MIN2( currentsz, count - j );
for (/* empty */; j + 1 < count; j += nr - 1) {
nr = MIN2(currentsz, count - j);
if (j + nr >= count &&
count > 1 &&
(flags & PRIM_END))
{
(flags & PRIM_END)) {
void *tmp;
tmp = ALLOC_VERTS(nr+1);
tmp = TAG(emit_verts)(ctx, start + j, nr, tmp);
tmp = TAG(emit_verts)( ctx, start, 1, tmp );
(void) tmp;
}
else {
} else {
TAG(emit_verts)(ctx, start + j, nr, ALLOC_VERTS(nr));
currentsz = dmasz;
}
}
}
else if (count > 1 && (flags & PRIM_END)) {
} else if (count > 1 && (flags & PRIM_END)) {
void *tmp;
tmp = ALLOC_VERTS(2);
tmp = TAG(emit_verts)( ctx, start+1, 1, tmp );
@ -682,10 +677,10 @@ static void TAG(render_lines_elts)(struct gl_context *ctx,
}
static void TAG(render_line_strip_elts)( struct gl_context *ctx,
static void TAG(render_line_strip_elts)(struct gl_context *ctx,
GLuint start,
GLuint count,
GLuint flags )
GLuint flags)
{
LOCAL_VARS;
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
@ -694,25 +689,25 @@ static void TAG(render_line_strip_elts)( struct gl_context *ctx,
GLuint j, nr;
FLUSH(); /* always a new primitive */
ELT_INIT( GL_LINE_STRIP );
ELT_INIT(GL_LINE_STRIP);
currentsz = GET_CURRENT_VB_MAX_ELTS();
if (currentsz < 8)
currentsz = dmasz;
for (j = 0; j + 1 < count; j += nr - 1) {
nr = MIN2( currentsz, count - j );
TAG(emit_elts)( ctx, elts + start + j, nr, ALLOC_ELTS(nr));
nr = MIN2(currentsz, count - j);
TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
FLUSH();
currentsz = dmasz;
}
}
static void TAG(render_line_loop_elts)( struct gl_context *ctx,
static void TAG(render_line_loop_elts)(struct gl_context *ctx,
GLuint start,
GLuint count,
GLuint flags )
GLuint flags)
{
LOCAL_VARS;
int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS();
@ -721,14 +716,13 @@ static void TAG(render_line_loop_elts)( struct gl_context *ctx,
GLuint j, nr;
FLUSH();
ELT_INIT( GL_LINE_STRIP );
ELT_INIT(GL_LINE_STRIP);
j = (flags & PRIM_BEGIN) ? 0 : 1;
currentsz = GET_CURRENT_VB_MAX_ELTS();
if (currentsz < 8) {
if (currentsz < 8)
currentsz = dmasz;
}
/* Ensure last vertex doesn't wrap:
*/
@ -736,27 +730,23 @@ static void TAG(render_line_loop_elts)( struct gl_context *ctx,
dmasz--;
if (j + 1 < count) {
for ( ; j + 1 < count; j += nr - 1 ) {
nr = MIN2( currentsz, count - j );
for (/* empty */; j + 1 < count; j += nr - 1) {
nr = MIN2(currentsz, count - j);
if (j + nr >= count &&
count > 1 &&
(flags & PRIM_END))
{
(flags & PRIM_END)) {
void *tmp;
tmp = ALLOC_ELTS(nr+1);
tmp = TAG(emit_elts)(ctx, elts + start + j, nr, tmp);
tmp = TAG(emit_elts)( ctx, elts+start, 1, tmp );
tmp = TAG(emit_elts)(ctx, elts + start, 1, tmp);
(void) tmp;
}
else {
} else {
TAG(emit_elts)(ctx, elts + start + j, nr, ALLOC_ELTS(nr));
currentsz = dmasz;
}
}
}
else if (count > 1 && (flags & PRIM_END)) {
} else if (count > 1 && (flags & PRIM_END)) {
void *tmp;
tmp = ALLOC_ELTS(2);
tmp = TAG(emit_elts)( ctx, elts+start+1, 1, tmp );
@ -1086,11 +1076,7 @@ static GLboolean TAG(validate_render)( struct gl_context *ctx,
ok = HAVE_POINTS;
break;
case GL_LINES:
ok = !ctx->Line.StippleFlag;
break;
case GL_LINE_STRIP:
ok = !ctx->Line.StippleFlag;
break;
case GL_LINE_LOOP:
ok = !ctx->Line.StippleFlag;
break;