nine: fix incorrect calculation of layer count for 3D textures
authorYevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Fri, 26 Jun 2020 10:40:43 +0000 (13:40 +0300)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Jul 2020 13:48:10 +0000 (13:48 +0000)
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>

src/gallium/frontends/nine/basetexture9.c

index 1f5608149eb1ee5b82356427105fbdc0106c94c7..c9ef17c6c6e0cfc44834150f07d680f1cbdb46da 100644 (file)
@@ -563,7 +563,7 @@ NineBaseTexture9_UpdateSamplerView( struct NineBaseTexture9 *This,
         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];