diff options
Diffstat (limited to 'source/blender/draw/intern/draw_manager.h')
-rw-r--r-- | source/blender/draw/intern/draw_manager.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/source/blender/draw/intern/draw_manager.h b/source/blender/draw/intern/draw_manager.h index ba84660ff53..9dfd4d9d0bf 100644 --- a/source/blender/draw/intern/draw_manager.h +++ b/source/blender/draw/intern/draw_manager.h @@ -120,8 +120,17 @@ typedef struct DRWCullingState { #define DRW_RESOURCE_CHUNK_LEN 512 typedef struct DRWResourceHandle { - uint32_t id : 9; - uint32_t chunk : 23; + union { + struct { + uint32_t negative_scale : 1; + uint32_t id : 9; + uint32_t chunk : 22; + }; + /** Use this to read the whole handle value as one 32bit uint. + * Useful for sorting and test. + */ + uint32_t value; + }; } DRWResourceHandle; typedef struct DRWObjectMatrix { @@ -140,20 +149,16 @@ typedef struct DRWObjectInfos { BLI_STATIC_ASSERT_ALIGN(DRWObjectMatrix, 16) BLI_STATIC_ASSERT_ALIGN(DRWObjectInfos, 16) -typedef struct DRWCallState { - uchar flag; - DRWResourceHandle handle; -} DRWCallState; - typedef struct DRWCall { struct DRWCall *next; - DRWCallState *state; GPUBatch *batch; uint vert_first; uint vert_count; uint inst_count; + DRWResourceHandle handle; + #ifdef USE_GPU_SELECT /* TODO(fclem) remove once we have a dedicated selection engine. */ int select_id; @@ -309,10 +314,8 @@ typedef struct DRWManager { /* Cache generation */ ViewportMemoryPool *vmempool; DRWInstanceDataList *idatalist; - /* Default Unit model matrix state without culling. */ - DRWCallState *unit_state; /* State of the object being evaluated if already allocated. */ - DRWCallState *ob_state; + DRWResourceHandle ob_handle; /** 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). */ |