diff options
| author | 2022-11-10 21:32:53 -0500 | |
|---|---|---|
| committer | 2022-11-11 03:32:53 +0100 | |
| commit | c9bb888adf228a646ede2c99e8450207c612fe42 (patch) | |
| tree | 1a098df07c3a1e8e57f47d58fe1f02ca2bf79e05 /src/shader_recompiler/ir_opt/texture_pass.cpp | |
| parent | Merge pull request #9198 from liamwhite/arm64 (diff) | |
| download | yuzu-c9bb888adf228a646ede2c99e8450207c612fe42.tar.gz yuzu-c9bb888adf228a646ede2c99e8450207c612fe42.tar.xz yuzu-c9bb888adf228a646ede2c99e8450207c612fe42.zip | |
ir/texture_pass: Use host_info instead of querying Settings::values (#9176)
Diffstat (limited to 'src/shader_recompiler/ir_opt/texture_pass.cpp')
| -rw-r--r-- | src/shader_recompiler/ir_opt/texture_pass.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shader_recompiler/ir_opt/texture_pass.cpp b/src/shader_recompiler/ir_opt/texture_pass.cpp index 9eff84a3d..f5c86fcb1 100644 --- a/src/shader_recompiler/ir_opt/texture_pass.cpp +++ b/src/shader_recompiler/ir_opt/texture_pass.cpp | |||
| @@ -7,11 +7,11 @@ | |||
| 7 | 7 | ||
| 8 | #include <boost/container/small_vector.hpp> | 8 | #include <boost/container/small_vector.hpp> |
| 9 | 9 | ||
| 10 | #include "common/settings.h" | ||
| 11 | #include "shader_recompiler/environment.h" | 10 | #include "shader_recompiler/environment.h" |
| 12 | #include "shader_recompiler/frontend/ir/basic_block.h" | 11 | #include "shader_recompiler/frontend/ir/basic_block.h" |
| 13 | #include "shader_recompiler/frontend/ir/breadth_first_search.h" | 12 | #include "shader_recompiler/frontend/ir/breadth_first_search.h" |
| 14 | #include "shader_recompiler/frontend/ir/ir_emitter.h" | 13 | #include "shader_recompiler/frontend/ir/ir_emitter.h" |
| 14 | #include "shader_recompiler/host_translate_info.h" | ||
| 15 | #include "shader_recompiler/ir_opt/passes.h" | 15 | #include "shader_recompiler/ir_opt/passes.h" |
| 16 | #include "shader_recompiler/shader_info.h" | 16 | #include "shader_recompiler/shader_info.h" |
| 17 | 17 | ||
| @@ -461,7 +461,7 @@ void PatchImageSampleImplicitLod(IR::Block& block, IR::Inst& inst) { | |||
| 461 | ir.FPRecip(ir.ConvertUToF(32, 32, ir.CompositeExtract(texture_size, 1)))))); | 461 | ir.FPRecip(ir.ConvertUToF(32, 32, ir.CompositeExtract(texture_size, 1)))))); |
| 462 | } | 462 | } |
| 463 | 463 | ||
| 464 | void PathTexelFetch(IR::Block& block, IR::Inst& inst, TexturePixelFormat pixel_format) { | 464 | void PatchTexelFetch(IR::Block& block, IR::Inst& inst, TexturePixelFormat pixel_format) { |
| 465 | const auto it{IR::Block::InstructionList::s_iterator_to(inst)}; | 465 | const auto it{IR::Block::InstructionList::s_iterator_to(inst)}; |
| 466 | IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; | 466 | IR::IREmitter ir{block, IR::Block::InstructionList::s_iterator_to(inst)}; |
| 467 | auto get_max_value = [pixel_format]() -> float { | 467 | auto get_max_value = [pixel_format]() -> float { |
| @@ -494,7 +494,7 @@ void PathTexelFetch(IR::Block& block, IR::Inst& inst, TexturePixelFormat pixel_f | |||
| 494 | } | 494 | } |
| 495 | } // Anonymous namespace | 495 | } // Anonymous namespace |
| 496 | 496 | ||
| 497 | void TexturePass(Environment& env, IR::Program& program) { | 497 | void TexturePass(Environment& env, IR::Program& program, const HostTranslateInfo& host_info) { |
| 498 | TextureInstVector to_replace; | 498 | TextureInstVector to_replace; |
| 499 | for (IR::Block* const block : program.post_order_blocks) { | 499 | for (IR::Block* const block : program.post_order_blocks) { |
| 500 | for (IR::Inst& inst : block->Instructions()) { | 500 | for (IR::Inst& inst : block->Instructions()) { |
| @@ -639,11 +639,11 @@ void TexturePass(Environment& env, IR::Program& program) { | |||
| 639 | inst->SetArg(0, IR::Value{}); | 639 | inst->SetArg(0, IR::Value{}); |
| 640 | } | 640 | } |
| 641 | 641 | ||
| 642 | if (Settings::values.renderer_backend.GetValue() == Settings::RendererBackend::OpenGL && | 642 | if (!host_info.support_snorm_render_buffer && inst->GetOpcode() == IR::Opcode::ImageFetch && |
| 643 | inst->GetOpcode() == IR::Opcode::ImageFetch && flags.type == TextureType::Buffer) { | 643 | flags.type == TextureType::Buffer) { |
| 644 | const auto pixel_format = ReadTexturePixelFormat(env, cbuf); | 644 | const auto pixel_format = ReadTexturePixelFormat(env, cbuf); |
| 645 | if (pixel_format != TexturePixelFormat::OTHER) { | 645 | if (pixel_format != TexturePixelFormat::OTHER) { |
| 646 | PathTexelFetch(*texture_inst.block, *texture_inst.inst, pixel_format); | 646 | PatchTexelFetch(*texture_inst.block, *texture_inst.inst, pixel_format); |
| 647 | } | 647 | } |
| 648 | } | 648 | } |
| 649 | } | 649 | } |