Blender V5.3
gpu_py_batch.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <Python.h>
12
13#include "BLI_compiler_attrs.hh"
14
15namespace blender {
16
17namespace gpu {
18class Batch;
19}
20
21#define USE_GPU_PY_REFERENCES
22
23extern PyTypeObject BPyGPUBatch_Type;
24
25#define BPyGPUBatch_Check(v) (Py_TYPE(v) == &BPyGPUBatch_Type)
26
28 PyObject_HEAD
29 /* The batch is owned, we may support thin wrapped batches later. */
30 gpu::Batch *batch;
31#ifdef USE_GPU_PY_REFERENCES
32 /* Just to keep a user to prevent freeing buffers we're using. */
33 PyObject *references;
34#endif
35};
36
37[[nodiscard]] PyObject *BPyGPUBatch_CreatePyObject(gpu::Batch *batch) ATTR_NONNULL(1);
38
39} // namespace blender
BMesh Iterators.
PyTypeObject BPyGPUBatch_Type
void ATTR_NONNULL(1, 2)
PyObject * BPyGPUBatch_CreatePyObject(gpu::Batch *batch)
PyObject_HEAD gpu::Batch * batch