mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
panfrost: Allocate space for multisampling
As an effective depth. Ugly but matches the blob. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5782>
This commit is contained in:
parent
37204588da
commit
95afda39a6
1 changed files with 14 additions and 1 deletions
|
|
@ -272,6 +272,16 @@ panfrost_setup_slices(struct panfrost_resource *pres, size_t *bo_size)
|
||||||
unsigned depth = res->depth0;
|
unsigned depth = res->depth0;
|
||||||
unsigned bytes_per_pixel = util_format_get_blocksize(pres->internal_format);
|
unsigned bytes_per_pixel = util_format_get_blocksize(pres->internal_format);
|
||||||
|
|
||||||
|
/* MSAA is implemented as a 3D texture with z corresponding to the
|
||||||
|
* sample #, horrifyingly enough */
|
||||||
|
|
||||||
|
bool msaa = res->nr_samples > 1;
|
||||||
|
|
||||||
|
if (msaa) {
|
||||||
|
assert(depth == 1);
|
||||||
|
depth = res->nr_samples;
|
||||||
|
}
|
||||||
|
|
||||||
assert(depth > 0);
|
assert(depth > 0);
|
||||||
|
|
||||||
/* Tiled operates blockwise; linear is packed. Also, anything
|
/* Tiled operates blockwise; linear is packed. Also, anything
|
||||||
|
|
@ -361,7 +371,10 @@ panfrost_setup_slices(struct panfrost_resource *pres, size_t *bo_size)
|
||||||
|
|
||||||
width = u_minify(width, 1);
|
width = u_minify(width, 1);
|
||||||
height = u_minify(height, 1);
|
height = u_minify(height, 1);
|
||||||
depth = u_minify(depth, 1);
|
|
||||||
|
/* Don't mipmap the sample count */
|
||||||
|
if (!msaa)
|
||||||
|
depth = u_minify(depth, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(res->array_size);
|
assert(res->array_size);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue