Clear image before drawing

This commit is contained in:
Patrick Nicolas
2024-05-03 23:10:52 +02:00
parent 35a54474b0
commit 33c40f0588
+4 -1
View File
@@ -215,7 +215,7 @@ stream_reprojection::stream_reprojection(
vk::AttachmentDescription attachment{
.format = format,
.samples = vk::SampleCountFlagBits::e1,
.loadOp = vk::AttachmentLoadOp::eDontCare,
.loadOp = vk::AttachmentLoadOp::eClear,
.storeOp = vk::AttachmentStoreOp::eStore,
.initialLayout = vk::ImageLayout::eColorAttachmentOptimal,
.finalLayout = vk::ImageLayout::eColorAttachmentOptimal,
@@ -437,6 +437,7 @@ void stream_reprojection::reproject(vk::raii::CommandBuffer & command_buffer, in
ubo[source]->xc.y = foveation_parameters[source].y.center;
}
vk::ClearValue clear(vk::ClearColorValue(0, 0, 0, 0));
vk::RenderPassBeginInfo begin_info{
.renderPass = *renderpass,
.framebuffer = *framebuffers[destination],
@@ -444,6 +445,8 @@ void stream_reprojection::reproject(vk::raii::CommandBuffer & command_buffer, in
.offset = {0, 0},
.extent = extent,
},
.clearValueCount = 1,
.pClearValues = &clear,
};
command_buffer.pipelineBarrier(