diff options
author | Ameer J <52414509+ameerj@users.noreply.github.com> | 2021-09-20 05:56:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-20 05:56:08 +0200 |
commit | cd973d603735bfc573871a6c719a98c312ffd41f (patch) | |
tree | 3dce46d1f0219b5df58e53785a51b5f2d60821f1 /src | |
parent | Merge pull request #7019 from ameerj/videocore-jthread (diff) | |
parent | Spir-V: Rescale the frag depth to 0,1 mode when -1,1 mode is used in Vulkan. (diff) | |
download | yuzu-cd973d603735bfc573871a6c719a98c312ffd41f.tar yuzu-cd973d603735bfc573871a6c719a98c312ffd41f.tar.gz yuzu-cd973d603735bfc573871a6c719a98c312ffd41f.tar.bz2 yuzu-cd973d603735bfc573871a6c719a98c312ffd41f.tar.lz yuzu-cd973d603735bfc573871a6c719a98c312ffd41f.tar.xz yuzu-cd973d603735bfc573871a6c719a98c312ffd41f.tar.zst yuzu-cd973d603735bfc573871a6c719a98c312ffd41f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | 8 |
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&) { |