@@ -380,7 +380,6 @@ void VulkanQueueRunner::RunSteps(VkCommandBuffer cmd, std::vector<VKRStep *> &st
380
380
// Planned optimizations:
381
381
// * Create copies of render target that are rendered to multiple times and textured from in sequence, and push those render passes
382
382
// as early as possible in the frame (Wipeout billboards).
383
- // * Merge subsequent render passes to the same target that are interspersed with unrelated draws to other render targets (God of War).
384
383
385
384
for (int j = 0 ; j < (int )steps.size (); j++) {
386
385
if (steps[j]->stepType == VKRStepType::RENDER &&
@@ -721,10 +720,10 @@ std::string VulkanQueueRunner::StepToString(const VKRStep &step) const {
721
720
snprintf (buffer, sizeof (buffer), " Blit (%dx%d->%dx%d)" , step.blit .srcRect .extent .width , step.blit .srcRect .extent .height , step.blit .dstRect .extent .width , step.blit .dstRect .extent .height );
722
721
break ;
723
722
case VKRStepType::READBACK:
724
- snprintf (buffer, sizeof (buffer), " Readback (%dx%d)" , step.readback .srcRect .extent .width , step.readback .srcRect .extent .height );
723
+ snprintf (buffer, sizeof (buffer), " Readback (%dx%d, fb: %p )" , step.readback .srcRect .extent .width , step.readback .srcRect .extent .height , step. readback . src );
725
724
break ;
726
725
case VKRStepType::READBACK_IMAGE:
727
- snprintf (buffer, sizeof (buffer), " ReadbackImage" );
726
+ snprintf (buffer, sizeof (buffer), " ReadbackImage (%dx%d) " , step. readback_image . srcRect . extent . width , step. readback_image . srcRect . extent . height );
728
727
break ;
729
728
case VKRStepType::RENDER_SKIP:
730
729
snprintf (buffer, sizeof (buffer), " (SKIPPED RenderPass)" );
@@ -740,7 +739,6 @@ std::string VulkanQueueRunner::StepToString(const VKRStep &step) const {
740
739
// much a guaranteed neutral or win in terms of GPU power. However, dependency calculation really
741
740
// must be perfect!
742
741
void VulkanQueueRunner::ApplyRenderPassMerge (std::vector<VKRStep *> &steps) {
743
- return ;
744
742
// First let's count how many times each framebuffer is rendered to.
745
743
// If it's more than one, let's do our best to merge them. This can help God of War quite a bit.
746
744
@@ -784,6 +782,11 @@ void VulkanQueueRunner::ApplyRenderPassMerge(std::vector<VKRStep *> &steps) {
784
782
goto done_fb;
785
783
}
786
784
break ;
785
+ case VKRStepType::READBACK:
786
+ if (steps[j]->readback .src == fb) {
787
+ goto done_fb;
788
+ }
789
+ break ;
787
790
}
788
791
}
789
792
done_fb:
@@ -864,20 +867,20 @@ void VulkanQueueRunner::LogRenderPass(const VKRStep &pass) {
864
867
ILOG (" RenderPass End(%x)" , fb);
865
868
}
866
869
867
- void VulkanQueueRunner::LogCopy (const VKRStep &pass ) {
868
- ILOG (" Copy() " );
870
+ void VulkanQueueRunner::LogCopy (const VKRStep &step ) {
871
+ ILOG (" %s " , StepToString (step). c_str () );
869
872
}
870
873
871
- void VulkanQueueRunner::LogBlit (const VKRStep &pass ) {
872
- ILOG (" Blit() " );
874
+ void VulkanQueueRunner::LogBlit (const VKRStep &step ) {
875
+ ILOG (" %s " , StepToString (step). c_str () );
873
876
}
874
877
875
- void VulkanQueueRunner::LogReadback (const VKRStep &pass ) {
876
- ILOG (" Readback " );
878
+ void VulkanQueueRunner::LogReadback (const VKRStep &step ) {
879
+ ILOG (" %s " , StepToString (step). c_str () );
877
880
}
878
881
879
- void VulkanQueueRunner::LogReadbackImage (const VKRStep &pass ) {
880
- ILOG (" ReadbackImage " );
882
+ void VulkanQueueRunner::LogReadbackImage (const VKRStep &step ) {
883
+ ILOG (" %s " , StepToString (step). c_str () );
881
884
}
882
885
883
886
void VulkanQueueRunner::PerformRenderPass (const VKRStep &step, VkCommandBuffer cmd) {
0 commit comments