From e5790958406f6db6a45ebe54ac4518bb859f4b0b Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Tue, 5 Sep 2023 18:31:28 +0200 Subject: [PATCH] Clear raytrace framebuffer when drawing into it --- src/common/rendering/vulkan/accelstructs/vk_lightmap.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/common/rendering/vulkan/accelstructs/vk_lightmap.cpp b/src/common/rendering/vulkan/accelstructs/vk_lightmap.cpp index 15d834d76f..d7a25bdb8a 100644 --- a/src/common/rendering/vulkan/accelstructs/vk_lightmap.cpp +++ b/src/common/rendering/vulkan/accelstructs/vk_lightmap.cpp @@ -68,6 +68,7 @@ void VkLightmap::RenderAtlasImage(size_t pageIndex) .RenderPass(raytrace.renderPass.get()) .RenderArea(0, 0, atlasImageSize, atlasImageSize) .Framebuffer(img.raytrace.Framebuffer.get()) + .AddClearColor(0.0f, 0.0f, 0.0f, 0.0f) .Execute(cmdbuffer); VkDeviceSize offset = 0; @@ -504,7 +505,7 @@ void VkLightmap::CreateRaytracePipeline() .AddAttachment( VK_FORMAT_R16G16B16A16_SFLOAT, VK_SAMPLE_COUNT_4_BIT, - VK_ATTACHMENT_LOAD_OP_DONT_CARE, + VK_ATTACHMENT_LOAD_OP_CLEAR, VK_ATTACHMENT_STORE_OP_STORE, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL)