mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
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:
@ -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)
|
||||
|
Reference in New Issue
Block a user