mirror of
https://github.com/godotengine/godot.git
synced 2024-12-09 10:09:20 +08:00
Merge pull request #9916 from bruvzg/3.0-msaa-check
Add missing max. number of samples (MSAA) check
This commit is contained in:
commit
3ea3c2d4cb
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user