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

Render the project offscreen and present it using DirectX or Vulkan to solve NVIDIA Optimus stuttering #1725

Closed
EIREXE opened this issue Oct 26, 2020 · 9 comments

Comments

@EIREXE
Copy link

EIREXE commented Oct 26, 2020

Describe the project you are working on:

A rhythm game in Godot.

Describe the problem or limitation you are having in your project:

OpenGL software has stuttering issues in some NVIDIA Optimus setups, this is universal and the only solution is to either not use OpenGL or to render the OpenGL buffer offscreen and present it using DirectX or Vulkan and forcing v-sync to be on.

Vulkan is preferred, as that leads to the least amount of problems in my experience using ANGLE.

Describe the feature / enhancement and how it helps to overcome the problem or limitation:

An option that allows the game to render offscreen and be presented by Dx11 or Vulkan.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:

I suppose the best way would be to do this in the Windows OS code, possibly overriding something in the GL context code.

If this enhancement will not be used often, can it be worked around with a few lines of script?:

There is no solution.

Is there a reason why this should be core and not an add-on in the asset library?:

This is a fairly low level change that can't be done from an asset.

P.S:

It is obvious this change would only apply to 3.2 and the GLES2 renderer in 4.0.

@Calinou Calinou changed the title Rendering game offscreen and presenting it using DirectX/Vulkan to solve NVIDIA Optimus stuttering. Render the project offscreen and present it using DirectX or Vulkan to solve NVIDIA Optimus stuttering Oct 26, 2020
@EIREXE
Copy link
Author

EIREXE commented Oct 28, 2020

It has been informed to me that the actual way to fix this issue is to have exclusive fullscreen, is it planned for 4.0?

Keep in mind the solution only works if we are using EGL, so that would have to be changed too, I can take a crack at it.

@Calinou
Copy link
Member

Calinou commented Oct 28, 2020

It has been informed to me that the actual way to fix this issue is to have exclusive fullscreen, is it planned for 4.0?

Not that I know of. In general, exclusive fullscreen is becoming increasingly less relevant over time due to the lower convenience compared to a borderless fullscreen window. See also godotengine/godot#41746.

@EIREXE
Copy link
Author

EIREXE commented Oct 28, 2020

It has been informed to me that the actual way to fix this issue is to have exclusive fullscreen, is it planned for 4.0?

Not that I know of. In general, exclusive fullscreen is becoming increasingly less relevant over time due to the lower convenience compared to a borderless fullscreen window. See also godotengine/godot#41746.

I will be doing a PR switching WGL with EGL if you think it's reasonable, and implementing exclusive fullscreen as an option, because the games are unplayable on optimus.

@Calinou
Copy link
Member

Calinou commented Jan 23, 2021

@EIREXE Is this still relevant with godotengine/godot#44845?

@EIREXE
Copy link
Author

EIREXE commented Jan 23, 2021

@EIREXE Is this still relevant with godotengine/godot#44845?

Actually no, that does fix it, I also have another patch to fix fullscreen to behave like borderless windowed ready after that. I still have to port it to 4.0 though.

@Calinou
Copy link
Member

Calinou commented Nov 14, 2022

@EIREXE Is this still an issue on the latest NVIDIA drivers (526.86 as of writing)?

@EIREXE
Copy link
Author

EIREXE commented Nov 14, 2022

@EIREXE Is this still an issue on the latest NVIDIA drivers (526.86 as of writing)?

As I understand yes, but only on opengl

@EIREXE
Copy link
Author

EIREXE commented Dec 18, 2023

This doesn't apply anymore I believe since nvidia threaded optimization is now disabled.

@EIREXE EIREXE closed this as completed Dec 18, 2023
@Calinou
Copy link
Member

Calinou commented Dec 19, 2023

Note that DXGI presentation of Vulkan is tracked in a separate proposal: #5692

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

No branches or pull requests

2 participants