For 3d textures, NumLayers is set to 1, which is not what we want. This
fixes the newly added gl-layer-render-storage test (which constructs
immutable 3d textures). Fixes regression introduced in
d82bd7eb060.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84145
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
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;
}
/* Adjust for texture views */
- if (strb->is_rtt) {
+ if (strb->is_rtt && resource->array_size > 1 &&
+ strb->Base.TexImage->TexObject->Immutable) {
struct gl_texture_object *tex = strb->Base.TexImage->TexObject;
first_layer += tex->MinLayer;
if (!strb->rtt_layered)
if (stObj->base.Immutable) {
level += stObj->base.MinLevel;
z += stObj->base.MinLayer;
- d = MIN2(d, stObj->base.NumLayers);
+ if (stObj->pt->array_size > 1)
+ d = MIN2(d, stObj->base.NumLayers);
}
z += stImage->base.Face;