diff options
author | Roland Scheidegger <rscheidegger@gmx.ch> | 2005-10-05 11:42:44 +0000 |
---|---|---|
committer | Roland Scheidegger <rscheidegger@gmx.ch> | 2005-10-05 11:42:44 +0000 |
commit | a3c8de2fa7fba22647e5b3e8cfb05c85d1a5a980 (patch) | |
tree | 2661e1f4301fa24c41a55e29d2be2a28cc42a31a /src/mesa/drivers/dri/radeon/radeon_maos_verts.c | |
parent | 06f606ce5761e673fca3f6b1f7dd40dace8a9906 (diff) |
Remove the tcl fallback for texture rectangle (by manipulating the texture matrix) (tested with texrect). Enable texgen for r/q coordinates (tested with projtex). Fix projected texcoords when an app uses TexCoord3x and the texture matrix to save on vertex size (fixes ut2k3 shadow projectors in tcl mode). From texgenmix, all cases with all texgen or no texgen work, with the exception of texgen enabled for s/t only, this one works with hw tcl, but not with vtxfmt (suspect issues with vtxfmt), the mixed cases do not work (which is expected, and should be rare in practice), with the exception of the first one which hits a tcl fallback.
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_maos_verts.c')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_maos_verts.c | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c index 8cb08a812a..f3221e60d8 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c @@ -243,7 +243,7 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) init_tcl_verts(); firsttime = 0; } - + if (1) { req |= RADEON_CP_VC_FRMT_Z; if (VB->ObjPtr->size == 4) { @@ -254,7 +254,7 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) if (inputs & VERT_BIT_NORMAL) { req |= RADEON_CP_VC_FRMT_N0; } - + if (inputs & VERT_BIT_COLOR0) { req |= RADEON_CP_VC_FRMT_PKCOLOR; } @@ -265,20 +265,38 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) if (inputs & VERT_BIT_TEX0) { req |= RADEON_CP_VC_FRMT_ST0; - - if (VB->TexCoordPtr[0]->size == 4) { + /* assume we need the 3rd coord if texgen is active for r/q OR at least 3 + coords are submitted. This may not be 100% correct */ + if (VB->TexCoordPtr[0]->size >= 3) { req |= RADEON_CP_VC_FRMT_Q0; vtx |= RADEON_TCL_VTX_Q0; } + if ( (ctx->Texture.Unit[0].TexGenEnabled & (R_BIT | Q_BIT)) ) + vtx |= RADEON_TCL_VTX_Q0; + else if (VB->TexCoordPtr[0]->size >= 3) { + GLuint swaptexmatcol = (VB->TexCoordPtr[0]->size - 3); + if ((rmesa->NeedTexMatrix & 1) && + (swaptexmatcol != (rmesa->TexMatColSwap & 1))) + radeonUploadTexMatrix( rmesa, rmesa->tmpmat[0].m, 0, swaptexmatcol ) ; + } } + if (inputs & VERT_BIT_TEX1) { req |= RADEON_CP_VC_FRMT_ST1; - if (VB->TexCoordPtr[1]->size == 4) { + if (VB->TexCoordPtr[1]->size >= 3) { req |= RADEON_CP_VC_FRMT_Q1; vtx |= RADEON_TCL_VTX_Q1; } + if ( (ctx->Texture.Unit[1].TexGenEnabled & (R_BIT | Q_BIT)) ) + vtx |= RADEON_TCL_VTX_Q1; + else if (VB->TexCoordPtr[1]->size >= 3) { + GLuint swaptexmatcol = (VB->TexCoordPtr[1]->size - 3); + if (((rmesa->NeedTexMatrix >> 1) & 1) && + (swaptexmatcol != ((rmesa->TexMatColSwap >> 1) & 1))) + radeonUploadTexMatrix( rmesa, rmesa->tmpmat[1].m, 1, swaptexmatcol ) ; + } } if (vtx != rmesa->hw.tcl.cmd[TCL_OUTPUT_VTXFMT]) { |