mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 08:58:02 +02:00
panfrost: do not over-estimate memory needed for dummy-rt
This matches better what we do in pan_emit_fbd, where we don't increase the cbuf_offset variable for unused render-targets. This way we simply make sure we *at least* can fit a dummy-RT (as per the HW spec), but since we don't write to it we also don't need to give it dedicated memory beyond that. This also seemingly fixes a subtle bug where we don't deal with PLS if there's no active render-targets. Fixes:9ec6197a0b("panfrost: allocate tile-buffer for dummy render-targets") Fixes:c15a43cce0("pan/lib: prepare for pixel local storage support") Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> (cherry picked from commit762fe6e9dc) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39003>
This commit is contained in:
parent
8f15e54119
commit
7e327e5e31
2 changed files with 10 additions and 13 deletions
|
|
@ -54,7 +54,7 @@
|
|||
"description": "panfrost: do not over-estimate memory needed for dummy-rt",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "9ec6197a0b553e2d6037d04a4eca68998021ba33",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -470,23 +470,20 @@ pan_bytes_per_pixel_tib(enum pipe_format format)
|
|||
static unsigned
|
||||
pan_cbuf_bytes_per_pixel(const struct pan_fb_info *fb)
|
||||
{
|
||||
/* dummy/non-existent render-targets use RGBA8 UNORM, e.g 4 bytes */
|
||||
const unsigned dummy_rt_size = 4 * fb->nr_samples;
|
||||
|
||||
bool need_dummy = false;
|
||||
unsigned sum = 0;
|
||||
|
||||
if (!fb->rt_count) {
|
||||
/* The HW needs at least one render-target */
|
||||
return dummy_rt_size;
|
||||
}
|
||||
|
||||
for (int cb = 0; cb < fb->rt_count; ++cb) {
|
||||
unsigned rt_size = dummy_rt_size;
|
||||
for (int cb = 0; cb < MAX2(fb->rt_count, 1); ++cb) {
|
||||
const struct pan_image_view *rt = fb->rts[cb].view;
|
||||
if (rt)
|
||||
rt_size = pan_bytes_per_pixel_tib(rt->format) * rt->nr_samples;
|
||||
sum += pan_bytes_per_pixel_tib(rt->format) * rt->nr_samples;
|
||||
else
|
||||
need_dummy = true;
|
||||
}
|
||||
|
||||
sum += rt_size;
|
||||
if (need_dummy) {
|
||||
/* dummy/non-existent render-targets use RGBA8 UNORM, e.g 4 bytes */
|
||||
sum = MAX2(sum, 4 * fb->nr_samples);
|
||||
}
|
||||
|
||||
return sum;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue