summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <alyssa@collabora.com>2021-06-07 13:59:26 -0400
committerMarge Bot <eric+marge@anholt.net>2021-06-09 02:58:08 +0000
commit95bd6e915f6bd14b45a341b3e0d3b62389ddd5de (patch)
tree6ab7895de8980bca528ec4dba400dd6d8d423950 /src/compiler
parent209c82977572dc73cc5c022be3949e1600fba05e (diff)
nir/lower_fragcolor: Avoid redundant load_output
At best, this is an extra instruction for NIR to optimize out. At worst, depending on pass ordering nir_load_output could sneak into the final NIR, even on drivers that don't support fbfetch. Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11255>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_lower_fragcolor.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_lower_fragcolor.c b/src/compiler/nir/nir_lower_fragcolor.c
index 15480361764..8c7c234efaa 100644
--- a/src/compiler/nir/nir_lower_fragcolor.c
+++ b/src/compiler/nir/nir_lower_fragcolor.c
@@ -65,7 +65,8 @@ lower_fragcolor_instr(nir_builder *b, nir_instr *intr, void *data)
return false;
b->cursor = nir_after_instr(&instr->instr);
- nir_ssa_def *frag_color = nir_load_var(b, out);
+ assert(instr->src[1].is_ssa);
+ nir_ssa_def *frag_color = instr->src[1].ssa;
ralloc_free(out->name);
const char *name = out->data.index == 0 ? "gl_FragData[0]" :