summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2017-01-31 08:31:37 -0500
committerRob Clark <[email protected]>2017-03-13 10:33:07 -0400
commitf805593b129729e516dea30245612b6a49b8505a (patch)
tree2ce0db1f2eceb7e002293bb9dd45de68e119f9ec /src/gallium/drivers/freedreno
parentb1df639db662d7b1484a3d729575ecde5a92933e (diff)
freedreno/ir3: fragz cannot be half precision
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
index 77d86855ddb..bb3f66c2300 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler_nir.c
@@ -2428,8 +2428,14 @@ ir3_compile_shader_nir(struct ir3_compiler *compiler,
if (so->key.half_precision) {
for (i = 0; i < ir->noutputs; i++) {
struct ir3_instruction *out = ir->outputs[i];
+
if (!out)
continue;
+
+ /* if frag shader writes z, that needs to be full precision: */
+ if (so->outputs[i/4].slot == FRAG_RESULT_DEPTH)
+ continue;
+
out->regs[0]->flags |= IR3_REG_HALF;
/* output could be a fanout (ie. texture fetch output)
* in which case we need to propagate the half-reg flag