[Bf-blender-cvs] [15afcb6dd91] greasepencil-object: DRW: New functions for getting stencil_mask id

Antonioya noreply at git.blender.org
Wed Jun 19 12:58:32 CEST 2019


Commit: 15afcb6dd91030af2a61b4bc8a6a72fde9974efa
Author: Antonioya
Date:   Wed Jun 19 09:28:34 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB15afcb6dd91030af2a61b4bc8a6a72fde9974efa

DRW: New functions for getting stencil_mask id

Workaround functions waiting for the clearing operation to be available inside the shgroups.

Required to check if the stencil was activated in the shading group to calculate batches of 255 stencil masks and reduce number of stencil clearing.

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

M	source/blender/draw/intern/DRW_render.h
M	source/blender/draw/intern/draw_manager_data.c

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

diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h
index aae1ad42860..392362e73c5 100644
--- a/source/blender/draw/intern/DRW_render.h
+++ b/source/blender/draw/intern/DRW_render.h
@@ -531,7 +531,11 @@ void DRW_shgroup_uniform_float_copy(DRWShadingGroup *shgroup, const char *name,
 void DRW_shgroup_uniform_vec2_copy(DRWShadingGroup *shgroup, const char *name, const float *value);
 
 bool DRW_shgroup_is_empty(DRWShadingGroup *shgroup);
+
+/* TODO: workaround functions waiting for the clearing operation to be available inside the
+ * shgroups. */
 DRWShadingGroup *DRW_shgroup_get_next(DRWShadingGroup *shgroup);
+uint DRW_shgroup_stencil_mask_get(DRWShadingGroup *shgroup);
 
 /* Passes */
 DRWPass *DRW_pass_create(const char *name, DRWState state);
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index 10d16021b27..99ab25645d2 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -1003,6 +1003,13 @@ DRWShadingGroup *DRW_shgroup_get_next(DRWShadingGroup *shgroup)
   return shgroup->next;
 }
 
+/* This is a workaround function waiting for the clearing operation to be available inside the
+ * shgroups. */
+uint DRW_shgroup_stencil_mask_get(DRWShadingGroup *shgroup)
+{
+  return shgroup->stencil_mask;
+}
+
 DRWShadingGroup *DRW_shgroup_create_sub(DRWShadingGroup *shgroup)
 {
   DRWShadingGroup *shgroup_new = BLI_memblock_alloc(DST.vmempool->shgroups);



More information about the Bf-blender-cvs mailing list