Mesa (staging/20.1): nine: fix incorrect calculation of layer count for 3D textures

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jul 29 11:33:13 UTC 2020


Module: Mesa
Branch: staging/20.1
Commit: 55d4d57d365867dbb8892d4f068f6b9f2e23c1b0
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=55d4d57d365867dbb8892d4f068f6b9f2e23c1b0

Author: Yevhenii Kolesnikov <yevhenii.kolesnikov at globallogic.com>
Date:   Fri Jun 26 13:40:43 2020 +0300

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 at lists.freedesktop.org>
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov at globallogic.com>
Reviewed-by: Axel Davy <davyaxel0 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5808>
(cherry picked from commit 845a50ee2525c6cc4e6160eda1826c0670e0daaf)

---

 .pick_status.json                              | 2 +-
 src/gallium/state_trackers/nine/basetexture9.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 60441e04af2..2c8d895d9d5 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -202,7 +202,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
     },
diff --git a/src/gallium/state_trackers/nine/basetexture9.c b/src/gallium/state_trackers/nine/basetexture9.c
index c59bda5d295..f9772fd45f6 100644
--- a/src/gallium/state_trackers/nine/basetexture9.c
+++ b/src/gallium/state_trackers/nine/basetexture9.c
@@ -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];



More information about the mesa-commit mailing list