From 33c40f05883b9de3821e34eabc3819dd3fb7285c Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Fri, 3 May 2024 23:10:52 +0200 Subject: [PATCH] Clear image before drawing --- client/scenes/stream_reprojection.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/scenes/stream_reprojection.cpp b/client/scenes/stream_reprojection.cpp index 73dace4a..8c20d96b 100644 --- a/client/scenes/stream_reprojection.cpp +++ b/client/scenes/stream_reprojection.cpp @@ -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(