Skip to content

GS-hw: Fix recent alpha max check.#5197

Merged
lightningterror merged 2 commits into
masterfrom
more-alpha-checks
Dec 25, 2021
Merged

GS-hw: Fix recent alpha max check.#5197
lightningterror merged 2 commits into
masterfrom
more-alpha-checks

Conversation

@lightningterror

@lightningterror lightningterror commented Dec 20, 2021

Copy link
Copy Markdown
Contributor

Description of Changes

GS: Redo GetAlphaMinMax.
Cleaner this way, also fix recent regression on Full Blend with alpha max.

GS-hw: Move the blend mix alpha check after sw blending selection.
Optimization.

Rationale behind Changes

Fix recent regression and optimization.

Suggested Testing Steps

Test blending and make sure still works on both renderers.

@TellowKrinkle

Copy link
Copy Markdown
Member

Instead of this mess where we try to do all sorts of checks to only run GetAlphaMinMax() when needed, why not just have GetAlphaMinMax() return a reference to m_vt.alpha and then just do GetAlphaMinMax().max

Then we won't accidentally mess up conditions and we won't have to worry about that anymore at all

@TellowKrinkle

TellowKrinkle commented Dec 20, 2021

Copy link
Copy Markdown
Member

Side note, GetAlphaMinMax() already checks m_vt.m_alpha.valid for an early return. But if you're worried about function call overhead, since compilers are terrible at splitting functions into a small inlinable part and a big rest of the function, you can do that manually and split GetAlphaMinMax() into

private:
	void CalcAlphaMinMax();
public:
	GSVertexTrace::VertexAlpha& GetAlphaMinMax()
	{
		if (!m_vt.m_alpha.valid)
			CalcAlphaMinMax();
		return m_vt.m_alpha;
	}

Cleaner this way, also fix recent regression on Full Blend with alpha max.
@lightningterror
lightningterror merged commit 013c907 into master Dec 25, 2021
@lightningterror
lightningterror deleted the more-alpha-checks branch December 25, 2021 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants