summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/r300_swtcl.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@nx6125b.(none)>2007-07-01 18:40:26 +1000
committerDave Airlie <airlied@nx6125b.(none)>2007-07-01 18:40:26 +1000
commitb691d460465f992dc3febde06593341f192be970 (patch)
tree616a9ef727f862f5c24219c5cd8de2007a67a946 /src/mesa/drivers/dri/r300/r300_swtcl.c
parent8f7478e5cb28912f81ec302a3c1b80733a3a6df3 (diff)
r300: cleanup some of the swtcl code
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_swtcl.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_swtcl.c101
1 files changed, 1 insertions, 100 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c
index ef3f3b347c..3fc229807f 100644
--- a/src/mesa/drivers/dri/r300/r300_swtcl.c
+++ b/src/mesa/drivers/dri/r300/r300_swtcl.c
@@ -77,6 +77,7 @@ do { \
rmesa->swtcl.vertex_attr_count++; \
} while (0)
+/* this differs from the VIR0 in emit.c - TODO merge them using another option */
static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr,
int *inputs, GLint * tab, GLuint nr)
{
@@ -101,103 +102,6 @@ static GLuint r300VAPInputRoute0(uint32_t * dst, GLvector4f ** attribptr,
return (nr + 1) >> 1;
}
-static GLuint r300VAPInputRoute1Swizzle(int swizzle[4])
-{
- return (swizzle[0] << R300_INPUT_ROUTE_X_SHIFT) |
- (swizzle[1] << R300_INPUT_ROUTE_Y_SHIFT) |
- (swizzle[2] << R300_INPUT_ROUTE_Z_SHIFT) |
- (swizzle[3] << R300_INPUT_ROUTE_W_SHIFT);
-}
-
-static GLuint r300VAPInputRoute1(uint32_t * dst, int swizzle[][4], GLuint nr)
-{
- GLuint i;
-
- for (i = 0; i + 1 < nr; i += 2) {
- dst[i >> 1] = r300VAPInputRoute1Swizzle(swizzle[i]) | R300_INPUT_ROUTE_ENABLE;
- dst[i >> 1] |= (r300VAPInputRoute1Swizzle(swizzle[i + 1]) | R300_INPUT_ROUTE_ENABLE) << 16;
- }
-
- if (nr & 1) {
- dst[nr >> 1] = r300VAPInputRoute1Swizzle(swizzle[nr - 1]) | R300_INPUT_ROUTE_ENABLE;
- }
-
- return (nr + 1) >> 1;
-}
-
-static GLuint r300VAPInputCntl0(GLcontext * ctx, GLuint InputsRead)
-{
- /* No idea what this value means. I have seen other values written to
- * this register... */
- return 0x5555;
-}
-
-static GLuint r300VAPInputCntl1(GLcontext * ctx, GLuint InputsRead)
-{
- r300ContextPtr rmesa = R300_CONTEXT(ctx);
- GLuint i, vic_1 = 0;
-
- if (InputsRead & (1 << VERT_ATTRIB_POS))
- vic_1 |= R300_INPUT_CNTL_POS;
-
- if (InputsRead & (1 << VERT_ATTRIB_NORMAL))
- vic_1 |= R300_INPUT_CNTL_NORMAL;
-
- if (InputsRead & (1 << VERT_ATTRIB_COLOR0))
- vic_1 |= R300_INPUT_CNTL_COLOR;
-
- rmesa->state.texture.tc_count = 0;
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++)
- if (InputsRead & (1 << (VERT_ATTRIB_TEX0 + i))) {
- rmesa->state.texture.tc_count++;
- vic_1 |= R300_INPUT_CNTL_TC0 << i;
- }
-
- return vic_1;
-}
-
-static GLuint r300VAPOutputCntl0(GLcontext * ctx, GLuint OutputsWritten)
-{
- GLuint ret = 0;
-
- if (OutputsWritten & (1 << VERT_RESULT_HPOS))
- ret |= R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT;
-
- if (OutputsWritten & (1 << VERT_RESULT_COL0))
- ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_PRESENT;
-
- if (OutputsWritten & (1 << VERT_RESULT_COL1))
- ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_1_PRESENT;
-
-#if 0
- if (OutputsWritten & (1 << VERT_RESULT_BFC0))
- ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_2_PRESENT;
-
- if (OutputsWritten & (1 << VERT_RESULT_BFC1))
- ret |= R300_VAP_OUTPUT_VTX_FMT_0__COLOR_3_PRESENT;
-
- if (OutputsWritten & (1 << VERT_RESULT_FOGC)) ;
-#endif
-
- if (OutputsWritten & (1 << VERT_RESULT_PSIZ))
- ret |= R300_VAP_OUTPUT_VTX_FMT_0__PT_SIZE_PRESENT;
-
- return ret;
-}
-
-static GLuint r300VAPOutputCntl1(GLcontext * ctx, GLuint OutputsWritten)
-{
- GLuint i, ret = 0;
-
- for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
- if (OutputsWritten & (1 << (VERT_RESULT_TEX0 + i))) {
- ret |= (4 << (3 * i));
- }
- }
-
- return ret;
-}
-
static void r300SetVertexFormat( GLcontext *ctx )
{
r300ContextPtr rmesa = R300_CONTEXT( ctx );
@@ -659,9 +563,6 @@ static void r300ChooseRenderState( GLcontext *ctx )
GLuint index = 0;
GLuint flags = ctx->_TriangleCaps;
- // if (!rmesa->TclFallback || rmesa->Fallback)
-// return;
-
if (flags & DD_TRI_LIGHT_TWOSIDE) index |= R300_TWOSIDE_BIT;
if (flags & DD_TRI_UNFILLED) index |= R300_UNFILLED_BIT;