diff options
Diffstat (limited to 'source/blender/gpu/GPU_batch.h')
-rw-r--r-- | source/blender/gpu/GPU_batch.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_batch.h b/source/blender/gpu/GPU_batch.h index d47df08afb6..c77f0707ee5 100644 --- a/source/blender/gpu/GPU_batch.h +++ b/source/blender/gpu/GPU_batch.h @@ -197,6 +197,13 @@ void gpu_batch_exit(void); } \ } while (0) +#define GPU_BATCH_CLEAR_SAFE(batch) do { \ + if (batch != NULL) { \ + GPU_batch_clear(batch); \ + memset(batch, 0, sizeof(*(batch))); \ + } \ +} while (0) + #define GPU_BATCH_DISCARD_ARRAY_SAFE(_batch_array, _len) do { \ if (_batch_array != NULL) { \ BLI_assert(_len > 0); \ |