From 8f0005bfd5dad4a338c23b9650baa3f5a1b0b06f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 5 Jan 2011 14:04:08 -0800 Subject: [PATCH] intel: Clean up redundant setup of firstLevel. It's always BaseLevel (since TEXTURE_RECTANGLE's baselevel can't be changed from 0), except for 8xx minlod hilarity. --- src/mesa/drivers/dri/intel/intel_tex_validate.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index 0df2b119fc6..1fc7cd124d4 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -24,7 +24,7 @@ intel_calculate_first_last_level(struct intel_context *intel, * and having firstLevel and lastLevel as signed prevents the need for * extra sign checks. */ - int firstLevel; + int firstLevel = tObj->BaseLevel; int lastLevel; /* Yes, this looks overly complicated, but it's all needed. @@ -37,11 +37,11 @@ intel_calculate_first_last_level(struct intel_context *intel, if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) { /* GL_NEAREST and GL_LINEAR only care about GL_TEXTURE_BASE_LEVEL. */ - firstLevel = lastLevel = tObj->BaseLevel; + lastLevel = tObj->BaseLevel; } else { if (intel->gen == 2) { - firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5); + firstLevel += (GLint) (tObj->MinLod + 0.5); firstLevel = MAX2(firstLevel, tObj->BaseLevel); firstLevel = MIN2(firstLevel, tObj->BaseLevel + baseImage->MaxLog2); lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5); @@ -55,7 +55,6 @@ intel_calculate_first_last_level(struct intel_context *intel, * since it means a bunch of blitting around and probably no memory * savings (since we have to keep the other levels around anyway). */ - firstLevel = tObj->BaseLevel; lastLevel = MIN2(tObj->BaseLevel + baseImage->MaxLog2, tObj->MaxLevel); /* need at least one level */ @@ -64,7 +63,7 @@ intel_calculate_first_last_level(struct intel_context *intel, } break; case GL_TEXTURE_RECTANGLE_NV: - firstLevel = lastLevel = 0; + lastLevel = 0; break; default: return; -- 2.30.2