diff options
author | Brian Paul <[email protected]> | 2004-12-16 02:14:19 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-12-16 02:14:19 +0000 |
commit | c75900e7a2ad17ecf832e7e9aa41e714a1a78f2a (patch) | |
tree | 1782a2bfe2ef600ef105ead722968a1242c1dc50 /src/mesa/swrast | |
parent | d16aa9859c9f5a3a7bf74a13dbbdd20688d3ad84 (diff) |
don't divide texcoords by q if using a fragment program
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_pointtemp.h | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h index c564f2ee8ea..25a6a31772c 100644 --- a/src/mesa/swrast/s_pointtemp.h +++ b/src/mesa/swrast/s_pointtemp.h @@ -120,14 +120,25 @@ NAME ( GLcontext *ctx, const SWvertex *vert ) #endif #if FLAGS & TEXTURE span->arrayMask |= SPAN_TEXTURE; - for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { - if (ctx->Texture._EnabledCoordUnits & (1 << u)) { - const GLfloat q = vert->texcoord[u][3]; - const GLfloat invQ = (q == 0.0F || q == 1.0F) ? 1.0F : (1.0F / q); - texcoord[u][0] = vert->texcoord[u][0] * invQ; - texcoord[u][1] = vert->texcoord[u][1] * invQ; - texcoord[u][2] = vert->texcoord[u][2] * invQ; - texcoord[u][3] = q; + if (ctx->FragmentProgram._Enabled) { + /* Don't divide texture s,t,r by q (use TXP to do that) */ + for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { + if (ctx->Texture._EnabledCoordUnits & (1 << u)) { + COPY_4V(texcoord[u], vert->texcoord[u]); + } + } + } + else { + /* Divide texture s,t,r by q here */ + for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { + if (ctx->Texture._EnabledCoordUnits & (1 << u)) { + const GLfloat q = vert->texcoord[u][3]; + const GLfloat invQ = (q == 0.0F || q == 1.0F) ? 1.0F : (1.0F / q); + texcoord[u][0] = vert->texcoord[u][0] * invQ; + texcoord[u][1] = vert->texcoord[u][1] * invQ; + texcoord[u][2] = vert->texcoord[u][2] * invQ; + texcoord[u][3] = q; + } } } /* need these for fragment programs */ |