Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/draw_cache_inline.h
| Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | BLI_INLINE bool DRW_batch_requested(GPUBatch *batch, int prim_type) | ||||
| return false; | return false; | ||||
| } | } | ||||
| BLI_INLINE void DRW_ibo_request(GPUBatch *batch, GPUIndexBuf **ibo) | BLI_INLINE void DRW_ibo_request(GPUBatch *batch, GPUIndexBuf **ibo) | ||||
| { | { | ||||
| if (*ibo == NULL) { | if (*ibo == NULL) { | ||||
| *ibo = MEM_callocN(sizeof(GPUIndexBuf), "GPUIndexBuf"); | *ibo = MEM_callocN(sizeof(GPUIndexBuf), "GPUIndexBuf"); | ||||
| } | } | ||||
| if (batch != NULL) { | |||||
| GPU_batch_vao_cache_clear(batch); | GPU_batch_vao_cache_clear(batch); | ||||
| batch->elem = *ibo; | batch->elem = *ibo; | ||||
| } | } | ||||
| } | |||||
| BLI_INLINE bool DRW_ibo_requested(GPUIndexBuf *ibo) | BLI_INLINE bool DRW_ibo_requested(GPUIndexBuf *ibo) | ||||
| { | { | ||||
| /* TODO do not rely on data uploaded. This prevents multithreading. | /* TODO do not rely on data uploaded. This prevents multithreading. | ||||
| * (need access to a gl context) */ | * (need access to a gl context) */ | ||||
| return (ibo != NULL && ibo->ibo_id == 0 && ibo->data == NULL); | return (ibo != NULL && ibo->ibo_id == 0 && ibo->data == NULL); | ||||
| } | } | ||||
| Show All 25 Lines | |||||