summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2024-01-03 11:46:06 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2024-01-07 20:16:26 +0100
commit520d755d324a32c97cb9e25b617e99d0ab93d666 (patch)
tree2469ae0b821f127c5a3afee1211aaaa4a4c0e45f /src/gui/rhi
parentcc67b25579c1bb5ea9f5c1ca4c9b7997e66f19b9 (diff)
rhi: gl: Pretend 4x MSAA is always supported when cannot query
With ES 3.0 and up the GL_MAX_SAMPLES query is available and is guaranteed to be at least 4. With ES 2.0 there is no such query. While what we report from supportedSampleCounts() has little significance with OpenGL (for the window's color buffer it is anyway the QSurfaceFormat that decides, not QRhi), QRhi users such as Qt Quick may rely on supportedSampleCounts() returning real values and may, for example, warn if the value attempted to use is not in the supported list. (even if MSAA is fully functional) Avoid getting such warnings on a pure ES 2.0 implementation with 4x at least. Pick-to: 6.7 6.6 6.5 Fixes: QTBUG-120474 Change-Id: I8a34a8bc9ce37ce951fdf7794247e8db44435d41 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi')
-rw-r--r--src/gui/rhi/qrhigles2.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/rhi/qrhigles2.cpp b/src/gui/rhi/qrhigles2.cpp
index ec1a17459e..e41ac6d353 100644
--- a/src/gui/rhi/qrhigles2.cpp
+++ b/src/gui/rhi/qrhigles2.cpp
@@ -846,8 +846,8 @@ bool QRhiGles2::create(QRhi::Flags flags)
caps.maxDrawBuffers = 1;
caps.hasDrawBuffersFunc = false;
// This does not mean MSAA is not supported, just that we cannot query
- // the supported sample counts.
- caps.maxSamples = 1;
+ // the supported sample counts. Assume that 4x is always supported.
+ caps.maxSamples = 4;
}
caps.msaaRenderBuffer = f->hasOpenGLExtension(QOpenGLExtensions::FramebufferMultisample)