diff options
Diffstat (limited to 'src/shader_recompiler')
4 files changed, 7 insertions, 3 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 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) { | |||
| 461 | } | 461 | } |
| 462 | 462 | ||
| 463 | void EmitSetFragDepth(EmitContext& ctx, Id value) { | 463 | void EmitSetFragDepth(EmitContext& ctx, Id value) { |
| 464 | if (!ctx.runtime_info.convert_depth_mode) { | 464 | if (!ctx.runtime_info.convert_depth_mode || ctx.profile.support_native_ndc) { |
| 465 | ctx.OpStore(ctx.frag_depth, value); | 465 | ctx.OpStore(ctx.frag_depth, value); |
| 466 | return; | 466 | return; |
| 467 | } | 467 | } |
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) { | |||
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | void EmitEpilogue(EmitContext& ctx) { | 118 | void EmitEpilogue(EmitContext& ctx) { |
| 119 | if (ctx.stage == Stage::VertexB && ctx.runtime_info.convert_depth_mode) { | 119 | if (ctx.stage == Stage::VertexB && ctx.runtime_info.convert_depth_mode && |
| 120 | !ctx.profile.support_native_ndc) { | ||
| 120 | ConvertDepthMode(ctx); | 121 | ConvertDepthMode(ctx); |
| 121 | } | 122 | } |
| 122 | if (ctx.stage == Stage::Fragment) { | 123 | if (ctx.stage == Stage::Fragment) { |
| @@ -125,7 +126,7 @@ void EmitEpilogue(EmitContext& ctx) { | |||
| 125 | } | 126 | } |
| 126 | 127 | ||
| 127 | void EmitEmitVertex(EmitContext& ctx, const IR::Value& stream) { | 128 | void EmitEmitVertex(EmitContext& ctx, const IR::Value& stream) { |
| 128 | if (ctx.runtime_info.convert_depth_mode) { | 129 | if (ctx.runtime_info.convert_depth_mode && !ctx.profile.support_native_ndc) { |
| 129 | ConvertDepthMode(ctx); | 130 | ConvertDepthMode(ctx); |
| 130 | } | 131 | } |
| 131 | if (stream.IsImmediate()) { | 132 | if (stream.IsImmediate()) { |
diff --git a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp index 8e3e40cd5..41dc6d031 100644 --- a/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp +++ b/src/shader_recompiler/backend/spirv/spirv_emit_context.cpp | |||
| @@ -1345,8 +1345,10 @@ void EmitContext::DefineInputs(const IR::Program& program) { | |||
| 1345 | if (info.uses_fswzadd || info.uses_subgroup_invocation_id || info.uses_subgroup_shuffles || | 1345 | if (info.uses_fswzadd || info.uses_subgroup_invocation_id || info.uses_subgroup_shuffles || |
| 1346 | (profile.warp_size_potentially_larger_than_guest && | 1346 | (profile.warp_size_potentially_larger_than_guest && |
| 1347 | (info.uses_subgroup_vote || info.uses_subgroup_mask))) { | 1347 | (info.uses_subgroup_vote || info.uses_subgroup_mask))) { |
| 1348 | AddCapability(spv::Capability::GroupNonUniform); | ||
| 1348 | subgroup_local_invocation_id = | 1349 | subgroup_local_invocation_id = |
| 1349 | DefineInput(*this, U32[1], false, spv::BuiltIn::SubgroupLocalInvocationId); | 1350 | DefineInput(*this, U32[1], false, spv::BuiltIn::SubgroupLocalInvocationId); |
| 1351 | Decorate(subgroup_local_invocation_id, spv::Decoration::Flat); | ||
| 1350 | } | 1352 | } |
| 1351 | if (info.uses_fswzadd) { | 1353 | if (info.uses_fswzadd) { |
| 1352 | const Id f32_one{Const(1.0f)}; | 1354 | const Id f32_one{Const(1.0f)}; |
diff --git a/src/shader_recompiler/profile.h b/src/shader_recompiler/profile.h index 21d3d236b..b8841a536 100644 --- a/src/shader_recompiler/profile.h +++ b/src/shader_recompiler/profile.h | |||
| @@ -35,6 +35,7 @@ struct Profile { | |||
| 35 | bool support_int64_atomics{}; | 35 | bool support_int64_atomics{}; |
| 36 | bool support_derivative_control{}; | 36 | bool support_derivative_control{}; |
| 37 | bool support_geometry_shader_passthrough{}; | 37 | bool support_geometry_shader_passthrough{}; |
| 38 | bool support_native_ndc{}; | ||
| 38 | bool support_gl_nv_gpu_shader_5{}; | 39 | bool support_gl_nv_gpu_shader_5{}; |
| 39 | bool support_gl_amd_gpu_shader_half_float{}; | 40 | bool support_gl_amd_gpu_shader_half_float{}; |
| 40 | bool support_gl_texture_shadow_lod{}; | 41 | bool support_gl_texture_shadow_lod{}; |