summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-03-26 18:05:36 +0000
committerBrian Paul <[email protected]>2004-03-26 18:05:36 +0000
commitf132413965a49c0554988a88edb8b101de657493 (patch)
treef0fa9cbeaad2ec5545673c989a6c6c9ea7301eca
parent04800374eef6eb906203e8721a2b8b208af2486f (diff)
clamp BiasMin, BiasMax to reasonable values
-rw-r--r--progs/demos/lodbias.c8
1 files changed, 8 insertions, 0 deletions
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;
}