GSdx: bypass (prevent) some crashes.

Important: this is not a fix of the cause of the crashes, it just bypasses cases of sure crash. Once that spot is bypassed, things can go wrong elsewhere. Generally, however, things just continue normally. E.g. GT4 (camera changes), Tourist Trophy (camera changes), MGS3 (codec screen when CRC hacks are disabled) and probably more - now don't crash anymore, even at high resolution (but might still get some slowdowns).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4895 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
avihal 2011-09-01 13:25:08 +00:00
parent 4c57d1bbbe
commit 9314c5fed7
4 changed files with 34 additions and 1 deletions

View File

@ -518,6 +518,12 @@ GSTexture* GSDevice11::CopyOffscreen(GSTexture* src, const GSVector4& sr, int w,
void GSDevice11::CopyRect(GSTexture* st, GSTexture* dt, const GSVector4i& r)
{
if(!st || !dt)
{
ASSERT(0);
return;
}
D3D11_BOX box = {r.left, r.top, 0, r.right, r.bottom, 1};
m_ctx->CopySubresourceRegion(*(GSTexture11*)dt, 0, 0, 0, 0, *(GSTexture11*)st, 0, &box);
@ -535,6 +541,12 @@ void GSDevice11::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dt,
void GSDevice11::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dt, const GSVector4& dr, ID3D11PixelShader* ps, ID3D11Buffer* ps_cb, ID3D11BlendState* bs, bool linear)
{
if(!st || !dt)
{
ASSERT(0);
return;
}
BeginScene();
GSVector2i ds = dt->GetSize();

View File

@ -701,6 +701,12 @@ GSTexture* GSDevice9::CopyOffscreen(GSTexture* src, const GSVector4& sr, int w,
void GSDevice9::CopyRect(GSTexture* st, GSTexture* dt, const GSVector4i& r)
{
if(!st || !dt)
{
ASSERT(0);
return;
}
m_dev->StretchRect(*(GSTexture9*)st, r, *(GSTexture9*)dt, r, D3DTEXF_NONE);
}
@ -716,6 +722,12 @@ void GSDevice9::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dt, c
void GSDevice9::StretchRect(GSTexture* st, const GSVector4& sr, GSTexture* dt, const GSVector4& dr, IDirect3DPixelShader9* ps, const float* ps_cb, int ps_cb_len, Direct3DBlendState9* bs, bool linear)
{
if(!st || !dt)
{
ASSERT(0);
return;
}
BeginScene();
GSVector2i ds = dt->GetSize();

View File

@ -756,6 +756,12 @@ protected:
GSTextureCache::Target* ds = m_tc->LookupTarget(TEX0, m_width, m_height, GSTextureCache::DepthStencil, m_context->DepthWrite());
if(!rt || !ds)
{
ASSERT(0);
return;
}
GSTextureCache::Source* tex = NULL;
if(PRIM->TME)

View File

@ -736,7 +736,10 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con
src->m_texture = dt;
}
src->m_texture->SetScale(scale);
if( src->m_texture )
src->m_texture->SetScale(scale);
else
ASSERT(0);
switch(TEX0.PSM)
{