[Bf-blender-cvs] [b66a221835d] temp-gpencil-drw-engine: GPencil: Reduce parameters for draw_pass_range

Antonioya noreply at git.blender.org
Fri Jun 28 23:02:57 CEST 2019


Commit: b66a221835debec1a6217c43b2d155c9840d61ac
Author: Antonioya
Date:   Fri Jun 28 23:02:51 2019 +0200
Branches: temp-gpencil-drw-engine
https://developer.blender.org/rBb66a221835debec1a6217c43b2d155c9840d61ac

GPencil: Reduce parameters for draw_pass_range

Don't need to pass redudant parameter

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

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

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

diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index 30498bb6d77..73227bcddde 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -817,8 +817,7 @@ static void gpencil_free_runtime_data(GPENCIL_StorageList *stl)
   MEM_SAFE_FREE(stl->g_data->gp_object_cache);
 }
 
-static void gpencil_draw_pass_range(GPENCIL_FramebufferList *fbl,
-                                    GPENCIL_StorageList *stl,
+static void gpencil_draw_pass_range(GPENCIL_StorageList *stl,
                                     GPENCIL_PassList *psl,
                                     GPUFrameBuffer *fb,
                                     Object *ob,
@@ -830,9 +829,6 @@ static void gpencil_draw_pass_range(GPENCIL_FramebufferList *fbl,
     return;
   }
 
-  const bool do_antialiasing = ((!stl->storage->is_mat_preview) &&
-                                (stl->storage->multisamples > 0));
-
   DRWShadingGroup *shgrp = init_shgrp;
   DRWShadingGroup *from_shgrp = init_shgrp;
   DRWShadingGroup *to_shgrp = init_shgrp;
@@ -858,12 +854,7 @@ static void gpencil_draw_pass_range(GPENCIL_FramebufferList *fbl,
                            from_shgrp,
                            to_shgrp);
       /* Clear Stencil and prepare for next group. */
-      if (do_antialiasing) {
-        GPU_framebuffer_clear_stencil(fbl->multisample_fb, 0x0);
-      }
-      else {
-        GPU_framebuffer_clear_stencil(fb, 0x0);
-      }
+      GPU_framebuffer_clear_stencil(fb, 0x0);
 
       /* Set new init group and reset. */
       do_last = false;
@@ -1027,6 +1018,8 @@ void GPENCIL_draw_scene(void *ved)
 
       GPU_framebuffer_bind(fbl->temp_a_fb);
       GPU_framebuffer_clear_color_depth_stencil(fbl->temp_a_fb, clearcol, 1.0f, 0x0);
+      const bool do_antialiasing = ((!stl->storage->is_mat_preview) &&
+                                    (stl->storage->multisamples > 0));
 
       for (int i = 0; i < stl->g_data->gp_cache_used; i++) {
         cache_ob = &stl->g_data->gp_object_cache[i];
@@ -1050,15 +1043,14 @@ void GPENCIL_draw_scene(void *ved)
 
             if (array_elm->mode == eGplBlendMode_Regular) {
               /* Draw current group in MSAA texture or final texture. */
-              gpencil_draw_pass_range(
-                  fbl, stl, psl, fbl->temp_a_fb, ob, gpd, init_shgrp, end_shgrp);
+              GPUFrameBuffer *final_fb = (do_antialiasing) ? fbl->multisample_fb : fbl->temp_fx_fb;
+              gpencil_draw_pass_range(stl, psl, final_fb, ob, gpd, init_shgrp, end_shgrp);
             }
             else {
               /* Draw current group in separated texture to blend later. */
               GPU_framebuffer_bind(blend_fb);
               GPU_framebuffer_clear_color_depth_stencil(blend_fb, clearcol, 1.0f, 0x0);
-              gpencil_draw_pass_range(
-                  fbl, stl, psl, fbl->temp_fx_fb, ob, gpd, init_shgrp, end_shgrp);
+              gpencil_draw_pass_range(stl, psl, fbl->temp_fx_fb, ob, gpd, init_shgrp, end_shgrp);
 
               /* Draw Blended texture over MSAA texture */
               if (stl->storage->multisamples > 0) {



More information about the Bf-blender-cvs mailing list