diff options
author | Jacques Lucke <mail@jlucke.com> | 2018-11-13 17:25:22 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2018-11-13 17:25:51 +0300 |
commit | c8975b0fc71c0e02f7bb7bc4680077b5745a6931 (patch) | |
tree | 22a129061a69a58c912b42f16aad992e3117696c /source/blender/python/gpu/gpu_py_vertex_format.c | |
parent | 444f1fd4237d68151cb0cb844ad25276102291bd (diff) |
Py API Docs: GPUVertFormat documentation
Diffstat (limited to 'source/blender/python/gpu/gpu_py_vertex_format.c')
-rw-r--r-- | source/blender/python/gpu/gpu_py_vertex_format.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/source/blender/python/gpu/gpu_py_vertex_format.c b/source/blender/python/gpu/gpu_py_vertex_format.c index 0f863d04227..27f3791ec15 100644 --- a/source/blender/python/gpu/gpu_py_vertex_format.c +++ b/source/blender/python/gpu/gpu_py_vertex_format.c @@ -162,7 +162,22 @@ static PyObject *bpygpu_VertFormat_new(PyTypeObject *UNUSED(type), PyObject *arg } PyDoc_STRVAR(bpygpu_VertFormat_attr_add_doc, -"TODO" +".. 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 (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 reduced precision.\n" +" E.g. you can store a float in only 1 byte but it will be 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 *bpygpu_VertFormat_attr_add(BPyGPUVertFormat *self, PyObject *args, PyObject *kwds) { @@ -206,12 +221,18 @@ static void bpygpu_VertFormat_dealloc(BPyGPUVertFormat *self) Py_TYPE(self)->tp_free(self); } +PyDoc_STRVAR(bpygpu_VertFormat_doc, +".. class:: GPUVertFormat()\n" +"\n" +" This object contains information about the structure of a vertex buffer.\n" +); PyTypeObject BPyGPUVertFormat_Type = { PyVarObject_HEAD_INIT(NULL, 0) .tp_name = "GPUVertFormat", .tp_basicsize = sizeof(BPyGPUVertFormat), .tp_dealloc = (destructor)bpygpu_VertFormat_dealloc, .tp_flags = Py_TPFLAGS_DEFAULT, + .tp_doc = bpygpu_VertFormat_doc, .tp_methods = bpygpu_VertFormat_methods, .tp_new = bpygpu_VertFormat_new, }; |