mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Renderer: Move depth state to VideoCommon and seperate from bpmem
This commit is contained in:
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user