panfrost: Don't bail on PIPE_BUFFER
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 16 Aug 2019 17:25:05 +0000 (10:25 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 21 Aug 2019 17:43:02 +0000 (10:43 -0700)
We can handle some of it.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_context.c

index 5e66adb2f0f9b68ee86ad69cd02b8636241a44b5..f9e03ab4fbdfcca20ce9fdf539b9e5ba63ef107e 100644 (file)
@@ -605,11 +605,11 @@ panfrost_upload_tex(
 
         /* For easy access */
 
-        assert(pview->target != PIPE_BUFFER);
-        unsigned first_level = pview->u.tex.first_level;
-        unsigned last_level = pview->u.tex.last_level;
-        unsigned first_layer = pview->u.tex.first_layer;
-        unsigned last_layer = pview->u.tex.last_layer;
+        bool is_buffer = pview->target == PIPE_BUFFER;
+        unsigned first_level = is_buffer ? 0 : pview->u.tex.first_level;
+        unsigned last_level  = is_buffer ? 0 : pview->u.tex.last_level;
+        unsigned first_layer = is_buffer ? 0 : pview->u.tex.first_layer;
+        unsigned last_layer  = is_buffer ? 0 : pview->u.tex.last_layer;
 
         /* Lower-bit is set when sampling from colour AFBC */
         bool is_afbc = rsrc->layout == PAN_AFBC;