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.
This commit is contained in:
2019-06-26 13:28:26 +02:00
parent b6cf4a715b
commit 9dea69149a
2 changed files with 11 additions and 0 deletions

View File

@@ -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);

View File

@@ -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);