Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/gpu/gpu_py_shader.c
| Show First 20 Lines • Show All 518 Lines • ▼ Show 20 Lines | PyDoc_STRVAR(bpygpu_shader_calc_format_doc, | ||||
| "\n" | "\n" | ||||
| " Build a new format based on the attributes of the shader.\n" | " Build a new format based on the attributes of the shader.\n" | ||||
| "\n" | "\n" | ||||
| " :return: vertex attribute format for the shader\n" | " :return: vertex attribute format for the shader\n" | ||||
| " :rtype: GPUVertFormat\n"); | " :rtype: GPUVertFormat\n"); | ||||
| static PyObject *bpygpu_shader_calc_format(BPyGPUShader *self, PyObject *UNUSED(arg)) | static PyObject *bpygpu_shader_calc_format(BPyGPUShader *self, PyObject *UNUSED(arg)) | ||||
| { | { | ||||
| BPyGPUVertFormat *ret = (BPyGPUVertFormat *)BPyGPUVertFormat_CreatePyObject(NULL); | BPyGPUVertFormat *ret = (BPyGPUVertFormat *)BPyGPUVertFormat_CreatePyObject(NULL); | ||||
| GPU_vertformat_from_interface(&ret->fmt, GPU_shader_get_interface(self->shader)); | GPU_vertformat_from_shader(&ret->fmt, self->shader); | ||||
| return (PyObject *)ret; | return (PyObject *)ret; | ||||
| } | } | ||||
| static struct PyMethodDef bpygpu_shader_methods[] = { | static struct PyMethodDef bpygpu_shader_methods[] = { | ||||
| {"bind", (PyCFunction)bpygpu_shader_bind, METH_NOARGS, bpygpu_shader_bind_doc}, | {"bind", (PyCFunction)bpygpu_shader_bind, METH_NOARGS, bpygpu_shader_bind_doc}, | ||||
| {"uniform_from_name", | {"uniform_from_name", | ||||
| (PyCFunction)bpygpu_shader_uniform_from_name, | (PyCFunction)bpygpu_shader_uniform_from_name, | ||||
| METH_O, | METH_O, | ||||
| ▲ Show 20 Lines • Show All 253 Lines • Show Last 20 Lines | |||||