mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 17:40:11 +01:00
panfrost: Fix ZS reloading on Bifrost v6
EARLY_ZS_ALWAYS was introduced in Bifrost v7. Use ALWAYS (or INTERSECT
depending on the situation) on v6.
Fixes: 8ba2f9f698 ("panfrost: Create a blitter library to replace the existing preload helpers")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10250>
This commit is contained in:
parent
52d3f6b123
commit
1de393fec5
1 changed files with 30 additions and 4 deletions
|
|
@ -987,10 +987,36 @@ pan_preload_emit_bifrost_pre_frame_dcd(struct pan_pool *desc_pool,
|
||||||
(dcd_idx * (MALI_DRAW_LENGTH + MALI_DRAW_PADDING_LENGTH));
|
(dcd_idx * (MALI_DRAW_LENGTH + MALI_DRAW_PADDING_LENGTH));
|
||||||
|
|
||||||
pan_preload_emit_dcd(desc_pool, fb, zs, coords, tsd, rsd, dcd);
|
pan_preload_emit_dcd(desc_pool, fb, zs, coords, tsd, rsd, dcd);
|
||||||
|
if (zs) {
|
||||||
|
enum pipe_format fmt = fb->zs.view.zs->image->layout.format;
|
||||||
|
bool always = false;
|
||||||
|
|
||||||
|
/* If we're dealing with a combined ZS resource and only one
|
||||||
|
* component is cleared, we need to reload the whole surface
|
||||||
|
* because the zs_clean_pixel_write_enable flag is set in that
|
||||||
|
* case.
|
||||||
|
*/
|
||||||
|
if (util_format_is_depth_and_stencil(fmt) &&
|
||||||
|
fb->zs.clear.z != fb->zs.clear.s)
|
||||||
|
always = true;
|
||||||
|
|
||||||
|
/* We could use INTERSECT on Bifrost v7 too, but
|
||||||
|
* EARLY_ZS_ALWAYS has the advantage of reloading the ZS tile
|
||||||
|
* buffer one or more tiles ahead, making ZS data immediately
|
||||||
|
* available for any ZS tests taking place in other shaders.
|
||||||
|
* Thing's haven't been benchmarked to determine what's
|
||||||
|
* preferable (saving bandwidth vs having ZS preloaded
|
||||||
|
* earlier), so let's leave it like that for now.
|
||||||
|
*/
|
||||||
fb->bifrost.pre_post.modes[dcd_idx] =
|
fb->bifrost.pre_post.modes[dcd_idx] =
|
||||||
zs ?
|
desc_pool->dev->arch > 6 ?
|
||||||
MALI_PRE_POST_FRAME_SHADER_MODE_EARLY_ZS_ALWAYS :
|
MALI_PRE_POST_FRAME_SHADER_MODE_EARLY_ZS_ALWAYS :
|
||||||
|
always ? MALI_PRE_POST_FRAME_SHADER_MODE_ALWAYS :
|
||||||
MALI_PRE_POST_FRAME_SHADER_MODE_INTERSECT;
|
MALI_PRE_POST_FRAME_SHADER_MODE_INTERSECT;
|
||||||
|
} else {
|
||||||
|
fb->bifrost.pre_post.modes[dcd_idx] =
|
||||||
|
MALI_PRE_POST_FRAME_SHADER_MODE_INTERSECT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue