Mesh Batch Cache: Port Texture paint batches to new batch request
[blender.git] / source / blender / gpu / GPU_batch.h
index d47df08afb63d65c20376b9348e2a74d7aa19921..c77f0707ee5f68a9d6f3bd58fc0992ca383fe317 100644 (file)
@@ -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); \