panfrost: Fix decoding of tiled 3D textures
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Tue, 4 Feb 2020 07:29:50 +0000 (08:29 +0100)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Tue, 4 Feb 2020 14:46:06 +0000 (15:46 +0100)
From decoding cmd streams generated by the blob, the pointers in the
payload don't seem to include those that refer to different depth levels
when the texture is in tiled format.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3692>

src/panfrost/pandecode/decode.c

index 3e832b6e3dbbad3a53efc4955060f1f1d8fd54db..32a6ba42a7a8850cfd88407fd293f5d402569b64 100644 (file)
@@ -2030,8 +2030,8 @@ pandecode_texture(mali_ptr u,
         /* Miptree for each face */
         if (f.type == MALI_TEX_CUBE)
                 bitmap_count *= 6;
-        else if (f.type == MALI_TEX_3D)
-                bitmap_count *= t->depth;
+        else if (f.type == MALI_TEX_3D && f.layout == MALI_TEXTURE_LINEAR)
+                bitmap_count *= (t->depth + 1);
 
         /* Array of textures */
         bitmap_count *= (t->array_size + 1);