17 #include "../generic/py_capi_utils.h"
30 #ifdef USE_PYGPU_SHADER_INFO_IMAGE_METHOD
33 # define PYDOC_QUALIFIERS \
34 " - ``NO_RESTRICT``\n" \
37 static const struct PyC_FlagSet pygpu_qualifiers[] = {
38 {(int)Qualifier::NO_RESTRICT,
"NO_RESTRICT"},
39 {(int)Qualifier::READ,
"READ"},
40 {(int)Qualifier::WRITE,
"WRITE"},
45 #define PYDOC_TYPE_LIST \
63 {(int)Type::VEC2,
"VEC2"},
64 {(int)Type::VEC3,
"VEC3"},
65 {(int)Type::VEC4,
"VEC4"},
66 {(int)Type::MAT3,
"MAT3"},
67 {(int)Type::MAT4,
"MAT4"},
69 {(int)Type::UVEC2,
"UVEC2"},
70 {(int)Type::UVEC3,
"UVEC3"},
71 {(int)Type::UVEC4,
"UVEC4"},
72 {(int)Type::INT,
"INT"},
73 {(int)Type::IVEC2,
"IVEC2"},
74 {(int)Type::IVEC3,
"IVEC3"},
75 {(int)Type::IVEC4,
"IVEC4"},
76 {(int)Type::BOOL,
"BOOL"},
80 #define PYDOC_IMAGE_TYPES \
81 " - ``FLOAT_BUFFER``\n" \
83 " - ``FLOAT_1D_ARRAY``\n" \
85 " - ``FLOAT_2D_ARRAY``\n" \
87 " - ``FLOAT_CUBE``\n" \
88 " - ``FLOAT_CUBE_ARRAY``\n" \
89 " - ``INT_BUFFER``\n" \
91 " - ``INT_1D_ARRAY``\n" \
93 " - ``INT_2D_ARRAY``\n" \
96 " - ``INT_CUBE_ARRAY``\n" \
97 " - ``UINT_BUFFER``\n" \
99 " - ``UINT_1D_ARRAY``\n" \
101 " - ``UINT_2D_ARRAY``\n" \
103 " - ``UINT_CUBE``\n" \
104 " - ``UINT_CUBE_ARRAY``\n" \
105 " - ``SHADOW_2D``\n" \
106 " - ``SHADOW_2D_ARRAY``\n" \
107 " - ``SHADOW_CUBE``\n" \
108 " - ``SHADOW_CUBE_ARRAY``\n" \
109 " - ``DEPTH_2D``\n" \
110 " - ``DEPTH_2D_ARRAY``\n" \
111 " - ``DEPTH_CUBE``\n" \
112 " - ``DEPTH_CUBE_ARRAY``\n"
114 {(int)ImageType::FLOAT_BUFFER,
"FLOAT_BUFFER"},
115 {(int)ImageType::FLOAT_1D,
"FLOAT_1D"},
116 {(int)ImageType::FLOAT_1D_ARRAY,
"FLOAT_1D_ARRAY"},
117 {(int)ImageType::FLOAT_2D,
"FLOAT_2D"},
118 {(int)ImageType::FLOAT_2D_ARRAY,
"FLOAT_2D_ARRAY"},
119 {(int)ImageType::FLOAT_3D,
"FLOAT_3D"},
120 {(int)ImageType::FLOAT_CUBE,
"FLOAT_CUBE"},
121 {(int)ImageType::FLOAT_CUBE_ARRAY,
"FLOAT_CUBE_ARRAY"},
122 {(int)ImageType::INT_BUFFER,
"INT_BUFFER"},
123 {(int)ImageType::INT_1D,
"INT_1D"},
124 {(int)ImageType::INT_1D_ARRAY,
"INT_1D_ARRAY"},
125 {(int)ImageType::INT_2D,
"INT_2D"},
126 {(int)ImageType::INT_2D_ARRAY,
"INT_2D_ARRAY"},
127 {(int)ImageType::INT_3D,
"INT_3D"},
128 {(int)ImageType::INT_CUBE,
"INT_CUBE"},
129 {(int)ImageType::INT_CUBE_ARRAY,
"INT_CUBE_ARRAY"},
130 {(int)ImageType::UINT_BUFFER,
"UINT_BUFFER"},
131 {(int)ImageType::UINT_1D,
"UINT_1D"},
132 {(int)ImageType::UINT_1D_ARRAY,
"UINT_1D_ARRAY"},
133 {(int)ImageType::UINT_2D,
"UINT_2D"},
134 {(int)ImageType::UINT_2D_ARRAY,
"UINT_2D_ARRAY"},
135 {(int)ImageType::UINT_3D,
"UINT_3D"},
136 {(int)ImageType::UINT_CUBE,
"UINT_CUBE"},
137 {(int)ImageType::UINT_CUBE_ARRAY,
"UINT_CUBE_ARRAY"},
138 {(int)ImageType::SHADOW_2D,
"SHADOW_2D"},
139 {(int)ImageType::SHADOW_2D_ARRAY,
"SHADOW_2D_ARRAY"},
140 {(int)ImageType::SHADOW_CUBE,
"SHADOW_CUBE"},
141 {(int)ImageType::SHADOW_CUBE_ARRAY,
"SHADOW_CUBE_ARRAY"},
142 {(int)ImageType::DEPTH_2D,
"DEPTH_2D"},
143 {(int)ImageType::DEPTH_2D_ARRAY,
"DEPTH_2D_ARRAY"},
144 {(int)ImageType::DEPTH_CUBE,
"DEPTH_CUBE"},
145 {(int)ImageType::DEPTH_CUBE_ARRAY,
"DEPTH_CUBE_ARRAY"},
150 {(int)DualBlend::NONE,
"NONE"},
151 {(int)DualBlend::SRC_0,
"SRC_0"},
152 {(int)DualBlend::SRC_1,
"SRC_1"},
173 const char *name = PyUnicode_AsUTF8(py_name);
174 if (name ==
nullptr) {
178 #ifdef USE_GPU_PY_REFERENCES
179 PyList_Append(
self->references, (PyObject *)py_name);
188 ".. method:: smooth(type, name)\n"
190 " Add an attribute with qualifier of type `smooth` to the interface block.\n"
192 " :param type: One of these types:\n"
196 " :param name: name of the attribute.\n"
197 " :type name: str\n");
212 ".. method:: flat(type, name)\n"
214 " Add an attribute with qualifier of type `flat` to the interface block.\n"
216 " :param type: One of these types:\n"
220 " :param name: name of the attribute.\n"
221 " :type name: str\n");
236 pygpu_interface_info_no_perspective_doc,
237 ".. method:: no_perspective(type, name)\n"
239 " Add an attribute with qualifier of type `no_perspective` to the interface block.\n"
241 " :param type: One of these types:\n"
245 " :param name: name of the attribute.\n"
246 " :type name: str\n");
265 pygpu_interface_info_smooth_doc},
270 pygpu_interface_info_no_perspective_doc},
271 {
nullptr,
nullptr, 0,
nullptr},
281 "Name of the interface block.\n"
288 return PyUnicode_FromString(interface->name.c_str());
295 pygpu_interface_info_name_doc,
297 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
311 PyErr_SetString(PyExc_TypeError,
"no keywords are expected");
316 if (!PyArg_ParseTuple(args,
"s:GPUStageInterfaceInfo.__new__*", &name)) {
321 GPUStageInterfaceInfo *interface_info =
reinterpret_cast<GPUStageInterfaceInfo *
>(interface);
325 #ifdef USE_GPU_PY_REFERENCES
326 PyObject *py_name = PyTuple_GET_ITEM(args, 0);
333 #ifdef USE_GPU_PY_REFERENCES
335 static int pygpu_interface_info__tp_traverse(PyObject *
self, visitproc visit,
void *arg)
342 static int pygpu_interface_info__tp_clear(PyObject *
self)
357 #ifdef USE_GPU_PY_REFERENCES
358 PyObject_GC_UnTrack(
self);
360 pygpu_interface_info__tp_clear(
self);
365 Py_TYPE(
self)->tp_free((PyObject *)
self);
369 ".. class:: GPUStageInterfaceInfo(name)\n"
371 " List of varyings between shader stages.\n\n"
373 " :param name: Name of the interface block.\n"
374 " :type value: str\n");
377 PyTypeObject pytype = {PyVarObject_HEAD_INIT(
nullptr, 0)};
378 pytype.tp_name =
"GPUStageInterfaceInfo";
381 pytype.tp_doc = pygpu_interface_info__tp_doc;
382 #ifdef USE_GPU_PY_REFERENCES
383 pytype.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC;
384 pytype.tp_traverse = pygpu_interface_info__tp_traverse;
385 pytype.tp_clear = pygpu_interface_info__tp_clear;
387 pytype.tp_flags = Py_TPFLAGS_DEFAULT,
402 ".. method:: vertex_in(slot, type, name)\n"
404 " Add a vertex shader input attribute.\n"
406 " :param slot: The attribute index.\n"
408 " :param type: One of these types:\n"
412 " :param name: name of the attribute.\n"
413 " :type name: str\n");
420 if (!PyArg_ParseTuple(args,
"iO&s:vertex_in", &slot,
PyC_ParseStringEnum, &pygpu_type, ¶m)) {
424 #ifdef USE_GPU_PY_REFERENCES
425 PyObject *py_name = PyTuple_GET_ITEM(args, 2);
426 PyList_Append(
self->references, py_name);
435 ".. method:: vertex_out(interface)\n"
437 " Add a vertex shader output interface block.\n"
439 " :param interface: Object describing the block.\n"
440 " :type interface: :class:`gpu.types.GPUStageInterfaceInfo`\n");
445 PyErr_Format(PyExc_TypeError,
"Expected a GPUStageInterfaceInfo, got %s", Py_TYPE(o)->tp_name);
449 #ifdef USE_GPU_PY_REFERENCES
450 PyList_Append(
self->references, (PyObject *)o);
461 ".. method:: fragment_out(slot, type, name, blend='NONE')\n"
463 " Specify a fragment output corresponding to a framebuffer target slot.\n"
465 " :param slot: The attribute index.\n"
467 " :param type: One of these types:\n"
471 " :param name: Name of the attribute.\n"
473 " :param blend: Dual Source Blending Index. It can be 'NONE', 'SRC_0' or 'SRC_1'.\n"
474 " :type blend: str\n");
484 static const char *_keywords[] = {
"slot",
"type",
"name",
"blend",
nullptr};
485 static _PyArg_Parser _parser = {
495 if (!_PyArg_ParseTupleAndKeywordsFast(args,
507 #ifdef USE_GPU_PY_REFERENCES
508 PyObject *py_name = PyTuple_GET_ITEM(args, 2);
509 PyList_Append(
self->references, py_name);
519 pygpu_shader_info_uniform_buf_doc,
520 ".. method:: uniform_buf(slot, type_name, name)\n"
522 " Specify a uniform variable whose type can be one of those declared in `typedef_source`.\n"
524 " :param slot: The uniform variable index.\n"
526 " :param type_name: Name of the data type. It can be a struct type defined in the source "
527 "passed through the :meth:`gpu.types.GPUShaderCreateInfo.typedef_source`.\n"
528 " :type type_name: str\n"
529 " :param name: The uniform variable name.\n"
530 " :type name: str\n");
534 const char *type_name;
537 if (!PyArg_ParseTuple(args,
"iss:uniform_buf", &slot, &type_name, &name)) {
541 #ifdef USE_GPU_PY_REFERENCES
542 PyList_Append(
self->references, PyTuple_GET_ITEM(args, 1));
543 PyList_Append(
self->references, PyTuple_GET_ITEM(args, 2));
552 #ifdef USE_PYGPU_SHADER_INFO_IMAGE_METHOD
554 pygpu_shader_info_image_doc,
555 ".. method:: image(slot, format, type, name, qualifiers={'NO_RESTRICT'})\n"
557 " Specify an image resource used for arbitrary load and store operations.\n"
559 " :param slot: The image resource index.\n"
561 " :param format: The GPUTexture format that is passed to the shader. Possible values are:\n"
562 "" PYDOC_TEX_FORMAT_ITEMS
563 " :type format: str\n"
564 " :param type: The data type describing how the image is to be read in the shader. "
565 "Possible values are:\n"
569 " :param name: The image resource name.\n"
571 " :param qualifiers: Set containing values that describe how the image resource is to be "
572 "read or written. Possible values are:\n"
575 " :type qualifiers: set\n");
584 PyObject *py_qualifiers =
nullptr;
585 Qualifier qualifier = Qualifier::NO_RESTRICT;
587 static const char *_keywords[] = {
"slot",
"format",
"type",
"name",
"qualifiers",
nullptr};
588 static _PyArg_Parser _parser = {
599 if (!_PyArg_ParseTupleAndKeywordsFast(args,
614 pygpu_qualifiers, py_qualifiers, (
int *)&qualifier,
"shader_info.image") == -1) {
618 # ifdef USE_GPU_PY_REFERENCES
619 PyList_Append(
self->references, PyTuple_GET_ITEM(args, 3));
634 pygpu_shader_info_sampler_doc,
635 ".. method:: sampler(slot, type, name)\n"
637 " Specify an image texture sampler.\n"
639 " :param slot: The image texture sampler index.\n"
641 " :param type: The data type describing the format of each sampler unit. Possible values "
646 " :param name: The image texture sampler name.\n"
647 " :type name: str\n");
654 if (!PyArg_ParseTuple(
659 #ifdef USE_GPU_PY_REFERENCES
660 PyList_Append(
self->references, PyTuple_GET_ITEM(args, 2));
707 for (
const ShaderCreateInfo::PushConst &uniform : info->
push_constants_) {
710 if (size_last && size_last !=
size) {
712 int pack = (
size == 8) ? 8 : 16;
713 if (size_last <
size) {
714 pad = pack - (size_last % pack);
717 pad = size_prev % pack;
720 else if (
size == 12) {
728 return size_prev + (size_prev % 16);
732 ".. method:: push_constant(type, name, size=0)\n"
734 " Specify a global access constant.\n"
736 " :param type: One of these types:\n"
740 " :param name: Name of the constant.\n"
742 " :param size: If not zero, indicates that the constant is an array with the "
744 " :type size: uint\n");
750 const char *name =
nullptr;
753 static const char *_keywords[] = {
"type",
"name",
"size",
nullptr};
754 static _PyArg_Parser _parser = {
763 if (!_PyArg_ParseTupleAndKeywordsFast(
768 #ifdef USE_GPU_PY_REFERENCES
769 PyObject *py_name = PyTuple_GET_ITEM(args, 1);
770 PyList_Append(
self->references, py_name);
776 #define VULKAN_LIMIT 128
779 printf(
"Push constants have a minimum supported size of "
781 " bytes, however the constants added so far already reach %d bytes. Consider using UBO.\n",
size);
789 pygpu_shader_info_vertex_source_doc,
790 ".. method:: vertex_source(source)\n"
792 " Vertex shader source code written in GLSL.\n"
796 " .. code-block:: python\n"
798 " \"void main {gl_Position = vec4(pos, 1.0);}\"\n"
800 " :param source: The vertex shader source code.\n"
801 " :type source: str\n"
803 " .. seealso:: `GLSL Cross Compilation "
804 "<https://wiki.blender.org/wiki/EEVEE_%26_Viewport/GPU_Module/GLSL_Cross_Compilation>`__\n");
809 PyErr_Format(PyExc_ValueError,
"expected a string, got %s", Py_TYPE(o)->tp_name);
813 #ifdef USE_GPU_PY_REFERENCES
814 if (
self->vertex_source) {
815 Py_DECREF(
self->vertex_source);
818 self->vertex_source = o;
830 pygpu_shader_info_fragment_source_doc,
831 ".. method:: fragment_source(source)\n"
833 " Fragment shader source code written in GLSL.\n"
837 " .. code-block:: python\n"
839 " \"void main {fragColor = vec4(0.0, 0.0, 0.0, 1.0);}\"\n"
841 " :param source: The fragment shader source code.\n"
842 " :type source: str\n"
844 " .. seealso:: `GLSL Cross Compilation "
845 "<https://wiki.blender.org/wiki/EEVEE_%26_Viewport/GPU_Module/GLSL_Cross_Compilation>`__\n");
850 PyErr_Format(PyExc_ValueError,
"expected a string, got %s", Py_TYPE(o)->tp_name);
854 #ifdef USE_GPU_PY_REFERENCES
855 if (
self->fragment_source) {
856 Py_DECREF(
self->fragment_source);
859 self->fragment_source = o;
871 ".. method:: typedef_source(source)\n"
873 " Source code included before resource declaration. "
874 "Useful for defining structs used by Uniform Buffers.\n"
878 ".. code-block:: python\n"
880 " \"struct MyType {int foo; float bar;};\"\n"
882 " :param source: The source code defining types.\n"
883 " :type source: str\n");
888 PyErr_Format(PyExc_ValueError,
"expected a string, got %s", Py_TYPE(o)->tp_name);
892 #ifdef USE_GPU_PY_REFERENCES
893 if (
self->typedef_source) {
894 Py_DECREF(
self->typedef_source);
897 self->typedef_source = o;
913 ".. method:: define(name, value)\n"
915 " Add a preprocessing define directive. In GLSL it would be something like:\n"
917 ".. code-block:: glsl\n"
919 " #define name value\n"
921 " :param name: Token name.\n"
923 " :param value: Text that replaces token occurrences.\n"
924 " :type value: str\n");
928 const char *value =
nullptr;
930 if (!PyArg_ParseTuple(args,
"s|s:define", &name, &value)) {
934 #ifdef USE_GPU_PY_REFERENCES
935 PyList_Append(
self->references, PyTuple_GET_ITEM(args, 0));
937 PyList_Append(
self->references, PyTuple_GET_ITEM(args, 1));
943 info->
define(name, value);
956 pygpu_shader_info_vertex_in_doc},
960 pygpu_shader_info_vertex_out_doc},
963 METH_VARARGS | METH_KEYWORDS,
964 pygpu_shader_info_fragment_out_doc},
968 pygpu_shader_info_uniform_buf_doc},
969 #ifdef USE_PYGPU_SHADER_INFO_IMAGE_METHOD
971 (PyCFunction)(
void *)pygpu_shader_info_image,
972 METH_VARARGS | METH_KEYWORDS,
973 pygpu_shader_info_image_doc},
978 pygpu_shader_info_sampler_doc},
981 METH_VARARGS | METH_KEYWORDS,
982 pygpu_shader_info_push_constant_doc},
986 pygpu_shader_info_vertex_source_doc},
990 pygpu_shader_info_fragment_source_doc},
994 pygpu_shader_info_typedef_source_doc},
996 {
nullptr,
nullptr, 0,
nullptr},
1009 if (PyTuple_Size(args) || kwds) {
1010 PyErr_SetString(PyExc_TypeError,
"no args or keywords are expected");
1020 #ifdef USE_GPU_PY_REFERENCES
1022 static int pygpu_shader_info__tp_traverse(PyObject *
self, visitproc visit,
void *arg)
1031 static int pygpu_shader_info__tp_clear(PyObject *
self)
1048 #ifdef USE_GPU_PY_REFERENCES
1049 PyObject_GC_UnTrack(
self);
1051 pygpu_shader_info__tp_clear(
self);
1058 Py_TYPE(
self)->tp_free((PyObject *)
self);
1062 ".. class:: GPUShaderCreateInfo()\n"
1064 " Stores and describes types and variables that are used in shader sources.\n");
1067 PyTypeObject pytype = {PyVarObject_HEAD_INIT(
nullptr, 0)};
1068 pytype.tp_name =
"GPUShaderCreateInfo";
1071 pytype.tp_doc = pygpu_shader_info__tp_doc;
1072 #ifdef USE_GPU_PY_REFERENCES
1073 pytype.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC;
1074 pytype.tp_traverse = pygpu_shader_info__tp_traverse;
1075 pytype.tp_clear = pygpu_shader_info__tp_clear;
1077 pytype.tp_flags = Py_TPFLAGS_DEFAULT,
1097 #ifdef USE_GPU_PY_REFERENCES
1104 self->interface = interface;
1106 return (PyObject *)
self;
1113 #ifdef USE_GPU_PY_REFERENCES
1116 self->fragment_source =
nullptr;
1117 self->typedef_source =
nullptr;
1118 self->references = PyList_New(0);
1124 self->constants_total_size = 0;
1126 return (PyObject *)
self;
KDTree *BLI_kdtree_nd_() new(unsigned int maxsize)
typedef UINT(API *GHOST_WIN32_GetDpiForWindow)(HWND)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
struct GPUShaderCreateInfo GPUShaderCreateInfo
int pad[32 - sizeof(int)]
vertex_source("basic_depth_pointcloud_vert.glsl") .additional_info("draw_pointcloud")
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
out_color fragment_source("eevee_film_frag.glsl") .additional_info("draw_fullscreen"
typedef_source("eevee_defines.hh") .typedef_source("eevee_shader_shared.hh")
struct BPyGPUShaderCreateInfo BPyGPUShaderCreateInfo
struct BPyGPUStageInterfaceInfo BPyGPUStageInterfaceInfo
#define BPyGPUStageInterfaceInfo_Check(v)
static PyObject * pygpu_shader_info_define(BPyGPUShaderCreateInfo *self, PyObject *args)
constexpr PyTypeObject pygpu_interface_info_type()
static PyObject * pygpu_shader_info__tp_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds)
static int constant_type_size(Type type)
PyTypeObject BPyGPUStageInterfaceInfo_Type
static const struct PyC_StringEnumItems pygpu_attrtype_items[]
static PyObject * pygpu_interface_info__tp_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject *kwds)
static PyObject * pygpu_shader_info_uniform_buf(BPyGPUShaderCreateInfo *self, PyObject *args)
static int constants_calc_size(ShaderCreateInfo *info)
static PyObject * pygpu_shader_info_vertex_source(BPyGPUShaderCreateInfo *self, PyObject *o)
static PyObject * pygpu_shader_info_fragment_out(BPyGPUShaderCreateInfo *self, PyObject *args, PyObject *kwds)
static void pygpu_shader_info__tp_dealloc(PyObject *self)
static PyGetSetDef pygpu_interface_info__tp_getseters[]
static const struct PyC_StringEnumItems pygpu_dualblend_items[]
constexpr PyTypeObject pygpu_shader_info_type()
static PyObject * pygpu_shader_info_typedef_source(BPyGPUShaderCreateInfo *self, PyObject *o)
PyObject * BPyGPUStageInterfaceInfo_CreatePyObject(GPUStageInterfaceInfo *interface)
static struct PyMethodDef pygpu_shader_info__tp_methods[]
static PyObject * pygpu_interface_info_name_get(BPyGPUStageInterfaceInfo *self, void *UNUSED(closure))
PyDoc_STRVAR(pygpu_interface_info_smooth_doc, ".. method:: smooth(type, name)\n" "\n" " Add an attribute with qualifier of type `smooth` to the interface block.\n" "\n" " :param type: One of these types:\n" "\n" PYDOC_TYPE_LIST "\n" " :type type: str\n" " :param name: name of the attribute.\n" " :type name: str\n")
static PyObject * pygpu_interface_info_no_perspective(BPyGPUStageInterfaceInfo *self, PyObject *args)
PyObject * BPyGPUShaderCreateInfo_CreatePyObject(GPUShaderCreateInfo *info)
static PyObject * pygpu_shader_info_vertex_in(BPyGPUShaderCreateInfo *self, PyObject *args)
static PyObject * pygpu_shader_info_vertex_out(BPyGPUShaderCreateInfo *self, BPyGPUStageInterfaceInfo *o)
#define PYDOC_IMAGE_TYPES
PyTypeObject BPyGPUShaderCreateInfo_Type
static PyObject * pygpu_interface_info_smooth(BPyGPUStageInterfaceInfo *self, PyObject *args)
static struct PyMethodDef pygpu_interface_info__tp_methods[]
static void pygpu_interface_info__tp_dealloc(PyObject *self)
static PyObject * pygpu_shader_info_sampler(BPyGPUShaderCreateInfo *self, PyObject *args)
static const struct PyC_StringEnumItems pygpu_imagetype_items[]
static PyObject * pygpu_interface_info_flat(BPyGPUStageInterfaceInfo *self, PyObject *args)
static PyObject * pygpu_shader_info_fragment_source(BPyGPUShaderCreateInfo *self, PyObject *o)
static bool pygpu_interface_info_get_args(BPyGPUStageInterfaceInfo *self, PyObject *args, const char *format, Type *r_type, const char **r_name)
static PyObject * pygpu_shader_info_push_constant(BPyGPUShaderCreateInfo *self, PyObject *args, PyObject *kwds)
static const struct PyC_StringEnumItems pygpu_textureformat_items[]
int PyC_ParseStringEnum(PyObject *o, void *p)
int PyC_FlagSet_ToBitfield(const PyC_FlagSet *items, PyObject *value, int *r_value, const char *error_prefix)
PyObject_VAR_HEAD struct GPUShaderCreateInfo * info
PyObject * fragment_source
PyObject_VAR_HEAD struct GPUStageInterfaceInfo * interface
Describe inputs & outputs, stage interfaces, resources and sources of a shader. If all data is correc...
Self & typedef_source(StringRefNull filename)
Self & uniform_buf(int slot, StringRefNull type_name, StringRefNull name, Frequency freq=Frequency::PASS)
Self & sampler(int slot, ImageType type, StringRefNull name, Frequency freq=Frequency::PASS, eGPUSamplerState sampler=(eGPUSamplerState) -1)
std::string fragment_source_generated
Self & fragment_source(StringRefNull filename)
std::string vertex_source_generated
Self & vertex_in(int slot, Type type, StringRefNull name)
std::string typedef_source_generated
Self & vertex_out(StageInterfaceInfo &interface)
Self & push_constant(Type type, StringRefNull name, int array_size=0)
Self & define(StringRefNull name, StringRefNull value="")
Self & vertex_source(StringRefNull filename)
Self & image(int slot, eGPUTextureFormat format, Qualifier qualifiers, ImageType type, StringRefNull name, Frequency freq=Frequency::PASS)
Vector< StringRefNull > typedef_sources_
Vector< PushConst > push_constants_
Self & fragment_out(int slot, Type type, StringRefNull name, DualBlend blend=DualBlend::NONE)
Self & no_perspective(Type type, StringRefNull _name)
Self & smooth(Type type, StringRefNull _name)
Self & flat(Type type, StringRefNull _name)