From: Xiang, Haihao Date: Tue, 11 Sep 2007 08:49:02 +0000 (+0800) Subject: i965: limit on LOD Bias, fix#11987 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=241b7bc0a3e6277e15bb45887ad5533ffe692428;p=mesa.git i965: limit on LOD Bias, fix#11987 --- 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 81fc9ef2f0c..8afefdd4353 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -178,7 +178,7 @@ static void brw_update_sampler_state( struct gl_texture_unit *texUnit, /* Set LOD bias: */ - sampler->ss0.lod_bias = S_FIXED(texUnit->LodBias + texObj->LodBias, 6); + sampler->ss0.lod_bias = S_FIXED(CLAMP(texUnit->LodBias + texObj->LodBias, -16, 15), 6); sampler->ss0.lod_preclamp = 1; /* OpenGL mode */ sampler->ss0.default_color_mode = 0; /* OpenGL/DX10 mode */