Blender V5.0
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.h"
14
15namespace blender::gpu {
16class Batch;
17}
18
19#define USE_GPU_PY_REFERENCES
20
21extern PyTypeObject BPyGPUBatch_Type;
22
23#define BPyGPUBatch_Check(v) (Py_TYPE(v) == &BPyGPUBatch_Type)
24
26 PyObject_VAR_HEAD
27 /* The batch is owned, we may support thin wrapped batches later. */
28 blender::gpu::Batch *batch;
29#ifdef USE_GPU_PY_REFERENCES
30 /* Just to keep a user to prevent freeing buffers we're using. */
31 PyObject *references;
32#endif
33};
34
35[[nodiscard]] PyObject *BPyGPUBatch_CreatePyObject(blender::gpu::Batch *batch) ATTR_NONNULL(1);
#define ATTR_NONNULL(...)
struct @021025263243242147216143265077100330027142264337::@225245033123204053237120173316075113304004012000 batch
PyTypeObject BPyGPUBatch_Type
PyObject * BPyGPUBatch_CreatePyObject(blender::gpu::Batch *batch) ATTR_NONNULL(1)
PyObject * references
PyObject_VAR_HEAD blender::gpu::Batch * batch