Blender V5.0
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.h"
14
15extern PyTypeObject BPyGPU_BufferType;
16
17#define BPyGPU_Buffer_Check(v) (Py_TYPE(v) == &BPyGPU_BufferType)
18
25 PyObject_VAR_HEAD
26 PyObject *parent;
27
28 int format;
30 Py_ssize_t *shape;
31
32 union {
33 char *as_byte;
34 int *as_int;
36 float *as_float;
37
38 void *as_void;
39 } buf;
40};
41
42[[nodiscard]] size_t bpygpu_Buffer_size(BPyGPUBuffer *buffer);
51 const Py_ssize_t *shape,
52 int shape_len,
53 void *buffer);
unsigned int uint
PyTypeObject BPyGPU_BufferType
BPyGPUBuffer * BPyGPU_Buffer_CreatePyObject(int format, const Py_ssize_t *shape, int shape_len, void *buffer)
size_t bpygpu_Buffer_size(BPyGPUBuffer *buffer)
format
union BPyGPUBuffer::@121060215011127262115351146023070133300154361035 buf
Py_ssize_t * shape
PyObject_VAR_HEAD PyObject * parent