From 9b727e117e26ef6e5a410bc1e2ad9d33e54603eb Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 25 May 2007 23:02:57 +0000 Subject: [PATCH] r300: Cleaned up t_vir0 and t_vir1 slightly. --- src/mesa/drivers/dri/r300/r300_context.h | 2 +- src/mesa/drivers/dri/r300/r300_emit.c | 25 +++++++++--------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 01caa617667..4bc73dc862d 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -785,7 +785,7 @@ struct r300_fragment_program { #define AOS_FORMAT_USHORT 0 #define AOS_FORMAT_FLOAT 1 -#define AOS_FORMAT_UBYTE 2 +#define AOS_FORMAT_UNSIGNED_BYTE 2 #define AOS_FORMAT_FLOAT_COLOR 3 #define REG_COORDS 0 diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 605c72f6de4..fcf2ae3f089 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -243,29 +243,24 @@ static inline GLuint t_vir_pack(GLvector4f ** dt, int *inputs, int i) static GLuint t_vir0(uint32_t * dst, GLvector4f ** dt, int *inputs, GLint * tab, GLuint nr) { - GLuint i, dw, dwInternel; + GLuint i, dw; for (i = 0; i + 1 < nr; i += 2) { dw = t_vir_pack(dt, inputs, tab[i]); - dwInternel = t_vir_pack(dt, inputs, tab[i + 1]); - dw |= dwInternel << R300_VIR0_HIGH_SHIFT; - + dw |= t_vir_pack(dt, inputs, tab[i + 1]) << R300_VIR0_HIGH_SHIFT; if (i + 2 == nr) { - dw |= - (1 << - (R300_VIR0_AOS_STOP_SHIFT + R300_VIR0_HIGH_SHIFT)); + dw |= (1 << (R300_VIR0_AOS_STOP_SHIFT + R300_VIR0_HIGH_SHIFT)); } - dst[i >> 1] = dw; /* i / 2 */ + dst[i >> 1] = dw; } if (nr & 1) { dw = t_vir_pack(dt, inputs, tab[nr - 1]); dw |= 1 << R300_VIR0_AOS_STOP_SHIFT; - dst[nr >> 1] = dw; } - return (nr + 1) >> 1; /* (nr + 1) / 2 */ + return (nr + 1) >> 1; } static GLuint t_swizzle(int swizzle[4]) @@ -282,14 +277,12 @@ static GLuint t_vir1(uint32_t * dst, int swizzle[][4], GLuint nr) for (i = 0; i + 1 < nr; i += 2) { dst[i >> 1] = t_swizzle(swizzle[i]) | R300_INPUT_ROUTE_ENABLE; - dst[i >> 1] |= - (t_swizzle(swizzle[i + 1]) | R300_INPUT_ROUTE_ENABLE) - << 16; + dst[i >> 1] |= (t_swizzle(swizzle[i + 1]) | R300_INPUT_ROUTE_ENABLE) << 16; } - if (nr & 1) - dst[nr >> 1] = - t_swizzle(swizzle[nr - 1]) | R300_INPUT_ROUTE_ENABLE; + if (nr & 1) { + dst[nr >> 1] = t_swizzle(swizzle[nr - 1]) | R300_INPUT_ROUTE_ENABLE; + } return (nr + 1) >> 1; } -- 2.30.2