From 5e268a01d260d0dd4037b048e1f7a406d92515bf Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 16 Aug 2019 10:25:05 -0700 Subject: [PATCH] panfrost: Don't bail on PIPE_BUFFER We can handle some of it. Signed-off-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/pan_context.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 5e66adb2f0f..f9e03ab4fbd 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -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; -- 2.30.2