diff options
| author | 2023-05-09 22:13:15 +0100 | |
|---|---|---|
| committer | 2023-05-09 22:13:15 +0100 | |
| commit | a386003b649e24a9df916a81b95cbcc9ab8bcbaa (patch) | |
| tree | 4d7bf0db0171c49f9cac8e346e17cf23441f1bc4 /src | |
| parent | Merge pull request #10183 from liamwhite/mods (diff) | |
| download | yuzu-a386003b649e24a9df916a81b95cbcc9ab8bcbaa.tar.gz yuzu-a386003b649e24a9df916a81b95cbcc9ab8bcbaa.tar.xz yuzu-a386003b649e24a9df916a81b95cbcc9ab8bcbaa.zip | |
Use the rendertarget format of the correct RT rather than the first valid
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 628e1376f..cbf23552c 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -349,25 +349,12 @@ void RasterizerVulkan::Clear(u32 layer_count) { | |||
| 349 | 349 | ||
| 350 | const u32 color_attachment = regs.clear_surface.RT; | 350 | const u32 color_attachment = regs.clear_surface.RT; |
| 351 | if (use_color && framebuffer->HasAspectColorBit(color_attachment)) { | 351 | if (use_color && framebuffer->HasAspectColorBit(color_attachment)) { |
| 352 | VkClearValue clear_value; | 352 | const auto format = |
| 353 | bool is_integer = false; | 353 | VideoCore::Surface::PixelFormatFromRenderTargetFormat(regs.rt[color_attachment].format); |
| 354 | bool is_signed = false; | 354 | bool is_integer = IsPixelFormatInteger(format); |
| 355 | size_t int_size = 8; | 355 | bool is_signed = IsPixelFormatSignedInteger(format); |
| 356 | for (std::size_t i = 0; i < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets; ++i) { | 356 | size_t int_size = PixelComponentSizeBitsInteger(format); |
| 357 | const auto& this_rt = regs.rt[i]; | 357 | VkClearValue clear_value{}; |
| 358 | if (this_rt.Address() == 0) { | ||
| 359 | continue; | ||
| 360 | } | ||
| 361 | if (this_rt.format == Tegra::RenderTargetFormat::NONE) { | ||
| 362 | continue; | ||
| 363 | } | ||
| 364 | const auto format = | ||
| 365 | VideoCore::Surface::PixelFormatFromRenderTargetFormat(this_rt.format); | ||
| 366 | is_integer = IsPixelFormatInteger(format); | ||
| 367 | is_signed = IsPixelFormatSignedInteger(format); | ||
| 368 | int_size = PixelComponentSizeBitsInteger(format); | ||
| 369 | break; | ||
| 370 | } | ||
| 371 | if (!is_integer) { | 358 | if (!is_integer) { |
| 372 | std::memcpy(clear_value.color.float32, regs.clear_color.data(), | 359 | std::memcpy(clear_value.color.float32, regs.clear_color.data(), |
| 373 | regs.clear_color.size() * sizeof(f32)); | 360 | regs.clear_color.size() * sizeof(f32)); |