diff options
| author | Lioncash <mathew1800@gmail.com> | 2020-12-05 04:51:14 -0500 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2020-12-05 06:39:35 -0500 |
| commit | 414a87a4f4570344140d77a7985b4d118b754341 (patch) | |
| tree | 6eac8e13f3333c89d8c0f3428b8664cab63a484a /src/video_core/renderer_vulkan/vk_rasterizer.cpp | |
| parent | e6a896c4bdf9cc47c2002c115c9ff280e540fd1b (diff) | |
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/renderer_vulkan/vk_rasterizer.cpp')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index e0fb8693f..560386081 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp @@ -904,15 +904,14 @@ void RasterizerVulkan::SetupShaderDescriptors( texture_cache.GuardSamplers(false); } -void RasterizerVulkan::SetupImageTransitions( - Texceptions texceptions, const std::array<View, Maxwell::NumRenderTargets>& color_attachments, - const View& zeta_attachment) { +void RasterizerVulkan::SetupImageTransitions(Texceptions texceptions, const ColorAttachments& color, + const ZetaAttachment& zeta) { TransitionImages(sampled_views, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, VK_ACCESS_SHADER_READ_BIT); TransitionImages(image_views, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT); - for (std::size_t rt = 0; rt < std::size(color_attachments); ++rt) { - const auto color_attachment = color_attachments[rt]; + for (std::size_t rt = 0; rt < color.size(); ++rt) { + const auto color_attachment = color[rt]; if (color_attachment == nullptr) { continue; } @@ -923,13 +922,13 @@ void RasterizerVulkan::SetupImageTransitions( VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT); } - if (zeta_attachment != nullptr) { + if (zeta != nullptr) { const auto image_layout = texceptions[ZETA_TEXCEPTION_INDEX] ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL; - zeta_attachment->Transition(image_layout, VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | - VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT); + zeta->Transition(image_layout, VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT, + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT | + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT); } } |
