diff options
| author | 2020-04-21 14:11:18 -0400 | |
|---|---|---|
| committer | 2020-04-21 14:11:18 -0400 | |
| commit | 9bf3abcb63003e1f6cb911270a88cda761f63525 (patch) | |
| tree | c633d54ee61e75888ce227720d576b7c0d3cf7e5 /src | |
| parent | Merge pull request #3724 from bunnei/fix-unicorn (diff) | |
| parent | key_manager: Resolve missing field initializer warning (diff) | |
| download | yuzu-9bf3abcb63003e1f6cb911270a88cda761f63525.tar.gz yuzu-9bf3abcb63003e1f6cb911270a88cda761f63525.tar.xz yuzu-9bf3abcb63003e1f6cb911270a88cda761f63525.zip | |
Merge pull request #3698 from lioncash/warning
General: Resolve minor assorted warnings
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/crypto/key_manager.cpp | 3 | ||||
| -rw-r--r-- | src/core/hle/service/time/time_zone_manager.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/shader/decode/memory.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/shader/decode/texture.cpp | 23 |
4 files changed, 17 insertions, 15 deletions
diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp index 87e6a1fd3..8997c7082 100644 --- a/src/core/crypto/key_manager.cpp +++ b/src/core/crypto/key_manager.cpp | |||
| @@ -1202,7 +1202,8 @@ const boost::container::flat_map<std::string, KeyIndex<S128KeyType>> KeyManager: | |||
| 1202 | {S128KeyType::Source, static_cast<u64>(SourceKeyType::KeyAreaKey), | 1202 | {S128KeyType::Source, static_cast<u64>(SourceKeyType::KeyAreaKey), |
| 1203 | static_cast<u64>(KeyAreaKeyType::System)}}, | 1203 | static_cast<u64>(KeyAreaKeyType::System)}}, |
| 1204 | {"titlekek_source", {S128KeyType::Source, static_cast<u64>(SourceKeyType::Titlekek), 0}}, | 1204 | {"titlekek_source", {S128KeyType::Source, static_cast<u64>(SourceKeyType::Titlekek), 0}}, |
| 1205 | {"keyblob_mac_key_source", {S128KeyType::Source, static_cast<u64>(SourceKeyType::KeyblobMAC)}}, | 1205 | {"keyblob_mac_key_source", |
| 1206 | {S128KeyType::Source, static_cast<u64>(SourceKeyType::KeyblobMAC), 0}}, | ||
| 1206 | {"tsec_key", {S128KeyType::TSEC, 0, 0}}, | 1207 | {"tsec_key", {S128KeyType::TSEC, 0, 0}}, |
| 1207 | {"secure_boot_key", {S128KeyType::SecureBoot, 0, 0}}, | 1208 | {"secure_boot_key", {S128KeyType::SecureBoot, 0, 0}}, |
| 1208 | {"sd_seed", {S128KeyType::SDSeed, 0, 0}}, | 1209 | {"sd_seed", {S128KeyType::SDSeed, 0, 0}}, |
diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp index c8159bcd5..69152d0ac 100644 --- a/src/core/hle/service/time/time_zone_manager.cpp +++ b/src/core/hle/service/time/time_zone_manager.cpp | |||
| @@ -518,8 +518,8 @@ static bool ParseTimeZoneBinary(TimeZoneRule& time_zone_rule, FileSys::VirtualFi | |||
| 518 | constexpr s32 time_zone_max_leaps{50}; | 518 | constexpr s32 time_zone_max_leaps{50}; |
| 519 | constexpr s32 time_zone_max_chars{50}; | 519 | constexpr s32 time_zone_max_chars{50}; |
| 520 | if (!(0 <= header.leap_count && header.leap_count < time_zone_max_leaps && | 520 | if (!(0 <= header.leap_count && header.leap_count < time_zone_max_leaps && |
| 521 | 0 < header.type_count && header.type_count < time_zone_rule.ttis.size() && | 521 | 0 < header.type_count && header.type_count < s32(time_zone_rule.ttis.size()) && |
| 522 | 0 <= header.time_count && header.time_count < time_zone_rule.ats.size() && | 522 | 0 <= header.time_count && header.time_count < s32(time_zone_rule.ats.size()) && |
| 523 | 0 <= header.char_count && header.char_count < time_zone_max_chars && | 523 | 0 <= header.char_count && header.char_count < time_zone_max_chars && |
| 524 | (header.ttis_std_count == header.type_count || header.ttis_std_count == 0) && | 524 | (header.ttis_std_count == header.type_count || header.ttis_std_count == 0) && |
| 525 | (header.ttis_gmt_count == header.type_count || header.ttis_gmt_count == 0))) { | 525 | (header.ttis_gmt_count == header.type_count || header.ttis_gmt_count == 0))) { |
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp index 8112ead3e..9392f065b 100644 --- a/src/video_core/shader/decode/memory.cpp +++ b/src/video_core/shader/decode/memory.cpp | |||
| @@ -479,7 +479,7 @@ std::tuple<Node, Node, GlobalMemoryBase> ShaderIR::TrackGlobalMemory(NodeBlock& | |||
| 479 | bb.push_back(Comment(fmt::format("Base address is c[0x{:x}][0x{:x}]", index, offset))); | 479 | bb.push_back(Comment(fmt::format("Base address is c[0x{:x}][0x{:x}]", index, offset))); |
| 480 | 480 | ||
| 481 | const GlobalMemoryBase descriptor{index, offset}; | 481 | const GlobalMemoryBase descriptor{index, offset}; |
| 482 | const auto& [entry, is_new] = used_global_memory.try_emplace(descriptor); | 482 | const auto& entry = used_global_memory.try_emplace(descriptor).first; |
| 483 | auto& usage = entry->second; | 483 | auto& usage = entry->second; |
| 484 | usage.is_written |= is_write; | 484 | usage.is_written |= is_write; |
| 485 | usage.is_read |= is_read; | 485 | usage.is_read |= is_read; |
diff --git a/src/video_core/shader/decode/texture.cpp b/src/video_core/shader/decode/texture.cpp index 6c4a1358b..e68f1d305 100644 --- a/src/video_core/shader/decode/texture.cpp +++ b/src/video_core/shader/decode/texture.cpp | |||
| @@ -139,7 +139,7 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 139 | } | 139 | } |
| 140 | const Node component = Immediate(static_cast<u32>(instr.tld4s.component)); | 140 | const Node component = Immediate(static_cast<u32>(instr.tld4s.component)); |
| 141 | 141 | ||
| 142 | const SamplerInfo info{TextureType::Texture2D, false, is_depth_compare}; | 142 | const SamplerInfo info{TextureType::Texture2D, false, is_depth_compare, false}; |
| 143 | const Sampler& sampler = *GetSampler(instr.sampler, info); | 143 | const Sampler& sampler = *GetSampler(instr.sampler, info); |
| 144 | 144 | ||
| 145 | Node4 values; | 145 | Node4 values; |
| @@ -171,13 +171,12 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 171 | const auto coord_count = GetCoordCount(texture_type); | 171 | const auto coord_count = GetCoordCount(texture_type); |
| 172 | Node index_var{}; | 172 | Node index_var{}; |
| 173 | const Sampler* sampler = | 173 | const Sampler* sampler = |
| 174 | is_bindless ? GetBindlessSampler(base_reg, index_var, {{texture_type, is_array, false}}) | 174 | is_bindless |
| 175 | : GetSampler(instr.sampler, {{texture_type, is_array, false}}); | 175 | ? GetBindlessSampler(base_reg, index_var, {{texture_type, is_array, false, false}}) |
| 176 | : GetSampler(instr.sampler, {{texture_type, is_array, false, false}}); | ||
| 176 | Node4 values; | 177 | Node4 values; |
| 177 | if (sampler == nullptr) { | 178 | if (sampler == nullptr) { |
| 178 | for (u32 element = 0; element < values.size(); ++element) { | 179 | std::generate(values.begin(), values.end(), [] { return Immediate(0); }); |
| 179 | values[element] = Immediate(0); | ||
| 180 | } | ||
| 181 | WriteTexInstructionFloat(bb, instr, values); | 180 | WriteTexInstructionFloat(bb, instr, values); |
| 182 | break; | 181 | break; |
| 183 | } | 182 | } |
| @@ -269,7 +268,6 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) { | |||
| 269 | "NDV is not implemented"); | 268 | "NDV is not implemented"); |
| 270 | 269 | ||
| 271 | auto texture_type = instr.tmml.texture_type.Value(); | 270 | auto texture_type = instr.tmml.texture_type.Value(); |
| 272 | const bool is_array = instr.tmml.array != 0; | ||
| 273 | Node index_var{}; | 271 | Node index_var{}; |
| 274 | const Sampler* sampler = | 272 | const Sampler* sampler = |
| 275 | is_bindless ? GetBindlessSampler(instr.gpr20, index_var) : GetSampler(instr.sampler); | 273 | is_bindless ? GetBindlessSampler(instr.gpr20, index_var) : GetSampler(instr.sampler); |
| @@ -593,8 +591,9 @@ Node4 ShaderIR::GetTexCode(Instruction instr, TextureType texture_type, | |||
| 593 | ++parameter_register; | 591 | ++parameter_register; |
| 594 | } | 592 | } |
| 595 | 593 | ||
| 596 | const auto [coord_count, total_coord_count] = ValidateAndGetCoordinateElement( | 594 | const auto coord_counts = ValidateAndGetCoordinateElement(texture_type, depth_compare, is_array, |
| 597 | 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); | ||
| 598 | // If enabled arrays index is always stored in the gpr8 field | 597 | // If enabled arrays index is always stored in the gpr8 field |
| 599 | const u64 array_register = instr.gpr8.Value(); | 598 | const u64 array_register = instr.gpr8.Value(); |
| 600 | // 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 |
| @@ -632,8 +631,10 @@ Node4 ShaderIR::GetTexsCode(Instruction instr, TextureType texture_type, | |||
| 632 | const bool lod_bias_enabled = | 631 | const bool lod_bias_enabled = |
| 633 | (process_mode != TextureProcessMode::None && process_mode != TextureProcessMode::LZ); | 632 | (process_mode != TextureProcessMode::None && process_mode != TextureProcessMode::LZ); |
| 634 | 633 | ||
| 635 | const auto [coord_count, total_coord_count] = ValidateAndGetCoordinateElement( | 634 | const auto coord_counts = ValidateAndGetCoordinateElement(texture_type, depth_compare, is_array, |
| 636 | 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 | |||
| 637 | // If enabled arrays index is always stored in the gpr8 field | 638 | // If enabled arrays index is always stored in the gpr8 field |
| 638 | const u64 array_register = instr.gpr8.Value(); | 639 | const u64 array_register = instr.gpr8.Value(); |
| 639 | // 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 |