diff options
| -rw-r--r-- | src/video_core/shader/decode/texture.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/video_core/shader/decode/texture.cpp b/src/video_core/shader/decode/texture.cpp index 0b9817093..e68f1d305 100644 --- a/src/video_core/shader/decode/texture.cpp +++ b/src/video_core/shader/decode/texture.cpp | |||
| @@ -268,7 +268,6 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 268 | "NDV is not implemented"); | 268 | "NDV is not implemented"); |
| 269 | 269 | ||
| 270 | auto texture_type = instr.tmml.texture_type.Value(); | 270 | auto texture_type = instr.tmml.texture_type.Value(); |
| 271 | const bool is_array = instr.tmml.array != 0; | ||
| 272 | Node index_var{}; | 271 | Node index_var{}; |
| 273 | const Sampler* sampler = | 272 | const Sampler* sampler = |
| 274 | is_bindless ? GetBindlessSampler(instr.gpr20, index_var) : GetSampler(instr.sampler); | 273 | is_bindless ? GetBindlessSampler(instr.gpr20, index_var) : GetSampler(instr.sampler); |
| @@ -592,8 +591,9 @@ Node4 ShaderIR::GetTexCode(Instruction instr, TextureType texture_type, | |||
| 592 | ++parameter_register; | 591 | ++parameter_register; |
| 593 | } | 592 | } |
| 594 | 593 | ||
| 595 | const auto [coord_count, total_coord_count] = ValidateAndGetCoordinateElement( | 594 | const auto coord_counts = ValidateAndGetCoordinateElement(texture_type, depth_compare, is_array, |
| 596 | texture_type, depth_compare, is_array, lod_bias_enabled, 4, 5); | 595 | lod_bias_enabled, 4, 5); |
| 596 | const auto coord_count = std::get<0>(coord_counts); | ||
| 597 | // If enabled arrays index is always stored in the gpr8 field | 597 | // If enabled arrays index is always stored in the gpr8 field |
| 598 | const u64 array_register = instr.gpr8.Value(); | 598 | const u64 array_register = instr.gpr8.Value(); |
| 599 | // First coordinate index is the gpr8 or gpr8 + 1 when arrays are used | 599 | // First coordinate index is the gpr8 or gpr8 + 1 when arrays are used |
| @@ -631,8 +631,10 @@ Node4 ShaderIR::GetTexsCode(Instruction instr, TextureType texture_type, | |||
| 631 | const bool lod_bias_enabled = | 631 | const bool lod_bias_enabled = |
| 632 | (process_mode != TextureProcessMode::None && process_mode != TextureProcessMode::LZ); | 632 | (process_mode != TextureProcessMode::None && process_mode != TextureProcessMode::LZ); |
| 633 | 633 | ||
| 634 | const auto [coord_count, total_coord_count] = ValidateAndGetCoordinateElement( | 634 | const auto coord_counts = ValidateAndGetCoordinateElement(texture_type, depth_compare, is_array, |
| 635 | texture_type, depth_compare, is_array, lod_bias_enabled, 4, 4); | 635 | lod_bias_enabled, 4, 4); |
| 636 | const auto coord_count = std::get<0>(coord_counts); | ||
| 637 | |||
| 636 | // If enabled arrays index is always stored in the gpr8 field | 638 | // If enabled arrays index is always stored in the gpr8 field |
| 637 | const u64 array_register = instr.gpr8.Value(); | 639 | const u64 array_register = instr.gpr8.Value(); |
| 638 | // First coordinate index is stored in gpr8 field or (gpr8 + 1) when arrays are used | 640 | // First coordinate index is stored in gpr8 field or (gpr8 + 1) when arrays are used |