diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-09-23 21:34:14 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-09-25 21:14:42 +0300 |
commit | 2a7b747f18cd35827ee19517ff1c0c50e602f398 (patch) | |
tree | 1a4e2856894bfc79959666a9d2d49b03015492dc /source/blender/gpu | |
parent | e61572422144a2fd1047f83c44b86e2102e783e3 (diff) |
GPUFramebuffer: Fix Blit function so that it works with multisample textures.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c index 48a8267bff2..4ba0d5543fe 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.c +++ b/source/blender/gpu/intern/gpu_framebuffer.c @@ -519,16 +519,17 @@ void GPU_framebuffer_blit(GPUFrameBuffer *fb_read, int read_slot, GPUFrameBuffer glBindFramebuffer(GL_READ_FRAMEBUFFER, fb_read->object); glFramebufferTexture2D( GL_READ_FRAMEBUFFER, read_attach, - GL_TEXTURE_2D, read_bind, 0); + GPU_texture_target(read_tex), read_bind, 0); BLI_assert(glCheckFramebufferStatus(GL_READ_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); /* write into new single-sample buffer */ glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb_write->object); glFramebufferTexture2D( GL_DRAW_FRAMEBUFFER, write_attach, - GL_TEXTURE_2D, write_bind, 0); + GPU_texture_target(write_tex), write_bind, 0); BLI_assert(glCheckFramebufferStatus(GL_DRAW_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE); + glDrawBuffer((use_depth) ? GL_COLOR_ATTACHMENT0 : read_attach); glBlitFramebuffer(0, 0, read_w, read_h, 0, 0, write_w, write_h, (use_depth) ? GL_DEPTH_BUFFER_BIT : GL_COLOR_BUFFER_BIT, GL_NEAREST); /* Restore previous framebuffer */ |