@@ -1452,7 +1452,9 @@ void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture
14521452{
14531453 pxAssert (dTex->IsDepthStencil () == HasDepthOutput (shader));
14541454 pxAssert (linear ? SupportsBilinear (shader) : SupportsNearest (shader));
1455- StretchRect (sTex , sRect , dTex, dRect, m_convert.ps [(int )shader], false , OMColorMaskSelector (ShaderConvertWriteMask (shader)), linear);
1455+ if (sTex ->HasBackup32BitDepth ())
1456+ shader = GetShaderWithBackup32BitDepth (shader);
1457+ StretchRect (sTex , sRect , dTex, dRect, m_convert.ps [(int )shader], false , OMColorMaskSelector (ShaderConvertWriteMask (shader)), linear, sTex ->HasBackup32BitDepth ());
14561458}
14571459
14581460void GSDeviceOGL::StretchRect (GSTexture* sTex , const GSVector4& sRect , GSTexture* dTex, const GSVector4& dRect, const GLProgram& ps, bool linear)
@@ -1469,12 +1471,14 @@ void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture
14691471 cms.wb = blue;
14701472 cms.wa = alpha;
14711473
1472- StretchRect (sTex , sRect , dTex, dRect, m_convert.ps [(int )shader], false , cms, false );
1474+ if (sTex ->HasBackup32BitDepth ())
1475+ shader = GetShaderWithBackup32BitDepth (shader);
1476+ StretchRect (sTex , sRect , dTex, dRect, m_convert.ps [(int )shader], false , cms, false , sTex ->HasBackup32BitDepth ());
14731477}
14741478
1475- void GSDeviceOGL::StretchRect (GSTexture* sTex , const GSVector4& sRect , GSTexture* dTex, const GSVector4& dRect, const GLProgram& ps, bool alpha_blend, OMColorMaskSelector cms, bool linear)
1479+ void GSDeviceOGL::StretchRect (GSTexture* sTex , const GSVector4& sRect , GSTexture* dTex, const GSVector4& dRect, const GLProgram& ps, bool alpha_blend, OMColorMaskSelector cms, bool linear, bool useBackup32BitDepth )
14761480{
1477- CommitClear (sTex , true );
1481+ CommitClear (sTex , true ); // FIXME: What to do about clear when have a backup depth?
14781482
14791483 const bool draw_in_depth = dTex->IsDepthStencil ();
14801484
@@ -1483,6 +1487,7 @@ void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture
14831487 // ************************************
14841488
14851489 GL_PUSH (" StretchRect from %d to %d" , static_cast <GSTextureOGL*>(sTex )->GetID (), static_cast <GSTextureOGL*>(dTex)->GetID ());
1490+
14861491 if (draw_in_depth)
14871492 OMSetRenderTargets (nullptr , dTex);
14881493 else
@@ -1507,6 +1512,8 @@ void GSDeviceOGL::StretchRect(GSTexture* sTex, const GSVector4& sRect, GSTexture
15071512 // ************************************
15081513
15091514 PSSetShaderResource (0 , sTex );
1515+ if (useBackup32BitDepth)
1516+ PSSetShaderResource (1 , sTex ->GetBackup32BitDepth ());
15101517 PSSetSamplerState (linear ? m_convert.ln : m_convert.pt );
15111518
15121519 // ************************************
0 commit comments