Mesa (master): r600/sfn: Add a forced output swizzle for depth write
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jul 20 09:42:30 UTC 2020
Module: Mesa
Branch: master
Commit: c18b1c6df5108112445c34b30680d8818202a4cb
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c18b1c6df5108112445c34b30680d8818202a4cb
Author: Gert Wollny <gert.wollny at collabora.com>
Date: Sat Jul 18 21:33:54 2020 +0200
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 <gert.wollny at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5963>
---
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<uint32_t,4> 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};
More information about the mesa-commit
mailing list