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:
authorClément Foucault <foucault.clem@gmail.com>2019-06-01 19:20:26 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-08-17 15:48:48 +0300
commitfb940758a9187761accf4b209588ceb6b851084e (patch)
tree9dcea6951f35386194c9c7dca45f8082e766f405
parent6c051273f0c4c243ca708ad3f5ab706c76eaf66b (diff)
DRW: Replace DRW_CALL_OBINFOS by a boolean in DRWManager
This is to remove the use of keeping a shared flag per drawcall.
-rw-r--r--source/blender/draw/intern/draw_manager.h3
-rw-r--r--source/blender/draw/intern/draw_manager_data.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/draw/intern/draw_manager.h b/source/blender/draw/intern/draw_manager.h
index 334369cb7f3..c75fbb33e7c 100644
--- a/source/blender/draw/intern/draw_manager.h
+++ b/source/blender/draw/intern/draw_manager.h
@@ -94,7 +94,6 @@
/* Used by DRWCallState.flag */
enum {
DRW_CALL_NEGSCALE = (1 << 0),
- DRW_CALL_OBINFOS = (1 << 1),
};
typedef struct DRWCullingState {
@@ -312,6 +311,8 @@ typedef struct DRWManager {
DRWCallState *unit_state;
/* State of the object being evaluated if already allocated. */
DRWCallState *ob_state;
+ /** True if current DST.ob_state has its matching DRWObjectInfos init. */
+ bool ob_state_obinfo_init;
/** Handle of current object resource in object resource arrays (DRWObjectMatrices/Infos). */
DRWResourceHandle resource_handle;
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index 9dfe4d623ab..9a08b050047 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -479,11 +479,12 @@ static DRWCallState *drw_call_state_object(DRWShadingGroup *shgroup, float (*obm
else {
if (DST.ob_state == NULL) {
DST.ob_state = drw_call_state_create(obmat, ob);
+ DST.ob_state_obinfo_init = false;
}
if (shgroup->objectinfo != -1 || shgroup->orcotexfac != -1) {
- if ((DST.ob_state->flag & DRW_CALL_OBINFOS) == 0) {
- DST.ob_state->flag |= DRW_CALL_OBINFOS;
+ if (!DST.ob_state_obinfo_init) {
+ DST.ob_state_obinfo_init = true;
DRWObjectInfos *ob_infos = BLI_memblock_elem_get(
DST.vmempool->obinfos, DST.ob_state->handle.chunk, DST.ob_state->handle.id);