i965: Take the upper limitation on LOD into account.
authorXiang, Haihao <haihao.xiang@intel.com>
Fri, 31 Aug 2007 04:51:36 +0000 (12:51 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Fri, 31 Aug 2007 04:51:36 +0000 (12:51 +0800)
src/mesa/drivers/dri/i965/brw_wm_sampler_state.c

index 83a4b02e483df812bbe604bb07d2aeb7c4c6ae2c..81fc9ef2f0ca109f0f9549bb91b16cd70090434a 100644 (file)
@@ -192,8 +192,8 @@ static void brw_update_sampler_state( struct gl_texture_unit *texUnit,
     */
    sampler->ss0.base_level = U_FIXED(0, 1);
 
-   sampler->ss1.max_lod = U_FIXED(MAX2(texObj->MaxLod, 0), 6);
-   sampler->ss1.min_lod = U_FIXED(MAX2(texObj->MinLod, 0), 6);
+   sampler->ss1.max_lod = U_FIXED(MIN2(MAX2(texObj->MaxLod, 0), 13), 6);
+   sampler->ss1.min_lod = U_FIXED(MIN2(MAX2(texObj->MinLod, 0), 13), 6);
    
    sampler->ss2.default_color_pointer = sdc_gs_offset >> 5;
 }