From 241b7bc0a3e6277e15bb45887ad5533ffe692428 Mon Sep 17 00:00:00 2001 From: "Xiang, Haihao" Date: Tue, 11 Sep 2007 16:49:02 +0800 Subject: [PATCH] i965: limit on LOD Bias, fix#11987 --- src/mesa/drivers/dri/i965/brw_wm_sampler_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ -- 2.30.2