{
GLuint i;
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) {
- COPY_4V(span->tex[i], ctx->Current.RasterTexCoords[i]);
+ const GLfloat *tc = ctx->Current.RasterTexCoords[i];
+ if (tc[3] > 0.0F) {
+ /* use (s/q, t/q, r/q, 1) */
+ span->tex[i][0] = tc[0] / tc[3];
+ span->tex[i][1] = tc[1] / tc[3];
+ span->tex[i][2] = tc[2] / tc[3];
+ span->tex[i][3] = 1.0;
+ }
+ else {
+ ASSIGN_4V(span->tex[i], 0.0F, 0.0F, 0.0F, 1.0F);
+ }
ASSIGN_4V(span->texStepX[i], 0.0F, 0.0F, 0.0F, 0.0F);
ASSIGN_4V(span->texStepY[i], 0.0F, 0.0F, 0.0F, 0.0F);
}
if (obj) {
const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
needLambda = (obj->MinFilter != obj->MagFilter)
- || ctx->FragmentProgram.Enabled;
+ || ctx->FragmentProgram._Enabled;
texW = img->WidthScale;
texH = img->HeightScale;
}
GLfloat r = span->tex[u][2];
GLfloat q = span->tex[u][3];
GLuint i;
- if (ctx->FragmentProgram.Enabled) {
+ if (ctx->FragmentProgram._Enabled) {
/* do perspective correction but don't divide s, t, r by q */
const GLfloat dwdx = span->dwdx;
GLfloat w = span->w;
GLfloat r = span->tex[u][2];
GLfloat q = span->tex[u][3];
GLuint i;
- if (ctx->FragmentProgram.Enabled) {
+ if (ctx->FragmentProgram._Enabled) {
/* do perspective correction but don't divide s, t, r by q */
const GLfloat dwdx = span->dwdx;
GLfloat w = span->w;
if (obj) {
const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
needLambda = (obj->MinFilter != obj->MagFilter)
- || ctx->FragmentProgram.Enabled;
+ || ctx->FragmentProgram._Enabled;
texW = (GLfloat) img->WidthScale;
texH = (GLfloat) img->HeightScale;
}
GLfloat r = span->tex[0][2];
GLfloat q = span->tex[0][3];
GLuint i;
- if (ctx->FragmentProgram.Enabled) {
+ if (ctx->FragmentProgram._Enabled) {
/* do perspective correction but don't divide s, t, r by q */
const GLfloat dwdx = span->dwdx;
GLfloat w = span->w;
}
else {
/* tex.c */
- GLfloat w = span->w;
- GLfloat dwdx = span->dwdx;
- assert(span->interpMask & SPAN_W);
for (i = 0; i < span->end; i++) {
const GLfloat invQ = (q == 0.0F) ? 1.0F : (1.0F / q);
lambda[i] = _swrast_compute_lambda(dsdx, dsdy, dtdx, dtdy,
t += dtdx;
r += drdx;
q += dqdx;
- w += dwdx;
}
}
span->arrayMask |= SPAN_LAMBDA;
GLfloat r = span->tex[0][2];
GLfloat q = span->tex[0][3];
GLuint i;
- if (ctx->FragmentProgram.Enabled) {
+ if (ctx->FragmentProgram._Enabled) {
/* do perspective correction but don't divide s, t, r by q */
const GLfloat dwdx = span->dwdx;
GLfloat w = span->w;
}
/* Fragment program */
- if (ctx->FragmentProgram.Enabled) {
+ if (ctx->FragmentProgram._Enabled) {
/* Now we may need to interpolate the colors and texcoords */
if ((span->interpMask & SPAN_RGBA) &&
(span->arrayMask & SPAN_RGBA) == 0) {
span->primitive == GL_POLYGON || span->primitive == GL_BITMAP);
ASSERT(span->end <= MAX_WIDTH);
ASSERT((span->interpMask & span->arrayMask) == 0);
- ASSERT(ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram.Enabled);
+ ASSERT(ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram._Enabled);
/*
printf("%s() interp 0x%x array 0x%x\n", __FUNCTION__, span->interpMask, span->arrayMask);
/* Texturing without alpha is done after depth-testing which
* gives a potential speed-up.
*/
- if (ctx->FragmentProgram.Enabled)
+ if (ctx->FragmentProgram._Enabled)
_swrast_exec_fragment_program( ctx, span );
else
_swrast_texture_span( ctx, span );
interpolate_specular(ctx, span);
}
- if (ctx->FragmentProgram.Enabled)
+ if (ctx->FragmentProgram._Enabled)
_swrast_exec_fragment_program( ctx, span );
else
_swrast_texture_span( ctx, span );