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

@ -68,12 +68,14 @@ void SetScissor()
void SetDepthMode()
{
g_renderer->SetDepthMode();
DepthState state = {};
state.Generate(bpmem);
g_renderer->SetDepthState(state);
}
void SetBlendMode()
{
BlendingState state;
BlendingState state = {};
state.Generate(bpmem);
g_renderer->SetBlendingState(state);
}

View File

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

View File

@ -4,6 +4,13 @@
#include "VideoCommon/RenderState.h"
void DepthState::Generate(const BPMemory& bp)
{
testenable = bp.zmode.testenable.Value();
updateenable = bp.zmode.updateenable.Value();
func = bp.zmode.func.Value();
}
// If the framebuffer format has no alpha channel, it is assumed to
// ONE on blending. As the backends may emulate this framebuffer
// configuration with an alpha channel, we just drop all references

View File

@ -9,6 +9,17 @@
#include "VideoCommon/BPMemory.h"
#include "VideoCommon/BPStructs.h"
union DepthState
{
void Generate(const BPMemory& bp);
BitField<0, 1, u32> testenable;
BitField<1, 1, u32> updateenable;
BitField<2, 3, ZMode::CompareMode> func;
u32 hex;
};
union BlendingState
{
void Generate(const BPMemory& bp);