diff options
| author | 2023-01-29 12:27:33 -0500 | |
|---|---|---|
| committer | 2023-01-29 12:27:33 -0500 | |
| commit | 149271923c1634275536f02908e59a265f6416e5 (patch) | |
| tree | 7081428efe226b16b5267d8478604619e9215e7e | |
| parent | Merge pull request #9694 from ameerj/txq-mips (diff) | |
| parent | texture_pass: Refactor texture handle retrieval (diff) | |
| download | yuzu-149271923c1634275536f02908e59a265f6416e5.tar.gz yuzu-149271923c1634275536f02908e59a265f6416e5.tar.xz yuzu-149271923c1634275536f02908e59a265f6416e5.zip | |
Merge pull request #9698 from ameerj/texture-pass-handle
texture_pass: Refactor texture handle retrieval
Diffstat (limited to '')
| -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) { | |||
| 355 | }; | 355 | }; |
| 356 | } | 356 | } |
| 357 | 357 | ||
| 358 | TextureType ReadTextureType(Environment& env, const ConstBufferAddr& cbuf) { | 358 | u32 GetTextureHandle(Environment& env, const ConstBufferAddr& cbuf) { |
| 359 | const u32 secondary_index{cbuf.has_secondary ? cbuf.secondary_index : cbuf.index}; | 359 | const u32 secondary_index{cbuf.has_secondary ? cbuf.secondary_index : cbuf.index}; |
| 360 | const u32 secondary_offset{cbuf.has_secondary ? cbuf.secondary_offset : cbuf.offset}; | 360 | const u32 secondary_offset{cbuf.has_secondary ? cbuf.secondary_offset : cbuf.offset}; |
| 361 | const u32 lhs_raw{env.ReadCbufValue(cbuf.index, cbuf.offset) << cbuf.shift_left}; | 361 | const u32 lhs_raw{env.ReadCbufValue(cbuf.index, cbuf.offset) << cbuf.shift_left}; |
| 362 | const u32 rhs_raw{env.ReadCbufValue(secondary_index, secondary_offset) | 362 | const u32 rhs_raw{env.ReadCbufValue(secondary_index, secondary_offset) |
| 363 | << cbuf.secondary_shift_left}; | 363 | << cbuf.secondary_shift_left}; |
| 364 | return env.ReadTextureType(lhs_raw | rhs_raw); | 364 | return lhs_raw | rhs_raw; |
| 365 | } | ||
| 366 | |||
| 367 | TextureType ReadTextureType(Environment& env, const ConstBufferAddr& cbuf) { | ||
| 368 | return env.ReadTextureType(GetTextureHandle(env, cbuf)); | ||
| 365 | } | 369 | } |
| 366 | 370 | ||
| 367 | TexturePixelFormat ReadTexturePixelFormat(Environment& env, const ConstBufferAddr& cbuf) { | 371 | TexturePixelFormat ReadTexturePixelFormat(Environment& env, const ConstBufferAddr& cbuf) { |
| 368 | const u32 secondary_index{cbuf.has_secondary ? cbuf.secondary_index : cbuf.index}; | 372 | return env.ReadTexturePixelFormat(GetTextureHandle(env, cbuf)); |
| 369 | const u32 secondary_offset{cbuf.has_secondary ? cbuf.secondary_offset : cbuf.offset}; | ||
| 370 | const u32 lhs_raw{env.ReadCbufValue(cbuf.index, cbuf.offset)}; | ||
| 371 | const u32 rhs_raw{env.ReadCbufValue(secondary_index, secondary_offset)}; | ||
| 372 | return env.ReadTexturePixelFormat(lhs_raw | rhs_raw); | ||
| 373 | } | 373 | } |
| 374 | 374 | ||
| 375 | class Descriptors { | 375 | class Descriptors { |