From 0104e28fe4215468b8c444500e24b62d1ec0cc56 Mon Sep 17 00:00:00 2001 From: FernandoS27 Date: Thu, 25 Nov 2021 11:42:20 +0100 Subject: Vulkan: Add support for VK_EXT_depth_clip_control. --- src/shader_recompiler/backend/spirv/emit_spirv_context_get_set.cpp | 2 +- src/shader_recompiler/backend/spirv/emit_spirv_special.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/shader_recompiler/backend/spirv') 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 01f6ec9b5..73b67f0af 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 @@ -461,7 +461,7 @@ void EmitSetSampleMask(EmitContext& ctx, Id value) { } void EmitSetFragDepth(EmitContext& ctx, Id value) { - if (!ctx.runtime_info.convert_depth_mode) { + if (!ctx.runtime_info.convert_depth_mode || ctx.profile.support_native_ndc) { ctx.OpStore(ctx.frag_depth, value); return; } diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp index 00be1f127..9f7b6bb4b 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv_special.cpp @@ -116,7 +116,8 @@ void EmitPrologue(EmitContext& ctx) { } void EmitEpilogue(EmitContext& ctx) { - if (ctx.stage == Stage::VertexB && ctx.runtime_info.convert_depth_mode) { + if (ctx.stage == Stage::VertexB && ctx.runtime_info.convert_depth_mode && + !ctx.profile.support_native_ndc) { ConvertDepthMode(ctx); } if (ctx.stage == Stage::Fragment) { @@ -125,7 +126,7 @@ void EmitEpilogue(EmitContext& ctx) { } void EmitEmitVertex(EmitContext& ctx, const IR::Value& stream) { - if (ctx.runtime_info.convert_depth_mode) { + if (ctx.runtime_info.convert_depth_mode && !ctx.profile.support_native_ndc) { ConvertDepthMode(ctx); } if (stream.IsImmediate()) { -- cgit v1.2.3