summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/r300_emit.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2008-05-03 21:31:47 +1000
committerDave Airlie <airlied@linux.ie>2008-05-03 21:31:47 +1000
commitcea4f1464b00e025859b3b5dc415ce135afebd92 (patch)
tree25b5c03494dec3682489b166664bfd5c93229057 /src/mesa/drivers/dri/r300/r300_emit.c
parent026ef8111a94f6449dfa5e5cc0ae91fca4e68c0c (diff)
r300: recombine the vap input route 0 code and clean
This gets non-tcl cards working again on this branch.. at least texrect and glxgears
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_emit.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_emit.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c
index 0eeb8bf98a..dc08b642c5 100644
--- a/src/mesa/drivers/dri/r300/r300_emit.c
+++ b/src/mesa/drivers/dri/r300/r300_emit.c
@@ -207,7 +207,10 @@ static void r300EmitVec(GLcontext * ctx, struct r300_dma_region *rvb,
}
}
-static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr,
+#define DW_SIZE(x) ((inputs[tab[(x)]] << R300_DST_VEC_LOC_SHIFT) | \
+ (attribptr[tab[(x)]]->size - 1) << R300_DATA_TYPE_0_SHIFT)
+
+GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr,
int *inputs, GLint * tab, GLuint nr)
{
GLuint i, dw;
@@ -216,16 +219,13 @@ static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr,
for (i = 0; i < nr; i += 2) {
/* make sure input is valid, would lockup the gpu */
assert(inputs[tab[i]] != -1);
- dw = (R300_SIGNED |
- (inputs[tab[i]] << R300_DST_VEC_LOC_SHIFT) |
- (attribptr[tab[i]]->size - 1)) << R300_DATA_TYPE_0_SHIFT;
+ dw = (R300_SIGNED | DW_SIZE(i));
if (i + 1 == nr) {
dw |= R300_LAST_VEC << R300_DATA_TYPE_0_SHIFT;
} else {
assert(inputs[tab[i + 1]] != -1);
dw |= (R300_SIGNED |
- (inputs[tab[i + 1]] << R300_DST_VEC_LOC_SHIFT) |
- (attribptr[tab[i + 1]]->size - 1)) << R300_DATA_TYPE_1_SHIFT;
+ DW_SIZE(i + 1)) << R300_DATA_TYPE_1_SHIFT;
if (i + 2 == nr) {
dw |= R300_LAST_VEC << R300_DATA_TYPE_1_SHIFT;
}