summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2021-09-15 20:14:39 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2021-09-15 21:30:33 +0200
commit8984abfc76ec82cba2c919934981a5a5bf9216e7 (patch)
treee946421b6f6d6e9848cd8f3dd00933c62a47d68f /src
parentMerge pull request #6943 from FernandoS27/omae-wa-mou-shindeiru (diff)
downloadyuzu-8984abfc76ec82cba2c919934981a5a5bf9216e7.tar
yuzu-8984abfc76ec82cba2c919934981a5a5bf9216e7.tar.gz
yuzu-8984abfc76ec82cba2c919934981a5a5bf9216e7.tar.bz2
yuzu-8984abfc76ec82cba2c919934981a5a5bf9216e7.tar.lz
yuzu-8984abfc76ec82cba2c919934981a5a5bf9216e7.tar.xz
yuzu-8984abfc76ec82cba2c919934981a5a5bf9216e7.tar.zst
yuzu-8984abfc76ec82cba2c919934981a5a5bf9216e7.zip
Diffstat (limited to 'src')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
index 68f360b3c..6f60c6574 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp
@@ -477,7 +477,13 @@ void EmitSetSampleMask(EmitContext& ctx, Id value) {
}
void EmitSetFragDepth(EmitContext& ctx, Id value) {
- ctx.OpStore(ctx.frag_depth, value);
+ if (!ctx.runtime_info.convert_depth_mode) {
+ ctx.OpStore(ctx.frag_depth, value);
+ return;
+ }
+ const Id unit{ctx.Const(0.5f)};
+ const Id new_depth{ctx.OpFma(ctx.F32[1], value, unit, unit)};
+ ctx.OpStore(ctx.frag_depth, new_depth);
}
void EmitGetZFlag(EmitContext&) {