summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-01-05 14:04:08 -0800
committerEric Anholt <[email protected]>2011-01-05 14:45:16 -0800
commit8f0005bfd5dad4a338c23b9650baa3f5a1b0b06f (patch)
tree4a77995c56f88c337e9e578313e86216f2e78835 /src
parente2ee0c55d360f6b0bb8cd140b6dd6c0f46998ab1 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_validate.c9
1 files 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;