[Mesa-dev] [PATCH 12/13] nvc0: force depth block size dimension to 1 for 3d images

Karol Herbst kherbst at redhat.com
Sun Jul 15 18:15:52 UTC 2018


this fixes cases where layers of a 3d image are used as 2d images inside
load/store operations.

fixes

spec at arb_shader_image_load_store@layer image3D/non-layered binding
shader_image_load_store.non-layered_binding

Signed-off-by: Karol Herbst <kherbst at redhat.com>
---
 src/gallium/drivers/nouveau/nv50/nv50_miptree.c |  7 -------
 src/gallium/drivers/nouveau/nvc0/nvc0_tex.c     | 14 +++++---------
 2 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
index f2e304fde62..a60e4e564de 100644
--- a/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nouveau/nv50/nv50_miptree.c
@@ -48,13 +48,6 @@ nv50_tex_choose_tile_dims_helper(unsigned nx, unsigned ny, unsigned nz,
       if (tile_mode > 0x020)
          tile_mode = 0x020;
 
-   if (nz > 16 && tile_mode < 0x020)
-      return tile_mode | 0x500; /* depth 32 tiles */
-   if (nz > 8) return tile_mode | 0x400; /* depth 16 tiles */
-   if (nz > 4) return tile_mode | 0x300; /* depth 8 tiles */
-   if (nz > 2) return tile_mode | 0x200; /* depth 4 tiles */
-   if (nz > 1) return tile_mode | 0x100; /* depth 2 tiles */
-
    return tile_mode;
 }
 
diff --git a/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c b/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c
index f40600e48aa..7504e8b2d1a 100644
--- a/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c
+++ b/src/gallium/drivers/nouveau/nvc0/nvc0_tex.c
@@ -169,6 +169,9 @@ gm107_create_texture_view(struct pipe_context *pipe,
       address += view->pipe.u.tex.first_layer * mt->layer_stride;
       depth = view->pipe.u.tex.last_layer - view->pipe.u.tex.first_layer + 1;
    }
+   else if (templ->u.tex.first_layer > 0) {
+      address += nvc0_mt_zslice_offset(mt, 0, templ->u.tex.first_layer);
+   }
    tic[1]  = address;
    tic[2] |= address >> 32;
 
@@ -1029,17 +1032,10 @@ nve4_set_surface_info(struct nouveau_pushbuf *push,
       const unsigned z = view->u.tex.first_layer;
 
       if (z) {
-         if (mt->layout_3d) {
+         if (mt->layout_3d)
             address += nvc0_mt_zslice_offset(mt, view->u.tex.level, z);
-            /* doesn't work if z passes z-tile boundary */
-            if (depth > 1) {
-               pipe_debug_message(&nvc0->base.debug, CONFORMANCE,
-                                  "3D images are not really supported!");
-               debug_printf("3D images are not really supported!\n");
-            }
-         } else {
+         else
             address += mt->layer_stride * z;
-         }
       }
       address += lvl->offset;
 
-- 
2.17.1



More information about the mesa-dev mailing list