diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index 990cce8a2c3..fed929ade2b 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -994,15 +994,9 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so, } /* MSAA only supported for 2D textures (and 2D texture arrays via an - * extension currently unimplemented */ + * extension currently unimplemented) */ - if (so->base.target == PIPE_TEXTURE_2D) { - assert(depth == 1); - depth = texture->nr_samples; - } else { - /* MSAA only supported for 2D textures */ - assert(texture->nr_samples <= 1); - } + assert(texture->nr_samples <= 1 || so->base.target == PIPE_TEXTURE_2D); enum mali_texture_dimension type = panfrost_translate_texture_dimension(so->base.target); diff --git a/src/panfrost/lib/midgard.xml b/src/panfrost/lib/midgard.xml index 18fa4bb569f..f4d0b000470 100644 --- a/src/panfrost/lib/midgard.xml +++ b/src/panfrost/lib/midgard.xml @@ -679,7 +679,8 @@ - + + diff --git a/src/panfrost/lib/pan_texture.c b/src/panfrost/lib/pan_texture.c index c28b36152b2..8fb10d8ef11 100644 --- a/src/panfrost/lib/pan_texture.c +++ b/src/panfrost/lib/pan_texture.c @@ -392,7 +392,10 @@ panfrost_new_texture( pan_pack(out, MIDGARD_TEXTURE, cfg) { cfg.width = u_minify(width, first_level); cfg.height = u_minify(height, first_level); - cfg.depth = u_minify(depth, first_level); + if (dim == MALI_TEXTURE_DIMENSION_3D) + cfg.depth = u_minify(depth, first_level); + else + cfg.sample_count = MAX2(1, nr_samples); cfg.array_size = array_size; cfg.format = panfrost_pipe_format_v6[format].hw; cfg.dimension = dim;