diff --git a/common/lc_context.cpp b/common/lc_context.cpp index baa90d46..99f1fa13 100644 --- a/common/lc_context.cpp +++ b/common/lc_context.cpp @@ -568,7 +568,7 @@ lcFramebuffer lcContext::CreateFramebuffer(int Width, int Height, bool Depth, bo #endif { #ifdef LC_USE_QOPENGLWIDGET - int Samples = (Multisample && gSupportsTexImage2DMultisample) ? QSurfaceFormat::defaultFormat().samples() : 1; + int Samples = (Multisample && gSupportsTexImage2DMultisample && QSurfaceFormat::defaultFormat().samples() > 1) ? QSurfaceFormat::defaultFormat().samples() : 1; #else int Samples = (Multisample && gSupportsTexImage2DMultisample && QGLFormat::defaultFormat().sampleBuffers()) ? QGLFormat::defaultFormat().samples() : 1; #endif diff --git a/common/lc_view.cpp b/common/lc_view.cpp index efb48a9b..278dd4c5 100644 --- a/common/lc_view.cpp +++ b/common/lc_view.cpp @@ -724,7 +724,9 @@ bool lcView::BeginRenderToImage(int Width, int Height) MaxTexture = qMin(MaxTexture, 2048); #ifdef LC_USE_QOPENGLWIDGET - MaxTexture /= QSurfaceFormat::defaultFormat().samples(); + const int Samples = QSurfaceFormat::defaultFormat().samples(); + if (Samples > 1) + MaxTexture /= Samples; #else MaxTexture /= QGLFormat::defaultFormat().sampleBuffers() ? QGLFormat::defaultFormat().samples() : 1; #endif