Page MenuHomeWildfire Games

Bugfix: GLSL query for FXAA
ClosedPublic

Authored by OptimusShepard on Jun 1 2020, 9:22 PM.

Details

Summary

Disabling GLSL should disable FXAA. That doesn't currently work correct. The current implementation only blocking changes of FXAA settings, while GLSL is disabled.
The patch disables FXAA, when GLSL is disabled. Also, the option in the graphics menu gets blocked.

Test Plan

Test, if FXAA is automatically disabled, while GLSL is disabled.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

OptimusShepard created this revision.Jun 1 2020, 9:22 PM
Vulcan added a comment.Jun 1 2020, 9:25 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2290/display/redirect

vladislavbelov requested changes to this revision.EditedJun 8 2020, 8:11 PM

Could you please create the patch with context? (https://trac.wildfiregames.com/wiki/SubmittingPatches#Makingsomechanges)

Also isn't PostProc locked by GLSL? Since we don't have effects for ARB (iirc).

source/renderer/PostprocManager.cpp
504 ↗(On Diff #12097)

There is a case when you do a useless work: when no effects and no GLSL. I suggest to replace m_AATech && g_RenderingOptions.GetPreferGLSL() by hasAA (add const bool hasAA = m_AATech && g_RenderingOptions.GetPreferGLSL() near to const bool hasEffects = ...) here and in the condition with the early return above.

557 ↗(On Diff #12097)

That means that we're still going to load effect even without GLSL. Instead I suggest to leave the condition with the following code:

if (!g_RenderingOptions.GetPreferGLSL())
{
	m_AATech.reset();
	return;
}
This revision now requires changes to proceed.Jun 8 2020, 8:11 PM

Edit some comments.

OptimusShepard marked an inline comment as done.Jun 18 2020, 9:38 PM

Also isn't PostProc locked by GLSL? Since we don't have effects for ARB (iirc).

No it isn't. It's currently independent. I have also tried to lock postproc, to lock antialiasing, but that doesn't work. It would only lock postproc. A bit strange I think.

source/renderer/PostprocManager.cpp
557 ↗(On Diff #12097)

m_AATech.reset();
Seems to not working correctly. If I implement it, FXAA is always disabled.

This revision was not accepted when it landed; it landed in state Needs Review.Jul 24 2020, 8:48 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Owners added subscribers: Restricted Owners Package, Restricted Owners Package.Jul 24 2020, 8:48 PM