Fixed MSAA check.

This commit is contained in:
Leonardo Zide 2020-12-28 14:36:04 -08:00
parent 0499e055e1
commit 985fb8b778
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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