summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp25
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 64bd2f6a5..8d3a9736b 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -348,25 +348,12 @@ void RasterizerVulkan::Clear(u32 layer_count) {
348 348
349 const u32 color_attachment = regs.clear_surface.RT; 349 const u32 color_attachment = regs.clear_surface.RT;
350 if (use_color && framebuffer->HasAspectColorBit(color_attachment)) { 350 if (use_color && framebuffer->HasAspectColorBit(color_attachment)) {
351 VkClearValue clear_value; 351 const auto format =
352 bool is_integer = false; 352 VideoCore::Surface::PixelFormatFromRenderTargetFormat(regs.rt[color_attachment].format);
353 bool is_signed = false; 353 bool is_integer = IsPixelFormatInteger(format);
354 size_t int_size = 8; 354 bool is_signed = IsPixelFormatSignedInteger(format);
355 for (std::size_t i = 0; i < Tegra::Engines::Maxwell3D::Regs::NumRenderTargets; ++i) { 355 size_t int_size = PixelComponentSizeBitsInteger(format);
356 const auto& this_rt = regs.rt[i]; 356 VkClearValue clear_value{};
357 if (this_rt.Address() == 0) {
358 continue;
359 }
360 if (this_rt.format == Tegra::RenderTargetFormat::NONE) {
361 continue;
362 }
363 const auto format =
364 VideoCore::Surface::PixelFormatFromRenderTargetFormat(this_rt.format);
365 is_integer = IsPixelFormatInteger(format);
366 is_signed = IsPixelFormatSignedInteger(format);
367 int_size = PixelComponentSizeBitsInteger(format);
368 break;
369 }
370 if (!is_integer) { 357 if (!is_integer) {
371 std::memcpy(clear_value.color.float32, regs.clear_color.data(), 358 std::memcpy(clear_value.color.float32, regs.clear_color.data(),
372 regs.clear_color.size() * sizeof(f32)); 359 regs.clear_color.size() * sizeof(f32));