diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2017-07-28 11:14:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-28 11:14:51 +0200 |
commit | 3ea3c2d4cbc96a1cc6e969a864bf7a98931c8e73 (patch) | |
tree | 75242386b5bd36345fdf284c53076a2b4a318fea | |
parent | a4c150d26c43717be425273523715dac015f3b16 (diff) | |
parent | 1a03cd537ffdaf99ad8294f95322dffc43ef9de4 (diff) |
Merge pull request #9916 from bruvzg/3.0-msaa-check
Add missing max. number of samples (MSAA) check
-rw-r--r-- | drivers/gles3/rasterizer_storage_gles3.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp index 2a9f078d8c..89bea1e8cc 100644 --- a/drivers/gles3/rasterizer_storage_gles3.cpp +++ b/drivers/gles3/rasterizer_storage_gles3.cpp @@ -5999,6 +5999,13 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) { static const int msaa_value[] = { 0, 2, 4, 8, 16 }; int msaa = msaa_value[rt->msaa]; + int max_samples = 0; + glGetIntegerv(GL_MAX_SAMPLES, &max_samples); + if (msaa > max_samples) { + WARN_PRINTS("MSAA must be <= GL_MAX_SAMPLES, falling-back to GL_MAX_SAMPLES = " + itos(max_samples)); + msaa = max_samples; + } + //regular fbo glGenFramebuffers(1, &rt->buffers.fbo); glBindFramebuffer(GL_FRAMEBUFFER, rt->buffers.fbo); |