2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
Python: gpu module: add new submodules and types
This commit extends the gpu python API with:
```
gpu.types.Buffer #"__init__", "to_list"
gpu.types.GPUTexture #"__init__", "clear", "read", "format"
gpu.types.GPUFrameBuffer #"__init__", "bind", "clear", "is_bound", "viewport", ("__enter__", "__exit__" with "GPUFrameBufferStackContext")
gpu.types.GPUUniformBuf #"__init__", "update"
gpu.state #"blend_set", "blend_get", "depth_test_set", "depth_test_get", "depth_mask_set", "depth_mask_get", "viewport_set", "viewport_get", "line_width_set", "line_width_get", "point_size_set", "color_mask_set", "face_culling_set", "front_facing_set", "program_point_size_set"
```
Add these methods to existing objects:
```
gpu.types.GPUShader #"uniform_sample", "uniform_buffer"
```
Maniphest Tasks: T80481
Differential Revision: https://developer.blender.org/D8826
2021-02-17 10:48:08 -03:00
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
|
* \ingroup bpygpu
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2025-01-07 12:39:13 +01:00
|
|
|
#include <Python.h>
|
|
|
|
|
|
2024-09-24 15:25:36 +02:00
|
|
|
#include "../generic/py_capi_utils.hh"
|
2022-11-29 18:46:59 +01:00
|
|
|
|
2021-02-22 08:26:45 -03:00
|
|
|
extern struct PyC_StringEnumItems bpygpu_primtype_items[];
|
Python: gpu module: add new submodules and types
This commit extends the gpu python API with:
```
gpu.types.Buffer #"__init__", "to_list"
gpu.types.GPUTexture #"__init__", "clear", "read", "format"
gpu.types.GPUFrameBuffer #"__init__", "bind", "clear", "is_bound", "viewport", ("__enter__", "__exit__" with "GPUFrameBufferStackContext")
gpu.types.GPUUniformBuf #"__init__", "update"
gpu.state #"blend_set", "blend_get", "depth_test_set", "depth_test_get", "depth_mask_set", "depth_mask_get", "viewport_set", "viewport_get", "line_width_set", "line_width_get", "point_size_set", "color_mask_set", "face_culling_set", "front_facing_set", "program_point_size_set"
```
Add these methods to existing objects:
```
gpu.types.GPUShader #"uniform_sample", "uniform_buffer"
```
Maniphest Tasks: T80481
Differential Revision: https://developer.blender.org/D8826
2021-02-17 10:48:08 -03:00
|
|
|
extern struct PyC_StringEnumItems bpygpu_dataformat_items[];
|
2021-02-22 09:44:57 -03:00
|
|
|
|
2025-06-28 00:15:23 +00:00
|
|
|
[[nodiscard]] bool bpygpu_is_init_or_error();
|
2024-06-19 17:54:35 +02:00
|
|
|
|
|
|
|
|
#define BPYGPU_IS_INIT_OR_ERROR_OBJ \
|
|
|
|
|
if (UNLIKELY(!bpygpu_is_init_or_error())) { \
|
|
|
|
|
return NULL; \
|
|
|
|
|
} \
|
|
|
|
|
((void)0)
|
|
|
|
|
#define BPYGPU_IS_INIT_OR_ERROR_INT \
|
|
|
|
|
if (UNLIKELY(!bpygpu_is_init_or_error())) { \
|
|
|
|
|
return -1; \
|
|
|
|
|
} \
|
|
|
|
|
((void)0)
|