summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2016-01-19 15:18:31 -0500
committerEmil Velikov <emil.l.velikov@gmail.com>2016-02-04 12:35:13 +0000
commit185ee6b612aca567dfaa31ae1be93e3385af4be4 (patch)
treedd70ebcbef8dc3ce7db7060685799e34aa6c71f3
parent25fc54992e96886d71e5f266069ca21ac4828a4b (diff)
downloadmesa-intel-ci.tar.gz
radeonsi: fix discard-only fragment shaders (11.1 version)intel-ci
When a fragment shader is used that has no outputs but does conditional discard (KILL_IF), all fragments are killed without this patch. By comparing various register settings, my conclusion is that the exec mask is either not properly forwarded to the DB by NULL exports or ends up being unused, at least when there is _only_ a NULL export (the ISA documentation claims that NULL exports can be used to override a previously exported exec mask). Of the various approaches I have tried to work around the problem, this one seems to be the least invasive one. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93761 Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c
index 1baa2eb2178..1c1aaa088c2 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -2291,6 +2291,9 @@ static void si_llvm_emit_fs_epilogue(struct lp_build_tgsi_context * bld_base)
last_args[6]= uint->zero;
last_args[7]= uint->zero;
last_args[8]= uint->zero;
+
+ if (info->uses_kill)
+ si_shader_ctx->shader->spi_shader_z_format = V_028710_SPI_SHADER_32_R;
}
/* Specify whether the EXEC mask represents the valid mask */