diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-04-14 17:35:30 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-04-14 17:35:30 +0300 |
commit | 89e23c743e601940fc051189ef01c537233d2043 (patch) | |
tree | 2993efd36c79cd4cc25a0a41f9509683c3e5e8a9 /source/blender/gpu/intern/gpu_framebuffer.c | |
parent | bef2aab862b83eec63ddfae460373aae280934b0 (diff) |
OpenGL: fix Mac crashing on startup
On Apple we use OpenGL 2.1 + an ARB extension for framebuffers.
The glFramebufferTexture function is part of OpenGL 3.0 but not part of the ARB extension. This commit fills that gap.
All other platforms are using GL 3.0+ already so it's not an issue there. All platforms (Mac too) will use GL 3.3+ soon so this workaround will be removed.
Diffstat (limited to 'source/blender/gpu/intern/gpu_framebuffer.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c index ce3b37b3a66..5e66c691f37 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.c +++ b/source/blender/gpu/intern/gpu_framebuffer.c @@ -143,7 +143,12 @@ bool GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, int slo else attachment = GL_COLOR_ATTACHMENT0 + slot; +#if defined(__APPLE__) && defined(WITH_GL_PROFILE_COMPAT) + /* Mac workaround, remove after we switch to core profile */ + glFramebufferTextureEXT(GL_FRAMEBUFFER, attachment, GPU_texture_opengl_bindcode(tex), 0); +#else glFramebufferTexture(GL_FRAMEBUFFER, attachment, GPU_texture_opengl_bindcode(tex), 0); +#endif if (GPU_texture_depth(tex)) fb->depthtex = tex; |