From b9c0a00ed0022f0131dbf3cd9755ba8212ce3908 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 25 May 2007 23:42:03 +0000 Subject: r300: Specify the type in the t_vir0 function. --- src/mesa/drivers/dri/r300/r300_emit.c | 40 ++++++++--------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) (limited to 'src/mesa/drivers/dri/r300/r300_emit.c') diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index fcf2ae3f08..51e6d55cc9 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -214,49 +214,27 @@ static void r300EmitVec(GLcontext * ctx, } -/* TODO: explain this... */ -#define R300_VIR0_AOS_SIZE_SHIFT 0 -#define R300_VIR0_AOS_INPUT_SHIFT 8 -#define R300_VIR0_AOS_STOP_SHIFT 13 -#define R300_VIR0_AOS_TYPE_SHIFT 14 -#define R300_VIR0_HIGH_SHIFT 16 - -/* - * pack 4 elemets in a 16 bit integer. +/* dw: size, inputs, stop bit, type * - * aos_size first 8 - * input next 5 - * 1 stop bit (whild gues) - * aos_type last 2 + * I'll create some documentation for t_vir0 and t_vir1 tomorrow and probably + * add the shifts as defines in r300_reg.h. */ -static inline GLuint t_vir_pack(GLvector4f ** dt, int *inputs, int i) -{ - GLuint dw; - dw = (dt[i]->size - 1) << R300_VIR0_AOS_SIZE_SHIFT; - dw |= inputs[i] << R300_VIR0_AOS_INPUT_SHIFT; -#if 0 - dw |= t_type(&dt[i]) << R300_VIR0_AOS_TYPE_SHIFT; -#endif - return dw; -} - -static GLuint t_vir0(uint32_t * dst, GLvector4f ** dt, int *inputs, - GLint * tab, GLuint nr) +static GLuint t_vir0(uint32_t * dst, GLvector4f ** dt, int *inputs, GLint * tab, GLuint nr) { GLuint i, dw; for (i = 0; i + 1 < nr; i += 2) { - dw = t_vir_pack(dt, inputs, tab[i]); - dw |= t_vir_pack(dt, inputs, tab[i + 1]) << R300_VIR0_HIGH_SHIFT; + dw = (dt[tab[i]]->size - 1) | (inputs[tab[i]] << 8) | (AOS_FORMAT_FLOAT << 14); + dw |= ((dt[tab[i + 1]]->size - 1) | (inputs[tab[i + 1]] << 8) | (AOS_FORMAT_FLOAT << 14)) << 16; if (i + 2 == nr) { - dw |= (1 << (R300_VIR0_AOS_STOP_SHIFT + R300_VIR0_HIGH_SHIFT)); + dw |= (1 << (13 + 16)); } dst[i >> 1] = dw; } if (nr & 1) { - dw = t_vir_pack(dt, inputs, tab[nr - 1]); - dw |= 1 << R300_VIR0_AOS_STOP_SHIFT; + dw = (dt[tab[nr - 1]]->size - 1) | (inputs[tab[nr - 1]] << 8) | (AOS_FORMAT_FLOAT << 14); + dw |= 1 << 13; dst[nr >> 1] = dw; } -- cgit v1.2.3