From: Icecream95 Date: Wed, 8 Jul 2020 04:00:51 +0000 (+1200) Subject: pan/mdg: Set the z/s store intrinsic base correctly X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=18059f48f845c3f1358a36528b17bbe90bf140af;p=mesa.git pan/mdg: Set the z/s store intrinsic base correctly When EXT_shader_framebuffer_fetch is used and only depth and/or stencil are written, we can't rely on the first output being to depth/stencil. Reviewed-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index dc878c65f44..dec1f38e094 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -401,7 +401,12 @@ midgard_nir_lower_zs_store(nir_shader *nir) combined_store->num_components = 4; - nir_intrinsic_set_base(combined_store, 0); + unsigned base; + if (z_store) + base = nir_intrinsic_base(z_store); + else + base = nir_intrinsic_base(s_store); + nir_intrinsic_set_base(combined_store, base); unsigned writeout = 0; if (z_store)