diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-02-17 16:05:19 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-02-17 16:12:54 +0300 |
commit | cbd0e09898b3cf9f85d208bcca1d43bb57708f15 (patch) | |
tree | ef932f8952b0a04e68b1beb1788ffb45f5080746 /source/blender/gpu | |
parent | f2453ecdcd179fb696494d03501c0dd149ee1ed2 (diff) |
Fix GL_FRAMEBUFFER_UNSUPPORTED warning in console on macOS.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c index 2c38319906c..e83eeefe2c5 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.c +++ b/source/blender/gpu/intern/gpu_framebuffer.c @@ -385,6 +385,13 @@ bool GPU_framebuffer_check_valid(GPUFrameBuffer *fb, char err_out[256]) glBindFramebuffer(GL_FRAMEBUFFER, fb->object); GG.currentfb = fb->object; + /* On macOS glDrawBuffer must be set when checking completeness, + * otherwise it will return GL_FRAMEBUFFER_UNSUPPORTED when only a + * color buffer without depth is used. */ + if (fb->colortex[0]) { + glDrawBuffer(GL_COLOR_ATTACHMENT0); + } + GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); if (status != GL_FRAMEBUFFER_COMPLETE) { |