Skip to content

Commit

Permalink
renderer_vulkan: Clear blank frame
Browse files Browse the repository at this point in the history
Fix display of garbage images on startup.
  • Loading branch information
ngoquang2708 committed Jan 8, 2025
1 parent 8f5bcb0 commit 725c452
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/video_core/renderer_vulkan/vk_presenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,27 @@ Frame* Presenter::PrepareFrameInternal(VideoCore::ImageId image_id, bool is_eop)
cmdbuf.beginRendering(rendering_info);
cmdbuf.draw(3, 1, 0, 0);
cmdbuf.endRendering();
} else {
const std::array attachments = {vk::RenderingAttachmentInfo{
.imageView = frame->image_view,
.imageLayout = vk::ImageLayout::eColorAttachmentOptimal,
.loadOp = vk::AttachmentLoadOp::eClear,
.storeOp = vk::AttachmentStoreOp::eStore,
}};

vk::RenderingInfo rendering_info{
.renderArea =
vk::Rect2D{
.offset = {0, 0},
.extent = {frame->width, frame->height},
},
.layerCount = 1,
.colorAttachmentCount = attachments.size(),
.pColorAttachments = attachments.data(),
};

cmdbuf.beginRendering(rendering_info);
cmdbuf.endRendering();
}

const auto post_barrier =
Expand Down

0 comments on commit 725c452

Please sign in to comment.