mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
First Stage:
Fix depth related errors in dstalpha pass. best place to test: water splash effect in super mario galaxy
This commit is contained in:
@ -245,6 +245,7 @@ int GetNumMSAACoverageSamples(int MSAAMode)
|
||||
// Init functions
|
||||
Renderer::Renderer()
|
||||
{
|
||||
Renderer::LastMode = RSM_None;
|
||||
OSDInternalW = 0;
|
||||
OSDInternalH = 0;
|
||||
|
||||
@ -515,6 +516,49 @@ Renderer::~Renderer()
|
||||
delete g_framebuffer_manager;
|
||||
}
|
||||
|
||||
void Renderer::ApplyState(u32 mode)
|
||||
{
|
||||
if(mode & RSM_Zcomploc)
|
||||
{
|
||||
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
|
||||
}
|
||||
|
||||
if(mode & RSM_Multipass)
|
||||
{
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthMask(GL_FALSE);
|
||||
glDepthFunc(GL_EQUAL);
|
||||
}
|
||||
|
||||
if (mode & RSM_UseDstAlpha)
|
||||
{
|
||||
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_TRUE);
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
Renderer::LastMode |= mode;
|
||||
}
|
||||
|
||||
void Renderer::RestoreState()
|
||||
{
|
||||
if(Renderer::LastMode & RSM_Zcomploc)
|
||||
{
|
||||
SetColorMask();
|
||||
}
|
||||
|
||||
if(Renderer::LastMode & RSM_Multipass)
|
||||
{
|
||||
SetDepthMode();
|
||||
}
|
||||
|
||||
if (Renderer::LastMode & RSM_UseDstAlpha)
|
||||
{
|
||||
SetColorMask();
|
||||
if (bpmem.blendmode.blendenable || bpmem.blendmode.subtract)
|
||||
glEnable(GL_BLEND);
|
||||
}
|
||||
Renderer::LastMode = RSM_None;
|
||||
}
|
||||
|
||||
// Create On-Screen-Messages
|
||||
void Renderer::DrawDebugInfo()
|
||||
{
|
||||
|
Reference in New Issue
Block a user