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
VertexShaderManager: Only look for freelook config changes if we're using freelook #8884
Conversation
|
I'd love to hear from other devs on how they handle config changes that can occur at any time? |
|
Snapshot at the beginning of the frame? It doesn't make sense to change this setting mid-rendering anyway. |
|
Also: |
This function is called on config change and writes the current config values to
|
|
Thank you both. This is useful. I'm going to be moving these settings out of the graphics/video config in #8867 so I was curious how that was working. Despite having looked at For now though, I will add this setting to |
c89cd60
to
c759c92
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM otherwise. I think the CheckForConfigChanges() method makes more sense though.
…ion each call which caused a performance hit, move check to RenderBase where it is checked when config changes
c759c92
to
0441d6a
Compare
|
Thanks @stenzek , updated per your suggestion. |
| @@ -406,6 +407,11 @@ void Renderer::CheckForConfigChanges() | |||
|
|
|||
| UpdateActiveConfig(); | |||
|
|
|||
| if (g_ActiveConfig.bFreeLook) | |||
| { | |||
| g_freelook_camera.SetControlType(g_ActiveConfig.iFreelookControlType); | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this function have to run every frame? Could you save the old freelook control type/freelook enable and only run it when that changes? e.g.
const bool old_freelook = g_ActiveConfig.bFreeLook;
const int old_freelook_control_type = g_ActiveConfig.iFreelookControlType;
if (old_freelook != g_ActiveConfig.bFreeLook || old_freelook_control_type != g_ActiveConfig.iFreelookControlType)
{
g_freelook_camera.SetControlType(g_ActiveConfig.iFreelookControlType);
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't have to but what's the point of all this checking? It doesn't really matter that function is called so often because the actual function already bails if there are no changes. The whole point is to just get the new value from configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't see the check here: https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoCommon/FreeLookCamera.cpp#L179
I misremembered it unconditionally reallocating it. In that case, it's fine as-is.
Another attempt to fix 12157. I made the assumption that pulling from our onion config system was relatively fast but that doesn't seem to be the case from testing that fifolog (4fps difference)