diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-01-29 18:27:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-29 18:27:33 +0100 |
commit | 149271923c1634275536f02908e59a265f6416e5 (patch) | |
tree | 7081428efe226b16b5267d8478604619e9215e7e /src/shader_recompiler/ir_opt | |
parent | Merge pull request #9694 from ameerj/txq-mips (diff) | |
parent | texture_pass: Refactor texture handle retrieval (diff) | |
download | yuzu-149271923c1634275536f02908e59a265f6416e5.tar yuzu-149271923c1634275536f02908e59a265f6416e5.tar.gz yuzu-149271923c1634275536f02908e59a265f6416e5.tar.bz2 yuzu-149271923c1634275536f02908e59a265f6416e5.tar.lz yuzu-149271923c1634275536f02908e59a265f6416e5.tar.xz yuzu-149271923c1634275536f02908e59a265f6416e5.tar.zst yuzu-149271923c1634275536f02908e59a265f6416e5.zip |
Diffstat (limited to 'src/shader_recompiler/ir_opt')
-rw-r--r-- | src/shader_recompiler/ir_opt/texture_pass.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/shader_recompiler/ir_opt/texture_pass.cpp b/src/shader_recompiler/ir_opt/texture_pass.cpp index b28194d0e..401aeb89f 100644 --- a/src/shader_recompiler/ir_opt/texture_pass.cpp +++ b/src/shader_recompiler/ir_opt/texture_pass.cpp @@ -355,21 +355,21 @@ TextureInst MakeInst(Environment& env, IR::Block* block, IR::Inst& inst) { }; } -TextureType ReadTextureType(Environment& env, const ConstBufferAddr& cbuf) { +u32 GetTextureHandle(Environment& env, const ConstBufferAddr& cbuf) { const u32 secondary_index{cbuf.has_secondary ? cbuf.secondary_index : cbuf.index}; const u32 secondary_offset{cbuf.has_secondary ? cbuf.secondary_offset : cbuf.offset}; const u32 lhs_raw{env.ReadCbufValue(cbuf.index, cbuf.offset) << cbuf.shift_left}; const u32 rhs_raw{env.ReadCbufValue(secondary_index, secondary_offset) << cbuf.secondary_shift_left}; - return env.ReadTextureType(lhs_raw | rhs_raw); + return lhs_raw | rhs_raw; +} + +TextureType ReadTextureType(Environment& env, const ConstBufferAddr& cbuf) { + return env.ReadTextureType(GetTextureHandle(env, cbuf)); } TexturePixelFormat ReadTexturePixelFormat(Environment& env, const ConstBufferAddr& cbuf) { - const u32 secondary_index{cbuf.has_secondary ? cbuf.secondary_index : cbuf.index}; - const u32 secondary_offset{cbuf.has_secondary ? cbuf.secondary_offset : cbuf.offset}; - const u32 lhs_raw{env.ReadCbufValue(cbuf.index, cbuf.offset)}; - const u32 rhs_raw{env.ReadCbufValue(secondary_index, secondary_offset)}; - return env.ReadTexturePixelFormat(lhs_raw | rhs_raw); + return env.ReadTexturePixelFormat(GetTextureHandle(env, cbuf)); } class Descriptors { |