nvc0: inform users that 3D images are not fully supported
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Sat, 9 Apr 2016 18:32:25 +0000 (20:32 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 26 Apr 2016 17:47:49 +0000 (19:47 +0200)
3D images are a bit more complicated to implement and will probably
requires a bunch of headaches and we don't care for now because they
do not seem to be really used by apps.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nvc0/nvc0_context.h
src/gallium/drivers/nouveau/nvc0/nvc0_tex.c
src/gallium/drivers/nouveau/nvc0/nve4_compute.c

index e6bad3d61bc028fcf4db751accda302058007ec1..7fcbf4a5254d04419d968570b639c9e303378d85 100644 (file)
@@ -328,7 +328,7 @@ void nvc0_validate_samplers(struct nvc0_context *);
 void nve4_set_tex_handles(struct nvc0_context *);
 void nvc0_validate_surfaces(struct nvc0_context *);
 void nve4_set_surface_info(struct nouveau_pushbuf *, struct pipe_image_view *,
-                           struct nvc0_screen *);
+                           struct nvc0_context *);
 
 struct pipe_sampler_view *
 nvc0_create_texture_view(struct pipe_context *,
index f5bf2cab656529ab6390604292f3ad606c8884c5..28f48bf72413df700d5b1e53fe701fe249fd4f60 100644 (file)
@@ -782,8 +782,9 @@ nvc0_get_surface_dims(struct pipe_image_view *view, int *width, int *height,
 void
 nve4_set_surface_info(struct nouveau_pushbuf *push,
                       struct pipe_image_view *view,
-                      struct nvc0_screen *screen)
+                      struct nvc0_context *nvc0)
 {
+   struct nvc0_screen *screen = nvc0->screen;
    struct nv04_resource *res;
    uint64_t address;
    uint32_t *const info = push->cur;
@@ -884,7 +885,11 @@ nve4_set_surface_info(struct nouveau_pushbuf *push,
          if (mt->layout_3d) {
             address += nvc0_mt_zslice_offset(mt, view->u.tex.level, z);
             /* doesn't work if z passes z-tile boundary */
-            assert(depth == 1);
+            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 {
             address += mt->layer_stride * z;
          }
@@ -938,7 +943,7 @@ nve4_update_surface_bindings(struct nvc0_context *nvc0)
          if (view->resource) {
             struct nv04_resource *res = nv04_resource(view->resource);
 
-            nve4_set_surface_info(push, view, screen);
+            nve4_set_surface_info(push, view, nvc0);
             BCTX_REFN(nvc0->bufctx_3d, 3D_SUF, res, RDWR);
          } else {
             for (j = 0; j < 16; j++)
index 05a49b1c9ad08fd90a7b391e27bf006168d6c8ca..0fe479a399c9344be5179f94dec17569cbee2520 100644 (file)
@@ -219,7 +219,7 @@ nve4_compute_validate_surfaces(struct nvc0_context *nvc0)
       if (view->resource) {
          struct nv04_resource *res = nv04_resource(view->resource);
 
-         nve4_set_surface_info(push, view, screen);
+         nve4_set_surface_info(push, view, nvc0);
          BCTX_REFN(nvc0->bufctx_cp, CP_SUF, res, RDWR);
       } else {
          for (j = 0; j < 16; j++)