QOpenGLWidget creates 6kx3k fbos
-
Hi,
I'm working on an OpenGL game and i've encountered a performance issue when using a mac, with a 4k display.
When I'm running my game on a 4k display in non scaled mode I have a viewport resolution of resolution of 3840 * 2160 and Qt internally renders at this resolution. This is a 1:1 to resolution of my monitor and my game renders fine. But when I run the game at a lower resolution 3360 * 1890 high DPI scaling kicks in which causes an internal resolution of 6720 * 3780 and this is killing performance. I've been poking around in the code and OpenGlWidget and had some some success getting some performance back by removing this scale when OpenGlWidget renders to its fbos - but the underlying surface still has a the *2 scale applied.
I understand why you would want to render at a high dpi for text, buttons etc, but for an opengl viewport in a game - it's totally overkill.
Is there a way to disable scaling on a OpenGlWidget so that it internally always renders as the native resolution.
Thanks
-
Hi and welcome to devnet,
You should add which version of Qt you are using as well as version of macOS.
-
Can you provide a minimal example that shows this behaviour ?