Module: Mesa
Branch: master
Commit: 2ed24b2c317a38627bee8704064c7c362811eda0
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=2ed24b2c317a38627bee8704064c7c362811eda0

Author: Stéphane Marchesin <marc...@chromium.org>
Date:   Sat Nov 22 00:09:24 2014 -0800

i915g: Fix maxlod computation.

Signed-off-by: Stéphane Marchesin <marc...@chromium.org>

---

 src/gallium/drivers/i915/i915_state_sampler.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_state_sampler.c 
b/src/gallium/drivers/i915/i915_state_sampler.c
index eb62479..c874361 100644
--- a/src/gallium/drivers/i915/i915_state_sampler.c
+++ b/src/gallium/drivers/i915/i915_state_sampler.c
@@ -304,11 +304,11 @@ static void update_map(struct i915_context *i915,
 {
    const struct pipe_resource *pt = &tex->b.b;
    uint width = pt->width0, height = pt->height0, depth = pt->depth0;
-   const uint num_levels = pt->last_level;
-   uint format, pitch;
-   unsigned max_lod = num_levels * 4;
    int first_level = view->u.tex.first_level;
+   const uint num_levels = pt->last_level - first_level;
+   unsigned max_lod = num_levels * 4;
    bool is_npot = (!util_is_power_of_two(pt->width0) || 
!util_is_power_of_two(pt->height0)); 
+   uint format, pitch;
 
    /*
     * This is a bit messy. i915 doesn't support NPOT with mipmaps, but we can

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to