From: Eric Anholt Date: Thu, 24 Apr 2014 00:19:41 +0000 (-0700) Subject: i915: Drop use of _ReallyEnabled. X-Git-Tag: upstream/10.3~2325 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=07b94c99a73481d08b285474db22106de1ca89fd;p=platform%2Fupstream%2Fmesa.git i915: Drop use of _ReallyEnabled. We can just look at _Current's target. Reviewed-by: Matt Turner Reviewed-by: Kenneth Graunke --- diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index 7209655..58d3356 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -331,30 +331,30 @@ i830UpdateTextureState(struct intel_context *intel) GLuint i; for (i = 0; i < I830_TEX_UNITS && ok; i++) { - switch (intel->ctx.Texture.Unit[i]._ReallyEnabled) { - case TEXTURE_1D_BIT: - case TEXTURE_2D_BIT: - case TEXTURE_CUBE_BIT: - ok = i830_update_tex_unit(intel, i, TEXCOORDS_ARE_NORMAL); - break; - case TEXTURE_RECT_BIT: - ok = i830_update_tex_unit(intel, i, TEXCOORDS_ARE_IN_TEXELUNITS); - break; - case 0:{ - struct i830_context *i830 = i830_context(&intel->ctx); - if (i830->state.active & I830_UPLOAD_TEX(i)) + if (intel->ctx.Texture.Unit[i]._Current) { + switch (intel->ctx.Texture.Unit[i]._Current->Target) { + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + case GL_TEXTURE_CUBE_MAP: + ok = i830_update_tex_unit(intel, i, TEXCOORDS_ARE_NORMAL); + break; + case GL_TEXTURE_RECTANGLE: + ok = i830_update_tex_unit(intel, i, TEXCOORDS_ARE_IN_TEXELUNITS); + break; + case GL_TEXTURE_3D: + default: + ok = false; + break; + } + } else { + struct i830_context *i830 = i830_context(&intel->ctx); + if (i830->state.active & I830_UPLOAD_TEX(i)) I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(i), false); - if (i830->state.tex_buffer[i] != NULL) { - drm_intel_bo_unreference(i830->state.tex_buffer[i]); - i830->state.tex_buffer[i] = NULL; - } - break; - } - case TEXTURE_3D_BIT: - default: - ok = false; - break; + if (i830->state.tex_buffer[i] != NULL) { + drm_intel_bo_unreference(i830->state.tex_buffer[i]); + i830->state.tex_buffer[i] = NULL; + } } } diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 70530e5..000ab6e 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -417,31 +417,30 @@ i915UpdateTextureState(struct intel_context *intel) GLuint i; for (i = 0; i < I915_TEX_UNITS && ok; i++) { - switch (intel->ctx.Texture.Unit[i]._ReallyEnabled) { - case TEXTURE_1D_BIT: - case TEXTURE_2D_BIT: - case TEXTURE_CUBE_BIT: - case TEXTURE_3D_BIT: - ok = i915_update_tex_unit(intel, i, SS3_NORMALIZED_COORDS); - break; - case TEXTURE_RECT_BIT: - ok = i915_update_tex_unit(intel, i, 0); - break; - case 0:{ - struct i915_context *i915 = i915_context(&intel->ctx); - if (i915->state.active & I915_UPLOAD_TEX(i)) - I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(i), false); - - if (i915->state.tex_buffer[i] != NULL) { - drm_intel_bo_unreference(i915->state.tex_buffer[i]); - i915->state.tex_buffer[i] = NULL; - } - + if (intel->ctx.Texture.Unit[i]._Current) { + switch (intel->ctx.Texture.Unit[i]._Current->Target) { + case GL_TEXTURE_1D: + case GL_TEXTURE_2D: + case GL_TEXTURE_CUBE_MAP: + case GL_TEXTURE_3D: + ok = i915_update_tex_unit(intel, i, SS3_NORMALIZED_COORDS); + break; + case GL_TEXTURE_RECTANGLE: + ok = i915_update_tex_unit(intel, i, 0); + break; + default: + ok = false; break; } - default: - ok = false; - break; + } else { + struct i915_context *i915 = i915_context(&intel->ctx); + if (i915->state.active & I915_UPLOAD_TEX(i)) + I915_ACTIVESTATE(i915, I915_UPLOAD_TEX(i), false); + + if (i915->state.tex_buffer[i] != NULL) { + drm_intel_bo_unreference(i915->state.tex_buffer[i]); + i915->state.tex_buffer[i] = NULL; + } } }