OGL: Rewrite POKE_Z with a draw call

It's now also merged and it should be faster than the glClear way.
This commit is contained in:
degasus
2015-05-29 09:55:45 +02:00
parent 2b5945ae07
commit 84b13de538
3 changed files with 50 additions and 72 deletions

View File

@ -1107,6 +1107,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
}
case POKE_COLOR:
case POKE_Z:
{
std::vector<EfbPokeData> vector;
EfbPokeData d;
@ -1118,26 +1119,6 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
break;
}
case POKE_Z:
{
ResetAPIState();
glDepthMask(GL_TRUE);
glClearDepthf(float(poke_data & 0xFFFFFF) / 16777216.0f);
glEnable(GL_SCISSOR_TEST);
glScissor(targetPixelRc.left, targetPixelRc.bottom, targetPixelRc.GetWidth(), targetPixelRc.GetHeight());
glClear(GL_DEPTH_BUFFER_BIT);
RestoreAPIState();
// TODO: Could just update the EFB cache with the new value
ClearEFBCache();
break;
}
default:
break;
}
@ -1147,18 +1128,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
void Renderer::PokeEFB(EFBAccessType type, const std::vector<EfbPokeData>& data)
{
switch(type)
{
case POKE_COLOR:
{
FramebufferManager::PokeEFB(type, data);
break;
}
default:
::Renderer::PokeEFB(type, data);
break;
}
FramebufferManager::PokeEFB(type, data);
}
u16 Renderer::BBoxRead(int index)