void sisUpdateTextureState( struct gl_context *ctx ) { sisContextPtr smesa = SIS_CONTEXT( ctx ); int i; __GLSiSHardware *current = &smesa->current; #if 1 /* TODO : if unmark these, error in multitexture */ /* XXX */ for (i = 0; i < SIS_MAX_TEXTURES; i++) smesa->TexStates[i] |= (NEW_TEXTURING | NEW_TEXTURE_ENV); #endif updateTextureUnit( ctx, 0 ); updateTextureUnit( ctx, 1 ); /* XXX Issues with the 2nd unit but not the first being enabled? */ if ( ctx->Texture.Unit[0]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT) || ctx->Texture.Unit[1]._ReallyEnabled & (TEXTURE_1D_BIT | TEXTURE_2D_BIT) ) { current->hwCapEnable |= MASK_TextureEnable; current->hwCapEnable &= ~MASK_TextureNumUsed; if (ctx->Texture.Unit[1]._ReallyEnabled) current->hwCapEnable |= 0x00002000; else current->hwCapEnable |= 0x00001000; } else { current->hwCapEnable &= ~MASK_TextureEnable; } }
void r128UpdateTextureState( GLcontext *ctx ) { r128ContextPtr rmesa = R128_CONTEXT(ctx); GLboolean ok; /* This works around a quirk with the R128 hardware. If only OpenGL * TEXTURE1 is enabled, then the hardware TEXTURE0 must be used. The * hardware TEXTURE1 can ONLY be used when hardware TEXTURE0 is also used. */ rmesa->tmu_source[0] = 0; rmesa->tmu_source[1] = 1; if ((ctx->Texture._EnabledUnits & 0x03) == 0x02) { /* only texture 1 enabled */ rmesa->tmu_source[0] = 1; rmesa->tmu_source[1] = 0; } ok = (updateTextureUnit( ctx, 0 ) && updateTextureUnit( ctx, 1 )); FALLBACK( rmesa, R128_FALLBACK_TEXTURE, !ok ); }