@@ -552,7 +552,7 @@ void FramebufferManagerCommon::CopyToDepthFromOverlappingFramebuffers(VirtualFra
552552 // For now, let's just do the last thing, if there are multiple.
553553
554554 // for (auto &source : sources) {
555- if (sources.size ()) {
555+ if (! sources.empty ()) {
556556 auto &source = sources.back ();
557557 if (source.channel == RASTER_DEPTH) {
558558 // Good old depth->depth copy.
@@ -561,11 +561,19 @@ void FramebufferManagerCommon::CopyToDepthFromOverlappingFramebuffers(VirtualFra
561561 dest->last_frame_depth_updated = gpuStats.numFlips ;
562562 } else if (source.channel == RASTER_COLOR) {
563563 VirtualFramebuffer *src = source.vfb ;
564+
565+ // Really hate to do this, but tracking the depth swizzle state across multiple
566+ // copies is not easy.
567+ Draw2DShader shader = DRAW2D_565_TO_DEPTH;
568+ if (PSP_CoreParameter ().compat .flags ().DeswizzleDepth ) {
569+ shader = DRAW2D_565_TO_DEPTH_DESWIZZLE;
570+ }
571+
564572 // Copying color to depth.
565573 BlitUsingRaster (
566574 src->fbo , 0 .0f , 0 .0f , src->renderWidth , src->renderHeight ,
567575 dest->fbo , 0 .0f , 0 .0f , src->renderWidth , src->renderHeight ,
568- false , DRAW2D_565_TO_DEPTH_DESWIZZLE , " 565_to_depth" );
576+ false , shader , " 565_to_depth" );
569577 }
570578 }
571579
0 commit comments