Volume textures don't have a concept of "layers"
v1: set last_layer to zero for 3D textures (Axel Davy)
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5808>
templ.format = resource->format;
templ.u.tex.first_layer = 0;
templ.u.tex.last_layer = resource->target == PIPE_TEXTURE_3D ?
- resource->depth0 - 1 : resource->array_size - 1;
+ 0 : resource->array_size - 1;
templ.u.tex.first_level = 0;
templ.u.tex.last_level = resource->last_level;
templ.swizzle_r = swizzle[0];