diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2015-04-21 17:04:14 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2015-04-21 17:04:14 +0300 |
commit | de687b6fa02138146294c0a9a810c5234f1ac0dc (patch) | |
tree | b1099d2663267a1f565729e8451b6b94ff111fdf /source | |
parent | e3a6440e7af7f90432319aec9f6ad43b557def31 (diff) |
Fix T44465: Crash using VSE OGL render + Grease Pencil
Likely caused by rBd5f1b9c22233
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/render/render_opengl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 0a605297a4c..35478cc864f 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -248,6 +248,7 @@ static void screen_opengl_render_doit(OGLRender *oglrender, RenderResult *rr) Object *camera = NULL; ImBuf *ibuf; float winmat[4][4]; + float *rectf = RE_RenderViewGetRectf(rr, oglrender->view_id); int sizex = oglrender->sizex; int sizey = oglrender->sizey; const short view_context = (v3d != NULL); @@ -271,7 +272,6 @@ static void screen_opengl_render_doit(OGLRender *oglrender, RenderResult *rr) ibuf = BKE_sequencer_give_ibuf(&context, CFRA, chanshown); if (ibuf) { - float *rectf; ImBuf *linear_ibuf; BLI_assert((oglrender->sizex == ibuf->x) && (oglrender->sizey == ibuf->y)); @@ -292,7 +292,6 @@ static void screen_opengl_render_doit(OGLRender *oglrender, RenderResult *rr) BKE_sequencer_imbuf_from_sequencer_space(scene, linear_ibuf); } - rectf = RE_RenderViewGetRectf(rr, oglrender->view_id); memcpy(rectf, linear_ibuf->rect_float, sizeof(float) * 4 * oglrender->sizex * oglrender->sizey); IMB_freeImBuf(linear_ibuf); @@ -317,10 +316,12 @@ static void screen_opengl_render_doit(OGLRender *oglrender, RenderResult *rr) gp_rect = MEM_mallocN(sizex * sizey * sizeof(unsigned char) * 4, "offscreen rect"); GPU_offscreen_read_pixels(oglrender->ofs, GL_UNSIGNED_BYTE, gp_rect); + BLI_assert(rectf != NULL); + for (i = 0; i < sizex * sizey * 4; i += 4) { float col_src[4]; rgba_uchar_to_float(col_src, &gp_rect[i]); - blend_color_mix_float(&rr->rectf[i], &rr->rectf[i], col_src); + blend_color_mix_float(&rectf[i], &rectf[i], col_src); } GPU_offscreen_unbind(oglrender->ofs, true); |