diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-06-16 08:03:08 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:38 +0200 |
commit | cbbca26d182991abf68d9b2e1b1e5935bf4eb476 (patch) | |
tree | 09662bca5ff6bfa688e409294562ed1cdd8754b2 /src/shader_recompiler/frontend/maxwell | |
parent | shader: Rename maxwell/program.h to translate_program.h (diff) | |
download | yuzu-cbbca26d182991abf68d9b2e1b1e5935bf4eb476.tar yuzu-cbbca26d182991abf68d9b2e1b1e5935bf4eb476.tar.gz yuzu-cbbca26d182991abf68d9b2e1b1e5935bf4eb476.tar.bz2 yuzu-cbbca26d182991abf68d9b2e1b1e5935bf4eb476.tar.lz yuzu-cbbca26d182991abf68d9b2e1b1e5935bf4eb476.tar.xz yuzu-cbbca26d182991abf68d9b2e1b1e5935bf4eb476.tar.zst yuzu-cbbca26d182991abf68d9b2e1b1e5935bf4eb476.zip |
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell')
-rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate_program.cpp | 8 | ||||
-rw-r--r-- | src/shader_recompiler/frontend/maxwell/translate_program.h | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.cpp b/src/shader_recompiler/frontend/maxwell/translate_program.cpp index e52170e3e..5250509c1 100644 --- a/src/shader_recompiler/frontend/maxwell/translate_program.cpp +++ b/src/shader_recompiler/frontend/maxwell/translate_program.cpp @@ -13,6 +13,7 @@ #include "shader_recompiler/frontend/maxwell/structured_control_flow.h" #include "shader_recompiler/frontend/maxwell/translate/translate.h" #include "shader_recompiler/frontend/maxwell/translate_program.h" +#include "shader_recompiler/host_translate_info.h" #include "shader_recompiler/ir_opt/passes.h" namespace Shader::Maxwell { @@ -120,7 +121,7 @@ void AddNVNStorageBuffers(IR::Program& program) { } // Anonymous namespace IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Block>& block_pool, - Environment& env, Flow::CFG& cfg) { + Environment& env, Flow::CFG& cfg, const HostTranslateInfo& host_info) { IR::Program program; program.syntax_list = BuildASL(inst_pool, block_pool, env, cfg); program.blocks = GenerateBlocks(program.syntax_list); @@ -150,8 +151,9 @@ IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Blo RemoveUnreachableBlocks(program); // Replace instructions before the SSA rewrite - Optimization::LowerFp16ToFp32(program); - + if (!host_info.support_float16) { + Optimization::LowerFp16ToFp32(program); + } Optimization::SsaRewritePass(program); Optimization::GlobalMemoryToStorageBufferPass(program); diff --git a/src/shader_recompiler/frontend/maxwell/translate_program.h b/src/shader_recompiler/frontend/maxwell/translate_program.h index 1e5536443..a84814811 100644 --- a/src/shader_recompiler/frontend/maxwell/translate_program.h +++ b/src/shader_recompiler/frontend/maxwell/translate_program.h @@ -8,13 +8,14 @@ #include "shader_recompiler/frontend/ir/basic_block.h" #include "shader_recompiler/frontend/ir/program.h" #include "shader_recompiler/frontend/maxwell/control_flow.h" +#include "shader_recompiler/host_translate_info.h" #include "shader_recompiler/object_pool.h" namespace Shader::Maxwell { [[nodiscard]] IR::Program TranslateProgram(ObjectPool<IR::Inst>& inst_pool, ObjectPool<IR::Block>& block_pool, Environment& env, - Flow::CFG& cfg); + Flow::CFG& cfg, const HostTranslateInfo& host_info); [[nodiscard]] IR::Program MergeDualVertexPrograms(IR::Program& vertex_a, IR::Program& vertex_b, Environment& env_vertex_b); |