Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoCommon: Better logic op invert approximation #10864

Merged
merged 1 commit into from Jan 31, 2023

Conversation

TellowKrinkle
Copy link
Contributor

Uses a bit of cooperation from the shader to perfectly emulate the Invert and CopyInverted logic ops with blending

Makes f-zero-missing-shadows.dff.zip (which uses Invert) work on logic-op-free systems.

@JMC47
Copy link
Contributor

JMC47 commented Sep 30, 2022

Is there anything else remaining on this?

ps->emulate_logic_op_with_blend = true;
ps->logic_op_mode = static_cast<u32>(blend.logicmode.Value());
}
blend.ApproximateLogicOpWithBlending();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're different. The new boolean in approximations is whether blending should be enabled. LogicOpApproximationIsExact says whether an approximation gives identical results to the real thing. As an example of a logic op where the two aren't the same, Invert has blending enabled but perfectly emulates the logic op, and therefore returns true from LogicOpApproximationIsExact.

@dvessel
Copy link
Contributor

dvessel commented Oct 21, 2022

Been running this for months. Found no issues with it.

@AdmiralCurtiss
Copy link
Contributor

Do we want to merge this?

@AdmiralCurtiss
Copy link
Contributor

Can you rebase this so fifoci runs on this again?

@TellowKrinkle
Copy link
Contributor Author

Can you rebase this so fifoci runs on this again?

Done

Just a heads up, fifoci won't test this because all its runners support logic ops. The main logic-op-free API is Metal/MVK, and it supports logic ops via framebuffer fetch on the CI (M1).

@OatmealDome
Copy link
Member

OatmealDome commented Jan 31, 2023

Tested on my MacBook Pro 16" (which doesn't support fbfetch on its dGPU), and the linked FIFO log now renders correctly. Other logic ops games like Kirby's Air Ride and Star Fox Adventures continue to render properly as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants