From f132413965a49c0554988a88edb8b101de657493 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 26 Mar 2004 18:05:36 +0000 Subject: [PATCH] clamp BiasMin, BiasMax to reasonable values --- progs/demos/lodbias.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/progs/demos/lodbias.c b/progs/demos/lodbias.c index bee06da80b0..a9b5312fd75 100644 --- a/progs/demos/lodbias.c +++ b/progs/demos/lodbias.c @@ -252,6 +252,14 @@ static void Init( void ) printf("LOD bias range: [%g, %g]\n", -maxBias, maxBias); BiasMin = -100 * maxBias; BiasMax = 100 * maxBias; + + /* Since we have (about) 8 mipmap levels, no need to bias beyond + * the range [-1, +8]. + */ + if (BiasMin < -100) + BiasMin = -100; + if (BiasMax > 800) + BiasMax = 800; } -- 2.30.2