panfrost: Stop forcing depth to nr_samples

Those are two different things, and the fact that Midgard use the same
offset in the texture descriptor for both things is just an
implementation detail.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7653>
This commit is contained in:
Boris Brezillon 2020-11-17 20:44:52 +01:00
parent bb69d3bf4e
commit de0b88223b
3 changed files with 8 additions and 10 deletions

View file

@ -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);

View file

@ -679,7 +679,8 @@
<struct name="Midgard Texture" size="8">
<field name="Width" size="16" start="0:0" type="uint" modifier="minus(1)"/>
<field name="Height" size="16" start="0:16" type="uint" modifier="minus(1)"/>
<field name="Depth" size="16" start="1:0" type="uint" modifier="minus(1)"/>
<field name="Depth" size="16" start="1:0" type="uint" modifier="minus(1)" default="1"/>
<field name="Sample count" size="16" start="1:0" type="uint" modifier="minus(1)" default="1"/>
<field name="Array size" size="16" start="1:16" type="uint" modifier="minus(1)"/>
<field name="Format" size="22" start="2:0" type="uint"/>
<field name="Dimension" size="2" start="2:22" type="Texture Dimension"/>

View file

@ -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;