nine: fix incorrect calculation of layer count for 3D textures

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>
(cherry picked from commit 845a50ee25)
This commit is contained in:
Yevhenii Kolesnikov 2020-06-26 13:40:43 +03:00 committed by Eric Engestrom
parent 33d59a3609
commit 370bd3ba47
2 changed files with 2 additions and 2 deletions

View file

@ -2722,7 +2722,7 @@
"description": "nine: fix incorrect calculation of layer count for 3D textures",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": null
},

View 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];