D3D9: Fall back to just creating a depth surface instead of a depth texture if the latter one isn't supported by the hardware.

This is a workaround for issue 3256.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6737 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX
2011-01-04 12:56:52 +00:00
parent efe555fc16
commit 599020ef99
4 changed files with 59 additions and 27 deletions

View File

@ -513,6 +513,11 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
return 0;
}
// if depth textures aren't supported by the hardware, just return
if (type == PEEK_Z)
if (FramebufferManager::GetEFBDepthTexture() == NULL)
return 0;
// We're using three surfaces here:
// - pEFBSurf: EFB Surface. Source surface when peeking, destination surface when poking.
// - pBufferRT: A render target surface. When peeking, we render a textured quad to this surface.
@ -646,7 +651,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
val += ((float)(z & 0xFF)) * ffrac;
break;
};
pSystemBuf->UnlockRect();
// TODO: in RE0 this value is often off by one, which causes lighting to disappear