38#define PYDOC_BUILTIN_SHADER_DESCRIPTION \
40 " :Attributes: vec3 pos, vec4 color\n" \
41 " :Uniforms: none\n" \
43 " :Attributes: vec3 pos, vec2 texCoord\n" \
44 " :Uniforms: sampler2D image\n" \
46 " :Attributes: vec3 pos, vec2 texCoord\n" \
47 " :Uniforms: sampler2D image, vec4 color\n" \
48 "``SMOOTH_COLOR``\n" \
49 " :Attributes: vec3 pos, vec4 color\n" \
50 " :Uniforms: none\n" \
51 "``UNIFORM_COLOR``\n" \
52 " :Attributes: vec3 pos\n" \
53 " :Uniforms: vec4 color\n" \
54 "``POLYLINE_FLAT_COLOR``\n" \
55 " :Attributes: vec3 pos, vec4 color\n" \
56 " :Uniforms: vec2 viewportSize, float lineWidth\n" \
57 "``POLYLINE_SMOOTH_COLOR``\n" \
58 " :Attributes: vec3 pos, vec4 color\n" \
59 " :Uniforms: vec2 viewportSize, float lineWidth\n" \
60 "``POLYLINE_UNIFORM_COLOR``\n" \
61 " :Attributes: vec3 pos\n" \
62 " :Uniforms: vec2 viewportSize, float lineWidth\n" \
63 "``POINT_FLAT_COLOR``\n" \
64 " :Attributes: vec3 pos, vec4 color\n" \
65 " :Uniforms: float size\n" \
66 "``POINT_UNIFORM_COLOR``\n" \
67 " :Attributes: vec3 pos\n" \
68 " :Uniforms: vec4 color, float size\n"
92 const char *error_prefix)
97 PyErr_Format(PyExc_ValueError,
"%s: uniform %.32s not found", error_prefix, name);
122 PyErr_SetString(PyExc_Exception,
123 "Direct shader creation is not supported on Vulkan. "
124 "Use gpu.shader.create_from_info(shader_info) instead.");
129 PyErr_SetString(PyExc_Exception,
130 "Direct shader creation is not supported on Metal. "
131 "Use gpu.shader.create_from_info(shader_info) instead.");
135 PyErr_WarnEx(PyExc_DeprecationWarning,
136 "Direct shader creation is deprecated. "
137 "Use gpu.shader.create_from_info(shader_info) instead.",
141 const char *vertexcode;
142 const char *fragcode;
149 static const char *_keywords[] = {
150 "vertexcode",
"fragcode",
"geocode",
"libcode",
"defines",
"name",
nullptr};
151 static _PyArg_Parser _parser = {
160 ":GPUShader.__new__",
164 if (!_PyArg_ParseTupleAndKeywordsFast(args,
184 if (shader ==
nullptr) {
185 PyErr_SetString(PyExc_Exception,
"Shader Compile Error, see console for more details");
194 pygpu_shader_bind_doc,
195 ".. method:: bind()\n"
197 " Bind the shader object. Required to be able to change uniforms of this shader.\n");
206 pygpu_shader_uniform_from_name_doc,
207 ".. method:: uniform_from_name(name)\n"
209 " Get uniform location by name.\n"
211 " :arg name: Name of the uniform variable whose location is to be queried.\n"
213 " :return: Location of the uniform variable.\n"
217 const char *name = PyUnicode_AsUTF8(arg);
218 if (name ==
nullptr) {
223 self->shader, name,
"GPUShader.get_uniform");
229 return PyLong_FromLong(uniform);
234 pygpu_shader_uniform_block_from_name_doc,
235 ".. method:: uniform_block_from_name(name)\n"
237 " Get uniform block location by name.\n"
239 " :arg name: Name of the uniform block variable whose location is to be queried.\n"
241 " :return: The location of the uniform block variable.\n"
245 const char *name = PyUnicode_AsUTF8(arg);
246 if (name ==
nullptr) {
253 PyErr_Format(PyExc_ValueError,
"GPUShader.get_uniform_block: uniform %.32s not found", name);
257 return PyLong_FromLong(uniform);
265 Py_buffer *r_pybuffer)
270 if (!PyArg_ParseTuple(
271 args,
"iOi|i:GPUShader.uniform_vector_*", r_location, &buffer, r_length, r_count))
276 if (PyObject_GetBuffer(buffer, r_pybuffer, PyBUF_SIMPLE) == -1) {
281 if (r_pybuffer->len < (*r_length * *r_count * elem_size)) {
282 PyErr_SetString(PyExc_OverflowError,
283 "GPUShader.uniform_vector_*: buffer size smaller than required.");
292 pygpu_shader_uniform_vector_float_doc,
293 ".. method:: uniform_vector_float(location, buffer, length, count)\n"
295 " Set the buffer to fill the uniform.\n"
297 " :arg location: Location of the uniform variable to be modified.\n"
298 " :type location: int\n"
299 " :arg buffer: The data that should be set. Can support the buffer protocol.\n"
300 " :type buffer: Sequence[float]\n"
301 " :arg length: Size of the uniform data type:\n"
304 " - 2: vec2 or float[2]\n"
305 " - 3: vec3 or float[3]\n"
306 " - 4: vec4 or float[4]\n"
309 " :type length: int\n"
310 " :arg count: Specifies the number of elements, vector or matrices that are to "
312 " :type count: int\n");
320 args,
sizeof(
float), &location, &
length, &
count, &pybuffer))
327 self->shader, location,
length,
count,
static_cast<const float *
>(pybuffer.buf));
329 PyBuffer_Release(&pybuffer);
336 pygpu_shader_uniform_vector_int_doc,
337 ".. method:: uniform_vector_int(location, buffer, length, count)\n"
339 " See GPUShader.uniform_vector_float(...) description.\n");
353 self->shader, location,
length,
count,
static_cast<const int *
>(pybuffer.buf));
355 PyBuffer_Release(&pybuffer);
362 pygpu_shader_uniform_bool_doc,
363 ".. method:: uniform_bool(name, value)\n"
365 " Specify the value of a uniform variable for the current program object.\n"
367 " :arg name: Name of the uniform variable whose value is to be changed.\n"
369 " :arg value: Value that will be used to update the specified uniform variable.\n"
370 " :type value: bool | Sequence[bool]\n");
373 const char *error_prefix =
"GPUShader.uniform_bool";
380 if (!PyArg_ParseTuple(args,
"sO:GPUShader.uniform_bool", &
params.id, &
params.seq)) {
387 if (PySequence_Check(
params.seq)) {
388 PyObject *seq_fast = PySequence_Fast(
params.seq, error_prefix);
389 if (seq_fast ==
nullptr) {
390 PyErr_Format(PyExc_TypeError,
391 "%s: expected a sequence, got %s",
393 Py_TYPE(
params.seq)->tp_name);
396 length = PySequence_Fast_GET_SIZE(seq_fast);
398 PyErr_Format(PyExc_TypeError,
399 "%s: invalid sequence length. expected 1..4, got %d",
405 values,
sizeof(*values), seq_fast,
length, &PyLong_Type, error_prefix);
410 else if (((values[0] =
int(PyLong_AsLong(
params.seq))) != -1) &&
ELEM(values[0], 0, 1)) {
416 PyExc_ValueError,
"expected a bool or sequence, got %s", Py_TYPE(
params.seq)->tp_name);
425 if (location == -1) {
437 pygpu_shader_uniform_float_doc,
438 ".. method:: uniform_float(name, value)\n"
440 " Specify the value of a uniform variable for the current program object.\n"
442 " :arg name: Name of the uniform variable whose value is to be changed.\n"
444 " :arg value: Value that will be used to update the specified uniform variable.\n"
445 " :type value: float | Sequence[float]\n");
448 const char *error_prefix =
"GPUShader.uniform_float";
455 if (!PyArg_ParseTuple(args,
"sO:GPUShader.uniform_float", &
params.id, &
params.seq)) {
462 if (PyFloat_Check(
params.seq)) {
463 values[0] = float(PyFloat_AsDouble(
params.seq));
466 else if (PyLong_Check(
params.seq)) {
467 values[0] = float(PyLong_AsDouble(
params.seq));
476 PyErr_SetString(PyExc_ValueError,
"Expected 3x3 or 4x4 matrix");
480 memcpy(values, mat->matrix,
sizeof(
float) *
length);
490 PyErr_SetString(PyExc_TypeError,
491 "Expected a single float or a sequence of floats of length 1..4, 9 or 16.");
497 if (location == -1) {
509 pygpu_shader_uniform_int_doc,
510 ".. method:: uniform_int(name, seq)\n"
512 " Specify the value of a uniform variable for the current program object.\n"
514 " :arg name: name of the uniform variable whose value is to be changed.\n"
516 " :arg seq: Value that will be used to update the specified uniform variable.\n"
517 " :type seq: Sequence[int]\n");
520 const char *error_prefix =
"GPUShader.uniform_int";
527 if (!PyArg_ParseTuple(args,
"sO:GPUShader.uniform_int", &
params.id, &
params.seq)) {
535 if (PyLong_Check(
params.seq)) {
536 values[0] = PyC_Long_AsI32(
params.seq);
541 PyObject *seq_fast = PySequence_Fast(
params.seq, error_prefix);
542 if (seq_fast ==
nullptr) {
543 PyErr_Format(PyExc_TypeError,
544 "%s: expected a sequence, got %s",
546 Py_TYPE(
params.seq)->tp_name);
550 length = PySequence_Fast_GET_SIZE(seq_fast);
552 PyErr_Format(PyExc_TypeError,
553 "%s: invalid sequence length. expected 1..4, got %d",
560 values,
sizeof(*values), seq_fast,
length, &PyLong_Type, error_prefix);
571 if (location == -1) {
583 pygpu_shader_uniform_sampler_doc,
584 ".. method:: uniform_sampler(name, texture)\n"
586 " Specify the value of a texture uniform variable for the current GPUShader.\n"
588 " :arg name: name of the uniform variable whose texture is to be specified.\n"
590 " :arg texture: Texture to attach.\n"
591 " :type texture: :class:`gpu.types.GPUTexture`\n");
596 if (!PyArg_ParseTuple(
612 pygpu_shader_image_doc,
613 ".. method:: image(name, texture)\n"
615 " Specify the value of an image variable for the current GPUShader.\n"
617 " :arg name: Name of the image variable to which the texture is to be bound.\n"
619 " :arg texture: Texture to attach.\n"
620 " :type texture: :class:`gpu.types.GPUTexture`\n");
625 if (!PyArg_ParseTuple(args,
"sO!:GPUShader.image", &name, &
BPyGPUTexture_Type, &py_texture)) {
631 if (image_unit == -1) {
632 PyErr_Format(PyExc_ValueError,
"Image '%s' not found in shader", name);
643 pygpu_shader_uniform_block_doc,
644 ".. method:: uniform_block(name, ubo)\n"
646 " Specify the value of an uniform buffer object variable for the current GPUShader.\n"
648 " :arg name: name of the uniform variable whose UBO is to be specified.\n"
650 " :arg ubo: Uniform Buffer to attach.\n"
651 " :type texture: :class:`gpu.types.GPUUniformBuf`\n");
656 if (!PyArg_ParseTuple(
666 "GPUShader.uniform_block: uniform block not found, make sure the name is correct");
678 pygpu_shader_attr_from_name_doc,
679 ".. method:: attr_from_name(name)\n"
681 " Get attribute location by name.\n"
683 " :arg name: The name of the attribute variable whose location is to be queried.\n"
685 " :return: The location of an attribute variable.\n"
689 const char *name = PyUnicode_AsUTF8(arg);
690 if (name ==
nullptr) {
697 PyErr_Format(PyExc_ValueError,
"GPUShader.attr_from_name: attribute %.32s not found", name);
701 return PyLong_FromLong(attr);
706 pygpu_shader_format_calc_doc,
707 ".. method:: format_calc()\n"
709 " Build a new format based on the attributes of the shader.\n"
711 " :return: vertex attribute format for the shader\n"
712 " :rtype: :class:`gpu.types.GPUVertFormat`\n");
730 return (PyObject *)
ret;
735 pygpu_shader_attrs_info_get_doc,
736 ".. method:: attrs_info_get()\n"
738 " Information about the attributes used in the Shader.\n"
740 " :return: tuples containing information about the attributes in order (name, type)\n"
741 " :rtype: tuple[tuple[str, str | None], ...]\n");
747 int location_test = 0, attrs_added = 0;
756 ret = PyTuple_New(input_len);
757 while (attrs_added < input_len) {
761 if (
STREQ(name,
"gpu_index_buf")) {
770 py_type = PyUnicode_InternFromString(
778 PyObject *attr_info = PyTuple_New(2);
780 PyTuple_SetItem(
ret, attrs_added, attr_info);
787 ret = PyTuple_New(attr_len);
788 while (attrs_added < attr_len) {
794 py_type = PyUnicode_InternFromString(
802 PyObject *attr_info = PyTuple_New(2);
804 PyTuple_SetItem(
ret, attrs_added, attr_info);
813# pragma clang diagnostic push
814# pragma clang diagnostic ignored "-Wcast-function-type"
816# pragma GCC diagnostic push
817# pragma GCC diagnostic ignored "-Wcast-function-type"
823 {
"uniform_from_name",
826 pygpu_shader_uniform_from_name_doc},
827 {
"uniform_block_from_name",
830 pygpu_shader_uniform_block_from_name_doc},
831 {
"uniform_vector_float",
834 pygpu_shader_uniform_vector_float_doc},
835 {
"uniform_vector_int",
838 pygpu_shader_uniform_vector_int_doc},
842 pygpu_shader_uniform_bool_doc},
846 pygpu_shader_uniform_float_doc},
850 pygpu_shader_uniform_int_doc},
854 pygpu_shader_uniform_sampler_doc},
859 pygpu_shader_uniform_block_doc},
863 pygpu_shader_attr_from_name_doc},
867 pygpu_shader_format_calc_doc},
871 pygpu_shader_attrs_info_get_doc},
872 {
nullptr,
nullptr, 0,
nullptr},
877# pragma clang diagnostic pop
879# pragma GCC diagnostic pop
885 pygpu_shader_name_doc,
886 "The name of the shader object for debugging purposes (read-only).\n"
896 pygpu_shader_program_doc,
897 "The name of the program object for use by the OpenGL API (read-only).\n"
898 "This is deprecated and will always return -1.\n"
904 PyExc_DeprecationWarning,
"'program' is deprecated. No valid handle will be returned.", 1);
905 return PyLong_FromLong(-1);
912 pygpu_shader_program_doc,
914 {
"name", (getter)
pygpu_shader_name, (setter)
nullptr, pygpu_shader_name_doc,
nullptr},
915 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
920 if (
self->is_builtin ==
false) {
923 Py_TYPE(
self)->tp_free((PyObject *)
self);
928 pygpu_shader__tp_doc,
929 ".. class:: GPUShader(vertexcode, fragcode, geocode=None, libcode=None, defines=None, "
930 "name='pyGPUShader')\n"
932 " Constructor is deprecated and will be removed in Blender 5.0, "
933 "use :func:`gpu.shader.create_from_info` instead.\n"
935 " GPUShader combines multiple GLSL shaders into a program used for drawing.\n"
936 " It must contain at least a vertex and fragment shaders.\n"
938 " The GLSL ``#version`` directive is automatically included at the top of shaders,\n"
939 " and set to 330. Some preprocessor directives are automatically added according to\n"
940 " the Operating System or availability: ``GPU_ATI``, ``GPU_NVIDIA`` and ``GPU_INTEL``.\n"
942 " The following extensions are enabled by default if supported by the GPU:\n"
943 " ``GL_ARB_texture_gather``, ``GL_ARB_texture_cube_map_array``\n"
944 " and ``GL_ARB_shader_draw_parameters``.\n"
946 " For drawing user interface elements and gizmos, use\n"
947 " ``fragOutput = blender_srgb_to_framebuffer_space(fragOutput)``\n"
948 " to transform the output sRGB colors to the frame-buffer color-space.\n"
950 " :arg vertexcode: Vertex shader code.\n"
951 " :type vertexcode: str\n"
952 " :arg fragcode: Fragment shader code.\n"
953 " :type value: str\n"
954 " :arg geocode: Geometry shader code.\n"
955 " :type value: str\n"
956 " :arg libcode: Code with functions and presets to be shared between shaders.\n"
957 " :type value: str\n"
958 " :arg defines: Preprocessor directives.\n"
959 " :type value: str\n"
960 " :arg name: Name of shader code, for debugging purposes.\n"
961 " :type value: str\n");
963 PyVarObject_HEAD_INIT(
nullptr, 0)
983 pygpu_shader__tp_doc,
1022 pygpu_shader_unbind_doc,
1023 ".. function:: unbind()\n"
1025 " Unbind the bound shader object.\n");
1034 pygpu_shader_from_builtin_doc,
1035 ".. function:: from_builtin(shader_name, config='DEFAULT')\n"
1037 " Shaders that are embedded in the blender internal code (see :ref:`built-in-shaders`).\n"
1038 " They all read the uniform ``mat4 ModelViewProjectionMatrix``,\n"
1039 " which can be edited by the :mod:`gpu.matrix` module.\n"
1041 " You can also choose a shader configuration that uses clip_planes by setting the "
1042 "``CLIPPED`` value to the config parameter. Note that in this case you also need to "
1043 "manually set the value of ``mat4 ModelMatrix``.\n"
1045 " :arg shader_name: One of the builtin shader names.\n"
1046 " :type shader_name: str\n"
1047 " :arg config: One of these types of shader configuration:\n"
1051 " :type config: str\n"
1052 " :return: Shader object corresponding to the given name.\n"
1053 " :rtype: :class:`gpu.types.GPUShader`\n");
1061 static const char *_keywords[] = {
"shader_name",
"config",
nullptr};
1062 static _PyArg_Parser _parser = {
1071 if (!_PyArg_ParseTupleAndKeywordsFast(args,
1075 &pygpu_bultinshader,
1087 PyErr_Format(PyExc_ValueError,
"Builtin shader doesn't exist in the requested config");
1096 pygpu_shader_create_from_info_doc,
1097 ".. function:: create_from_info(shader_info)\n"
1099 " Create shader from a GPUShaderCreateInfo.\n"
1101 " :arg shader_info: GPUShaderCreateInfo\n"
1102 " :type shader_info: :class:`gpu.types.GPUShaderCreateInfo`\n"
1103 " :return: Shader object corresponding to the given name.\n"
1104 " :rtype: :class:`gpu.types.GPUShader`\n");
1110 PyErr_Format(PyExc_TypeError,
"Expected a GPUShaderCreateInfo, got %s", Py_TYPE(o)->tp_name);
1116 PyErr_SetString(PyExc_Exception,
error);
1122 PyErr_SetString(PyExc_Exception,
"Shader Compile Error, see console for more details");
1131# pragma clang diagnostic push
1132# pragma clang diagnostic ignored "-Wcast-function-type"
1134# pragma GCC diagnostic push
1135# pragma GCC diagnostic ignored "-Wcast-function-type"
1143 METH_VARARGS | METH_KEYWORDS,
1144 pygpu_shader_from_builtin_doc},
1145 {
"create_from_info",
1148 pygpu_shader_create_from_info_doc},
1149 {
nullptr,
nullptr, 0,
nullptr},
1154# pragma clang diagnostic pop
1156# pragma GCC diagnostic pop
1162 pygpu_shader_module__tp_doc,
1163 "This module provides access to GPUShader internal functions.\n"
1165 ".. _built-in-shaders:\n"
1167 ".. rubric:: Built-in shaders\n"
1169 "All built-in shaders have the ``mat4 ModelViewProjectionMatrix`` uniform.\n"
1171 "Its value must be modified using the :class:`gpu.matrix` module.\n"
1176 pygpu_shader_module__tp_doc,
1197 self->is_builtin = is_builtin;
1199 return (PyObject *)
self;
1204 PyObject *submodule;
eGPUBackendType GPU_backend_get_type()
int GPU_shader_get_sampler_binding(GPUShader *shader, const char *name)
int GPU_shader_get_uniform(GPUShader *shader, const char *name)
GPUShader * GPU_shader_create_from_info_python(const GPUShaderCreateInfo *_info)
bool GPU_shader_get_attribute_info(const GPUShader *shader, int attr_location, char r_name[256], int *r_type)
const char * GPU_shader_get_name(GPUShader *shader)
void GPU_shader_uniform_1i(GPUShader *sh, const char *name, int value)
int GPU_shader_get_ubo_binding(GPUShader *shader, const char *name)
uint GPU_shader_get_ssbo_input_len(const GPUShader *shader)
void GPU_shader_uniform_int_ex(GPUShader *shader, int location, int length, int array_size, const int *value)
void GPU_shader_bind(GPUShader *shader, const blender::gpu::shader::SpecializationConstants *constants_state=nullptr)
uint GPU_shader_get_attribute_len(const GPUShader *shader)
int GPU_shader_get_ssbo_binding(GPUShader *shader, const char *name)
int GPU_shader_get_attribute(const GPUShader *shader, const char *name)
GPUShader * GPU_shader_create_from_python(std::optional< blender::StringRefNull > vertcode, std::optional< blender::StringRefNull > fragcode, std::optional< blender::StringRefNull > geomcode, std::optional< blender::StringRefNull > libcode, std::optional< blender::StringRefNull > defines, std::optional< blender::StringRefNull > name)
void GPU_shader_uniform_float_ex(GPUShader *shader, int location, int length, int array_size, const float *value)
int GPU_shader_get_uniform_block(GPUShader *shader, const char *name)
void GPU_shader_free(GPUShader *shader)
bool GPU_shader_create_info_check_error(const GPUShaderCreateInfo *_info, char r_error[128])
bool GPU_shader_get_ssbo_input_info(const GPUShader *shader, int ssbo_location, char r_name[256])
GPUShader * GPU_shader_get_builtin_shader_with_config(eGPUBuiltinShader shader, eGPUShaderConfig sh_cfg)
GPUShader * GPU_shader_get_builtin_shader(eGPUBuiltinShader shader)
@ GPU_SHADER_3D_SMOOTH_COLOR
@ GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
@ GPU_SHADER_3D_POINT_FLAT_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_3D_FLAT_COLOR
@ GPU_SHADER_3D_POLYLINE_FLAT_COLOR
@ GPU_SHADER_3D_POINT_UNIFORM_COLOR
@ GPU_SHADER_3D_IMAGE_COLOR
void GPU_texture_bind(GPUTexture *texture, int unit)
void GPU_texture_image_bind(GPUTexture *texture, int unit)
float length(VecOp< float, D >) RET
#define BPYGPU_IS_INIT_OR_ERROR_OBJ
#define PYDOC_BUILTIN_SHADER_DESCRIPTION
PyObject * BPyGPUShader_CreatePyObject(GPUShader *shader, bool is_builtin)
static PyObject * pygpu_shader_program_get(BPyGPUShader *, void *)
static const PyC_StringEnumItems pygpu_shader_builtin_items[]
static PyMethodDef pygpu_shader__tp_methods[]
static PyObject * pygpu_shader_unbind(BPyGPUShader *)
static PyObject * pygpu_shader_uniform_block(BPyGPUShader *self, PyObject *args)
static PyObject * pygpu_shader_uniform_vector_int(BPyGPUShader *self, PyObject *args)
bool bpygpu_shader_is_polyline(GPUShader *shader)
static PyObject * pygpu_shader_uniform_from_name(BPyGPUShader *self, PyObject *arg)
static PyObject * pygpu_shader_uniform_int(BPyGPUShader *self, PyObject *args)
static PyObject * pygpu_shader_create_from_info(BPyGPUShader *, BPyGPUShaderCreateInfo *o)
static PyObject * pygpu_shader_name(BPyGPUShader *self, void *)
PyTypeObject BPyGPUShader_Type
static PyObject * pygpu_shader_bind(BPyGPUShader *self)
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()
static PyObject * pygpu_shader_uniform_bool(BPyGPUShader *self, PyObject *args)
static PyObject * pygpu_shader_image(BPyGPUShader *self, PyObject *args)
static const PyC_StringEnumItems pygpu_shader_config_items[]
static PyObject * pygpu_shader__tp_new(PyTypeObject *, PyObject *args, PyObject *kwds)
static void pygpu_shader__tp_dealloc(BPyGPUShader *self)
static PyObject * pygpu_shader_from_builtin(PyObject *, PyObject *args, PyObject *kwds)
static PyObject * pygpu_shader_attr_from_name(BPyGPUShader *self, PyObject *arg)
static PyObject * pygpu_shader_format_calc(BPyGPUShader *self, PyObject *)
static PyObject * pygpu_shader_uniform_sampler(BPyGPUShader *self, PyObject *args)
static PyMethodDef pygpu_shader_module__tp_methods[]
static PyObject * pygpu_shader_uniform_float(BPyGPUShader *self, PyObject *args)
static std::optional< blender::StringRefNull > c_str_to_stringref_opt(const char *str)
static PyObject * pygpu_shader_uniform_vector_float(BPyGPUShader *self, PyObject *args)
static PyObject * pygpu_shader_uniform_block_from_name(BPyGPUShader *self, PyObject *arg)
static PyObject * pygpu_shader_attrs_info_get(BPyGPUShader *self, PyObject *)
static PyModuleDef pygpu_shader_module_def
PyDoc_STRVAR(pygpu_shader_bind_doc, ".. method:: bind()\n" "\n" " Bind the shader object. Required to be able to change uniforms of this shader.\n")
static PyGetSetDef pygpu_shader__tp_getseters[]
static int pygpu_shader_uniform_location_get(GPUShader *shader, const char *name, const char *error_prefix)
const struct PyC_StringEnumItems pygpu_attrtype_items[]
#define BPyGPUShaderCreateInfo_Check(v)
PyTypeObject BPyGPUTexture_Type
int mathutils_array_parse(float *array, int array_num_min, int array_num_max, PyObject *value, const char *error_prefix)
#define BaseMath_ReadCallback(_self)
#define MatrixObject_Check(v)
static void error(const char *str)
int PyC_ParseStringEnum(PyObject *o, void *p)
const char * PyC_StringEnum_FindIDFromValue(const PyC_StringEnumItems *items, const int value)
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)
header-only compatibility defines.
#define PY_ARG_PARSER_HEAD_COMPAT()
#define PyTuple_SET_ITEMS(op_arg,...)
PyObject_VAR_HEAD GPUShaderCreateInfo * info
PyObject_HEAD GPUTexture * tex