[Bf-blender-cvs] [895ec888577] greasepencil-object: Set default framebuffer

Antonio Vazquez noreply at git.blender.org
Wed Oct 11 10:56:46 CEST 2017


Commit: 895ec8885777d584a1931024a1267359f993a770
Author: Antonio Vazquez
Date:   Wed Oct 11 09:58:10 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rB895ec8885777d584a1931024a1267359f993a770

Set default framebuffer

After detach textures must set the default buffer again.

Also checked the number of samples, not only framebuffer.

===================================================================

M	source/blender/draw/engines/gpencil/gpencil_engine.c
M	source/blender/draw/engines/gpencil/gpencil_engine.h

===================================================================

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 43f525d5606..12a6bc217b1 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -607,6 +607,10 @@ static void GPENCIL_draw_scene(void *vedata)
 
 		DRW_framebuffer_texture_detach(e_data.temp_fbcolor_depth_tx);
 		DRW_framebuffer_texture_detach(e_data.temp_fbcolor_color_tx);
+
+		/* attach again default framebuffer after detach textures */
+		DRW_framebuffer_bind(dfbl->default_fb);
+
 		/* free memory */
 		gpencil_free_obj_list(stl);
 		return;
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h
index a8cb38c04c5..bf0a3e1eca9 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -51,18 +51,22 @@ struct GPENCIL_StorageList;
 
  /* anti aliasing macros using MSAA */
 #define MULTISAMPLE_GP_SYNC_ENABLE(dfbl, fbl) { \
-	if (dfbl->multisample_fb != NULL) { \
+	if ((U.ogl_multisamples > 0) && (dfbl->multisample_fb != NULL)) { \
+		DRW_stats_query_start("GP Multisample Blit"); \
 		DRW_framebuffer_blit(fbl->temp_color_fb, dfbl->multisample_fb, false); \
 		DRW_framebuffer_blit(fbl->temp_color_fb, dfbl->multisample_fb, true); \
 		DRW_framebuffer_bind(dfbl->multisample_fb); \
+		DRW_stats_query_end(); \
 	} \
 }
 
 #define MULTISAMPLE_GP_SYNC_DISABLE(dfbl, fbl) { \
-	if (dfbl->multisample_fb != NULL) { \
+	if ((U.ogl_multisamples > 0) && (dfbl->multisample_fb != NULL)) { \
+		DRW_stats_query_start("GP Multisample Resolve"); \
 		DRW_framebuffer_blit(dfbl->multisample_fb, fbl->temp_color_fb, false); \
 		DRW_framebuffer_blit(dfbl->multisample_fb, fbl->temp_color_fb, true); \
 		DRW_framebuffer_bind(fbl->temp_color_fb); \
+		DRW_stats_query_end(); \
 	} \
 }



More information about the Bf-blender-cvs mailing list