agx: Fix fragment side effects scheduling

We can't move discards across side effects, or the side effect might not happen.

Fixes KHR-GLES31.core.shader_image_load_store.basic-allFormats-load-fs
regression. Sigh.

CI is up next.

Fixes: 119e5b9719 ("agx: Schedule for register pressure")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26056>
This commit is contained in:
Alyssa Rosenzweig
2023-10-12 15:45:28 -04:00
committed by Marge Bot
parent e928f45735
commit 7b92c63105

View File

@@ -81,6 +81,8 @@ create_dag(agx_context *ctx, agx_block *block, void *memctx)
assert(dep != AGX_SCHEDULE_CLASS_INVALID && "invalid instruction seen");
bool barrier = dep == AGX_SCHEDULE_CLASS_BARRIER;
bool discards =
I->op == AGX_OPCODE_SAMPLE_MASK || I->op == AGX_OPCODE_ZS_EMIT;
if (dep == AGX_SCHEDULE_CLASS_STORE)
add_dep(node, memory_load);
@@ -94,6 +96,10 @@ create_dag(agx_context *ctx, agx_block *block, void *memctx)
if (dep == AGX_SCHEDULE_CLASS_COVERAGE || barrier)
serialize(node, &coverage);
/* Make sure side effects happen before a discard */
if (discards)
add_dep(node, memory_store);
if (dep == AGX_SCHEDULE_CLASS_PRELOAD)
serialize(node, &preload);
else