Renderer: Move depth state to VideoCommon and seperate from bpmem

This commit is contained in:
Stenzek
2017-04-30 15:54:45 +10:00
parent 4d36f0cc87
commit 2869c570f1
20 changed files with 80 additions and 104 deletions

View File

@ -1787,7 +1787,7 @@ void Renderer::RestoreAPIState()
}
SetGenerationMode();
BPFunctions::SetScissor();
SetDepthMode();
BPFunctions::SetDepthMode();
BPFunctions::SetBlendMode();
SetViewport();
@ -1813,16 +1813,16 @@ void Renderer::SetGenerationMode()
}
}
void Renderer::SetDepthMode()
void Renderer::SetDepthState(const DepthState& state)
{
const GLenum glCmpFuncs[8] = {GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL,
GL_GREATER, GL_NOTEQUAL, GL_GEQUAL, GL_ALWAYS};
if (bpmem.zmode.testenable)
if (state.testenable)
{
glEnable(GL_DEPTH_TEST);
glDepthMask(bpmem.zmode.updateenable ? GL_TRUE : GL_FALSE);
glDepthFunc(glCmpFuncs[bpmem.zmode.func]);
glDepthMask(state.updateenable ? GL_TRUE : GL_FALSE);
glDepthFunc(glCmpFuncs[state.func]);
}
else
{

View File

@ -80,7 +80,7 @@ public:
void SetBlendingState(const BlendingState& state) override;
void SetScissorRect(const EFBRectangle& rc) override;
void SetGenerationMode() override;
void SetDepthMode() override;
void SetDepthState(const DepthState& state) override;
void SetSamplerState(int stage, int texindex, bool custom_tex) override;
void SetInterlacingMode() override;
void SetViewport() override;