mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-27 03:14:17 +01:00
GPU: Synchronize the blend state on every draw call.
Only independent blending on render target 0 is implemented for now. This fixes the elongated squids in Splatoon 2's boot screen.
This commit is contained in:
parent
c712dafaee
commit
c011b6f67e
@ -349,6 +349,9 @@ void RasterizerOpenGL::DrawArrays() {
|
|||||||
// Sync the viewport
|
// Sync the viewport
|
||||||
SyncViewport(surfaces_rect, res_scale);
|
SyncViewport(surfaces_rect, res_scale);
|
||||||
|
|
||||||
|
// Sync the blend state registers
|
||||||
|
SyncBlendState();
|
||||||
|
|
||||||
// TODO(bunnei): Sync framebuffer_scale uniform here
|
// TODO(bunnei): Sync framebuffer_scale uniform here
|
||||||
// TODO(bunnei): Sync scissorbox uniform(s) here
|
// TODO(bunnei): Sync scissorbox uniform(s) here
|
||||||
|
|
||||||
@ -735,14 +738,21 @@ void RasterizerOpenGL::SyncDepthOffset() {
|
|||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerOpenGL::SyncBlendEnabled() {
|
void RasterizerOpenGL::SyncBlendState() {
|
||||||
UNREACHABLE();
|
const auto& regs = Core::System().GetInstance().GPU().Maxwell3D().regs;
|
||||||
}
|
ASSERT_MSG(regs.independent_blend_enable == 1, "Only independent blending is implemented");
|
||||||
|
|
||||||
void RasterizerOpenGL::SyncBlendFuncs() {
|
// TODO(Subv): Support more than just render target 0.
|
||||||
UNREACHABLE();
|
state.blend.enabled = regs.blend.enable[0] != 0;
|
||||||
}
|
|
||||||
|
|
||||||
void RasterizerOpenGL::SyncBlendColor() {
|
if (!state.blend.enabled)
|
||||||
UNREACHABLE();
|
return;
|
||||||
|
|
||||||
|
ASSERT_MSG(!regs.independent_blend[0].separate_alpha, "Unimplemented");
|
||||||
|
state.blend.rgb_equation = MaxwellToGL::BlendEquation(regs.independent_blend[0].equation_rgb);
|
||||||
|
state.blend.src_rgb_func = MaxwellToGL::BlendFunc(regs.independent_blend[0].factor_source_rgb);
|
||||||
|
state.blend.dst_rgb_func = MaxwellToGL::BlendFunc(regs.independent_blend[0].factor_dest_rgb);
|
||||||
|
state.blend.a_equation = MaxwellToGL::BlendEquation(regs.independent_blend[0].equation_a);
|
||||||
|
state.blend.src_a_func = MaxwellToGL::BlendFunc(regs.independent_blend[0].factor_source_a);
|
||||||
|
state.blend.dst_a_func = MaxwellToGL::BlendFunc(regs.independent_blend[0].factor_dest_a);
|
||||||
}
|
}
|
||||||
|
@ -121,14 +121,8 @@ private:
|
|||||||
/// Syncs the depth offset to match the guest state
|
/// Syncs the depth offset to match the guest state
|
||||||
void SyncDepthOffset();
|
void SyncDepthOffset();
|
||||||
|
|
||||||
/// Syncs the blend enabled status to match the guest state
|
/// Syncs the blend state to match the guest state
|
||||||
void SyncBlendEnabled();
|
void SyncBlendState();
|
||||||
|
|
||||||
/// Syncs the blend functions to match the guest state
|
|
||||||
void SyncBlendFuncs();
|
|
||||||
|
|
||||||
/// Syncs the blend color to match the guest state
|
|
||||||
void SyncBlendColor();
|
|
||||||
|
|
||||||
bool has_ARB_buffer_storage;
|
bool has_ARB_buffer_storage;
|
||||||
bool has_ARB_direct_state_access;
|
bool has_ARB_direct_state_access;
|
||||||
|
Loading…
Reference in New Issue
Block a user