Skip to content

Commit

Permalink
renderer_vulkan: Clear blank frame shadps4-emu#2095
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolix29 committed Jan 9, 2025
1 parent 0ec9268 commit de04ba4
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion 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 Expand Up @@ -798,4 +819,4 @@ Frame* Presenter::GetRenderFrame() {
return frame;
}

} // namespace Vulkan
} // namespace Vulkan

0 comments on commit de04ba4

Please sign in to comment.