aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_atom_texture.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_atom_texture.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_texture.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_atom_texture.c b/mesalib/src/mesa/state_tracker/st_atom_texture.c
index ed9a44429..19072ae2f 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_texture.c
@@ -223,7 +223,7 @@ static unsigned last_level(struct st_texture_object *stObj)
static unsigned last_layer(struct st_texture_object *stObj)
{
- if (stObj->base.Immutable)
+ if (stObj->base.Immutable && stObj->pt->array_size > 1)
return MIN2(stObj->base.MinLayer + stObj->base.NumLayers - 1,
stObj->pt->array_size - 1);
return stObj->pt->array_size - 1;