Implement pixel data reinterpretation on EFB format change.

Whatever that means, it fixes that stupid Super Mario Sunshine glitch and possibly lots of other stuff, so test as many glitchy games as possible with this ;)


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6669 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX
2010-12-27 21:56:20 +00:00
parent 6e8df50fff
commit a271bb8182
22 changed files with 221 additions and 10 deletions

View File

@ -85,6 +85,18 @@ public:
static LPDIRECT3DSURFACE9 GetEFBColorReadSurface() { return s_efb.color_ReadBuffer; }
static LPDIRECT3DSURFACE9 GetEFBDepthReadSurface() { return s_efb.depth_ReadBuffer; }
static LPDIRECT3DTEXTURE9 GetEFBColorReinterpretTexture() { return s_efb.color_reinterpret_texture; }
static LPDIRECT3DSURFACE9 GetEFBColorReinterpretSurface() { return s_efb.color_reinterpret_surface; }
static void SwapReinterpretTexture()
{
LPDIRECT3DSURFACE9 swapsurf = GetEFBColorReinterpretSurface();
LPDIRECT3DTEXTURE9 swaptex = GetEFBColorReinterpretTexture();
s_efb.color_reinterpret_surface = GetEFBColorRTSurface();
s_efb.color_reinterpret_texture = GetEFBColorTexture();
s_efb.color_surface = swapsurf;
s_efb.color_texture = swaptex;
}
private:
XFBSourceBase* CreateXFBSource(unsigned int target_width, unsigned int target_height);
void GetTargetSize(unsigned int *width, unsigned int *height, const EFBRectangle& sourceRc);
@ -98,6 +110,9 @@ private:
LPDIRECT3DTEXTURE9 depth_texture;//Texture thats contains the depth data of the render target
LPDIRECT3DTEXTURE9 depthRead_texture;//4 pixel texture for temporal data store
LPDIRECT3DTEXTURE9 color_reinterpret_texture;//buffer used for ReinterpretPixelData
LPDIRECT3DSURFACE9 color_reinterpret_surface;//corresponding surface
LPDIRECT3DSURFACE9 depth_surface;//Depth Surface
LPDIRECT3DSURFACE9 color_surface;//Color Surface
LPDIRECT3DSURFACE9 color_ReadBuffer;//Surface 0 of colorRead_texture