Mesa (master): freedreno/ir3: fix crash with samgq workaround
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Feb 28 17:12:35 UTC 2020
Module: Mesa
Branch: master
Commit: 4b8e198fd2b5bfcefccd998a94a1f065c91119d3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4b8e198fd2b5bfcefccd998a94a1f065c91119d3
Author: Rob Clark <robdclark at chromium.org>
Date: Tue Feb 25 16:37:26 2020 -0800
freedreno/ir3: fix crash with samgq workaround
Need to list_delinit() before we clone the instruction to split it into
individual samgpN instructions, otherwise we get list corruption.
Tested-by: Eduardo Lima Mitev <elima at igalia.com>
Signed-off-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3989>
---
src/freedreno/ir3/ir3_legalize.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/freedreno/ir3/ir3_legalize.c b/src/freedreno/ir3/ir3_legalize.c
index 9c349bf2745..d5cdd6d4443 100644
--- a/src/freedreno/ir3/ir3_legalize.c
+++ b/src/freedreno/ir3/ir3_legalize.c
@@ -215,13 +215,14 @@ legalize_block(struct ir3_legalize_ctx *ctx, struct ir3_block *block)
ctx->type == MESA_SHADER_VERTEX && n->opc == OPC_SAMGQ) {
struct ir3_instruction *samgp;
+ list_delinit(&n->node);
+
for (i = 0; i < 4; i++) {
samgp = ir3_instr_clone(n);
samgp->opc = OPC_SAMGP0 + i;
if (i > 1)
samgp->flags |= IR3_INSTR_SY;
}
- list_delinit(&n->node);
} else {
list_addtail(&n->node, &block->instr_list);
}
More information about the mesa-commit
mailing list