From c18b1c6df5108112445c34b30680d8818202a4cb Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Sat, 18 Jul 2020 21:33:54 +0200 Subject: [PATCH] r600/sfn: Add a forced output swizzle for depth write This makes sure no components are written that shouldn't be written. Signed-off-by: Gert Wollny Part-of: --- src/gallium/drivers/r600/sfn/sfn_shader_fragment.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/drivers/r600/sfn/sfn_shader_fragment.cpp b/src/gallium/drivers/r600/sfn/sfn_shader_fragment.cpp index 850092ef843..978d96277d1 100644 --- a/src/gallium/drivers/r600/sfn/sfn_shader_fragment.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_shader_fragment.cpp @@ -701,6 +701,10 @@ bool FragmentShaderFromNir::emit_export_pixel(const nir_variable *out_var, nir_i std::array swizzle; unsigned writemask = nir_intrinsic_write_mask(instr); switch (out_var->data.location) { + case FRAG_RESULT_DEPTH: + writemask = 1; + swizzle = {0,7,7,7}; + break; case FRAG_RESULT_STENCIL: writemask = 2; swizzle = {7,0,7,7}; -- 2.30.2