diff options
| author | 2020-12-05 04:51:14 -0500 | |
|---|---|---|
| committer | 2020-12-05 06:39:35 -0500 | |
| commit | 414a87a4f4570344140d77a7985b4d118b754341 (patch) | |
| tree | 6eac8e13f3333c89d8c0f3428b8664cab63a484a /src/video_core/shader | |
| parent | Merge pull request #5124 from lioncash/video-shadow (diff) | |
| download | yuzu-414a87a4f4570344140d77a7985b4d118b754341.tar.gz yuzu-414a87a4f4570344140d77a7985b4d118b754341.tar.xz yuzu-414a87a4f4570344140d77a7985b4d118b754341.zip | |
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.
Diffstat (limited to 'src/video_core/shader')
| -rw-r--r-- | src/video_core/shader/control_flow.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/shader/decode/image.cpp | 10 | ||||
| -rw-r--r-- | src/video_core/shader/decode/other.cpp | 10 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/video_core/shader/control_flow.cpp b/src/video_core/shader/control_flow.cpp index 4c8971615..d656e0668 100644 --- a/src/video_core/shader/control_flow.cpp +++ b/src/video_core/shader/control_flow.cpp | |||
| @@ -241,10 +241,10 @@ std::pair<ParseResult, ParseInfo> ParseCode(CFGRebuildState& state, u32 address) | |||
| 241 | ParseInfo parse_info{}; | 241 | ParseInfo parse_info{}; |
| 242 | SingleBranch single_branch{}; | 242 | SingleBranch single_branch{}; |
| 243 | 243 | ||
| 244 | const auto insert_label = [](CFGRebuildState& state, u32 address) { | 244 | const auto insert_label = [](CFGRebuildState& rebuild_state, u32 label_address) { |
| 245 | const auto pair = state.labels.emplace(address); | 245 | const auto pair = rebuild_state.labels.emplace(label_address); |
| 246 | if (pair.second) { | 246 | if (pair.second) { |
| 247 | state.inspect_queries.push_back(address); | 247 | rebuild_state.inspect_queries.push_back(label_address); |
| 248 | } | 248 | } |
| 249 | }; | 249 | }; |
| 250 | 250 | ||
diff --git a/src/video_core/shader/decode/image.cpp b/src/video_core/shader/decode/image.cpp index 1ed4212ee..532f66d27 100644 --- a/src/video_core/shader/decode/image.cpp +++ b/src/video_core/shader/decode/image.cpp | |||
| @@ -358,9 +358,9 @@ u32 ShaderIR::DecodeImage(NodeBlock& bb, u32 pc) { | |||
| 358 | instr.suldst.GetStoreDataLayout() != StoreType::Bits64); | 358 | instr.suldst.GetStoreDataLayout() != StoreType::Bits64); |
| 359 | 359 | ||
| 360 | auto descriptor = [this, instr] { | 360 | auto descriptor = [this, instr] { |
| 361 | std::optional<Tegra::Engines::SamplerDescriptor> descriptor; | 361 | std::optional<Tegra::Engines::SamplerDescriptor> sampler_descriptor; |
| 362 | if (instr.suldst.is_immediate) { | 362 | if (instr.suldst.is_immediate) { |
| 363 | descriptor = | 363 | sampler_descriptor = |
| 364 | registry.ObtainBoundSampler(static_cast<u32>(instr.image.index.Value())); | 364 | registry.ObtainBoundSampler(static_cast<u32>(instr.image.index.Value())); |
| 365 | } else { | 365 | } else { |
| 366 | const Node image_register = GetRegister(instr.gpr39); | 366 | const Node image_register = GetRegister(instr.gpr39); |
| @@ -368,12 +368,12 @@ u32 ShaderIR::DecodeImage(NodeBlock& bb, u32 pc) { | |||
| 368 | static_cast<s64>(global_code.size())); | 368 | static_cast<s64>(global_code.size())); |
| 369 | const auto buffer = std::get<1>(result); | 369 | const auto buffer = std::get<1>(result); |
| 370 | const auto offset = std::get<2>(result); | 370 | const auto offset = std::get<2>(result); |
| 371 | descriptor = registry.ObtainBindlessSampler(buffer, offset); | 371 | sampler_descriptor = registry.ObtainBindlessSampler(buffer, offset); |
| 372 | } | 372 | } |
| 373 | if (!descriptor) { | 373 | if (!sampler_descriptor) { |
| 374 | UNREACHABLE_MSG("Failed to obtain image descriptor"); | 374 | UNREACHABLE_MSG("Failed to obtain image descriptor"); |
| 375 | } | 375 | } |
| 376 | return *descriptor; | 376 | return *sampler_descriptor; |
| 377 | }(); | 377 | }(); |
| 378 | 378 | ||
| 379 | const auto comp_mask = GetImageComponentMask(descriptor.format); | 379 | const auto comp_mask = GetImageComponentMask(descriptor.format); |
diff --git a/src/video_core/shader/decode/other.cpp b/src/video_core/shader/decode/other.cpp index 29a7cfbfe..1db500bc4 100644 --- a/src/video_core/shader/decode/other.cpp +++ b/src/video_core/shader/decode/other.cpp | |||
| @@ -90,11 +90,11 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) { | |||
| 90 | UNIMPLEMENTED_MSG("S2R WscaleFactorZ is not implemented"); | 90 | UNIMPLEMENTED_MSG("S2R WscaleFactorZ is not implemented"); |
| 91 | return Immediate(0U); | 91 | return Immediate(0U); |
| 92 | case SystemVariable::Tid: { | 92 | case SystemVariable::Tid: { |
| 93 | Node value = Immediate(0); | 93 | Node val = Immediate(0); |
| 94 | value = BitfieldInsert(value, Operation(OperationCode::LocalInvocationIdX), 0, 9); | 94 | val = BitfieldInsert(val, Operation(OperationCode::LocalInvocationIdX), 0, 9); |
| 95 | value = BitfieldInsert(value, Operation(OperationCode::LocalInvocationIdY), 16, 9); | 95 | val = BitfieldInsert(val, Operation(OperationCode::LocalInvocationIdY), 16, 9); |
| 96 | value = BitfieldInsert(value, Operation(OperationCode::LocalInvocationIdZ), 26, 5); | 96 | val = BitfieldInsert(val, Operation(OperationCode::LocalInvocationIdZ), 26, 5); |
| 97 | return value; | 97 | return val; |
| 98 | } | 98 | } |
| 99 | case SystemVariable::TidX: | 99 | case SystemVariable::TidX: |
| 100 | return Operation(OperationCode::LocalInvocationIdX); | 100 | return Operation(OperationCode::LocalInvocationIdX); |