diff options
Diffstat (limited to 'source/blender/draw/intern/draw_cache.c')
-rw-r--r-- | source/blender/draw/intern/draw_cache.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index 08cf56982ea..be95b0a5325 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -3953,68 +3953,6 @@ GPUBatch *DRW_cache_cursor_get(bool crosshair_lines) /** \name Batch Cache Impl. common * \{ */ -GPUBatch *DRW_batch_request(GPUBatch **batch) -{ - /* XXX TODO(fclem): We are writting to batch cache here. Need to make this thread safe. */ - if (*batch == NULL) { - *batch = MEM_callocN(sizeof(GPUBatch), "GPUBatch"); - } - return *batch; -} - -bool DRW_batch_requested(GPUBatch *batch, int prim_type) -{ - /* Batch has been requested if it has been created but not initialized. */ - if (batch != NULL && batch->verts[0] == NULL) { - /* HACK. We init without a valid VBO and let the first vbo binding - * fill verts[0]. */ - GPU_batch_init_ex(batch, prim_type, (GPUVertBuf *)1, NULL, 0); - batch->verts[0] = NULL; - return true; - } - return false; -} - -void DRW_ibo_request(GPUBatch *batch, GPUIndexBuf **ibo) -{ - if (*ibo == NULL) { - *ibo = MEM_callocN(sizeof(GPUIndexBuf), "GPUIndexBuf"); - } - GPU_batch_vao_cache_clear(batch); - batch->elem = *ibo; -} - -bool DRW_ibo_requested(GPUIndexBuf *ibo) -{ - /* TODO do not rely on data uploaded. This prevents multithreading. - * (need access to a gl context) */ - return (ibo != NULL && ibo->ibo_id == 0 && ibo->data == NULL); -} - -void DRW_vbo_request(GPUBatch *batch, GPUVertBuf **vbo) -{ - if (*vbo == NULL) { - *vbo = MEM_callocN(sizeof(GPUVertBuf), "GPUVertBuf"); - } - /* HACK set first vbo if not init. */ - if (batch->verts[0] == NULL) { - GPU_batch_vao_cache_clear(batch); - batch->verts[0] = *vbo; - } - else { - /* HACK: bypass assert */ - int vbo_vert_len = (*vbo)->vertex_len; - (*vbo)->vertex_len = batch->verts[0]->vertex_len; - GPU_batch_vertbuf_add(batch, *vbo); - (*vbo)->vertex_len = vbo_vert_len; - } -} - -bool DRW_vbo_requested(GPUVertBuf *vbo) -{ - return (vbo != NULL && vbo->format.attr_len == 0); -} - void drw_batch_cache_generate_requested(Object *ob) { const DRWContextState *draw_ctx = DRW_context_state_get(); |