summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2019-07-15 14:06:22 +0200
committerErik Faye-Lund <[email protected]>2019-10-28 08:51:46 +0000
commita9770e2bd2105106026d0345fe681d16ebcb7724 (patch)
tree4bdd2b10514f54a858e487ab354e8c80ebbeee67 /src/gallium
parent10f26ef92ddbb05a6e2b2e8e29020dbd9be70a49 (diff)
zink: set ExecutionModeDepthReplacing when depth is written
Acked-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c6
1 files changed, 5 insertions, 1 deletions
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,