diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index 93d4cfc..83bed06 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -96,7 +96,8 @@ static void brw_update_sampler_state( st struct gl_texture_object *texObj, GLuint sdc_gs_offset, struct brw_sampler_state *sampler) -{ +{ + struct intel_texture_object *intelObj = intel_texture_object(texObj); _mesa_memset(sampler, 0, sizeof(*sampler)); switch (texObj->MinFilter) { @@ -192,9 +193,11 @@ #endif */ sampler->ss0.base_level = U_FIXED(0, 1); + /* If Min LOD is greater than Max LOD, Min LOD takes precedence + */ sampler->ss1.max_lod = U_FIXED(MAX2(texObj->MaxLod, 0), 6); - sampler->ss1.min_lod = U_FIXED(MAX2(texObj->MinLod, 0), 6); - + sampler->ss1.min_lod = U_FIXED(MIN2(MAX2(texObj->MinLod, 0), MIN2(intelObj->lastLevel, 13)), 6); + sampler->ss2.default_color_pointer = sdc_gs_offset >> 5; }