diff options
author | Brian Paul <[email protected]> | 2008-06-17 10:28:00 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2008-06-17 10:28:00 -0600 |
commit | 93deede760e5a1309f1b948d91eae3d27f59ed97 (patch) | |
tree | f1c615f9e5758b2ee59ea1438123ff11b322209f /src/mesa/state_tracker | |
parent | 3ccbde627edb420071b08a830dd58ed5daf82ffa (diff) |
gallium: check if sampler->max_lod < sampler->min_lod
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_atom_sampler.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index 10283d31a19..9abd0b3531d 100644 --- a/src/mesa/state_tracker/st_atom_sampler.c +++ b/src/mesa/state_tracker/st_atom_sampler.c @@ -153,6 +153,15 @@ update_samplers(struct st_context *st) sampler->min_lod = MAX2(0.0f, texobj->MinLod); sampler->max_lod = MIN2(texobj->MaxLevel - texobj->BaseLevel, texobj->MaxLod); + if (sampler->max_lod < sampler->min_lod) { + /* The GL spec doesn't seem to specify what to do in this case. + * Swap the values. + */ + float tmp = sampler->max_lod; + sampler->max_lod = sampler->min_lod; + sampler->min_lod = tmp; + assert(sampler->min_lod <= sampler->max_lod); + } sampler->border_color[0] = texobj->BorderColor[RCOMP]; sampler->border_color[1] = texobj->BorderColor[GCOMP]; |