mesa: Replace use of _ReallyEnabled as a boolean with use of _Current.
I'm probably not the only person that has tried to kill _ReallyEnabled. This does the mechanical part of the work, and cleans _ReallyEnabled from i965. I think that using _Current makes texture management clearer: You can't have multiple targets in use in the same texture image unit at the same time, because there's just that one pointer. Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
62d46332d8
commit
ff9c3e8e5a
|
@ -3265,7 +3265,7 @@ _mesa_meta_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat y, GLfloat z,
|
|||
GLfloat s, t, s1, t1;
|
||||
GLuint tw, th;
|
||||
|
||||
if (!ctx->Texture.Unit[i]._ReallyEnabled) {
|
||||
if (!ctx->Texture.Unit[i]._Current) {
|
||||
GLuint j;
|
||||
for (j = 0; j < 4; j++) {
|
||||
verts[j].st[i][0] = 0.0f;
|
||||
|
|
|
@ -446,7 +446,7 @@ i830EmitTextureBlend(struct i830_context *i830)
|
|||
|
||||
if (ctx->Texture._MaxEnabledTexImageUnit != -1) {
|
||||
for (unit = 0; unit < ctx->Texture._MaxEnabledTexImageUnit; unit++)
|
||||
if (ctx->Texture.Unit[unit]._ReallyEnabled)
|
||||
if (ctx->Texture.Unit[unit]._Current)
|
||||
emit_texblend(i830, unit, blendunit++,
|
||||
unit == ctx->Texture._MaxEnabledTexImageUnit);
|
||||
} else {
|
||||
|
|
|
@ -317,7 +317,7 @@ brw_predraw_resolve_buffers(struct brw_context *brw)
|
|||
/* Resolve depth buffer and render cache of each enabled texture. */
|
||||
int maxEnabledUnit = ctx->Texture._MaxEnabledTexImageUnit;
|
||||
for (int i = 0; i <= maxEnabledUnit; i++) {
|
||||
if (!ctx->Texture.Unit[i]._ReallyEnabled)
|
||||
if (!ctx->Texture.Unit[i]._Current)
|
||||
continue;
|
||||
tex_obj = intel_texture_object(ctx->Texture.Unit[i]._Current);
|
||||
if (!tex_obj || !tex_obj->mt)
|
||||
|
|
|
@ -51,7 +51,7 @@ void brw_validate_textures( struct brw_context *brw )
|
|||
for (i = 0; i <= maxEnabledUnit; i++) {
|
||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
|
||||
|
||||
if (texUnit->_ReallyEnabled) {
|
||||
if (texUnit->_Current) {
|
||||
intel_finalize_mipmap_tree(brw, i);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -337,7 +337,7 @@ brw_populate_sampler_prog_key_data(struct gl_context *ctx,
|
|||
int unit_id = prog->SamplerUnits[s];
|
||||
const struct gl_texture_unit *unit = &ctx->Texture.Unit[unit_id];
|
||||
|
||||
if (unit->_ReallyEnabled && unit->_Current->Target != GL_TEXTURE_BUFFER) {
|
||||
if (unit->_Current && unit->_Current->Target != GL_TEXTURE_BUFFER) {
|
||||
const struct gl_texture_object *t = unit->_Current;
|
||||
const struct gl_texture_image *img = t->Image[0][t->BaseLevel];
|
||||
struct gl_sampler_object *sampler = _mesa_get_samplerobj(ctx, unit_id);
|
||||
|
|
|
@ -395,7 +395,7 @@ brw_upload_sampler_state_table(struct brw_context *brw,
|
|||
for (unsigned s = 0; s < sampler_count; s++) {
|
||||
if (SamplersUsed & (1 << s)) {
|
||||
const unsigned unit = prog->SamplerUnits[s];
|
||||
if (ctx->Texture.Unit[unit]._ReallyEnabled)
|
||||
if (ctx->Texture.Unit[unit]._Current)
|
||||
brw_update_sampler_state(brw, unit, s, &samplers[s],
|
||||
*sst_offset, &sdc_offset[s]);
|
||||
}
|
||||
|
|
|
@ -778,7 +778,7 @@ update_stage_texture_surfaces(struct brw_context *brw,
|
|||
const unsigned unit = prog->SamplerUnits[s];
|
||||
|
||||
/* _NEW_TEXTURE */
|
||||
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
|
||||
if (ctx->Texture.Unit[unit]._Current) {
|
||||
brw->vtbl.update_texture_surface(ctx, unit, surf_offset + s, for_gather);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -202,7 +202,7 @@ gen7_upload_sampler_state_table(struct brw_context *brw,
|
|||
for (unsigned s = 0; s < sampler_count; s++) {
|
||||
if (SamplersUsed & (1 << s)) {
|
||||
const unsigned unit = prog->SamplerUnits[s];
|
||||
if (ctx->Texture.Unit[unit]._ReallyEnabled)
|
||||
if (ctx->Texture.Unit[unit]._Current)
|
||||
gen7_update_sampler_state(brw, unit, s, &samplers[s],
|
||||
&sdc_offset[s]);
|
||||
}
|
||||
|
|
|
@ -53,9 +53,9 @@ nv04_context_engine(struct gl_context *ctx)
|
|||
struct nouveau_pushbuf *push = context_push(ctx);
|
||||
struct nouveau_object *fahrenheit;
|
||||
|
||||
if ((ctx->Texture.Unit[0]._ReallyEnabled &&
|
||||
if ((ctx->Texture.Unit[0]._Current &&
|
||||
texunit_needs_combiners(&ctx->Texture.Unit[0])) ||
|
||||
ctx->Texture.Unit[1]._ReallyEnabled ||
|
||||
ctx->Texture.Unit[1]._Current ||
|
||||
ctx->Stencil.Enabled ||
|
||||
!(ctx->Color.ColorMask[0][RCOMP] &&
|
||||
ctx->Color.ColorMask[0][GCOMP] &&
|
||||
|
|
|
@ -257,7 +257,7 @@ nv04_emit_tex_env(struct gl_context *ctx, int emit)
|
|||
struct combiner_state rc_a = {}, rc_c = {};
|
||||
|
||||
/* Compute the new combiner state. */
|
||||
if (ctx->Texture.Unit[i]._ReallyEnabled) {
|
||||
if (ctx->Texture.Unit[i]._Current) {
|
||||
INIT_COMBINER(A, ctx, &rc_a, i);
|
||||
setup_combiner(&rc_a);
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ nv04_emit_tex_obj(struct gl_context *ctx, int emit)
|
|||
struct nouveau_surface *s;
|
||||
uint32_t format = 0xa0, filter = 0x1010;
|
||||
|
||||
if (ctx->Texture.Unit[i]._ReallyEnabled) {
|
||||
if (ctx->Texture.Unit[i]._Current) {
|
||||
struct gl_texture_object *t = ctx->Texture.Unit[i]._Current;
|
||||
struct gl_texture_image *ti = t->Image[0][t->BaseLevel];
|
||||
const struct gl_sampler_object *sa = _mesa_get_samplerobj(ctx, i);
|
||||
|
|
|
@ -304,7 +304,7 @@ nv10_get_general_combiner(struct gl_context *ctx, int i,
|
|||
{
|
||||
struct combiner_state rc_a, rc_c;
|
||||
|
||||
if (ctx->Texture.Unit[i]._ReallyEnabled) {
|
||||
if (ctx->Texture.Unit[i]._Current) {
|
||||
INIT_COMBINER(RGB, ctx, &rc_c, i);
|
||||
|
||||
if (rc_c.mode == GL_DOT3_RGBA)
|
||||
|
|
|
@ -165,7 +165,7 @@ nv10_emit_tex_obj(struct gl_context *ctx, int emit)
|
|||
|
||||
PUSH_RESET(push, BUFCTX_TEX(i));
|
||||
|
||||
if (!ctx->Texture.Unit[i]._ReallyEnabled) {
|
||||
if (!ctx->Texture.Unit[i]._Current) {
|
||||
BEGIN_NV04(push, NV10_3D(TEX_ENABLE(i)), 1);
|
||||
PUSH_DATA (push, 0);
|
||||
return;
|
||||
|
|
|
@ -169,7 +169,7 @@ nv20_emit_tex_obj(struct gl_context *ctx, int emit)
|
|||
|
||||
PUSH_RESET(push, BUFCTX_TEX(i));
|
||||
|
||||
if (!ctx->Texture.Unit[i]._ReallyEnabled) {
|
||||
if (!ctx->Texture.Unit[i]._Current) {
|
||||
BEGIN_NV04(push, NV20_3D(TEX_ENABLE(i)), 1);
|
||||
PUSH_DATA (push, 0);
|
||||
|
||||
|
@ -263,7 +263,7 @@ nv20_emit_tex_shader(struct gl_context *ctx, int emit)
|
|||
int i;
|
||||
|
||||
for (i = 0; i < NV20_TEXTURE_UNITS; i++) {
|
||||
if (!ctx->Texture.Unit[i]._ReallyEnabled)
|
||||
if (!ctx->Texture.Unit[i]._Current)
|
||||
continue;
|
||||
|
||||
tx_shader_op |= NV20_3D_TEX_SHADER_OP_TX0_TEXTURE_2D << 5 * i;
|
||||
|
|
|
@ -2167,7 +2167,7 @@ static void update_texturematrix( struct gl_context *ctx )
|
|||
rmesa->TexMatCompSel = 0;
|
||||
|
||||
for (unit = 0 ; unit < ctx->Const.MaxTextureUnits; unit++) {
|
||||
if (!ctx->Texture.Unit[unit]._ReallyEnabled)
|
||||
if (!ctx->Texture.Unit[unit]._Current)
|
||||
continue;
|
||||
|
||||
if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY) {
|
||||
|
@ -2239,7 +2239,7 @@ static GLboolean r200ValidateBuffers(struct gl_context *ctx)
|
|||
for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; ++i) {
|
||||
radeonTexObj *t;
|
||||
|
||||
if (!ctx->Texture.Unit[i]._ReallyEnabled)
|
||||
if (!ctx->Texture.Unit[i]._Current)
|
||||
continue;
|
||||
|
||||
t = radeon_tex_obj(ctx->Texture.Unit[i]._Current);
|
||||
|
|
|
@ -412,7 +412,7 @@ static GLboolean r200_run_tcl_render( struct gl_context *ctx,
|
|||
}
|
||||
|
||||
for (i = 0 ; i < ctx->Const.MaxTextureUnits; i++) {
|
||||
if (ctx->Texture.Unit[i]._ReallyEnabled) {
|
||||
if (ctx->Texture.Unit[i]._Current) {
|
||||
if (rmesa->TexGenNeedNormals[i]) {
|
||||
map_rev_fixed[2] = VERT_ATTRIB_NORMAL;
|
||||
}
|
||||
|
|
|
@ -296,12 +296,6 @@ static GLboolean r200UpdateTextureEnv( struct gl_context *ctx, int unit, int slo
|
|||
~(R200_TXA_DOT_ALPHA | R200_TXA_SCALE_MASK | R200_TXA_OUTPUT_REG_MASK |
|
||||
R200_TXA_TFACTOR_SEL_MASK | R200_TXA_TFACTOR1_SEL_MASK);
|
||||
|
||||
/* texUnit->_Current can be NULL if and only if the texture unit is
|
||||
* not actually enabled.
|
||||
*/
|
||||
assert( (texUnit->_ReallyEnabled == 0)
|
||||
|| (texUnit->_Current != NULL) );
|
||||
|
||||
if ( R200_DEBUG & RADEON_TEXTURE ) {
|
||||
fprintf( stderr, "%s( %p, %d )\n", __FUNCTION__, (void *)ctx, unit );
|
||||
}
|
||||
|
@ -320,7 +314,7 @@ static GLboolean r200UpdateTextureEnv( struct gl_context *ctx, int unit, int slo
|
|||
(unit << R200_TXA_TFACTOR_SEL_SHIFT) |
|
||||
(replaceargs << R200_TXA_TFACTOR1_SEL_SHIFT);
|
||||
|
||||
if ( !texUnit->_ReallyEnabled ) {
|
||||
if ( !texUnit->_Current ) {
|
||||
assert( unit == 0);
|
||||
color_combine = R200_TXC_ARG_A_ZERO | R200_TXC_ARG_B_ZERO
|
||||
| R200_TXC_ARG_C_DIFFUSE_COLOR | R200_TXC_OP_MADD;
|
||||
|
@ -840,7 +834,7 @@ static GLboolean r200UpdateAllTexEnv( struct gl_context *ctx )
|
|||
|
||||
/* find highest used unit */
|
||||
for ( j = 0; j < R200_MAX_TEXTURE_UNITS; j++) {
|
||||
if (ctx->Texture.Unit[j]._ReallyEnabled) {
|
||||
if (ctx->Texture.Unit[j]._Current) {
|
||||
maxunitused = j;
|
||||
}
|
||||
}
|
||||
|
@ -869,7 +863,7 @@ static GLboolean r200UpdateAllTexEnv( struct gl_context *ctx )
|
|||
|
||||
nextunit[j] = currentnext;
|
||||
|
||||
if (!texUnit->_ReallyEnabled) {
|
||||
if (!texUnit->_Current) {
|
||||
/* the not enabled stages are referenced "indirectly",
|
||||
must not cut off the lower stages */
|
||||
stageref[j] = REF_COLOR | REF_ALPHA;
|
||||
|
@ -953,7 +947,7 @@ static GLboolean r200UpdateAllTexEnv( struct gl_context *ctx )
|
|||
i = 0;
|
||||
while ((i <= maxunitused) && (i >= 0)) {
|
||||
/* only output instruction if the results are referenced */
|
||||
if (ctx->Texture.Unit[i]._ReallyEnabled && stageref[i+1]) {
|
||||
if (ctx->Texture.Unit[i]._Current && stageref[i+1]) {
|
||||
GLuint replaceunit = i;
|
||||
/* try to optimize GL_REPLACE away (only one level deep though) */
|
||||
if ( (ctx->Texture.Unit[i]._CurrentCombine->ModeRGB == GL_REPLACE) &&
|
||||
|
|
|
@ -1935,7 +1935,7 @@ static void update_texturematrix( struct gl_context *ctx )
|
|||
rmesa->TexMatColSwap = 0;
|
||||
|
||||
for (unit = 0 ; unit < ctx->Const.MaxTextureUnits; unit++) {
|
||||
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
|
||||
if (ctx->Texture.Unit[unit]._Current) {
|
||||
GLboolean needMatrix = GL_FALSE;
|
||||
if (ctx->TextureMatrixStack[unit].Top->type != MATRIX_IDENTITY) {
|
||||
needMatrix = GL_TRUE;
|
||||
|
@ -2016,7 +2016,7 @@ static GLboolean r100ValidateBuffers(struct gl_context *ctx)
|
|||
for (i = 0; i < ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits; ++i) {
|
||||
radeonTexObj *t;
|
||||
|
||||
if (!ctx->Texture.Unit[i]._ReallyEnabled)
|
||||
if (!ctx->Texture.Unit[i]._Current)
|
||||
continue;
|
||||
|
||||
t = rmesa->state.texture.unit[i].texobj;
|
||||
|
|
|
@ -211,9 +211,9 @@ CHECK( cube1_mm, (ctx->Texture.Unit[1]._ReallyEnabled & TEXTURE_CUBE_BIT), 2 + 4
|
|||
CHECK( cube2_mm, (ctx->Texture.Unit[2]._ReallyEnabled & TEXTURE_CUBE_BIT), 2 + 4*5 - CUBE_STATE_SIZE )
|
||||
CHECK( fog_add4, ctx->Fog.Enabled, 4 )
|
||||
TCL_CHECK( tcl_add4, GL_TRUE, 4 )
|
||||
TCL_CHECK( tcl_tex0_add4, ctx->Texture.Unit[0]._ReallyEnabled, 4 )
|
||||
TCL_CHECK( tcl_tex1_add4, ctx->Texture.Unit[1]._ReallyEnabled, 4 )
|
||||
TCL_CHECK( tcl_tex2_add4, ctx->Texture.Unit[2]._ReallyEnabled, 4 )
|
||||
TCL_CHECK( tcl_tex0_add4, ctx->Texture.Unit[0]._Current, 4 )
|
||||
TCL_CHECK( tcl_tex1_add4, ctx->Texture.Unit[1]._Current, 4 )
|
||||
TCL_CHECK( tcl_tex2_add4, ctx->Texture.Unit[2]._Current, 4 )
|
||||
TCL_CHECK( tcl_lighting, ctx->Light.Enabled, 0 )
|
||||
TCL_CHECK( tcl_lighting_add4, ctx->Light.Enabled, 4 )
|
||||
TCL_CHECK( tcl_eyespace_or_lighting_add4, ctx->_NeedEyeCoords || ctx->Light.Enabled, 4 )
|
||||
|
|
|
@ -386,7 +386,7 @@ static GLboolean radeon_run_tcl_render( struct gl_context *ctx,
|
|||
}
|
||||
|
||||
for (i = 0 ; i < ctx->Const.MaxTextureUnits; i++) {
|
||||
if (ctx->Texture.Unit[i]._ReallyEnabled) {
|
||||
if (ctx->Texture.Unit[i]._Current) {
|
||||
/* TODO: probably should not emit texture coords when texgen is enabled */
|
||||
if (rmesa->TexGenNeedNormals[i]) {
|
||||
inputs |= VERT_BIT_NORMAL;
|
||||
|
|
|
@ -257,12 +257,6 @@ static GLboolean radeonUpdateTextureEnv( struct gl_context *ctx, int unit )
|
|||
| RADEON_SCALE_1X | RADEON_CLAMP_TX;
|
||||
|
||||
|
||||
/* texUnit->_Current can be NULL if and only if the texture unit is
|
||||
* not actually enabled.
|
||||
*/
|
||||
assert( (texUnit->_ReallyEnabled == 0)
|
||||
|| (texUnit->_Current != NULL) );
|
||||
|
||||
if ( RADEON_DEBUG & RADEON_TEXTURE ) {
|
||||
fprintf( stderr, "%s( %p, %d )\n", __FUNCTION__, (void *)ctx, unit );
|
||||
}
|
||||
|
@ -279,7 +273,7 @@ static GLboolean radeonUpdateTextureEnv( struct gl_context *ctx, int unit )
|
|||
rmesa->state.texture.unit[unit].format = 0;
|
||||
rmesa->state.texture.unit[unit].envMode = 0;
|
||||
|
||||
if ( !texUnit->_ReallyEnabled ) {
|
||||
if ( !texUnit->_Current ) {
|
||||
color_combine = color_combine0;
|
||||
alpha_combine = alpha_combine0;
|
||||
}
|
||||
|
@ -1082,13 +1076,14 @@ static GLboolean radeonUpdateTextureUnit( struct gl_context *ctx, int unit )
|
|||
{
|
||||
r100ContextPtr rmesa = R100_CONTEXT(ctx);
|
||||
|
||||
if (ctx->Texture.Unit[unit]._ReallyEnabled & TEXTURE_3D_BIT) {
|
||||
if (ctx->Texture.Unit[unit]._Current &&
|
||||
ctx->Texture.Unit[unit]._Current->Target == GL_TEXTURE_3D) {
|
||||
disable_tex_obj_state(rmesa, unit);
|
||||
rmesa->state.texture.unit[unit].texobj = NULL;
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
if (!ctx->Texture.Unit[unit]._ReallyEnabled) {
|
||||
if (!ctx->Texture.Unit[unit]._Current) {
|
||||
/* disable the unit */
|
||||
disable_tex_obj_state(rmesa, unit);
|
||||
rmesa->state.texture.unit[unit].texobj = NULL;
|
||||
|
|
|
@ -430,7 +430,7 @@ static GLuint make_state_key( struct gl_context *ctx, struct state_key *key )
|
|||
const struct gl_sampler_object *samp;
|
||||
GLenum format;
|
||||
|
||||
if (!texUnit->_ReallyEnabled || !texUnit->Enabled)
|
||||
if (!texUnit->_Current || !texUnit->Enabled)
|
||||
continue;
|
||||
|
||||
samp = _mesa_get_samplerobj(ctx, i);
|
||||
|
|
|
@ -239,7 +239,7 @@ static void make_state_key( struct gl_context *ctx, struct state_key *key )
|
|||
for (i = 0; i < MAX_TEXTURE_COORD_UNITS; i++) {
|
||||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i];
|
||||
|
||||
if (texUnit->_ReallyEnabled)
|
||||
if (texUnit->_Current)
|
||||
key->unit[i].texunit_really_enabled = 1;
|
||||
|
||||
if (ctx->Point.PointSprite)
|
||||
|
|
|
@ -371,7 +371,7 @@ update_texture_matrices( struct gl_context *ctx )
|
|||
if (_math_matrix_is_dirty(ctx->TextureMatrixStack[u].Top)) {
|
||||
_math_matrix_analyse( ctx->TextureMatrixStack[u].Top );
|
||||
|
||||
if (ctx->Texture.Unit[u]._ReallyEnabled &&
|
||||
if (ctx->Texture.Unit[u]._Current &&
|
||||
ctx->TextureMatrixStack[u].Top->type != MATRIX_IDENTITY)
|
||||
ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(u);
|
||||
}
|
||||
|
|
|
@ -923,7 +923,7 @@ _swrast_print_vertex( struct gl_context *ctx, const SWvertex *v )
|
|||
v->attrib[VARYING_SLOT_POS][3]);
|
||||
|
||||
for (i = 0 ; i < ctx->Const.MaxTextureCoordUnits ; i++)
|
||||
if (ctx->Texture.Unit[i]._ReallyEnabled)
|
||||
if (ctx->Texture.Unit[i]._Current)
|
||||
_mesa_debug(ctx, "texcoord[%d] %f %f %f %f\n", i,
|
||||
v->attrib[VARYING_SLOT_TEX0 + i][0],
|
||||
v->attrib[VARYING_SLOT_TEX0 + i][1],
|
||||
|
|
|
@ -189,7 +189,7 @@ texture_combine( struct gl_context *ctx, GLuint unit,
|
|||
{
|
||||
const GLuint srcUnit = srcRGB - GL_TEXTURE0;
|
||||
ASSERT(srcUnit < ctx->Const.MaxTextureUnits);
|
||||
if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled)
|
||||
if (!ctx->Texture.Unit[srcUnit]._Current)
|
||||
goto end;
|
||||
argRGB[term] = get_texel_array(swrast, srcUnit);
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ texture_combine( struct gl_context *ctx, GLuint unit,
|
|||
{
|
||||
const GLuint srcUnit = srcA - GL_TEXTURE0;
|
||||
ASSERT(srcUnit < ctx->Const.MaxTextureUnits);
|
||||
if (!ctx->Texture.Unit[srcUnit]._ReallyEnabled)
|
||||
if (!ctx->Texture.Unit[srcUnit]._Current)
|
||||
goto end;
|
||||
argA[term] = get_texel_array(swrast, srcUnit);
|
||||
}
|
||||
|
@ -657,7 +657,7 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span )
|
|||
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
|
||||
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
|
||||
|
||||
if (texUnit->_ReallyEnabled &&
|
||||
if (texUnit->_Current &&
|
||||
texUnit->_CurrentCombine->ModeRGB == GL_BUMP_ENVMAP_ATI) {
|
||||
const GLfloat (*texcoords)[4] = (const GLfloat (*)[4])
|
||||
span->array->attribs[VARYING_SLOT_TEX0 + unit];
|
||||
|
@ -723,7 +723,7 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span )
|
|||
*/
|
||||
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
|
||||
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit];
|
||||
if (texUnit->_ReallyEnabled &&
|
||||
if (texUnit->_Current &&
|
||||
texUnit->_CurrentCombine->ModeRGB != GL_BUMP_ENVMAP_ATI) {
|
||||
const GLfloat (*texcoords)[4] = (const GLfloat (*)[4])
|
||||
span->array->attribs[VARYING_SLOT_TEX0 + unit];
|
||||
|
@ -787,7 +787,7 @@ _swrast_texture_span( struct gl_context *ctx, SWspan *span )
|
|||
* We modify the span->color.rgba values.
|
||||
*/
|
||||
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
|
||||
if (ctx->Texture.Unit[unit]._ReallyEnabled)
|
||||
if (ctx->Texture.Unit[unit]._Current)
|
||||
texture_combine(ctx, unit, primary_rgba, swrast->TexelBuffer, span);
|
||||
}
|
||||
|
||||
|
|
|
@ -362,11 +362,10 @@ _swrast_map_textures(struct gl_context *ctx)
|
|||
int unit;
|
||||
|
||||
for (unit = 0; unit <= ctx->Texture._MaxEnabledTexImageUnit; unit++) {
|
||||
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
|
||||
struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
|
||||
struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
|
||||
|
||||
if (texObj)
|
||||
_swrast_map_texture(ctx, texObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -379,10 +378,9 @@ _swrast_unmap_textures(struct gl_context *ctx)
|
|||
{
|
||||
int unit;
|
||||
for (unit = 0; unit <= ctx->Texture._MaxEnabledTexImageUnit; unit++) {
|
||||
if (ctx->Texture.Unit[unit]._ReallyEnabled) {
|
||||
struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
|
||||
struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current;
|
||||
|
||||
if (texObj)
|
||||
_swrast_unmap_texture(ctx, texObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue