From a9770e2bd2105106026d0345fe681d16ebcb7724 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 15 Jul 2019 14:06:22 +0200 Subject: [PATCH] zink: set ExecutionModeDepthReplacing when depth is written Acked-by: Jordan Justen --- src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c index 9683fb1416f..26bcd90a055 100644 --- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c +++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c @@ -1523,9 +1523,13 @@ nir_to_spirv(struct nir_shader *s) spirv_builder_emit_entry_point(&ctx.builder, exec_model, entry_point, "main", ctx.entry_ifaces, ctx.num_entry_ifaces); - if (s->info.stage == MESA_SHADER_FRAGMENT) + if (s->info.stage == MESA_SHADER_FRAGMENT) { spirv_builder_emit_exec_mode(&ctx.builder, entry_point, SpvExecutionModeOriginUpperLeft); + if (s->info.outputs_written & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) + spirv_builder_emit_exec_mode(&ctx.builder, entry_point, + SpvExecutionModeDepthReplacing); + } spirv_builder_function(&ctx.builder, entry_point, type_void, -- 2.30.2