Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2019-06-26 14:28:26 +0300
committerAntonioya <blendergit@gmail.com>2019-06-26 14:28:26 +0300
commit9dea69149ab54e59c8c3e2d341d0fc73c7a99527 (patch)
tree1e24ce22078c185ad209b9c3ca1352a9382b8747
parentb6cf4a715bf0031d429c81c1c9a7210dc1c9388a (diff)
DRW: New function to retry stencil_mask value
This function is a workaround to use the stencil in grease pencil and reduce the number of clears. Reviewed by @fclem. Note: This function will be removed when draw manager supports stencil clearing by group.
-rw-r--r--source/blender/draw/intern/DRW_render.h4
-rw-r--r--source/blender/draw/intern/draw_manager_data.c7
2 files changed, 11 insertions, 0 deletions
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);