Blender V5.3
gpu_py_buffer.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_sys_types.hh"
14
15namespace blender {
16
17extern PyTypeObject BPyGPU_BufferType;
18
19#define BPyGPU_Buffer_Check(v) (Py_TYPE(v) == &BPyGPU_BufferType)
20
27 PyObject_HEAD
28 PyObject *parent;
29
30 int format;
32 Py_ssize_t *shape;
33
34 union {
35 char *as_byte;
36 int *as_int;
38 float *as_float;
39
40 void *as_void;
41 } buf;
42};
43
44[[nodiscard]] size_t bpygpu_Buffer_size(BPyGPUBuffer *buffer);
52[[nodiscard]] BPyGPUBuffer *BPyGPU_Buffer_CreatePyObject(int format,
53 const Py_ssize_t *shape,
54 int shape_len,
55 void *buffer);
56
57} // namespace blender
BMesh Iterators.
PyTypeObject BPyGPU_BufferType
unsigned int uint
Definition BKE_text.h:55
size_t bpygpu_Buffer_size(BPyGPUBuffer *buffer)
BPyGPUBuffer * BPyGPU_Buffer_CreatePyObject(const int format, const Py_ssize_t *shape, const int shape_len, void *buffer)
union blender::BPyGPUBuffer::@121160014351146313222050217274041240110051113162 buf
PyObject_HEAD PyObject * parent