Blender  V3.3
gpu_py_vertex_format.c File Reference
#include <Python.h>
#include "../generic/py_capi_utils.h"
#include "../generic/python_utildefines.h"
#include "gpu_py_vertex_format.h"

Go to the source code of this file.

Functions

Public API
PyObject * BPyGPUVertFormat_CreatePyObject (GPUVertFormat *fmt)
 

Variables

Enum Conversion

Use with PyArg_ParseTuple's "O&" formatting.

static struct PyC_StringEnumItems pygpu_vertcomptype_items []
 
static struct PyC_StringEnumItems pygpu_vertfetchmode_items []
 

VertFormat Type

static struct PyMethodDef pygpu_vertformat__tp_methods []
 
PyTypeObject BPyGPUVertFormat_Type
 
static PyObject * pygpu_vertformat__tp_new (PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds)
 
 PyDoc_STRVAR (pygpu_vertformat_attr_add_doc, ".. method:: attr_add(id, comp_type, len, fetch_mode)\n" "\n" " Add a new attribute to the format.\n" "\n" " :param id: Name the attribute. Often `position`, `normal`, ...\n" " :type id: str\n" " :param comp_type: The data type that will be used store the value in memory.\n" " Possible values are `I8`, `U8`, `I16`, `U16`, `I32`, `U32`, `F32` and `I10`.\n" " :type comp_type: str\n" " :param len: How many individual values the attribute consists of\n" " (e.g. 2 for uv coordinates).\n" " :type len: int\n" " :param fetch_mode: How values from memory will be converted when used in the shader.\n" " This is mainly useful for memory optimizations when you want to store values with\n" " reduced precision. E.g. you can store a float in only 1 byte but it will be\n" " converted to a normal 4 byte float when used.\n" " Possible values are `FLOAT`, `INT`, `INT_TO_FLOAT_UNIT` and `INT_TO_FLOAT`.\n" " :type fetch_mode: str\n")
 
static PyObject * pygpu_vertformat_attr_add (BPyGPUVertFormat *self, PyObject *args, PyObject *kwds)
 
static void pygpu_vertformat__tp_dealloc (BPyGPUVertFormat *self)
 
 PyDoc_STRVAR (pygpu_vertformat__tp_doc, ".. class:: GPUVertFormat()\n" "\n" " This object contains information about the structure of a vertex buffer.\n")
 

Detailed Description

Definition in file gpu_py_vertex_format.c.

Function Documentation

◆ BPyGPUVertFormat_CreatePyObject()

PyObject* BPyGPUVertFormat_CreatePyObject ( GPUVertFormat fmt)

Definition at line 153 of file gpu_py_vertex_format.c.

References BPyGPUVertFormat_Type, and self.

Referenced by pygpu_vertformat__tp_new().

◆ PyDoc_STRVAR() [1/2]

PyDoc_STRVAR ( pygpu_vertformat__tp_doc  ,
".. class:: GPUVertFormat()\n" "\n" " This object contains information about the structure of a vertex buffer.\n"   
)

◆ PyDoc_STRVAR() [2/2]

PyDoc_STRVAR ( pygpu_vertformat_attr_add_doc  ,
".. method:: attr_add(id, comp_type, len, fetch_mode)\n" "\n" " Add a new attribute to the format.\n" "\n" " :param id: Name the attribute. Often `position`  ,
`normal ,
...\n" " :type id:str\n" " :param comp_type:The data type that will be used store the value in memory.\n" " Possible values are `I8`  ,
`U8`  ,
`I16`  ,
`U16`  ,
`I32`  ,
`U32`  ,
`F32` and `I10`.\n" " :type comp_type:str\n" " :param len:How many individual values the attribute consists of\n" "(e.g. 2 for uv coordinates).\n" " :type len:int\n" " :param fetch_mode:How values from memory will be converted when used in the shader.\n" " This is mainly useful for memory optimizations when you want to store values with\n" " reduced precision. E.g. you can store a float in only 1 byte but it will be\n" " converted to a normal 4 byte float when used.\n" " Possible values are `FLOAT ,
`INT`  ,
`INT_TO_FLOAT_UNIT` and `INT_TO_FLOAT`.\n" " :type fetch_mode:str\n"   
)

◆ pygpu_vertformat__tp_dealloc()

static void pygpu_vertformat__tp_dealloc ( BPyGPUVertFormat self)
static

Definition at line 128 of file gpu_py_vertex_format.c.

◆ pygpu_vertformat__tp_new()

static PyObject* pygpu_vertformat__tp_new ( PyTypeObject *  UNUSEDtype,
PyObject *  args,
PyObject *  kwds 
)
static

Definition at line 49 of file gpu_py_vertex_format.c.

References BPyGPUVertFormat_CreatePyObject(), and NULL.

◆ pygpu_vertformat_attr_add()

static PyObject* pygpu_vertformat_attr_add ( BPyGPUVertFormat self,
PyObject *  args,
PyObject *  kwds 
)
static

Definition at line 80 of file gpu_py_vertex_format.c.

Variable Documentation

◆ BPyGPUVertFormat_Type

PyTypeObject BPyGPUVertFormat_Type
Initial value:
= {
PyVarObject_HEAD_INIT(NULL, 0).tp_name = "GPUVertFormat",
.tp_basicsize = sizeof(BPyGPUVertFormat),
.tp_dealloc = (destructor)pygpu_vertformat__tp_dealloc,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_doc = pygpu_vertformat__tp_doc,
}
static void pygpu_vertformat__tp_dealloc(BPyGPUVertFormat *self)
static PyObject * pygpu_vertformat__tp_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds)
static struct PyMethodDef pygpu_vertformat__tp_methods[]
struct BPyGPUVertFormat BPyGPUVertFormat

Definition at line 137 of file gpu_py_vertex_format.c.

Referenced by bpygpu_types_init(), BPyGPUVertFormat_CreatePyObject(), and pygpu_vertbuf__tp_new().

◆ pygpu_vertcomptype_items

struct PyC_StringEnumItems pygpu_vertcomptype_items[]
static
Initial value:
= {
{GPU_COMP_I8, "I8"},
{GPU_COMP_U8, "U8"},
{GPU_COMP_I16, "I16"},
{GPU_COMP_U16, "U16"},
{GPU_COMP_I32, "I32"},
{GPU_COMP_U32, "U32"},
{GPU_COMP_F32, "F32"},
{GPU_COMP_I10, "I10"},
{0, NULL},
}
@ GPU_COMP_U16
@ GPU_COMP_I10
@ GPU_COMP_F32
@ GPU_COMP_I32
@ GPU_COMP_I8
@ GPU_COMP_U32
@ GPU_COMP_I16
@ GPU_COMP_U8

Definition at line 1 of file gpu_py_vertex_format.c.

◆ pygpu_vertfetchmode_items

struct PyC_StringEnumItems pygpu_vertfetchmode_items[]
static
Initial value:
= {
{GPU_FETCH_FLOAT, "FLOAT"},
{GPU_FETCH_INT, "INT"},
{GPU_FETCH_INT_TO_FLOAT_UNIT, "INT_TO_FLOAT_UNIT"},
{GPU_FETCH_INT_TO_FLOAT, "INT_TO_FLOAT"},
{0, NULL},
}
@ GPU_FETCH_FLOAT
@ GPU_FETCH_INT_TO_FLOAT_UNIT
@ GPU_FETCH_INT
@ GPU_FETCH_INT_TO_FLOAT

Definition at line 1 of file gpu_py_vertex_format.c.

◆ pygpu_vertformat__tp_methods

struct PyMethodDef pygpu_vertformat__tp_methods[]
static
Initial value:
= {
{"attr_add",
METH_VARARGS | METH_KEYWORDS,
pygpu_vertformat_attr_add_doc},
{NULL, NULL, 0, NULL},
}
static PyObject * pygpu_vertformat_attr_add(BPyGPUVertFormat *self, PyObject *args, PyObject *kwds)

Definition at line 80 of file gpu_py_vertex_format.c.