video_core: Resolve more variable shadowing scenarios pt.2
Migrates the video core code closer to enabling variable shadowing warnings as errors. This primarily sorts out shadowing occurrences within the Vulkan code.
This commit is contained in:
parent
e6a896c4bd
commit
414a87a4f4
39 changed files with 305 additions and 296 deletions
|
@ -241,10 +241,10 @@ std::pair<ParseResult, ParseInfo> ParseCode(CFGRebuildState& state, u32 address)
|
|||
ParseInfo parse_info{};
|
||||
SingleBranch single_branch{};
|
||||
|
||||
const auto insert_label = [](CFGRebuildState& state, u32 address) {
|
||||
const auto pair = state.labels.emplace(address);
|
||||
const auto insert_label = [](CFGRebuildState& rebuild_state, u32 label_address) {
|
||||
const auto pair = rebuild_state.labels.emplace(label_address);
|
||||
if (pair.second) {
|
||||
state.inspect_queries.push_back(address);
|
||||
rebuild_state.inspect_queries.push_back(label_address);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -358,9 +358,9 @@ u32 ShaderIR::DecodeImage(NodeBlock& bb, u32 pc) {
|
|||
instr.suldst.GetStoreDataLayout() != StoreType::Bits64);
|
||||
|
||||
auto descriptor = [this, instr] {
|
||||
std::optional<Tegra::Engines::SamplerDescriptor> descriptor;
|
||||
std::optional<Tegra::Engines::SamplerDescriptor> sampler_descriptor;
|
||||
if (instr.suldst.is_immediate) {
|
||||
descriptor =
|
||||
sampler_descriptor =
|
||||
registry.ObtainBoundSampler(static_cast<u32>(instr.image.index.Value()));
|
||||
} else {
|
||||
const Node image_register = GetRegister(instr.gpr39);
|
||||
|
@ -368,12 +368,12 @@ u32 ShaderIR::DecodeImage(NodeBlock& bb, u32 pc) {
|
|||
static_cast<s64>(global_code.size()));
|
||||
const auto buffer = std::get<1>(result);
|
||||
const auto offset = std::get<2>(result);
|
||||
descriptor = registry.ObtainBindlessSampler(buffer, offset);
|
||||
sampler_descriptor = registry.ObtainBindlessSampler(buffer, offset);
|
||||
}
|
||||
if (!descriptor) {
|
||||
if (!sampler_descriptor) {
|
||||
UNREACHABLE_MSG("Failed to obtain image descriptor");
|
||||
}
|
||||
return *descriptor;
|
||||
return *sampler_descriptor;
|
||||
}();
|
||||
|
||||
const auto comp_mask = GetImageComponentMask(descriptor.format);
|
||||
|
|
|
@ -90,11 +90,11 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) {
|
|||
UNIMPLEMENTED_MSG("S2R WscaleFactorZ is not implemented");
|
||||
return Immediate(0U);
|
||||
case SystemVariable::Tid: {
|
||||
Node value = Immediate(0);
|
||||
value = BitfieldInsert(value, Operation(OperationCode::LocalInvocationIdX), 0, 9);
|
||||
value = BitfieldInsert(value, Operation(OperationCode::LocalInvocationIdY), 16, 9);
|
||||
value = BitfieldInsert(value, Operation(OperationCode::LocalInvocationIdZ), 26, 5);
|
||||
return value;
|
||||
Node val = Immediate(0);
|
||||
val = BitfieldInsert(val, Operation(OperationCode::LocalInvocationIdX), 0, 9);
|
||||
val = BitfieldInsert(val, Operation(OperationCode::LocalInvocationIdY), 16, 9);
|
||||
val = BitfieldInsert(val, Operation(OperationCode::LocalInvocationIdZ), 26, 5);
|
||||
return val;
|
||||
}
|
||||
case SystemVariable::TidX:
|
||||
return Operation(OperationCode::LocalInvocationIdX);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue