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-05-08 00:02:42 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-05-08 18:52:48 +0300
commit05b0f52aa78344a4a74b816fd1d025aa344ec28c (patch)
treef2a35649d8d8145ba3c28595fe8265a537fdfaea /source/blender/draw/intern/draw_cache.c
parent0b88cd5032ab7d538f884083298390bf5d59bacc (diff)
DRW: Move all batch request functions to own header
This is in order to using BLI_INLINE for thoses functions and keep headers cleany separated.
Diffstat (limited to 'source/blender/draw/intern/draw_cache.c')
-rw-r--r--source/blender/draw/intern/draw_cache.c62
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();