Clear raytrace framebuffer when drawing into it

This commit is contained in:
Magnus Norddahl 2023-09-05 18:31:28 +02:00 committed by Christoph Oelckers
parent 64358712f0
commit e579095840

View file

@ -68,6 +68,7 @@ void VkLightmap::RenderAtlasImage(size_t pageIndex)
.RenderPass(raytrace.renderPass.get()) .RenderPass(raytrace.renderPass.get())
.RenderArea(0, 0, atlasImageSize, atlasImageSize) .RenderArea(0, 0, atlasImageSize, atlasImageSize)
.Framebuffer(img.raytrace.Framebuffer.get()) .Framebuffer(img.raytrace.Framebuffer.get())
.AddClearColor(0.0f, 0.0f, 0.0f, 0.0f)
.Execute(cmdbuffer); .Execute(cmdbuffer);
VkDeviceSize offset = 0; VkDeviceSize offset = 0;
@ -504,7 +505,7 @@ void VkLightmap::CreateRaytracePipeline()
.AddAttachment( .AddAttachment(
VK_FORMAT_R16G16B16A16_SFLOAT, VK_FORMAT_R16G16B16A16_SFLOAT,
VK_SAMPLE_COUNT_4_BIT, VK_SAMPLE_COUNT_4_BIT,
VK_ATTACHMENT_LOAD_OP_DONT_CARE, VK_ATTACHMENT_LOAD_OP_CLEAR,
VK_ATTACHMENT_STORE_OP_STORE, VK_ATTACHMENT_STORE_OP_STORE,
VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_UNDEFINED,
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL) VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL)