42#define PYDOC_BUILTIN_SHADER_DESCRIPTION \
44 " :Attributes: vec3 pos, vec4 color\n" \
45 " :Uniforms: none\n" \
47 " :Attributes: vec3 pos, vec2 texCoord\n" \
48 " :Uniforms: sampler2D image\n" \
49 "``IMAGE_SCENE_LINEAR_TO_REC709_SRGB``\n" \
50 " :Attributes: vec3 pos, vec2 texCoord\n" \
51 " :Uniforms: sampler2D image\n" \
52 " :Note: Expect texture to be in scene linear color space\n" \
54 " :Attributes: vec3 pos, vec2 texCoord\n" \
55 " :Uniforms: sampler2D image, vec4 color\n" \
56 "``IMAGE_COLOR_SCENE_LINEAR_TO_REC709_SRGB``\n" \
57 " :Attributes: vec3 pos, vec2 texCoord\n" \
58 " :Uniforms: sampler2D image, vec4 color\n" \
59 " :Note: Expect texture to be in scene linear color space\n" \
60 "``SMOOTH_COLOR``\n" \
61 " :Attributes: vec3 pos, vec4 color\n" \
62 " :Uniforms: none\n" \
63 "``UNIFORM_COLOR``\n" \
64 " :Attributes: vec3 pos\n" \
65 " :Uniforms: vec4 color\n" \
66 "``POLYLINE_FLAT_COLOR``\n" \
67 " :Attributes: vec3 pos, vec4 color\n" \
68 " :Uniforms: vec2 viewportSize, float lineWidth\n" \
69 "``POLYLINE_SMOOTH_COLOR``\n" \
70 " :Attributes: vec3 pos, vec4 color\n" \
71 " :Uniforms: vec2 viewportSize, float lineWidth\n" \
72 "``POLYLINE_UNIFORM_COLOR``\n" \
73 " :Attributes: vec3 pos\n" \
74 " :Uniforms: vec2 viewportSize, float lineWidth, vec4 color\n" \
75 "``POINT_FLAT_COLOR``\n" \
76 " :Attributes: vec3 pos, vec4 color\n" \
77 " :Uniforms: float size\n" \
78 "``POINT_UNIFORM_COLOR``\n" \
79 " :Attributes: vec3 pos\n" \
80 " :Uniforms: vec4 color, float size\n"
88 "IMAGE_COLOR_SCENE_LINEAR_TO_REC709_SRGB"},
107 const char *error_prefix)
112 PyErr_Format(PyExc_ValueError,
"%s: uniform %.32s not found", error_prefix, name);
126 pygpu_shader_bind_doc,
127 ".. method:: bind()\n"
129 " Bind the shader object. Required to be able to change uniforms of this shader.\n");
138 pygpu_shader_uniform_from_name_doc,
139 ".. method:: uniform_from_name(name)\n"
141 " Get uniform location by name.\n"
143 " :param name: Name of the uniform variable whose location is to be queried.\n"
145 " :return: Location of the uniform variable.\n"
149 const char *name = PyUnicode_AsUTF8(arg);
150 if (name ==
nullptr) {
155 self->
shader, name,
"GPUShader.get_uniform");
161 return PyLong_FromLong(
uniform);
166 pygpu_shader_uniform_block_from_name_doc,
167 ".. method:: uniform_block_from_name(name)\n"
169 " Get uniform block location by name.\n"
171 " :param name: Name of the uniform block variable whose location is to be queried.\n"
173 " :return: The location of the uniform block variable.\n"
177 const char *name = PyUnicode_AsUTF8(arg);
178 if (name ==
nullptr) {
185 PyErr_Format(PyExc_ValueError,
"GPUShader.get_uniform_block: uniform %.32s not found", name);
189 return PyLong_FromLong(
uniform);
197 Py_buffer *r_pybuffer)
202 if (!PyArg_ParseTuple(args,
208 ":GPUShader.uniform_vector_*",
217 if (PyObject_GetBuffer(buffer, r_pybuffer, PyBUF_SIMPLE) == -1) {
222 if (r_pybuffer->len < (*r_length * *r_count * elem_size)) {
223 PyErr_SetString(PyExc_OverflowError,
224 "GPUShader.uniform_vector_*: buffer size smaller than required.");
225 PyBuffer_Release(r_pybuffer);
234 pygpu_shader_uniform_vector_float_doc,
235 ".. method:: uniform_vector_float(location, buffer, length, count)\n"
237 " Set the buffer to fill the uniform.\n"
239 " :param location: Location of the uniform variable to be modified.\n"
240 " :type location: int\n"
241 " :param buffer: The data that should be set. Can support the buffer protocol.\n"
242 " :type buffer: Sequence[float]\n"
243 " :param length: Size of the uniform data type:\n"
246 " - 2: vec2 or float[2]\n"
247 " - 3: vec3 or float[3]\n"
248 " - 4: vec4 or float[4]\n"
251 " :type length: int\n"
252 " :param count: Specifies the number of elements, vector or matrices that are to "
254 " :type count: int\n");
257 int location,
length, count;
262 args,
sizeof(
float), &location, &
length, &count, &pybuffer))
269 self->
shader, location,
length, count,
static_cast<const float *
>(pybuffer.buf));
271 PyBuffer_Release(&pybuffer);
278 pygpu_shader_uniform_vector_int_doc,
279 ".. method:: uniform_vector_int(location, buffer, length, count)\n"
281 " Set the buffer to fill the uniform.\n"
283 " :param location: Location of the uniform variable to be modified.\n"
284 " :type location: int\n"
285 " :param buffer: Buffer object with format matching the uniform.\n"
286 " :type buffer: Buffer\n"
287 " :param length: Size of the uniform data type.\n"
288 " :type length: int\n"
289 " :param count: Specifies the number of elements that are to be modified.\n"
290 " :type count: int\n");
293 int location,
length, count;
304 self->
shader, location,
length, count,
static_cast<const int *
>(pybuffer.buf));
306 PyBuffer_Release(&pybuffer);
313 pygpu_shader_uniform_bool_doc,
314 ".. method:: uniform_bool(name, value)\n"
316 " Specify the value of a uniform variable for the current program object.\n"
318 " :param name: Name of the uniform variable whose value is to be changed.\n"
320 " :param value: Value that will be used to update the specified uniform variable.\n"
321 " :type value: bool | Sequence[bool]\n");
324 const char *error_prefix =
"GPUShader.uniform_bool";
331 if (!PyArg_ParseTuple(args,
334 ":GPUShader.uniform_bool",
344 if (PySequence_Check(params.seq)) {
345 PyObject *seq_fast = PySequence_Fast(params.seq, error_prefix);
346 if (seq_fast ==
nullptr) {
347 PyErr_Format(PyExc_TypeError,
348 "%s: expected a sequence, got %s",
350 Py_TYPE(params.seq)->tp_name);
353 length = PySequence_Fast_GET_SIZE(seq_fast);
355 PyErr_Format(PyExc_TypeError,
356 "%s: invalid sequence length. expected 1..4, got %d",
362 values,
sizeof(*values), seq_fast,
length, &PyLong_Type, error_prefix);
367 else if (((values[0] =
int(PyLong_AsLong(params.seq))) != -1) &&
ELEM(values[0], 0, 1)) {
373 PyExc_ValueError,
"expected a bool or sequence, got %s", Py_TYPE(params.seq)->tp_name);
382 if (location == -1) {
394 pygpu_shader_uniform_float_doc,
395 ".. method:: uniform_float(name, value)\n"
397 " Specify the value of a uniform variable for the current program object.\n"
399 " :param name: Name of the uniform variable whose value is to be changed.\n"
401 " :param value: Value that will be used to update the specified uniform variable.\n"
402 " :type value: float | Sequence[float]\n");
405 const char *error_prefix =
"GPUShader.uniform_float";
412 if (!PyArg_ParseTuple(args,
415 ":GPUShader.uniform_float",
425 if (PyFloat_Check(params.seq)) {
426 values[0] =
float(PyFloat_AsDouble(params.seq));
429 else if (PyLong_Check(params.seq)) {
430 values[0] =
float(PyLong_AsDouble(params.seq));
439 PyErr_SetString(PyExc_ValueError,
"Expected 3x3 or 4x4 matrix");
443 memcpy(values, mat->matrix,
sizeof(
float) *
length);
453 PyErr_SetString(PyExc_TypeError,
454 "Expected a single float or a sequence of floats of length 1..4, 9 or 16.");
460 if (location == -1) {
472 pygpu_shader_uniform_int_doc,
473 ".. method:: uniform_int(name, seq)\n"
475 " Specify the value of a uniform variable for the current program object.\n"
477 " :param name: Name of the uniform variable whose value is to be changed.\n"
479 " :param seq: Value that will be used to update the specified uniform variable.\n"
480 " :type seq: int | Sequence[int]\n");
483 const char *error_prefix =
"GPUShader.uniform_int";
490 if (!PyArg_ParseTuple(args,
493 ":GPUShader.uniform_int",
504 if (PyLong_Check(params.seq)) {
505 values[0] = PyC_Long_AsI32(params.seq);
510 PyObject *seq_fast = PySequence_Fast(params.seq, error_prefix);
511 if (seq_fast ==
nullptr) {
512 PyErr_Format(PyExc_TypeError,
513 "%s: expected a sequence, got %s",
515 Py_TYPE(params.seq)->tp_name);
519 length = PySequence_Fast_GET_SIZE(seq_fast);
521 PyErr_Format(PyExc_TypeError,
522 "%s: invalid sequence length. expected 1..4, got %d",
529 values,
sizeof(*values), seq_fast,
length, &PyLong_Type, error_prefix);
540 if (location == -1) {
552 pygpu_shader_uniform_sampler_doc,
553 ".. method:: uniform_sampler(name, texture)\n"
555 " Specify the value of a texture uniform variable for the current GPUShader.\n"
557 " :param name: Name of the uniform variable whose texture is to be specified.\n"
559 " :param texture: Texture to attach.\n"
560 " :type texture: :class:`gpu.types.GPUTexture`\n");
565 if (!PyArg_ParseTuple(args,
568 ":GPUShader.uniform_sampler",
586 pygpu_shader_image_doc,
587 ".. method:: image(name, texture)\n"
589 " Specify the value of an image variable for the current GPUShader.\n"
591 " :param name: Name of the image variable to which the texture is to be bound.\n"
593 " :param texture: Texture to attach.\n"
594 " :type texture: :class:`gpu.types.GPUTexture`\n");
599 if (!PyArg_ParseTuple(args,
612 if (image_unit == -1) {
613 PyErr_Format(PyExc_ValueError,
"Image '%s' not found in shader", name);
624 pygpu_shader_uniform_block_doc,
625 ".. method:: uniform_block(name, ubo)\n"
627 " Specify the value of a uniform buffer object variable for the current GPUShader.\n"
629 " :param name: Name of the uniform variable whose UBO is to be specified.\n"
631 " :param ubo: Uniform Buffer to attach.\n"
632 " :type ubo: :class:`gpu.types.GPUUniformBuf`\n");
637 if (!PyArg_ParseTuple(args,
640 ":GPUShader.uniform_block",
652 "GPUShader.uniform_block: uniform block not found, make sure the name is correct");
664 pygpu_shader_storage_block_doc,
665 ".. method:: storage_block(name, ssbo)\n"
667 " Specify the value of a storage buffer object variable for the current GPUShader.\n"
669 " :param name: Name of the storage block variable whose SSBO is to be specified.\n"
671 " :param ssbo: Storage Buffer to attach.\n"
672 " :type ssbo: :class:`gpu.types.GPUStorageBuf`\n");
677 if (!PyArg_ParseTuple(
687 "GPUShader.storage_block: storage block not found, make sure the name is correct");
699 pygpu_shader_attr_from_name_doc,
700 ".. method:: attr_from_name(name)\n"
702 " Get attribute location by name.\n"
704 " :param name: The name of the attribute variable whose location is to be queried.\n"
706 " :return: The location of an attribute variable.\n"
710 const char *name = PyUnicode_AsUTF8(arg);
711 if (name ==
nullptr) {
718 PyErr_Format(PyExc_ValueError,
"GPUShader.attr_from_name: attribute %.32s not found", name);
722 return PyLong_FromLong(attr);
727 pygpu_shader_format_calc_doc,
728 ".. method:: format_calc()\n"
730 " Build a new format based on the attributes of the shader.\n"
732 " :return: vertex attribute format for the shader\n"
733 " :rtype: :class:`gpu.types.GPUVertFormat`\n");
752 return reinterpret_cast<PyObject *
>(
ret);
757 pygpu_shader_attrs_info_get_doc,
758 ".. method:: attrs_info_get()\n"
760 " Information about the attributes used in the Shader.\n"
762 " :return: tuples containing information about the attributes in order (name, type)\n"
763 " :rtype: tuple[tuple[str, str | None], ...]\n");
769 int location_test = 0, attrs_added = 0;
778 ret = PyTuple_New(input_len);
779 while (attrs_added < input_len) {
783 if (
STREQ(name,
"gpu_index_buf")) {
792 py_type = PyUnicode_InternFromString(
800 PyObject *attr_info = PyTuple_New(2);
802 PyTuple_SetItem(
ret, attrs_added, attr_info);
809 ret = PyTuple_New(attr_len);
810 while (attrs_added < attr_len) {
816 py_type = PyUnicode_InternFromString(
824 PyObject *attr_info = PyTuple_New(2);
826 PyTuple_SetItem(
ret, attrs_added, attr_info);
835# pragma clang diagnostic push
836# pragma clang diagnostic ignored "-Wcast-function-type"
838# pragma GCC diagnostic push
839# pragma GCC diagnostic ignored "-Wcast-function-type"
844 {
"bind",
reinterpret_cast<PyCFunction
>(
pygpu_shader_bind), METH_NOARGS, pygpu_shader_bind_doc},
845 {
"uniform_from_name",
848 pygpu_shader_uniform_from_name_doc},
849 {
"uniform_block_from_name",
852 pygpu_shader_uniform_block_from_name_doc},
853 {
"uniform_vector_float",
856 pygpu_shader_uniform_vector_float_doc},
857 {
"uniform_vector_int",
860 pygpu_shader_uniform_vector_int_doc},
864 pygpu_shader_uniform_bool_doc},
868 pygpu_shader_uniform_float_doc},
872 pygpu_shader_uniform_int_doc},
876 pygpu_shader_uniform_sampler_doc},
880 pygpu_shader_image_doc},
884 pygpu_shader_uniform_block_doc},
888 pygpu_shader_storage_block_doc},
892 pygpu_shader_attr_from_name_doc},
896 pygpu_shader_format_calc_doc},
900 pygpu_shader_attrs_info_get_doc},
901 {
nullptr,
nullptr, 0,
nullptr},
906# pragma clang diagnostic pop
908# pragma GCC diagnostic pop
914 pygpu_shader_name_doc,
915 "The name of the shader object for debugging purposes (read-only).\n"
925 pygpu_shader_program_doc,
926 "The name of the program object for use by the OpenGL API (read-only).\n"
927 "This is deprecated and will always return -1.\n"
933 PyExc_DeprecationWarning,
"'program' is deprecated. No valid handle will be returned.", 1);
934 return PyLong_FromLong(-1);
940 static_cast<setter
>(
nullptr),
941 pygpu_shader_program_doc,
945 static_cast<setter
>(
nullptr),
946 pygpu_shader_name_doc,
948 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
956 Py_TYPE(self)->tp_free(
reinterpret_cast<PyObject *
>(self));
960 PyVarObject_HEAD_INIT(
nullptr, 0)
1019 pygpu_shader_unbind_doc,
1020 ".. function:: unbind()\n"
1022 " Unbind the bound shader object.\n");
1031 pygpu_shader_from_builtin_doc,
1032 ".. function:: from_builtin(shader_name, *, config='DEFAULT')\n"
1034 " Shaders that are embedded in the Blender internal code (see :ref:`built-in-shaders`).\n"
1035 " They all read the uniform ``mat4 ModelViewProjectionMatrix``,\n"
1036 " which can be edited by the :mod:`gpu.matrix` module.\n"
1038 " You can also choose a shader configuration that uses clip_planes by setting the "
1039 "``CLIPPED`` value to the config parameter. Note that in this case you also need to "
1040 "manually set the value of ``mat4 ModelMatrix``.\n"
1042 " :param shader_name: One of the builtin shader names.\n"
1043 " :type shader_name: str\n"
1044 " :param config: One of these types of shader configuration:\n"
1048 " :type config: str\n"
1049 " :return: Shader object corresponding to the given name.\n"
1050 " :rtype: :class:`gpu.types.GPUShader`\n");
1058 static const char *_keywords[] = {
"shader_name",
"config",
nullptr};
1059 static _PyArg_Parser _parser = {
1067 if (!_PyArg_ParseTupleAndKeywordsFast(args,
1071 &pygpu_bultinshader,
1082 PyErr_SetString(PyExc_ValueError,
"Builtin shader doesn't exist in the requested config");
1091 pygpu_shader_create_from_info_doc,
1092 ".. function:: create_from_info(shader_info)\n"
1094 " Create shader from a GPUShaderCreateInfo.\n"
1096 " :param shader_info: GPUShaderCreateInfo\n"
1097 " :type shader_info: :class:`gpu.types.GPUShaderCreateInfo`\n"
1098 " :return: Shader object corresponding to the given shader info.\n"
1099 " :rtype: :class:`gpu.types.GPUShader`\n");
1105 PyErr_Format(PyExc_TypeError,
"Expected a GPUShaderCreateInfo, got %s", Py_TYPE(o)->tp_name);
1111 PyErr_SetString(PyExc_Exception, error);
1117 PyErr_SetString(PyExc_Exception,
"Shader Compile Error, see console for more details");
1126# pragma clang diagnostic push
1127# pragma clang diagnostic ignored "-Wcast-function-type"
1129# pragma GCC diagnostic push
1130# pragma GCC diagnostic ignored "-Wcast-function-type"
1138 pygpu_shader_unbind_doc},
1141 METH_VARARGS | METH_KEYWORDS,
1142 pygpu_shader_from_builtin_doc},
1143 {
"create_from_info",
1146 pygpu_shader_create_from_info_doc},
1147 {
nullptr,
nullptr, 0,
nullptr},
1152# pragma clang diagnostic pop
1154# pragma GCC diagnostic pop
1160 pygpu_shader_module__tp_doc,
1161 "This module provides access to GPUShader internal functions.\n"
1163 ".. _built-in-shaders:\n"
1165 ".. rubric:: Built-in shaders\n"
1167 "All built-in shaders have the ``mat4 ModelViewProjectionMatrix`` uniform.\n"
1169 "Its value must be modified using the :mod:`gpu.matrix` module.\n"
1173 " Shader uniforms must be explicitly initialized to avoid retaining values from previous "
1179 pygpu_shader_module__tp_doc,
1202 return reinterpret_cast<PyObject *
>(self);
1207 PyObject *submodule;
#define BPYGPU_IS_INIT_OR_ERROR_OBJ
#define PYDOC_BUILTIN_SHADER_DESCRIPTION
#define BPyGPUShaderCreateInfo_Check(v)
float length(VecOp< float, D >) RET
#define BaseMath_ReadCallback(_self)
#define MatrixObject_Check(v)
static PyObject * pygpu_shader_attrs_info_get(BPyGPUShader *self, PyObject *)
static PyObject * pygpu_shader_unbind(PyObject *)
int PyC_AsArray_FAST(void *array, const size_t array_item_size, PyObject *value_fast, const Py_ssize_t length, const PyTypeObject *type, const char *error_prefix)
int GPU_shader_get_sampler_binding(gpu::Shader *shader, const char *name)
static PyObject * pygpu_shader_uniform_from_name(BPyGPUShader *self, PyObject *arg)
bool bpygpu_shader_is_polyline(gpu::Shader *shader)
static const PyC_StringEnumItems pygpu_shader_config_items[]
gpu::Shader * GPU_shader_create_from_info_python(const GPUShaderCreateInfo *_info)
static PyObject * pygpu_shader_uniform_sampler(BPyGPUShader *self, PyObject *args)
PyDoc_STRVAR(bpy_bm_new_doc, ".. function:: new(*, use_operators=True)\n" "\n" " :param use_operators: Support calling operators in :mod:`bmesh.ops` (uses some " "extra memory per vert/edge/face).\n" " :type use_operators: bool\n" " :return: Return a new, empty BMesh.\n" " :rtype: :class:`bmesh.types.BMesh`\n")
static PyObject * pygpu_shader_format_calc(BPyGPUShader *self, PyObject *)
static PyGetSetDef pygpu_shader__tp_getseters[]
static PyObject * pygpu_shader_uniform_vector_int(BPyGPUShader *self, PyObject *args)
void GPU_vertformat_from_shader(GPUVertFormat *format, const gpu::Shader *shader)
static PyObject * pygpu_shader_uniform_vector_float(BPyGPUShader *self, PyObject *args)
static PyObject * pygpu_shader_uniform_float(BPyGPUShader *self, PyObject *args)
int GPU_shader_get_attribute(const gpu::Shader *shader, const char *name)
void GPU_shader_uniform_int_ex(gpu::Shader *shader, int location, int length, int array_size, const int *value)
static PyObject * pygpu_shader_storage_block(BPyGPUShader *self, PyObject *args)
int GPU_shader_get_ssbo_binding(gpu::Shader *shader, const char *name)
static PyModuleDef pygpu_shader_module_def
static void pygpu_shader__tp_dealloc(BPyGPUShader *self)
static PyMethodDef pygpu_shader__tp_methods[]
PyObject * BPyGPUShader_CreatePyObject(gpu::Shader *shader, bool is_builtin)
PyObject * BPyGPUVertFormat_CreatePyObject(GPUVertFormat *fmt)
static PyObject * pygpu_shader_from_builtin(PyObject *, PyObject *args, PyObject *kwds)
bool GPU_shader_get_ssbo_input_info(const gpu::Shader *shader, int ssbo_location, char r_name[256])
static PyObject * pygpu_shader_create_from_info(BPyGPUShader *, BPyGPUShaderCreateInfo *o)
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
@ GPU_SHADER_3D_POLYLINE_FLAT_COLOR
@ GPU_SHADER_3D_IMAGE_COLOR_SCENE_LINEAR_TO_REC709_SRGB
@ GPU_SHADER_3D_SMOOTH_COLOR
@ GPU_SHADER_3D_IMAGE_COLOR
@ GPU_SHADER_3D_IMAGE_SCENE_LINEAR_TO_REC709_SRGB
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_3D_POINT_UNIFORM_COLOR
@ GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR
@ GPU_SHADER_3D_FLAT_COLOR
@ GPU_SHADER_3D_POINT_FLAT_COLOR
PyTypeObject BPyGPUStorageBuf_Type
void GPU_shader_uniform_float_ex(gpu::Shader *shader, int location, int length, int array_size, const float *value)
const struct PyC_StringEnumItems pygpu_attrtype_items[]
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
static PyObject * pygpu_shader_attr_from_name(BPyGPUShader *self, PyObject *arg)
static PyMethodDef pygpu_shader_module__tp_methods[]
uint GPU_shader_get_attribute_len(const gpu::Shader *shader)
static PyObject * pygpu_shader_bind(BPyGPUShader *self)
void GPU_shader_bind(gpu::Shader *shader, const gpu::shader::SpecializationConstants *constants_state=nullptr)
void GPU_shader_uniform_1i(gpu::Shader *sh, const char *name, int value)
void GPU_storagebuf_bind(gpu::StorageBuf *ssbo, int slot)
void GPU_uniformbuf_bind(gpu::UniformBuf *ubo, int slot)
uint GPU_vertformat_attr_add(GPUVertFormat *format, StringRef name, gpu::VertAttrType type)
PyTypeObject BPyGPUUniformBuf_Type
const char * PyC_StringEnum_FindIDFromValue(const PyC_StringEnumItems *items, const int value)
static bool pygpu_shader_uniform_vector_impl(PyObject *args, int elem_size, int *r_location, int *r_length, int *r_count, Py_buffer *r_pybuffer)
PyObject * bpygpu_shader_init()
int GPU_shader_get_uniform(gpu::Shader *shader, const char *name)
gpu::Shader * GPU_shader_get_builtin_shader(GPUBuiltinShader shader)
uint GPU_shader_get_ssbo_input_len(const gpu::Shader *shader)
static PyObject * pygpu_shader_image(BPyGPUShader *self, PyObject *args)
PyTypeObject BPyGPUTexture_Type
static PyObject * pygpu_shader_uniform_bool(BPyGPUShader *self, PyObject *args)
static int pygpu_shader_uniform_location_get(gpu::Shader *shader, const char *name, const char *error_prefix)
static PyObject * pygpu_shader_uniform_int(BPyGPUShader *self, PyObject *args)
void GPU_texture_bind(gpu::Texture *texture, int unit)
const char * GPU_shader_get_name(gpu::Shader *shader)
static PyObject * pygpu_shader_name(BPyGPUShader *self, void *)
int GPU_shader_get_ubo_binding(gpu::Shader *shader, const char *name)
void GPU_texture_image_bind(gpu::Texture *texture, int unit)
void GPU_vertformat_clear(GPUVertFormat *)
static const PyC_StringEnumItems pygpu_shader_builtin_items[]
gpu::Shader * GPU_shader_get_builtin_shader_with_config(GPUBuiltinShader shader, GPUShaderConfig sh_cfg)
void GPU_shader_free(gpu::Shader *shader)
int PyC_ParseStringEnum(PyObject *o, void *p)
PyTypeObject BPyGPUShader_Type
static PyObject * pygpu_shader_uniform_block(BPyGPUShader *self, PyObject *args)
static PyObject * pygpu_shader_uniform_block_from_name(BPyGPUShader *self, PyObject *arg)
bool GPU_shader_get_attribute_info(const gpu::Shader *shader, int attr_location, char r_name[256], int *r_type)
static PyObject * pygpu_shader_program_get(BPyGPUShader *, void *)
bool GPU_shader_create_info_check_error(const GPUShaderCreateInfo *_info, char r_error[128])
int GPU_shader_get_uniform_block(gpu::Shader *shader, const char *name)
header-only compatibility defines.
#define PyTuple_SET_ITEMS(op_arg,...)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
PyObject_HEAD GPUShaderCreateInfo * info
PyObject_HEAD gpu::Shader * shader
PyObject_HEAD gpu::StorageBuf * ssbo
PyObject_HEAD gpu::Texture * tex