summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/ir_opt
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2023-01-29 03:04:24 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2023-01-29 03:11:38 +0100
commit9bb429999e328e34d380c22fe6ba8c54eb088307 (patch)
tree233d049c899b1629eb1af0c486b4976182d21121 /src/shader_recompiler/ir_opt
parentMerge pull request #9687 from ameerj/ogl-shader-ms (diff)
downloadyuzu-9bb429999e328e34d380c22fe6ba8c54eb088307.tar
yuzu-9bb429999e328e34d380c22fe6ba8c54eb088307.tar.gz
yuzu-9bb429999e328e34d380c22fe6ba8c54eb088307.tar.bz2
yuzu-9bb429999e328e34d380c22fe6ba8c54eb088307.tar.lz
yuzu-9bb429999e328e34d380c22fe6ba8c54eb088307.tar.xz
yuzu-9bb429999e328e34d380c22fe6ba8c54eb088307.tar.zst
yuzu-9bb429999e328e34d380c22fe6ba8c54eb088307.zip
Diffstat (limited to 'src/shader_recompiler/ir_opt')
-rw-r--r--src/shader_recompiler/ir_opt/texture_pass.cpp14
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 70b620dcb..36d6de8d7 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 {