|
Blender
V2.93
|
#include <Python.h>#include "GPU_context.h"#include "GPU_framebuffer.h"#include "GPU_init_exit.h"#include "../generic/py_capi_utils.h"#include "../generic/python_utildefines.h"#include "../mathutils/mathutils.h"#include "gpu_py.h"#include "gpu_py_texture.h"#include "gpu_py_framebuffer.h"Go to the source code of this file.
Classes | |
| struct | PyFrameBufferStackContext |
Macros | |
| #define | BPYGPU_FB_MAX_COLOR_ATTACHMENT 6 |
Functions | |
Public API | |
| PyObject * | BPyGPUFrameBuffer_CreatePyObject (GPUFrameBuffer *fb) |
GPUFrameBuffer Common Utilities | |
| #define | PYGPU_FRAMEBUFFER_CHECK_OBJ(bpygpu) |
| #define | GPU_PY_FRAMEBUFFER_STACK_LEN 16 |
| static int | pygpu_framebuffer_valid_check (BPyGPUFrameBuffer *bpygpu_fb) |
| static void | pygpu_framebuffer_free_if_possible (GPUFrameBuffer *fb) |
| static bool | pygpu_framebuffer_stack_push_and_bind_or_error (GPUFrameBuffer *fb) |
| static bool | pygpu_framebuffer_stack_pop_and_restore_or_error (GPUFrameBuffer *fb) |
Stack (Context Manager) | |
| static PyMethodDef | pygpu_framebuffer_stack_context__tp_methods [] |
| static PyTypeObject | FramebufferStackContext_Type |
| static void | pygpu_framebuffer_stack_context__tp_dealloc (PyFrameBufferStackContext *self) |
| static PyObject * | pygpu_framebuffer_stack_context_enter (PyFrameBufferStackContext *self) |
| static PyObject * | pygpu_framebuffer_stack_context_exit (PyFrameBufferStackContext *self, PyObject *UNUSED(args)) |
| PyDoc_STRVAR (pygpu_framebuffer_bind_doc, ".. function:: bind()\n" "\n" " Context manager to ensure balanced bind calls, even in the case of an error.\n") | |
| static PyObject * | pygpu_framebuffer_bind (BPyGPUFrameBuffer *self) |
GPUFramebuffer Type | |
| static PyGetSetDef | pygpu_framebuffer__tp_getseters [] |
| static struct PyMethodDef | pygpu_framebuffer__tp_methods [] |
| PyTypeObject | BPyGPUFrameBuffer_Type |
| static bool | pygpu_framebuffer_new_parse_arg (PyObject *o, GPUAttachment *r_attach) |
| static PyObject * | pygpu_framebuffer__tp_new (PyTypeObject *UNUSED(self), PyObject *args, PyObject *kwds) |
| PyDoc_STRVAR (pygpu_framebuffer_is_bound_doc, "Checks if this is the active framebuffer in the context.") | |
| static PyObject * | pygpu_framebuffer_is_bound (BPyGPUFrameBuffer *self, void *UNUSED(type)) |
| PyDoc_STRVAR (pygpu_framebuffer_clear_doc, ".. method:: clear(color=None, depth=None, stencil=None)\n" "\n" " Fill color, depth and stencil textures with specific value.\n" " Common values: color=(0.0, 0.0, 0.0, 1.0), depth=1.0, stencil=0.\n" "\n" " :arg color: float sequence each representing ``(r, g, b, a)``.\n" " :type color: sequence of 3 or 4 floats\n" " :arg depth: depth value.\n" " :type depth: float\n" " :arg stencil: stencil value.\n" " :type stencil: int\n") | |
| static PyObject * | pygpu_framebuffer_clear (BPyGPUFrameBuffer *self, PyObject *args, PyObject *kwds) |
| PyDoc_STRVAR (pygpu_framebuffer_viewport_set_doc, ".. function:: viewport_set(x, y, xsize, ysize)\n" "\n" " Set the viewport for this framebuffer object.\n" " Note: The viewport state is not saved upon framebuffer rebind.\n" "\n" " :param x, y: lower left corner of the viewport_set rectangle, in pixels.\n" " :param xsize, ysize: width and height of the viewport_set.\n" " :type x, y, xsize, ysize: int\n") | |
| static PyObject * | pygpu_framebuffer_viewport_set (BPyGPUFrameBuffer *self, PyObject *args, void *UNUSED(type)) |
| PyDoc_STRVAR (pygpu_framebuffer_viewport_get_doc, ".. function:: viewport_get()\n" "\n" " Returns position and dimension to current viewport.\n") | |
| static PyObject * | pygpu_framebuffer_viewport_get (BPyGPUFrameBuffer *self, void *UNUSED(type)) |
| static void | BPyGPUFrameBuffer__tp_dealloc (BPyGPUFrameBuffer *self) |
| PyDoc_STRVAR (pygpu_framebuffer__tp_doc, ".. class:: GPUFrameBuffer(depth_slot=None, color_slots=None)\n" "\n" " This object gives access to framebuffer functionallities.\n" " When a 'layer' is specified in a argument, a single layer of a 3D or array " "texture is attached to the frame-buffer.\n" " For cube map textures, layer is translated into a cube map face.\n" "\n" " :arg depth_slot: GPUTexture to attach or a `dict` containing keywords: " "'texture', 'layer' and 'mip'.\n" " :type depth_slot: :class:`gpu.types.GPUTexture`, dict or Nonetype\n" " :arg color_slots: Tuple where each item can be a GPUTexture or a `dict` " "containing keywords: 'texture', 'layer' and 'mip'.\n" " :type color_slots: tuple or Nonetype\n") | |
This file defines the framebuffer functionalities of the 'gpu' module used for off-screen OpenGL rendering.
bpygpu_ for local API.BPyGPU for public API. Definition in file gpu_py_framebuffer.c.
| #define BPYGPU_FB_MAX_COLOR_ATTACHMENT 6 |
| #define GPU_PY_FRAMEBUFFER_STACK_LEN 16 |
Definition at line 84 of file gpu_py_framebuffer.c.
| #define PYGPU_FRAMEBUFFER_CHECK_OBJ | ( | bpygpu | ) |
Definition at line 61 of file gpu_py_framebuffer.c.
|
static |
Definition at line 468 of file gpu_py_framebuffer.c.
References pygpu_framebuffer_free_if_possible(), and self.
| PyObject* BPyGPUFrameBuffer_CreatePyObject | ( | GPUFrameBuffer * | fb | ) |
Definition at line 534 of file gpu_py_framebuffer.c.
References BPyGPUFrameBuffer_Type, and fb().
Referenced by pygpu_framebuffer__tp_new().
| PyDoc_STRVAR | ( | pygpu_framebuffer__tp_doc | , |
| ".. class:: GPUFrameBuffer(depth_slot=None, color_slots=None)\n" "\n" " This object gives access to framebuffer functionallities.\n" " When a 'layer' is specified in a | argument, | ||
| a single layer of a 3D or array " "texture is attached to the frame-buffer.\n" " For cube map | textures, | ||
| layer is translated into a cube map face.\n" "\n" " :arg depth_slot:GPUTexture to attach or a `dict` containing keywords:" " 'texture' | , | ||
| 'layer' and 'mip'.\n" " :type depth_slot::class:`gpu.types.GPUTexture` | , | ||
| dict or Nonetype\n" " :arg color_slots:Tuple where each item can be a GPUTexture or a `dict` " "containing keywords:'texture' | , | ||
| 'layer' and 'mip'.\n" " :type color_slots:tuple or Nonetype\n" | |||
| ) |
| PyDoc_STRVAR | ( | pygpu_framebuffer_bind_doc | , |
| ".. function:: bind()\n" "\n" " Context manager to ensure balanced bind | calls, | ||
| even in the case of an error.\n" | |||
| ) |
| PyDoc_STRVAR | ( | pygpu_framebuffer_clear_doc | , |
| ".. method:: clear(color=None, depth=None, stencil=None)\n" "\n" " Fill | color, | ||
| depth and stencil textures with specific value.\n" " Common values:color | = (0.0, 0.0, 0.0, 1.0), |
||
| depth | = 1.0 |
||
| ) |
| PyDoc_STRVAR | ( | pygpu_framebuffer_is_bound_doc | , |
| "Checks if this is the active framebuffer in the context." | |||
| ) |
| PyDoc_STRVAR | ( | pygpu_framebuffer_viewport_get_doc | , |
| ".. function:: viewport_get()\n" "\n" " Returns position and dimension to current viewport.\n" | |||
| ) |
| PyDoc_STRVAR | ( | pygpu_framebuffer_viewport_set_doc | , |
| ".. function:: viewport_set(x, y, xsize, ysize)\n" "\n" " Set the viewport for this framebuffer object.\n" " Note: The viewport state is not saved upon framebuffer rebind.\n" "\n" " :param | x, | ||
| y:lower left corner of the viewport_set | rectangle, | ||
| in pixels.\n" " :param | xsize, | ||
| ysize:width and height of the viewport_set.\n" " :type | x, | ||
| y | , | ||
| xsize | , | ||
| ysize:int\n" | |||
| ) |
|
static |
Definition at line 275 of file gpu_py_framebuffer.c.
References BPYGPU_FB_MAX_COLOR_ATTACHMENT, BPYGPU_IS_INIT_OR_ERROR_OBJ, BPyGPUFrameBuffer_CreatePyObject(), GPU_context_active_get(), GPU_framebuffer_config_array(), GPU_framebuffer_create(), GPU_texture_depth(), NULL, pygpu_framebuffer_new_parse_arg(), STRINGIFY, and tex.
|
static |
Definition at line 195 of file gpu_py_framebuffer.c.
References FramebufferStackContext_Type, and ret.
|
static |
Definition at line 362 of file gpu_py_framebuffer.c.
References col, GPU_COLOR_BIT, GPU_DEPTH_BIT, GPU_framebuffer_bound(), GPU_framebuffer_clear(), GPU_STENCIL_BIT, mathutils_array_parse(), NULL, PyC_Long_AsU32(), PYGPU_FRAMEBUFFER_CHECK_OBJ, and self.
|
static |
Definition at line 69 of file gpu_py_framebuffer.c.
References fb(), GPU_framebuffer_free(), and GPU_is_init().
Referenced by BPyGPUFrameBuffer__tp_dealloc().
|
static |
Definition at line 344 of file gpu_py_framebuffer.c.
References GPU_framebuffer_bound(), PYGPU_FRAMEBUFFER_CHECK_OBJ, and self.
|
static |
Definition at line 216 of file gpu_py_framebuffer.c.
References bpygpu_ParseTexture(), BPyGPUTexture_Check, GPUAttachment::layer, GPUAttachment::mip, NULL, pos, and GPUAttachment::tex.
Referenced by pygpu_framebuffer__tp_new().
|
static |
Definition at line 131 of file gpu_py_framebuffer.c.
References self.
|
static |
Definition at line 137 of file gpu_py_framebuffer.c.
References GPU_framebuffer_stack_level_get(), NULL, PYGPU_FRAMEBUFFER_CHECK_OBJ, pygpu_framebuffer_stack_push_and_bind_or_error(), and self.
|
static |
Definition at line 155 of file gpu_py_framebuffer.c.
References GPU_framebuffer_stack_level_get(), NULL, PYGPU_FRAMEBUFFER_CHECK_OBJ, pygpu_framebuffer_stack_pop_and_restore_or_error(), and self.
|
static |
Definition at line 99 of file gpu_py_framebuffer.c.
References fb(), GPU_framebuffer_bind(), GPU_framebuffer_bound(), GPU_framebuffer_pop(), and GPU_framebuffer_stack_level_get().
Referenced by pygpu_framebuffer_stack_context_exit().
|
static |
Definition at line 86 of file gpu_py_framebuffer.c.
References fb(), GPU_framebuffer_active_get(), GPU_framebuffer_bind(), GPU_framebuffer_push(), GPU_framebuffer_stack_level_get(), GPU_PY_FRAMEBUFFER_STACK_LEN, and STRINGIFY.
Referenced by pygpu_framebuffer_stack_context_enter().
|
static |
Definition at line 46 of file gpu_py_framebuffer.c.
References BPYGPU_USE_GPUOBJ_FREE_METHOD, BPyGPUFrameBuffer::fb, NULL, and UNLIKELY.
|
static |
Definition at line 438 of file gpu_py_framebuffer.c.
References GPU_framebuffer_viewport_get(), PYGPU_FRAMEBUFFER_CHECK_OBJ, PyTuple_SET_ITEMS, ret, and self.
|
static |
Definition at line 421 of file gpu_py_framebuffer.c.
References GPU_framebuffer_viewport_set(), NULL, self, x, and y.
| PyTypeObject BPyGPUFrameBuffer_Type |
Definition at line 517 of file gpu_py_framebuffer.c.
Referenced by bpygpu_types_init(), and BPyGPUFrameBuffer_CreatePyObject().
|
static |
Definition at line 183 of file gpu_py_framebuffer.c.
Referenced by pygpu_framebuffer_bind().
|
static |
Definition at line 474 of file gpu_py_framebuffer.c.
|
static |
Definition at line 474 of file gpu_py_framebuffer.c.
|
static |
Definition at line 177 of file gpu_py_framebuffer.c.