diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-04-30 13:50:17 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-04-30 13:55:03 +0300 |
commit | e8daa615704b55a8bd613f4e3d84656b5aabfcf8 (patch) | |
tree | e9ae91100e8d63270cf3c0b59fdc5397a946e5bc /source/blender/draw/intern/draw_cache_impl.h | |
parent | 782917648f6203a99410c92ead835f1d1131845b (diff) |
DRW: Add debug utility for batch cache requests
Diffstat (limited to 'source/blender/draw/intern/draw_cache_impl.h')
-rw-r--r-- | source/blender/draw/intern/draw_cache_impl.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/draw/intern/draw_cache_impl.h b/source/blender/draw/intern/draw_cache_impl.h index 8ab64aa26b9..4ef8f5a9326 100644 --- a/source/blender/draw/intern/draw_cache_impl.h +++ b/source/blender/draw/intern/draw_cache_impl.h @@ -205,10 +205,19 @@ struct GPUBatch *DRW_particles_batch_cache_get_edit_tip_points(struct Object *ob struct PTCacheEdit *edit); /* Common */ -#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) +// #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)) |