@@ -602,6 +602,23 @@ Frame* Presenter::PrepareFrameInternal(VideoCore::ImageId image_id, bool is_eop)
602
602
.pImageMemoryBarriers = &pre_barrier,
603
603
});
604
604
605
+ const std::array attachments = {vk::RenderingAttachmentInfo{
606
+ .imageView = frame->image_view ,
607
+ .imageLayout = vk::ImageLayout::eColorAttachmentOptimal,
608
+ .loadOp = vk::AttachmentLoadOp::eClear,
609
+ .storeOp = vk::AttachmentStoreOp::eStore,
610
+ }};
611
+ const vk::RenderingInfo rendering_info{
612
+ .renderArea =
613
+ vk::Rect2D{
614
+ .offset = {0 , 0 },
615
+ .extent = {frame->width , frame->height },
616
+ },
617
+ .layerCount = 1 ,
618
+ .colorAttachmentCount = attachments.size (),
619
+ .pColorAttachments = attachments.data (),
620
+ };
621
+
605
622
if (image_id != VideoCore::NULL_IMAGE_ID) {
606
623
auto & image = texture_cache.GetImage (image_id);
607
624
image.Transit (vk::ImageLayout::eShaderReadOnlyOptimal, vk::AccessFlagBits2::eShaderRead, {},
@@ -662,26 +679,13 @@ Frame* Presenter::PrepareFrameInternal(VideoCore::ImageId image_id, bool is_eop)
662
679
cmdbuf.pushConstants (*pp_pipeline_layout, vk::ShaderStageFlagBits::eFragment, 0 ,
663
680
sizeof (PostProcessSettings), &pp_settings);
664
681
665
- const std::array attachments = {vk::RenderingAttachmentInfo{
666
- .imageView = frame->image_view ,
667
- .imageLayout = vk::ImageLayout::eColorAttachmentOptimal,
668
- .loadOp = vk::AttachmentLoadOp::eClear,
669
- .storeOp = vk::AttachmentStoreOp::eStore,
670
- }};
671
-
672
- vk::RenderingInfo rendering_info{
673
- .renderArea =
674
- vk::Rect2D{
675
- .offset = {0 , 0 },
676
- .extent = {frame->width , frame->height },
677
- },
678
- .layerCount = 1 ,
679
- .colorAttachmentCount = attachments.size (),
680
- .pColorAttachments = attachments.data (),
681
- };
682
682
cmdbuf.beginRendering (rendering_info);
683
683
cmdbuf.draw (3 , 1 , 0 , 0 );
684
684
cmdbuf.endRendering ();
685
+ } else {
686
+ // Fix display of garbage images on startup on some drivers
687
+ cmdbuf.beginRendering (rendering_info);
688
+ cmdbuf.endRendering ();
685
689
}
686
690
687
691
const auto post_barrier =
0 commit comments