diff options
| author | 2019-03-26 19:02:24 -0400 | |
|---|---|---|
| committer | 2019-04-08 11:28:44 -0400 | |
| commit | ac3ba9a33e0d1e14061fc0f341b69cb85ea2e6a6 (patch) | |
| tree | 05563ef525c4f8b177f1d797de9fdb06e467e622 /src | |
| parent | Fixes to Const Buffer Accessor and Formatting (diff) | |
| download | yuzu-ac3ba9a33e0d1e14061fc0f341b69cb85ea2e6a6.tar.gz yuzu-ac3ba9a33e0d1e14061fc0f341b69cb85ea2e6a6.tar.xz yuzu-ac3ba9a33e0d1e14061fc0f341b69cb85ea2e6a6.zip | |
Corrections to TEX_B
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/shader_bytecode.h | 32 | ||||
| -rw-r--r-- | src/video_core/shader/decode/texture.cpp | 9 |
2 files changed, 37 insertions, 4 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index 2edd3245e..71c22aff0 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h | |||
| @@ -967,6 +967,38 @@ union Instruction { | |||
| 967 | } tex; | 967 | } tex; |
| 968 | 968 | ||
| 969 | union { | 969 | union { |
| 970 | BitField<28, 1, u64> array; | ||
| 971 | BitField<29, 2, TextureType> texture_type; | ||
| 972 | BitField<31, 4, u64> component_mask; | ||
| 973 | BitField<49, 1, u64> nodep_flag; | ||
| 974 | BitField<50, 1, u64> dc_flag; | ||
| 975 | BitField<36, 1, u64> aoffi_flag; | ||
| 976 | BitField<37, 3, TextureProcessMode> process_mode; | ||
| 977 | |||
| 978 | bool IsComponentEnabled(std::size_t component) const { | ||
| 979 | return ((1ull << component) & component_mask) != 0; | ||
| 980 | } | ||
| 981 | |||
| 982 | TextureProcessMode GetTextureProcessMode() const { | ||
| 983 | return process_mode; | ||
| 984 | } | ||
| 985 | |||
| 986 | bool UsesMiscMode(TextureMiscMode mode) const { | ||
| 987 | switch (mode) { | ||
| 988 | case TextureMiscMode::DC: | ||
| 989 | return dc_flag != 0; | ||
| 990 | case TextureMiscMode::NODEP: | ||
| 991 | return nodep_flag != 0; | ||
| 992 | case TextureMiscMode::AOFFI: | ||
| 993 | return aoffi_flag != 0; | ||
| 994 | default: | ||
| 995 | break; | ||
| 996 | } | ||
| 997 | return false; | ||
| 998 | } | ||
| 999 | } tex_b; | ||
| 1000 | |||
| 1001 | union { | ||
| 970 | BitField<22, 6, TextureQueryType> query_type; | 1002 | BitField<22, 6, TextureQueryType> query_type; |
| 971 | BitField<31, 4, u64> component_mask; | 1003 | BitField<31, 4, u64> component_mask; |
| 972 | BitField<49, 1, u64> nodep_flag; | 1004 | BitField<49, 1, u64> nodep_flag; |
diff --git a/src/video_core/shader/decode/texture.cpp b/src/video_core/shader/decode/texture.cpp index 3ac04f6b7..300f1abad 100644 --- a/src/video_core/shader/decode/texture.cpp +++ b/src/video_core/shader/decode/texture.cpp | |||
| @@ -65,10 +65,10 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 65 | LOG_WARNING(HW_GPU, "TEX.NODEP implementation is incomplete"); | 65 | LOG_WARNING(HW_GPU, "TEX.NODEP implementation is incomplete"); |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | const TextureType texture_type{instr.tex.texture_type}; | 68 | const TextureType texture_type{instr.tex_b.texture_type}; |
| 69 | const bool is_array = instr.tex.array != 0; | 69 | const bool is_array = instr.tex_b.array != 0; |
| 70 | const bool depth_compare = instr.tex.UsesMiscMode(TextureMiscMode::DC); | 70 | const bool depth_compare = instr.tex_b.UsesMiscMode(TextureMiscMode::DC); |
| 71 | const auto process_mode = instr.tex.GetTextureProcessMode(); | 71 | const auto process_mode = instr.tex_b.GetTextureProcessMode(); |
| 72 | WriteTexInstructionFloat(bb, instr, | 72 | WriteTexInstructionFloat(bb, instr, |
| 73 | GetTexCode(instr, texture_type, process_mode, depth_compare, | 73 | GetTexCode(instr, texture_type, process_mode, depth_compare, |
| 74 | is_array, true, instr.gpr20)); | 74 | is_array, true, instr.gpr20)); |
| @@ -462,6 +462,7 @@ Node4 ShaderIR::GetTexCode(Instruction instr, TextureType texture_type, | |||
| 462 | if (is_aoffi) { | 462 | if (is_aoffi) { |
| 463 | aoffi = GetAoffiCoordinates(GetRegister(parameter_register++), coord_count, false); | 463 | aoffi = GetAoffiCoordinates(GetRegister(parameter_register++), coord_count, false); |
| 464 | } | 464 | } |
| 465 | const u32 bindless_offset = (is_bindless ? 1 : 0); | ||
| 465 | 466 | ||
| 466 | Node dc{}; | 467 | Node dc{}; |
| 467 | if (depth_compare) { | 468 | if (depth_compare) { |