I hope you all like this. Changes:

Opengl:
Reorder the rendering path to make it more generic, and a little bit faster i think.
Reduce the index Buffer size to make it more Friendly to older video hardware.
get rid of the remaining annoying sps (I hope).
D3D:
Implement the same path as opengl to make the plugins more similar and maintainable.
Fixed Peek_Z this means, Pushing stars in SMG Now Works.
Please give heavy testing to this changes and compare the performance with the old path.
Thanks to hrydgard for let me participate :).

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4353 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Rodolfo Osvaldo Bogado
2009-10-02 14:03:07 +00:00
parent f099ea7be4
commit 9d67518f71
5 changed files with 180 additions and 209 deletions

View File

@ -472,22 +472,25 @@ u32 Renderer::AccessEFB(EFBAccessType type, int x, int y)
if (D3D::dev->GetDepthStencilSurface(&pZBuffer) == D3DERR_NOTFOUND)
pZBuffer = NULL;
//D3DLOCKED_RECT drect;
//HRESULT hr;
D3DLOCKED_RECT drect;
HRESULT hr;
if(!pZBuffer) {
PanicAlert("No Z-Buffer!");
return 0;
}
// TODO: Fix
//if((hr = pZBuffer->LockRect(0, &drect, NULL, NULL)) != D3D_OK)
// PanicAlert("IT WAS AS I THOUGHT, %s", hr == D3DERR_WASSTILLDRAWING ? "Still drawing" :
// hr == D3DERR_INVALIDCALL ? "Invalid call" : "w00t");
RECT RectToLock;
RectToLock.bottom = targetPixelRc.bottom;
RectToLock.left = targetPixelRc.left;
RectToLock.right = targetPixelRc.right;
RectToLock.top = targetPixelRc.top;
if((hr = pZBuffer->LockRect(&drect, &RectToLock, D3DLOCK_READONLY)) != D3D_OK)
PanicAlert("IT WAS AS I THOUGHT, %s", hr == D3DERR_WASSTILLDRAWING ? "Still drawing" :
hr == D3DERR_INVALIDCALL ? "Invalid call" : "w00t");
//val = ((float *)drect.pBits)[0];
val = ((float *)drect.pBits)[0];
//pZBuffer->UnlockRect(0);
pZBuffer->UnlockRect();
// [0.0, 1.0] ==> [0, 0xFFFFFFFF]
z = val * 0xFFFFFFFF;