summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h
diff options
context:
space:
mode:
authorRoland Scheidegger <rscheidegger@gmx.ch>2005-10-05 11:42:44 +0000
committerRoland Scheidegger <rscheidegger@gmx.ch>2005-10-05 11:42:44 +0000
commita3c8de2fa7fba22647e5b3e8cfb05c85d1a5a980 (patch)
tree2661e1f4301fa24c41a55e29d2be2a28cc42a31a /src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h
parent06f606ce5761e673fca3f6b1f7dd40dace8a9906 (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_vbtmp.h')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h
index c16234a943..8a07a01cb2 100644
--- a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h
+++ b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h
@@ -47,6 +47,7 @@ static void TAG(emit)( GLcontext *ctx,
GLuint tc0_stride, tc1_stride, col_stride, spec_stride, fog_stride;
GLuint tc2_stride, norm_stride;
GLuint fill_tex = 0;
+ GLuint rqcoordsnoswap = 0;
GLuint (*coord)[4];
GLuint coord_stride; /* object coordinates */
GLubyte dummy[4];
@@ -65,9 +66,14 @@ static void TAG(emit)( GLcontext *ctx,
const GLuint t2 = GET_TEXSOURCE(2);
tc2 = (GLuint (*)[4])VB->TexCoordPtr[t2]->data;
tc2_stride = VB->TexCoordPtr[t2]->stride;
- if (DO_PTEX && VB->TexCoordPtr[t2]->size < 4) {
+ if (DO_PTEX && VB->TexCoordPtr[t2]->size < 3) {
+ /* since DO_PTEX is only true when we have 3 or more coords
+ in the first place we don't really need this right? */
fill_tex |= (1<<2);
}
+ else if (DO_PTEX && VB->TexCoordPtr[t2]->size < 4) {
+ rqcoordsnoswap |= (1<<2);
+ }
} else {
tc2 = (GLuint (*)[4])&ctx->Current.Attrib[VERT_ATTRIB_TEX2];
tc2_stride = 0;
@@ -79,9 +85,12 @@ static void TAG(emit)( GLcontext *ctx,
const GLuint t1 = GET_TEXSOURCE(1);
tc1 = (GLuint (*)[4])VB->TexCoordPtr[t1]->data;
tc1_stride = VB->TexCoordPtr[t1]->stride;
- if (DO_PTEX && VB->TexCoordPtr[t1]->size < 4) {
+ if (DO_PTEX && VB->TexCoordPtr[t1]->size < 3) {
fill_tex |= (1<<1);
}
+ else if (DO_PTEX && VB->TexCoordPtr[t1]->size < 4) {
+ rqcoordsnoswap |= (1<<1);
+ }
} else {
tc1 = (GLuint (*)[4])&ctx->Current.Attrib[VERT_ATTRIB_TEX1];
tc1_stride = 0;
@@ -93,9 +102,12 @@ static void TAG(emit)( GLcontext *ctx,
const GLuint t0 = GET_TEXSOURCE(0);
tc0_stride = VB->TexCoordPtr[t0]->stride;
tc0 = (GLuint (*)[4])VB->TexCoordPtr[t0]->data;
- if (DO_PTEX && VB->TexCoordPtr[t0]->size < 4) {
+ if (DO_PTEX && VB->TexCoordPtr[t0]->size < 3) {
fill_tex |= (1<<0);
}
+ else if (DO_PTEX && VB->TexCoordPtr[t0]->size < 4) {
+ rqcoordsnoswap |= (1<<0);
+ }
} else {
tc0 = (GLuint (*)[4])&ctx->Current.Attrib[VERT_ATTRIB_TEX0];
tc0_stride = 0;
@@ -213,6 +225,8 @@ static void TAG(emit)( GLcontext *ctx,
if (DO_PTEX) {
if (fill_tex & (1<<0))
v[2].f = 1.0;
+ else if (rqcoordsnoswap & (1<<0))
+ v[2].ui = tc0[0][2];
else
v[2].ui = tc0[0][3];
if (TCL_DEBUG) fprintf(stderr, "%.2f ", v[2].f);
@@ -229,6 +243,8 @@ static void TAG(emit)( GLcontext *ctx,
if (DO_PTEX) {
if (fill_tex & (1<<1))
v[2].f = 1.0;
+ else if (rqcoordsnoswap & (1<<1))
+ v[2].ui = tc1[0][2];
else
v[2].ui = tc1[0][3];
if (TCL_DEBUG) fprintf(stderr, "%.2f ", v[2].f);
@@ -244,6 +260,8 @@ static void TAG(emit)( GLcontext *ctx,
if (DO_PTEX) {
if (fill_tex & (1<<2))
v[2].f = 1.0;
+ else if (rqcoordsnoswap & (1<<2))
+ v[2].ui = tc2[0][2];
else
v[2].ui = tc2[0][3];
v += 3;