mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 17:50:11 +01:00
st/mesa: Clamp min_lod to the max miplevel as well.
Otherwise min_lod can potentially be larger than the clamped max_lod. The code that follows will swap min_lod and max_lod in that case, resulting in a max_lod larger than MAX_LEVEL. Signed-off-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
2ecb73379e
commit
79db70bd8a
1 changed files with 3 additions and 1 deletions
|
|
@ -166,7 +166,9 @@ update_samplers(struct st_context *st)
|
|||
sampler->lod_bias = st->ctx->Texture.Unit[texUnit].LodBias +
|
||||
texobj->LodBias;
|
||||
|
||||
sampler->min_lod = MAX2(0.0f, texobj->MinLod);
|
||||
sampler->min_lod = CLAMP(texobj->MinLod,
|
||||
0.0f,
|
||||
(GLfloat) texobj->MaxLevel - texobj->BaseLevel);
|
||||
sampler->max_lod = MIN2((GLfloat) texobj->MaxLevel - texobj->BaseLevel,
|
||||
texobj->MaxLod);
|
||||
if (sampler->max_lod < sampler->min_lod) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue