diff options
author | Louai Al-Khanji <louai.al-khanji@theqtcompany.com> | 2016-03-28 10:37:44 -0700 |
---|---|---|
committer | Louai Al-Khanji <louai.al-khanji@theqtcompany.com> | 2016-04-01 22:01:14 +0000 |
commit | 36bc2477753d19a14c587b97d4ec4f263e9e16c0 (patch) | |
tree | 59f005ce1dc84724b8ebe85bfac3cdfce8927730 /src/platformsupport/glxconvenience/qglxconvenience.cpp | |
parent | 77c0730f55ede6117028805bbf05a6180c248c73 (diff) |
EGL/GLX: Resolve depth buffer more intelligently
If a depth buffer size >=32 is requested, try 24 bits as a fallback.
Task-number: QTBUG-44029
Done-with: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Change-Id: I43157d17c2bfe19b3b4a9139412e4c297e6150b7
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/platformsupport/glxconvenience/qglxconvenience.cpp')
-rw-r--r-- | src/platformsupport/glxconvenience/qglxconvenience.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/platformsupport/glxconvenience/qglxconvenience.cpp b/src/platformsupport/glxconvenience/qglxconvenience.cpp index 5fafdcf0c0..870e746a53 100644 --- a/src/platformsupport/glxconvenience/qglxconvenience.cpp +++ b/src/platformsupport/glxconvenience/qglxconvenience.cpp @@ -323,7 +323,11 @@ QSurfaceFormat qglx_reduceSurfaceFormat(const QSurfaceFormat &format, bool *redu QSurfaceFormat retFormat = format; *reduced = true; - if (retFormat.redBufferSize() > 1) { + if (retFormat.depthBufferSize() >= 32) { + retFormat.setDepthBufferSize(24); + } else if (retFormat.depthBufferSize() > 0) { + retFormat.setDepthBufferSize(0); + } else if (retFormat.redBufferSize() > 1) { retFormat.setRedBufferSize(1); } else if (retFormat.greenBufferSize() > 1) { retFormat.setGreenBufferSize(1); @@ -337,8 +341,6 @@ QSurfaceFormat qglx_reduceSurfaceFormat(const QSurfaceFormat &format, bool *redu retFormat.setStencilBufferSize(0); }else if (retFormat.hasAlpha()) { retFormat.setAlphaBufferSize(0); - }else if (retFormat.depthBufferSize() > 0) { - retFormat.setDepthBufferSize(0); }else if (retFormat.swapBehavior() != QSurfaceFormat::SingleBuffer) { retFormat.setSwapBehavior(QSurfaceFormat::SingleBuffer); }else{ |