diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/windowmanager/intern/wm_draw.c | 23 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_stereo.c | 6 | ||||
-rw-r--r-- | source/blender/windowmanager/wm_draw.h | 2 |
3 files changed, 21 insertions, 10 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 3825db14e93..77ffa46b990 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -430,7 +430,7 @@ static int wm_triple_gen_textures(wmWindow *win, wmDrawTriple *triple) return 1; } -void wm_triple_draw_textures(wmWindow *win, wmDrawTriple *triple, float alpha) +void wm_triple_draw_textures(wmWindow *win, wmDrawTriple *triple, float alpha, bool is_interlace) { const int sizex = WM_window_pixels_x(win); const int sizey = WM_window_pixels_y(win); @@ -451,7 +451,13 @@ void wm_triple_draw_textures(wmWindow *win, wmDrawTriple *triple, float alpha) halfy /= triple->y; } - GPU_basic_shader_bind((triple->target == GL_TEXTURE_2D) ? GPU_SHADER_TEXTURE_2D : GPU_SHADER_TEXTURE_RECT); + /* interlace stereo buffer bind the shader before calling wm_triple_draw_textures */ + if (is_interlace) { + glEnable(triple->target); + } + else { + GPU_basic_shader_bind((triple->target == GL_TEXTURE_2D) ? GPU_SHADER_TEXTURE_2D : GPU_SHADER_TEXTURE_RECT); + } glBindTexture(triple->target, triple->bind); @@ -472,7 +478,12 @@ void wm_triple_draw_textures(wmWindow *win, wmDrawTriple *triple, float alpha) glBindTexture(triple->target, 0); - GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); + if (is_interlace) { + glDisable(triple->target); + } + else { + GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); + } } static void wm_triple_copy_textures(wmWindow *win, wmDrawTriple *triple) @@ -495,7 +506,7 @@ static void wm_draw_region_blend(wmWindow *win, ARegion *ar, wmDrawTriple *tripl wmSubWindowScissorSet(win, win->screen->mainwin, &ar->winrct, true); glEnable(GL_BLEND); - wm_triple_draw_textures(win, triple, 1.0f - fac); + wm_triple_draw_textures(win, triple, 1.0f - fac, false); glDisable(GL_BLEND); } } @@ -516,7 +527,7 @@ static void wm_method_draw_triple(bContext *C, wmWindow *win) wmSubWindowSet(win, screen->mainwin); - wm_triple_draw_textures(win, drawdata->triple, 1.0f); + wm_triple_draw_textures(win, drawdata->triple, 1.0f, false); } else { /* we run it when we start OR when we turn stereo on */ @@ -656,7 +667,7 @@ static void wm_method_draw_triple_multiview(bContext *C, wmWindow *win, StereoVi wmSubWindowSet(win, screen->mainwin); - wm_triple_draw_textures(win, drawdata->triple, 1.0f); + wm_triple_draw_textures(win, drawdata->triple, 1.0f, false); } } else { diff --git a/source/blender/windowmanager/intern/wm_stereo.c b/source/blender/windowmanager/intern/wm_stereo.c index 1c1c2ad35af..46cee907991 100644 --- a/source/blender/windowmanager/intern/wm_stereo.c +++ b/source/blender/windowmanager/intern/wm_stereo.c @@ -77,7 +77,7 @@ static void wm_method_draw_stereo3d_pageflip(wmWindow *win) else //STEREO_RIGHT_ID glDrawBuffer(GL_BACK_RIGHT); - wm_triple_draw_textures(win, drawdata->triple, 1.0f); + wm_triple_draw_textures(win, drawdata->triple, 1.0f, false); } glDrawBuffer(GL_BACK); @@ -120,7 +120,7 @@ static void wm_method_draw_stereo3d_interlace(wmWindow *win) break; } - wm_triple_draw_textures(win, drawdata->triple, 1.0f); + wm_triple_draw_textures(win, drawdata->triple, 1.0f, true); GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); } interlace_prev_type = interlace_type; @@ -157,7 +157,7 @@ static void wm_method_draw_stereo3d_anaglyph(wmWindow *win) break; } - wm_triple_draw_textures(win, drawdata->triple, 1.0f); + wm_triple_draw_textures(win, drawdata->triple, 1.0f, false); glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); } diff --git a/source/blender/windowmanager/wm_draw.h b/source/blender/windowmanager/wm_draw.h index 0f125309045..5257bba45ff 100644 --- a/source/blender/windowmanager/wm_draw.h +++ b/source/blender/windowmanager/wm_draw.h @@ -56,7 +56,7 @@ void wm_draw_region_clear (struct wmWindow *win, struct ARegion *ar); void wm_tag_redraw_overlay (struct wmWindow *win, struct ARegion *ar); -void wm_triple_draw_textures (struct wmWindow *win, struct wmDrawTriple *triple, float alpha); +void wm_triple_draw_textures (struct wmWindow *win, struct wmDrawTriple *triple, float alpha, bool is_interlace); void wm_draw_data_free (struct wmWindow *win); |