12 #include "../generic/py_capi_utils.h"
13 #include "../generic/python_utildefines.h"
53 if (PyTuple_GET_SIZE(args) || (kwds && PyDict_Size(kwds))) {
54 PyErr_SetString(PyExc_ValueError,
"This function takes no arguments");
61 pygpu_vertformat_attr_add_doc,
62 ".. method:: attr_add(id, comp_type, len, fetch_mode)\n"
64 " Add a new attribute to the format.\n"
66 " :param id: Name the attribute. Often `position`, `normal`, ...\n"
68 " :param comp_type: The data type that will be used store the value in memory.\n"
69 " Possible values are `I8`, `U8`, `I16`, `U16`, `I32`, `U32`, `F32` and `I10`.\n"
70 " :type comp_type: str\n"
71 " :param len: How many individual values the attribute consists of\n"
72 " (e.g. 2 for uv coordinates).\n"
74 " :param fetch_mode: How values from memory will be converted when used in the shader.\n"
75 " This is mainly useful for memory optimizations when you want to store values with\n"
76 " reduced precision. E.g. you can store a float in only 1 byte but it will be\n"
77 " converted to a normal 4 byte float when used.\n"
78 " Possible values are `FLOAT`, `INT`, `INT_TO_FLOAT_UNIT` and `INT_TO_FLOAT`.\n"
79 " :type fetch_mode: str\n");
92 static const char *_keywords[] = {
"id",
"comp_type",
"len",
"fetch_mode",
NULL};
93 static _PyArg_Parser _parser = {
103 if (!_PyArg_ParseTupleAndKeywordsFast(args,
117 return PyLong_FromLong(
attr_id);
123 METH_VARARGS | METH_KEYWORDS,
124 pygpu_vertformat_attr_add_doc},
130 Py_TYPE(
self)->tp_free(
self);
134 ".. class:: GPUVertFormat()\n"
136 " This object contains information about the structure of a vertex buffer.\n");
138 PyVarObject_HEAD_INIT(
NULL, 0).tp_name =
"GPUVertFormat",
141 .tp_flags = Py_TPFLAGS_DEFAULT,
142 .tp_doc = pygpu_vertformat__tp_doc,
162 memset(&
self->fmt, 0,
sizeof(
self->fmt));
165 return (PyObject *)
self;
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
struct @653::@656 attr_id
int PyC_ParseStringEnum(PyObject *o, void *p)