this is EXPERIMENTAL. Implemented 3 different paths to use depth textures and allow peeking.

they are extremely hard/driver Dependant so your test is needed.
there plugin will automatically select the path thats work for your hard, need that everyone post the messages that the video init throw (yes all will hate me for the messages) but is the only way to see what is the optimal path. in the next commit will clean the unused paths.
i'm afraid thath the second path is Vista dependant (you need to include vista sdk to make it work).
the third path use lockable depth buffer so there is no change in that. 
now peek color is fully working and is fast because the you never lock the the real color texture only the offscreen surface.
please if someone knows a game that use peek color please test it.
also fixed blending so SMS underwater must be fixed.
this work with d3d teach me that i love opengl :)

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4393 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Rodolfo Osvaldo Bogado
2009-10-10 23:36:18 +00:00
parent 9701b88be1
commit 56224bd966
4 changed files with 286 additions and 110 deletions

View File

@ -32,31 +32,6 @@ const bool renderFog = false;
using namespace D3D;
// State translation lookup tables
static const D3DBLEND d3dSrcFactors[8] =
{
D3DBLEND_ZERO,
D3DBLEND_ONE,
D3DBLEND_DESTCOLOR,
D3DBLEND_INVDESTCOLOR,
D3DBLEND_SRCALPHA,
D3DBLEND_INVSRCALPHA,
D3DBLEND_DESTALPHA,
D3DBLEND_INVDESTALPHA
};
static const D3DBLEND d3dDestFactors[8] =
{
D3DBLEND_ZERO,
D3DBLEND_ONE,
D3DBLEND_SRCCOLOR,
D3DBLEND_INVSRCCOLOR,
D3DBLEND_SRCALPHA,
D3DBLEND_INVSRCALPHA,
D3DBLEND_DESTALPHA,
D3DBLEND_INVDESTALPHA
};
static const D3DCULL d3dCullModes[4] =
{
D3DCULL_NONE,
@ -150,42 +125,7 @@ void SetDepthMode(const BPCmd &bp)
void SetBlendMode(const BPCmd &bp)
{
if (bp.changes & 1)
D3D::SetRenderState(D3DRS_ALPHABLENDENABLE, bpmem.blendmode.blendenable);
D3DBLEND src = d3dSrcFactors[bpmem.blendmode.srcfactor];
D3DBLEND dst = d3dDestFactors[bpmem.blendmode.dstfactor];
if (bp.changes & 0x700)
D3D::SetRenderState(D3DRS_SRCBLEND, src);
if (bp.changes & 0xE0)
{
if (!bpmem.blendmode.subtract)
{
D3D::SetRenderState(D3DRS_DESTBLEND, dst);
}
else
{
D3D::SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);
}
}
if (bp.changes & 0x800)
{
if (bpmem.blendmode.subtract)
{
D3D::SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);
D3D::SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE);
}
else
{
D3D::SetRenderState(D3DRS_SRCBLEND, src);
D3D::SetRenderState(D3DRS_DESTBLEND, dst);
}
D3D::SetRenderState(D3DRS_BLENDOP,
bpmem.blendmode.subtract ? D3DBLENDOP_SUBTRACT : D3DBLENDOP_ADD);
}
Renderer::SetBlendMode(false);
}
void SetDitherMode(const BPCmd &bp)
{