Main change: Implemented EFB pokes in DX9/DX11.

Games affected by this change: Mario Smash Football, Mario Strikers Charged Football, Monster Hunter Tri.
Other games possibly affected: Shaun White Snowboarding, Resident Evil Code: Veronica, Baten Kaitos.
This implementation will decrease performance if the game uses this feature, but the glitches will be gone. I'll add an option for this in a later commit. EFB pokes are somewhat slow in DX11 right now, speed should be okayish in DX9 though.

Other changes:
- SOMEWHAT cleaned up the EFB access code in DX9
- Fixed incompatible parameter list of AccessEFB and TVideo_AccessEFB.
- Fixed a theoretical bug in ReplaceRGBATexture2D, add support for STAGING textures
- Removed unused parameters in various DX9 functions


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6300 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX
2010-10-22 19:40:05 +00:00
parent e9d115a8b1
commit ef75d96655
16 changed files with 248 additions and 168 deletions

View File

@ -24,7 +24,7 @@ namespace D3D
void ReplaceRGBATexture2D(ID3D11Texture2D* pTexture, const u8* buffer, unsigned int width, unsigned int height, unsigned int pitch, unsigned int level, D3D11_USAGE usage)
{
if (usage == D3D11_USAGE_DYNAMIC)
if (usage == D3D11_USAGE_DYNAMIC || usage == D3D11_USAGE_STAGING)
{
D3D11_MAPPED_SUBRESOURCE map;
D3D::context->Map(pTexture, level, D3D11_MAP_WRITE_DISCARD, 0, &map);
@ -35,7 +35,7 @@ void ReplaceRGBATexture2D(ID3D11Texture2D* pTexture, const u8* buffer, unsigned
else
{
for (unsigned int y = 0; y < height; ++y)
memcpy((u8*)map.pData + y * map.RowPitch, (u32*)buffer + y * pitch, map.RowPitch);
memcpy((u8*)map.pData + y * map.RowPitch, (u32*)buffer + y * pitch, 4 * pitch);
}
D3D::context->Unmap(pTexture, level);
}