56 if (PyTuple_GET_SIZE(args) || (kwds && PyDict_Size(kwds))) {
57 PyErr_SetString(PyExc_ValueError,
"This function takes no arguments");
65 pygpu_vertformat_attr_add_doc,
66 ".. method:: attr_add(id, comp_type, len, fetch_mode)\n"
68 " Add a new attribute to the format.\n"
70 " :arg id: Name the attribute. Often `position`, `normal`, ...\n"
72 " :arg comp_type: The data type that will be used store the value in memory.\n"
73 " Possible values are `I8`, `U8`, `I16`, `U16`, `I32`, `U32`, `F32` and `I10`.\n"
74 " :type comp_type: str\n"
75 " :arg len: How many individual values the attribute consists of\n"
76 " (e.g. 2 for uv coordinates).\n"
78 " :arg fetch_mode: How values from memory will be converted when used in the shader.\n"
79 " This is mainly useful for memory optimizations when you want to store values with\n"
80 " reduced precision. E.g. you can store a float in only 1 byte but it will be\n"
81 " converted to a normal 4 byte float when used.\n"
82 " Possible values are `FLOAT`, `INT`, `INT_TO_FLOAT_UNIT` and `INT_TO_FLOAT`.\n"
83 " :type fetch_mode: str\n");
96 static const char *_keywords[] = {
"id",
"comp_type",
"len",
"fetch_mode",
nullptr};
97 static _PyArg_Parser _parser = {
108 if (!_PyArg_ParseTupleAndKeywordsFast(args,
126 return PyLong_FromLong(
attr_id);
129#if (defined(__GNUC__) && !defined(__clang__))
130# pragma GCC diagnostic push
131# pragma GCC diagnostic ignored "-Wcast-function-type"
137 METH_VARARGS | METH_KEYWORDS,
138 pygpu_vertformat_attr_add_doc},
139 {
nullptr,
nullptr, 0,
nullptr},
142#if (defined(__GNUC__) && !defined(__clang__))
143# pragma GCC diagnostic pop
153 pygpu_vertformat__tp_doc,
154 ".. class:: GPUVertFormat()\n"
156 " This object contains information about the structure of a vertex buffer.\n");
158 PyVarObject_HEAD_INIT(
nullptr, 0)
178 pygpu_vertformat__tp_doc,
224 memset(&
self->fmt, 0,
sizeof(
self->fmt));
227 return (PyObject *)
self;
struct @620::@623 attr_id
#define BPYGPU_IS_INIT_OR_ERROR_OBJ
int PyC_ParseStringEnum(PyObject *o, void *p)
header-only compatibility defines.
#define PY_ARG_PARSER_HEAD_COMPAT()