Page MenuHomeWildfire Games

Bugfix: GLSL query for FXAA
Needs ReviewPublic

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

Details

Reviewers
vladislavbelov
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

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.EditedMon, Jun 8, 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

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

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.Mon, Jun 8, 8:11 PM

Edit some comments.

OptimusShepard marked an inline comment as done.Thu, Jun 18, 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

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