Mesa (main): pan/mdg: Read base for combined stores
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue May 24 16:35:46 UTC 2022
Module: Mesa
Branch: main
Commit: 0a53ebabcdd811b045eb24d2977b31de5cf4782e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0a53ebabcdd811b045eb24d2977b31de5cf4782e
Author: Icecream95 <ixn at disroot.org>
Date: Tue May 24 16:30:54 2022 +1200
pan/mdg: Read base for combined stores
Fixes depth/stencil writes with MRT.
Fixes: b3d72727537 ("pan/mdg: Don't read base for combined stores")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16685>
---
src/panfrost/midgard/midgard_compile.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c
index cf2120b731d..880591a56c0 100644
--- a/src/panfrost/midgard/midgard_compile.c
+++ b/src/panfrost/midgard/midgard_compile.c
@@ -1959,20 +1959,18 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
enum midgard_rt_id rt;
unsigned reg_z = ~0, reg_s = ~0, reg_2 = ~0;
+ unsigned writeout = PAN_WRITEOUT_C;
if (combined) {
- unsigned writeout = nir_intrinsic_component(instr);
+ writeout = nir_intrinsic_component(instr);
if (writeout & PAN_WRITEOUT_Z)
reg_z = nir_src_index(ctx, &instr->src[2]);
if (writeout & PAN_WRITEOUT_S)
reg_s = nir_src_index(ctx, &instr->src[3]);
if (writeout & PAN_WRITEOUT_2)
reg_2 = nir_src_index(ctx, &instr->src[4]);
+ }
- if (writeout & PAN_WRITEOUT_C)
- rt = MIDGARD_COLOR_RT0;
- else
- rt = MIDGARD_ZS_RT;
- } else {
+ if (writeout & PAN_WRITEOUT_C) {
const nir_variable *var =
nir_find_variable_with_driver_location(ctx->nir, nir_var_shader_out,
nir_intrinsic_base(instr));
@@ -1982,6 +1980,8 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
rt = MIDGARD_COLOR_RT0 + var->data.location -
FRAG_RESULT_DATA0;
+ } else {
+ rt = MIDGARD_ZS_RT;
}
/* Dual-source blend writeout is done by leaving the
More information about the mesa-commit
mailing list