Merge pull request #3698 from lioncash/warning

General: Resolve minor assorted warnings
This commit is contained in:
bunnei 2020-04-21 14:11:18 -04:00 committed by GitHub
commit 9bf3abcb63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 15 deletions

View File

@ -1202,7 +1202,8 @@ const boost::container::flat_map<std::string, KeyIndex<S128KeyType>> KeyManager:
{S128KeyType::Source, static_cast<u64>(SourceKeyType::KeyAreaKey), {S128KeyType::Source, static_cast<u64>(SourceKeyType::KeyAreaKey),
static_cast<u64>(KeyAreaKeyType::System)}}, static_cast<u64>(KeyAreaKeyType::System)}},
{"titlekek_source", {S128KeyType::Source, static_cast<u64>(SourceKeyType::Titlekek), 0}}, {"titlekek_source", {S128KeyType::Source, static_cast<u64>(SourceKeyType::Titlekek), 0}},
{"keyblob_mac_key_source", {S128KeyType::Source, static_cast<u64>(SourceKeyType::KeyblobMAC)}}, {"keyblob_mac_key_source",
{S128KeyType::Source, static_cast<u64>(SourceKeyType::KeyblobMAC), 0}},
{"tsec_key", {S128KeyType::TSEC, 0, 0}}, {"tsec_key", {S128KeyType::TSEC, 0, 0}},
{"secure_boot_key", {S128KeyType::SecureBoot, 0, 0}}, {"secure_boot_key", {S128KeyType::SecureBoot, 0, 0}},
{"sd_seed", {S128KeyType::SDSeed, 0, 0}}, {"sd_seed", {S128KeyType::SDSeed, 0, 0}},

View File

@ -518,8 +518,8 @@ static bool ParseTimeZoneBinary(TimeZoneRule& time_zone_rule, FileSys::VirtualFi
constexpr s32 time_zone_max_leaps{50}; constexpr s32 time_zone_max_leaps{50};
constexpr s32 time_zone_max_chars{50}; constexpr s32 time_zone_max_chars{50};
if (!(0 <= header.leap_count && header.leap_count < time_zone_max_leaps && if (!(0 <= header.leap_count && header.leap_count < time_zone_max_leaps &&
0 < header.type_count && header.type_count < time_zone_rule.ttis.size() && 0 < header.type_count && header.type_count < s32(time_zone_rule.ttis.size()) &&
0 <= header.time_count && header.time_count < time_zone_rule.ats.size() && 0 <= header.time_count && header.time_count < s32(time_zone_rule.ats.size()) &&
0 <= header.char_count && header.char_count < time_zone_max_chars && 0 <= header.char_count && header.char_count < time_zone_max_chars &&
(header.ttis_std_count == header.type_count || header.ttis_std_count == 0) && (header.ttis_std_count == header.type_count || header.ttis_std_count == 0) &&
(header.ttis_gmt_count == header.type_count || header.ttis_gmt_count == 0))) { (header.ttis_gmt_count == header.type_count || header.ttis_gmt_count == 0))) {

View File

@ -479,7 +479,7 @@ std::tuple<Node, Node, GlobalMemoryBase> ShaderIR::TrackGlobalMemory(NodeBlock&
bb.push_back(Comment(fmt::format("Base address is c[0x{:x}][0x{:x}]", index, offset))); bb.push_back(Comment(fmt::format("Base address is c[0x{:x}][0x{:x}]", index, offset)));
const GlobalMemoryBase descriptor{index, offset}; const GlobalMemoryBase descriptor{index, offset};
const auto& [entry, is_new] = used_global_memory.try_emplace(descriptor); const auto& entry = used_global_memory.try_emplace(descriptor).first;
auto& usage = entry->second; auto& usage = entry->second;
usage.is_written |= is_write; usage.is_written |= is_write;
usage.is_read |= is_read; usage.is_read |= is_read;

View File

@ -139,7 +139,7 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) {
} }
const Node component = Immediate(static_cast<u32>(instr.tld4s.component)); const Node component = Immediate(static_cast<u32>(instr.tld4s.component));
const SamplerInfo info{TextureType::Texture2D, false, is_depth_compare}; const SamplerInfo info{TextureType::Texture2D, false, is_depth_compare, false};
const Sampler& sampler = *GetSampler(instr.sampler, info); const Sampler& sampler = *GetSampler(instr.sampler, info);
Node4 values; Node4 values;
@ -171,13 +171,12 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) {
const auto coord_count = GetCoordCount(texture_type); const auto coord_count = GetCoordCount(texture_type);
Node index_var{}; Node index_var{};
const Sampler* sampler = const Sampler* sampler =
is_bindless ? GetBindlessSampler(base_reg, index_var, {{texture_type, is_array, false}}) is_bindless
: GetSampler(instr.sampler, {{texture_type, is_array, false}}); ? GetBindlessSampler(base_reg, index_var, {{texture_type, is_array, false, false}})
: GetSampler(instr.sampler, {{texture_type, is_array, false, false}});
Node4 values; Node4 values;
if (sampler == nullptr) { if (sampler == nullptr) {
for (u32 element = 0; element < values.size(); ++element) { std::generate(values.begin(), values.end(), [] { return Immediate(0); });
values[element] = Immediate(0);
}
WriteTexInstructionFloat(bb, instr, values); WriteTexInstructionFloat(bb, instr, values);
break; break;
} }
@ -269,7 +268,6 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) {
"NDV is not implemented"); "NDV is not implemented");
auto texture_type = instr.tmml.texture_type.Value(); auto texture_type = instr.tmml.texture_type.Value();
const bool is_array = instr.tmml.array != 0;
Node index_var{}; Node index_var{};
const Sampler* sampler = const Sampler* sampler =
is_bindless ? GetBindlessSampler(instr.gpr20, index_var) : GetSampler(instr.sampler); is_bindless ? GetBindlessSampler(instr.gpr20, index_var) : GetSampler(instr.sampler);
@ -593,8 +591,9 @@ Node4 ShaderIR::GetTexCode(Instruction instr, TextureType texture_type,
++parameter_register; ++parameter_register;
} }
const auto [coord_count, total_coord_count] = ValidateAndGetCoordinateElement( const auto coord_counts = ValidateAndGetCoordinateElement(texture_type, depth_compare, is_array,
texture_type, depth_compare, is_array, lod_bias_enabled, 4, 5); lod_bias_enabled, 4, 5);
const auto coord_count = std::get<0>(coord_counts);
// If enabled arrays index is always stored in the gpr8 field // If enabled arrays index is always stored in the gpr8 field
const u64 array_register = instr.gpr8.Value(); const u64 array_register = instr.gpr8.Value();
// First coordinate index is the gpr8 or gpr8 + 1 when arrays are used // 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,
const bool lod_bias_enabled = const bool lod_bias_enabled =
(process_mode != TextureProcessMode::None && process_mode != TextureProcessMode::LZ); (process_mode != TextureProcessMode::None && process_mode != TextureProcessMode::LZ);
const auto [coord_count, total_coord_count] = ValidateAndGetCoordinateElement( const auto coord_counts = ValidateAndGetCoordinateElement(texture_type, depth_compare, is_array,
texture_type, depth_compare, is_array, lod_bias_enabled, 4, 4); lod_bias_enabled, 4, 4);
const auto coord_count = std::get<0>(coord_counts);
// If enabled arrays index is always stored in the gpr8 field // If enabled arrays index is always stored in the gpr8 field
const u64 array_register = instr.gpr8.Value(); const u64 array_register = instr.gpr8.Value();
// First coordinate index is stored in gpr8 field or (gpr8 + 1) when arrays are used // First coordinate index is stored in gpr8 field or (gpr8 + 1) when arrays are used