[Bf-blender-cvs] [f3d35797517] greasepencil-object: New MSAA macros
Antonio Vazquez
noreply at git.blender.org
Tue Oct 10 18:50:16 CEST 2017
Commit: f3d35797517eeb5780be857aab773d6639f29f26
Author: Antonio Vazquez
Date: Tue Oct 10 18:41:06 2017 +0200
Branches: greasepencil-object
https://developer.blender.org/rBf3d35797517eeb5780be857aab773d6639f29f26
New MSAA macros
Define macros for cleanup code.
===================================================================
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 35c47d0bf89..94a05a6d606 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -635,21 +635,13 @@ static void GPENCIL_draw_scene(void *vedata)
}
if (end_grp >= init_grp) {
- if (dfbl->multisample_fb != NULL) {
- 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);
- }
+ MULTISAMPLE_GP_SYNC_ENABLE(dfbl, fbl);
DRW_draw_pass_subset(psl->stroke_pass,
stl->shgroups[init_grp].shgrps_fill != NULL ? stl->shgroups[init_grp].shgrps_fill : stl->shgroups[init_grp].shgrps_stroke,
stl->shgroups[end_grp].shgrps_stroke);
- if (dfbl->multisample_fb != NULL) {
- 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);
- }
+ MULTISAMPLE_GP_SYNC_DISABLE(dfbl, fbl);
}
/* Current buffer drawing */
if (ob->gpd->sbuffer_size > 0) {
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h
index d02a26c60cc..a8cb38c04c5 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.h
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.h
@@ -49,6 +49,23 @@ struct GPENCIL_StorageList;
#define GP_SIMPLIFY_MODIF(ts, playing) ((GP_SIMPLIFY_ONPLAY(playing) && (GP_SIMPLIFY(ts)) && (ts->gpencil_simplify & GP_TOOL_FLAG_SIMPLIFY_VIEW_MODIF)))
#define GP_SIMPLIFY_VFX(ts, playing) ((GP_SIMPLIFY_ONPLAY(playing) && (GP_SIMPLIFY(ts)) && (ts->gpencil_simplify & GP_TOOL_FLAG_SIMPLIFY_VIEW_VFX)))
+ /* anti aliasing macros using MSAA */
+#define MULTISAMPLE_GP_SYNC_ENABLE(dfbl, fbl) { \
+ if (dfbl->multisample_fb != NULL) { \
+ 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); \
+ } \
+}
+
+#define MULTISAMPLE_GP_SYNC_DISABLE(dfbl, fbl) { \
+ if (dfbl->multisample_fb != NULL) { \
+ 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); \
+ } \
+}
+
/* *********** OBJECTS CACHE *********** */
typedef struct GPencilVFXSwirl {
float center[2];
More information about the Bf-blender-cvs
mailing list