diff options
| author | 2021-04-13 16:56:22 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:27 -0400 | |
| commit | a83579b50a167ab9483e5058fd1c748018ef6d7c (patch) | |
| tree | ad924ec0219e4cbd6d2efae934061082751d9b27 /src/shader_recompiler | |
| parent | shader: Document and relax cache control on surface instructions (diff) | |
| download | yuzu-a83579b50a167ab9483e5058fd1c748018ef6d7c.tar.gz yuzu-a83579b50a167ab9483e5058fd1c748018ef6d7c.tar.xz yuzu-a83579b50a167ab9483e5058fd1c748018ef6d7c.zip | |
shader: Implement early Z tests
Diffstat (limited to 'src/shader_recompiler')
| -rw-r--r-- | src/shader_recompiler/backend/spirv/emit_spirv.cpp | 3 | ||||
| -rw-r--r-- | src/shader_recompiler/profile.h | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv.cpp b/src/shader_recompiler/backend/spirv/emit_spirv.cpp index 61a2018d7..7ad00c434 100644 --- a/src/shader_recompiler/backend/spirv/emit_spirv.cpp +++ b/src/shader_recompiler/backend/spirv/emit_spirv.cpp | |||
| @@ -178,6 +178,9 @@ void DefineEntryPoint(const IR::Program& program, EmitContext& ctx, Id main) { | |||
| 178 | if (program.info.stores_frag_depth) { | 178 | if (program.info.stores_frag_depth) { |
| 179 | ctx.AddExecutionMode(main, spv::ExecutionMode::DepthReplacing); | 179 | ctx.AddExecutionMode(main, spv::ExecutionMode::DepthReplacing); |
| 180 | } | 180 | } |
| 181 | if (ctx.profile.force_early_z) { | ||
| 182 | ctx.AddExecutionMode(main, spv::ExecutionMode::EarlyFragmentTests); | ||
| 183 | } | ||
| 181 | break; | 184 | break; |
| 182 | default: | 185 | default: |
| 183 | throw NotImplementedException("Stage {}", program.stage); | 186 | throw NotImplementedException("Stage {}", program.stage); |
diff --git a/src/shader_recompiler/profile.h b/src/shader_recompiler/profile.h index 06f1f59bd..919bec4e2 100644 --- a/src/shader_recompiler/profile.h +++ b/src/shader_recompiler/profile.h | |||
| @@ -53,6 +53,7 @@ struct Profile { | |||
| 53 | 53 | ||
| 54 | std::array<AttributeType, 32> generic_input_types{}; | 54 | std::array<AttributeType, 32> generic_input_types{}; |
| 55 | bool convert_depth_mode{}; | 55 | bool convert_depth_mode{}; |
| 56 | bool force_early_z{}; | ||
| 56 | 57 | ||
| 57 | InputTopology input_topology{}; | 58 | InputTopology input_topology{}; |
| 58 | 59 | ||