mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-16 17:18:01 -05:00
Fix stencil func registers, make clip control equivalent to how it was before, but surely wrong.
This commit is contained in:
@ -658,8 +658,13 @@ void RasterizerOpenGL::SyncDepthClamp() {
|
||||
}
|
||||
flags[Dirty::DepthClampEnabled] = false;
|
||||
|
||||
oglEnable(GL_DEPTH_CLAMP, maxwell3d->regs.viewport_clip_control.geometry_clip !=
|
||||
Maxwell::ViewportClipControl::GeometryClip::Passthrough);
|
||||
bool depth_clamp_disabled{maxwell3d->regs.viewport_clip_control.geometry_clip ==
|
||||
Maxwell::ViewportClipControl::GeometryClip::Passthrough ||
|
||||
maxwell3d->regs.viewport_clip_control.geometry_clip ==
|
||||
Maxwell::ViewportClipControl::GeometryClip::FrustumXYZ ||
|
||||
maxwell3d->regs.viewport_clip_control.geometry_clip ==
|
||||
Maxwell::ViewportClipControl::GeometryClip::FrustumZ};
|
||||
oglEnable(GL_DEPTH_CLAMP, !depth_clamp_disabled);
|
||||
}
|
||||
|
||||
void RasterizerOpenGL::SyncClipEnabled(u32 clip_mask) {
|
||||
@ -746,19 +751,19 @@ void RasterizerOpenGL::SyncStencilTestState() {
|
||||
oglEnable(GL_STENCIL_TEST, regs.stencil_enable);
|
||||
|
||||
glStencilFuncSeparate(GL_FRONT, MaxwellToGL::ComparisonOp(regs.stencil_front_op.func),
|
||||
regs.stencil_front_func.ref, regs.stencil_front_func.func_mask);
|
||||
regs.stencil_front_ref, regs.stencil_front_func_mask);
|
||||
glStencilOpSeparate(GL_FRONT, MaxwellToGL::StencilOp(regs.stencil_front_op.fail),
|
||||
MaxwellToGL::StencilOp(regs.stencil_front_op.zfail),
|
||||
MaxwellToGL::StencilOp(regs.stencil_front_op.zpass));
|
||||
glStencilMaskSeparate(GL_FRONT, regs.stencil_front_func.mask);
|
||||
glStencilMaskSeparate(GL_FRONT, regs.stencil_front_mask);
|
||||
|
||||
if (regs.stencil_two_side_enable) {
|
||||
glStencilFuncSeparate(GL_BACK, MaxwellToGL::ComparisonOp(regs.stencil_back_op.func),
|
||||
regs.stencil_back_func.ref, regs.stencil_back_func.mask);
|
||||
regs.stencil_back_ref, regs.stencil_back_mask);
|
||||
glStencilOpSeparate(GL_BACK, MaxwellToGL::StencilOp(regs.stencil_back_op.fail),
|
||||
MaxwellToGL::StencilOp(regs.stencil_back_op.zfail),
|
||||
MaxwellToGL::StencilOp(regs.stencil_back_op.zpass));
|
||||
glStencilMaskSeparate(GL_BACK, regs.stencil_back_func.mask);
|
||||
glStencilMaskSeparate(GL_BACK, regs.stencil_back_mask);
|
||||
} else {
|
||||
glStencilFuncSeparate(GL_BACK, GL_ALWAYS, 0, 0xFFFFFFFF);
|
||||
glStencilOpSeparate(GL_BACK, GL_KEEP, GL_KEEP, GL_KEEP);
|
||||
|
@ -100,14 +100,12 @@ void SetupDirtyDepthTest(Tables& tables) {
|
||||
|
||||
void SetupDirtyStencilTest(Tables& tables) {
|
||||
static constexpr std::array offsets = {
|
||||
OFF(stencil_enable), OFF(stencil_front_op.func),
|
||||
OFF(stencil_front_func.ref), OFF(stencil_front_func.func_mask),
|
||||
OFF(stencil_front_op.fail), OFF(stencil_front_op.zfail),
|
||||
OFF(stencil_front_op.zpass), OFF(stencil_front_func.mask),
|
||||
OFF(stencil_two_side_enable), OFF(stencil_back_op.func),
|
||||
OFF(stencil_back_func.ref), OFF(stencil_back_func.func_mask),
|
||||
OFF(stencil_back_op.fail), OFF(stencil_back_op.zfail),
|
||||
OFF(stencil_back_op.zpass), OFF(stencil_back_func.mask)};
|
||||
OFF(stencil_enable), OFF(stencil_front_op.func), OFF(stencil_front_ref),
|
||||
OFF(stencil_front_func_mask), OFF(stencil_front_op.fail), OFF(stencil_front_op.zfail),
|
||||
OFF(stencil_front_op.zpass), OFF(stencil_front_mask), OFF(stencil_two_side_enable),
|
||||
OFF(stencil_back_op.func), OFF(stencil_back_ref), OFF(stencil_back_func_mask),
|
||||
OFF(stencil_back_op.fail), OFF(stencil_back_op.zfail), OFF(stencil_back_op.zpass),
|
||||
OFF(stencil_back_mask)};
|
||||
for (const auto offset : offsets) {
|
||||
tables[0][offset] = StencilTest;
|
||||
}
|
||||
|
Reference in New Issue
Block a user