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.
This commit is contained in:
2019-05-07 23:02:42 +02:00
parent 0b88cd5032
commit 05b0f52aa7
7 changed files with 117 additions and 88 deletions

View File

@@ -202,30 +202,4 @@ struct GPUBatch *DRW_particles_batch_cache_get_edit_tip_points(struct Object *ob
struct ParticleSystem *psys,
struct PTCacheEdit *edit);
/* Common */
// #define DRW_DEBUG_MESH_CACHE_REQUEST
#ifdef DRW_DEBUG_MESH_CACHE_REQUEST
# define DRW_ADD_FLAG_FROM_VBO_REQUEST(flag, vbo, value) \
(flag |= DRW_vbo_requested(vbo) ? (printf(" VBO requested " #vbo "\n") ? value : value) : 0)
# define DRW_ADD_FLAG_FROM_IBO_REQUEST(flag, ibo, value) \
(flag |= DRW_ibo_requested(ibo) ? (printf(" IBO requested " #ibo "\n") ? value : value) : 0)
#else
# define DRW_ADD_FLAG_FROM_VBO_REQUEST(flag, vbo, value) \
(flag |= DRW_vbo_requested(vbo) ? (value) : 0)
# define DRW_ADD_FLAG_FROM_IBO_REQUEST(flag, ibo, value) \
(flag |= DRW_ibo_requested(ibo) ? (value) : 0)
#endif
/* Test and assign NULL if test fails */
#define DRW_TEST_ASSIGN_VBO(v) (v = (DRW_vbo_requested(v) ? (v) : NULL))
#define DRW_TEST_ASSIGN_IBO(v) (v = (DRW_ibo_requested(v) ? (v) : NULL))
struct GPUBatch *DRW_batch_request(struct GPUBatch **batch);
bool DRW_batch_requested(struct GPUBatch *batch, int prim_type);
void DRW_ibo_request(struct GPUBatch *batch, struct GPUIndexBuf **ibo);
bool DRW_ibo_requested(struct GPUIndexBuf *ibo);
void DRW_vbo_request(struct GPUBatch *batch, struct GPUVertBuf **vbo);
bool DRW_vbo_requested(struct GPUVertBuf *vbo);
#endif /* __DRAW_CACHE_IMPL_H__ */