summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r200/r200_maos_arrays.c
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2004-05-05 20:16:17 +0000
committerIan Romanick <idr@us.ibm.com>2004-05-05 20:16:17 +0000
commit95a0bd6762737bb25bdf5c4147da9d1372f6aac3 (patch)
tree4621bed2826ef56c66ea12e401a75bdf062a332f /src/mesa/drivers/dri/r200/r200_maos_arrays.c
parent4045b6e5b85ee407a21559155c34d16fd63dc79c (diff)
Added support for the 3rd texture coordinate for cubemaps and 3D
textures. progs/demos/cubemap and progs/demos/stex3d seem to work correctly at all tcl_mode settings. x86 / SSE codegen is currently disabled.
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_maos_arrays.c')
-rw-r--r--src/mesa/drivers/dri/r200/r200_maos_arrays.c50
1 files changed, 28 insertions, 22 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/src/mesa/drivers/dri/r200/r200_maos_arrays.c
index 9d1724db7e..301b265396 100644
--- a/src/mesa/drivers/dri/r200/r200_maos_arrays.c
+++ b/src/mesa/drivers/dri/r200/r200_maos_arrays.c
@@ -343,6 +343,8 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs )
GLuint nr = 0;
GLuint vfmt0 = 0, vfmt1 = 0;
GLuint count = VB->Count;
+ GLuint i;
+ GLuint re_cntl;
if (1) {
if (!rmesa->tcl.obj.buf)
@@ -422,30 +424,34 @@ void r200EmitArrays( GLcontext *ctx, GLuint inputs )
/* vtx = (rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT] & */
/* ~(R200_TCL_VTX_Q0|R200_TCL_VTX_Q1)); */
- if (inputs & VERT_BIT_TEX0) {
- if (!rmesa->tcl.tex[0].buf)
- emit_vector( ctx,
- &(rmesa->tcl.tex[0]),
- (char *)VB->TexCoordPtr[0]->data,
- VB->TexCoordPtr[0]->size,
- VB->TexCoordPtr[0]->stride,
- count );
-
- vfmt1 |= VB->TexCoordPtr[0]->size << R200_VTX_TEX0_COMP_CNT_SHIFT;
- component[nr++] = &rmesa->tcl.tex[0];
+ re_cntl = rmesa->hw.set.cmd[SET_RE_CNTL] & ~(R200_VTX_STQ0_D3D |
+ R200_VTX_STQ1_D3D |
+ R200_VTX_STQ2_D3D |
+ R200_VTX_STQ3_D3D |
+ R200_VTX_STQ4_D3D |
+ R200_VTX_STQ5_D3D );
+ for ( i = 0 ; i < ctx->Const.MaxTextureUnits ; i++ ) {
+ if (inputs & (VERT_BIT_TEX0 << i)) {
+ if (!rmesa->tcl.tex[i].buf)
+ emit_vector( ctx,
+ &(rmesa->tcl.tex[i]),
+ (char *)VB->TexCoordPtr[i]->data,
+ VB->TexCoordPtr[i]->size,
+ VB->TexCoordPtr[i]->stride,
+ count );
+
+ if ( ctx->Texture.Unit[i]._ReallyEnabled == TEXTURE_CUBE_BIT ) {
+ re_cntl |= R200_VTX_STQ0_D3D << (2 * i);
+ }
+
+ vfmt1 |= VB->TexCoordPtr[i]->size << (i * 3);
+ component[nr++] = &rmesa->tcl.tex[i];
+ }
}
- if (inputs & VERT_BIT_TEX1) {
- if (!rmesa->tcl.tex[1].buf)
- emit_vector( ctx,
- &(rmesa->tcl.tex[1]),
- (char *)VB->TexCoordPtr[1]->data,
- VB->TexCoordPtr[1]->size,
- VB->TexCoordPtr[1]->stride,
- count );
-
- vfmt1 |= VB->TexCoordPtr[1]->size << R200_VTX_TEX1_COMP_CNT_SHIFT;
- component[nr++] = &rmesa->tcl.tex[1];
+ if ( re_cntl != rmesa->hw.set.cmd[SET_RE_CNTL] ) {
+ R200_STATECHANGE( rmesa, set );
+ rmesa->hw.set.cmd[SET_RE_CNTL] = re_cntl;
}
if (vfmt0 != rmesa->hw.vtx.cmd[VTX_VTXFMT_0] ||