diff --git a/src/gallium/drivers/i915/i915_state_sampler.c b/src/gallium/drivers/i915/i915_state_sampler.c index c95eab91768..74acbabf45b 100644 --- a/src/gallium/drivers/i915/i915_state_sampler.c +++ b/src/gallium/drivers/i915/i915_state_sampler.c @@ -289,20 +289,8 @@ update_map(struct i915_context *i915, uint32_t unit, int first_level = view->u.tex.first_level; const uint32_t num_levels = pt->last_level - first_level; unsigned max_lod = num_levels * 4; - bool is_npot = (!util_is_power_of_two_or_zero(pt->width0) || - !util_is_power_of_two_or_zero(pt->height0)); uint32_t format, pitch; - /* - * This is a bit messy. i915 doesn't support NPOT with mipmaps, but we can - * still texture from a single level. This is useful to make u_blitter work. - */ - if (is_npot) { - width = u_minify(width, first_level); - height = u_minify(height, first_level); - max_lod = 1; - } - assert(tex); assert(width); assert(height); @@ -323,6 +311,8 @@ update_map(struct i915_context *i915, uint32_t unit, * XXX When min_filter != mag_filter and there's just one mipmap level, * set max_lod = 1 to make sure i915 chooses between min/mag filtering. */ + if (max_lod == 0) + max_lod = 1; /* See note at the top of file */ if (max_lod > (sampler->maxlod >> 2)) @@ -333,10 +323,7 @@ update_map(struct i915_context *i915, uint32_t unit, ((max_lod) << MS4_MAX_LOD_SHIFT) | ((depth - 1) << MS4_VOLUME_DEPTH_SHIFT)); - if (is_npot) - state[2] = i915_texture_offset(tex, first_level, 0); - else - state[2] = 0; + state[2] = 0; } static void