Mesa (main): radeonsi/gfx11: compile monolithic PS if it writes memory
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jun 15 21:27:03 UTC 2022
Module: Mesa
Branch: main
Commit: 0e8beb1eed994cc951bf53d90dd4664d2a5b5a28
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0e8beb1eed994cc951bf53d90dd4664d2a5b5a28
Author: Marek Olšák <marek.olsak at amd.com>
Date: Mon May 16 09:45:15 2022 -0400
radeonsi/gfx11: compile monolithic PS if it writes memory
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16990>
---
src/gallium/drivers/radeonsi/si_state_shaders.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.cpp b/src/gallium/drivers/radeonsi/si_state_shaders.cpp
index d2901c61939..1e8e72cd5bf 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.cpp
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.cpp
@@ -2325,11 +2325,16 @@ void si_ps_key_update_framebuffer_blend(struct si_context *sctx)
* Check if any output is eliminated.
*
* Dual source blending never has color buffer 1 enabled, so ignore it.
+ *
+ * On gfx11, pixel shaders that write memory should be compiled with an inlined epilog,
+ * so that the compiler can see s_endpgm and deallocates VGPRs before memory stores return.
*/
if (sel->info.colors_written_4bit &
(blend->dual_src_blend ? 0xffffff0f : 0xffffffff) &
~(sctx->framebuffer.colorbuf_enabled_4bit & blend->cb_target_enabled_4bit))
key->ps.opt.prefer_mono = 1;
+ else if (sctx->gfx_level >= GFX11 && sel->info.base.writes_memory)
+ key->ps.opt.prefer_mono = 1;
else
key->ps.opt.prefer_mono = 0;
}
More information about the mesa-commit
mailing list