26#define USE_PYGPU_SHADER_INFO_IMAGE_METHOD
35#ifdef USE_PYGPU_SHADER_INFO_IMAGE_METHOD
38# define PYDOC_QUALIFIERS \
39 " - ``NO_RESTRICT``\n" \
43 {
int(Qualifier::NO_RESTRICT),
"NO_RESTRICT"},
44 {
int(Qualifier::READ),
"READ"},
45 {
int(Qualifier::WRITE),
"WRITE"},
50#define PYDOC_TYPE_LIST \
67 {
int(Type::FLOAT),
"FLOAT"},
68 {
int(Type::VEC2),
"VEC2"},
69 {
int(Type::VEC3),
"VEC3"},
70 {
int(Type::VEC4),
"VEC4"},
71 {
int(Type::MAT3),
"MAT3"},
72 {
int(Type::MAT4),
"MAT4"},
73 {
int(Type::UINT),
"UINT"},
74 {
int(Type::UVEC2),
"UVEC2"},
75 {
int(Type::UVEC3),
"UVEC3"},
76 {
int(Type::UVEC4),
"UVEC4"},
77 {
int(Type::INT),
"INT"},
78 {
int(Type::IVEC2),
"IVEC2"},
79 {
int(Type::IVEC3),
"IVEC3"},
80 {
int(Type::IVEC4),
"IVEC4"},
81 {
int(Type::BOOL),
"BOOL"},
85#define PYDOC_IMAGE_TYPES \
86 " - ``FLOAT_BUFFER``\n" \
88 " - ``FLOAT_1D_ARRAY``\n" \
90 " - ``FLOAT_2D_ARRAY``\n" \
92 " - ``FLOAT_CUBE``\n" \
93 " - ``FLOAT_CUBE_ARRAY``\n" \
94 " - ``INT_BUFFER``\n" \
96 " - ``INT_1D_ARRAY``\n" \
98 " - ``INT_2D_ARRAY``\n" \
100 " - ``INT_CUBE``\n" \
101 " - ``INT_CUBE_ARRAY``\n" \
102 " - ``UINT_BUFFER``\n" \
104 " - ``UINT_1D_ARRAY``\n" \
106 " - ``UINT_2D_ARRAY``\n" \
108 " - ``UINT_CUBE``\n" \
109 " - ``UINT_CUBE_ARRAY``\n" \
110 " - ``SHADOW_2D``\n" \
111 " - ``SHADOW_2D_ARRAY``\n" \
112 " - ``SHADOW_CUBE``\n" \
113 " - ``SHADOW_CUBE_ARRAY``\n" \
114 " - ``DEPTH_2D``\n" \
115 " - ``DEPTH_2D_ARRAY``\n" \
116 " - ``DEPTH_CUBE``\n" \
117 " - ``DEPTH_CUBE_ARRAY``\n"
119 {
int(ImageType::FLOAT_BUFFER),
"FLOAT_BUFFER"},
120 {
int(ImageType::FLOAT_1D),
"FLOAT_1D"},
121 {
int(ImageType::FLOAT_1D_ARRAY),
"FLOAT_1D_ARRAY"},
122 {
int(ImageType::FLOAT_2D),
"FLOAT_2D"},
123 {
int(ImageType::FLOAT_2D_ARRAY),
"FLOAT_2D_ARRAY"},
124 {
int(ImageType::FLOAT_3D),
"FLOAT_3D"},
125 {
int(ImageType::FLOAT_CUBE),
"FLOAT_CUBE"},
126 {
int(ImageType::FLOAT_CUBE_ARRAY),
"FLOAT_CUBE_ARRAY"},
127 {
int(ImageType::INT_BUFFER),
"INT_BUFFER"},
128 {
int(ImageType::INT_1D),
"INT_1D"},
129 {
int(ImageType::INT_1D_ARRAY),
"INT_1D_ARRAY"},
130 {
int(ImageType::INT_2D),
"INT_2D"},
131 {
int(ImageType::INT_2D_ARRAY),
"INT_2D_ARRAY"},
132 {
int(ImageType::INT_3D),
"INT_3D"},
133 {
int(ImageType::INT_CUBE),
"INT_CUBE"},
134 {
int(ImageType::INT_CUBE_ARRAY),
"INT_CUBE_ARRAY"},
135 {
int(ImageType::INT_2D_ATOMIC),
"INT_2D_ATOMIC"},
136 {
int(ImageType::INT_2D_ARRAY_ATOMIC),
"INT_2D_ARRAY_ATOMIC"},
137 {
int(ImageType::INT_3D_ATOMIC),
"INT_3D_ATOMIC"},
138 {
int(ImageType::UINT_BUFFER),
"UINT_BUFFER"},
139 {
int(ImageType::UINT_1D),
"UINT_1D"},
140 {
int(ImageType::UINT_1D_ARRAY),
"UINT_1D_ARRAY"},
141 {
int(ImageType::UINT_2D),
"UINT_2D"},
142 {
int(ImageType::UINT_2D_ARRAY),
"UINT_2D_ARRAY"},
143 {
int(ImageType::UINT_3D),
"UINT_3D"},
144 {
int(ImageType::UINT_CUBE),
"UINT_CUBE"},
145 {
int(ImageType::UINT_CUBE_ARRAY),
"UINT_CUBE_ARRAY"},
146 {
int(ImageType::UINT_2D_ATOMIC),
"UINT_2D_ATOMIC"},
147 {
int(ImageType::UINT_2D_ARRAY_ATOMIC),
"UINT_2D_ARRAY_ATOMIC"},
148 {
int(ImageType::UINT_3D_ATOMIC),
"UINT_3D_ATOMIC"},
149 {
int(ImageType::SHADOW_2D),
"SHADOW_2D"},
150 {
int(ImageType::SHADOW_2D_ARRAY),
"SHADOW_2D_ARRAY"},
151 {
int(ImageType::SHADOW_CUBE),
"SHADOW_CUBE"},
152 {
int(ImageType::SHADOW_CUBE_ARRAY),
"SHADOW_CUBE_ARRAY"},
153 {
int(ImageType::DEPTH_2D),
"DEPTH_2D"},
154 {
int(ImageType::DEPTH_2D_ARRAY),
"DEPTH_2D_ARRAY"},
155 {
int(ImageType::DEPTH_CUBE),
"DEPTH_CUBE"},
156 {
int(ImageType::DEPTH_CUBE_ARRAY),
"DEPTH_CUBE_ARRAY"},
161 {
int(DualBlend::NONE),
"NONE"},
162 {
int(DualBlend::SRC_0),
"SRC_0"},
163 {
int(DualBlend::SRC_1),
"SRC_1"},
167#define PYDOC_TEX_FORMAT_ITEMS \
171 " - ``RGBA32UI``\n" \
174 " - ``RGBA16UI``\n" \
198 " - ``R11F_G11F_B10F``\n" \
199 " - ``DEPTH32F_STENCIL8``\n" \
200 " - ``DEPTH24_STENCIL8``\n" \
201 " - ``SRGB8_A8``\n" \
203 " - ``SRGB8_A8_DXT1``\n" \
204 " - ``SRGB8_A8_DXT3``\n" \
205 " - ``SRGB8_A8_DXT5``\n" \
206 " - ``RGBA8_DXT1``\n" \
207 " - ``RGBA8_DXT3``\n" \
208 " - ``RGBA8_DXT5``\n" \
209 " - ``DEPTH_COMPONENT32F``\n" \
210 " - ``DEPTH_COMPONENT24``\n" \
211 " - ``DEPTH_COMPONENT16``\n"
231 const char *name = PyUnicode_AsUTF8(py_name);
232 if (name ==
nullptr) {
236#ifdef USE_GPU_PY_REFERENCES
237 PyList_Append(
self->references, (PyObject *)py_name);
247 pygpu_interface_info_smooth_doc,
248 ".. method:: smooth(type, name)\n"
250 " Add an attribute with qualifier of type *smooth* to the interface block.\n"
252 " :arg type: One of these types:\n"
256 " :arg name: name of the attribute.\n"
257 " :type name: str\n");
267 interface->
smooth(type, name);
273 pygpu_interface_info_flat_doc,
274 ".. method:: flat(type, name)\n"
276 " Add an attribute with qualifier of type ``flat`` to the interface block.\n"
278 " :arg type: One of these types:\n"
282 " :arg name: name of the attribute.\n"
283 " :type name: str\n");
293 interface->
flat(type, name);
299 pygpu_interface_info_no_perspective_doc,
300 ".. method:: no_perspective(type, name)\n"
302 " Add an attribute with qualifier of type ``no_perspective`` to the interface block.\n"
304 " :arg type: One of these types:\n"
308 " :arg name: name of the attribute.\n"
309 " :type name: str\n");
328 pygpu_interface_info_smooth_doc},
333 pygpu_interface_info_no_perspective_doc},
334 {
nullptr,
nullptr, 0,
nullptr},
345 pygpu_interface_info_name_doc,
346 "Name of the interface block.\n"
352 return PyUnicode_FromString(interface->name.c_str());
359 pygpu_interface_info_name_doc,
361 {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr}
375 PyErr_SetString(PyExc_TypeError,
"no keywords are expected");
380 if (!PyArg_ParseTuple(args,
"s:GPUStageInterfaceInfo.__new__*", &name)) {
385 GPUStageInterfaceInfo *interface_info =
reinterpret_cast<GPUStageInterfaceInfo *
>(interface);
389#ifdef USE_GPU_PY_REFERENCES
390 PyObject *py_name = PyTuple_GET_ITEM(args, 0);
397#ifdef USE_GPU_PY_REFERENCES
399static int pygpu_interface_info__tp_traverse(PyObject *
self, visitproc visit,
void *arg)
406static int pygpu_interface_info__tp_clear(PyObject *
self)
421#ifdef USE_GPU_PY_REFERENCES
422 PyObject_GC_UnTrack(
self);
424 pygpu_interface_info__tp_clear(
self);
429 Py_TYPE(
self)->tp_free((PyObject *)
self);
434 pygpu_interface_info__tp_doc,
435 ".. class:: GPUStageInterfaceInfo(name)\n"
437 " List of varyings between shader stages.\n"
439 " :arg name: Name of the interface block.\n"
440 " :type value: str\n");
442 PyVarObject_HEAD_INIT(
nullptr, 0)
443 "GPUStageInterfaceInfo",
462 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
466 pygpu_interface_info__tp_doc,
468 pygpu_interface_info__tp_traverse,
473 pygpu_interface_info__tp_clear,
513 pygpu_shader_info_vertex_in_doc,
514 ".. method:: vertex_in(slot, type, name)\n"
516 " Add a vertex shader input attribute.\n"
518 " :arg slot: The attribute index.\n"
520 " :arg type: One of these types:\n"
524 " :arg name: name of the attribute.\n"
525 " :type name: str\n");
532 if (!PyArg_ParseTuple(args,
"iO&s:vertex_in", &slot,
PyC_ParseStringEnum, &pygpu_type, ¶m)) {
536#ifdef USE_GPU_PY_REFERENCES
537 PyObject *py_name = PyTuple_GET_ITEM(args, 2);
538 PyList_Append(
self->references, py_name);
548 pygpu_shader_info_vertex_out_doc,
549 ".. method:: vertex_out(interface)\n"
551 " Add a vertex shader output interface block.\n"
553 " :arg interface: Object describing the block.\n"
554 " :type interface: :class:`gpu.types.GPUStageInterfaceInfo`\n");
559 PyErr_Format(PyExc_TypeError,
"Expected a GPUStageInterfaceInfo, got %s", Py_TYPE(o)->tp_name);
563#ifdef USE_GPU_PY_REFERENCES
564 PyList_Append(
self->references, (PyObject *)o);
576 pygpu_shader_info_fragment_out_doc,
577 ".. method:: fragment_out(slot, type, name, blend='NONE')\n"
579 " Specify a fragment output corresponding to a framebuffer target slot.\n"
581 " :arg slot: The attribute index.\n"
583 " :arg type: One of these types:\n"
587 " :arg name: Name of the attribute.\n"
589 " :arg blend: Dual Source Blending Index. It can be 'NONE', 'SRC_0' or 'SRC_1'.\n"
590 " :type blend: str\n");
600 static const char *_keywords[] = {
"slot",
"type",
"name",
"blend",
nullptr};
601 static _PyArg_Parser _parser = {
612 if (!_PyArg_ParseTupleAndKeywordsFast(args,
625#ifdef USE_GPU_PY_REFERENCES
626 PyObject *py_name = PyTuple_GET_ITEM(args, 2);
627 PyList_Append(
self->references, py_name);
638 pygpu_shader_info_uniform_buf_doc,
639 ".. method:: uniform_buf(slot, type_name, name)\n"
641 " Specify a uniform variable whose type can be one of those declared in "
642 ":meth:`gpu.types.GPUShaderCreateInfo.typedef_source`.\n"
644 " :arg slot: The uniform variable index.\n"
646 " :arg type_name: Name of the data type. "
647 "It can be a struct type defined in the source passed through the "
648 ":meth:`gpu.types.GPUShaderCreateInfo.typedef_source`.\n"
649 " :type type_name: str\n"
650 " :arg name: The uniform variable name.\n"
651 " :type name: str\n");
655 const char *type_name;
658 if (!PyArg_ParseTuple(args,
"iss:uniform_buf", &slot, &type_name, &name)) {
662#ifdef USE_GPU_PY_REFERENCES
663 PyList_Append(
self->references, PyTuple_GET_ITEM(args, 1));
664 PyList_Append(
self->references, PyTuple_GET_ITEM(args, 2));
673#ifdef USE_PYGPU_SHADER_INFO_IMAGE_METHOD
676 pygpu_shader_info_image_doc,
677 ".. method:: image(slot, format, type, name, qualifiers={'NO_RESTRICT'})\n"
679 " Specify an image resource used for arbitrary load and store operations.\n"
681 " :arg slot: The image resource index.\n"
683 " :arg format: The GPUTexture format that is passed to the shader. Possible values are:\n"
685 " :type format: str\n"
686 " :arg type: The data type describing how the image is to be read in the shader. "
687 "Possible values are:\n"
691 " :arg name: The image resource name.\n"
693 " :arg qualifiers: Set containing values that describe how the image resource is to be "
694 "read or written. Possible values are:\n"
697 " :type qualifiers: set[str]\n");
706 PyObject *py_qualifiers =
nullptr;
707 Qualifier qualifier = Qualifier::NO_RESTRICT;
709 static const char *_keywords[] = {
"slot",
"format",
"type",
"name",
"qualifiers",
nullptr};
710 static _PyArg_Parser _parser = {
722 if (!_PyArg_ParseTupleAndKeywordsFast(args,
738 pygpu_qualifiers, py_qualifiers, (
int *)&qualifier,
"shader_info.image") == -1)
743# ifdef USE_GPU_PY_REFERENCES
744 PyList_Append(
self->references, PyTuple_GET_ITEM(args, 3));
760 pygpu_shader_info_sampler_doc,
761 ".. method:: sampler(slot, type, name)\n"
763 " Specify an image texture sampler.\n"
765 " :arg slot: The image texture sampler index.\n"
767 " :arg type: The data type describing the format of each sampler unit. Possible values "
772 " :arg name: The image texture sampler name.\n"
773 " :type name: str\n");
780 if (!PyArg_ParseTuple(
786#ifdef USE_GPU_PY_REFERENCES
787 PyList_Append(
self->references, PyTuple_GET_ITEM(args, 2));
805 case Type::VEC3_101010I2:
859 for (
const ShaderCreateInfo::PushConst &uniform : info->
push_constants_) {
862 if (size_last && size_last != size) {
864 int pack = (size == 8) ? 8 : 16;
865 if (size_last < size) {
866 pad = pack - (size_last % pack);
869 pad = size_prev % pack;
872 else if (size == 12) {
877 size_prev +=
pad + size * std::max(1, uniform.array_size);
880 return size_prev + (size_prev % 16);
885 pygpu_shader_info_push_constant_doc,
886 ".. method:: push_constant(type, name, size=0)\n"
888 " Specify a global access constant.\n"
890 " :arg type: One of these types:\n"
894 " :arg name: Name of the constant.\n"
896 " :arg size: If not zero, indicates that the constant is an array with the specified size.\n"
897 " :type size: int\n");
903 const char *name =
nullptr;
906 static const char *_keywords[] = {
"type",
"name",
"size",
nullptr};
907 static _PyArg_Parser _parser = {
917 if (!_PyArg_ParseTupleAndKeywordsFast(
923#ifdef USE_GPU_PY_REFERENCES
924 PyObject *py_name = PyTuple_GET_ITEM(args, 1);
925 PyList_Append(
self->references, py_name);
931#define VULKAN_LIMIT 128
934 printf(
"Push constants have a minimum supported size of " STRINGIFY(
VULKAN_LIMIT)
" bytes, however the constants added so far already reach %d bytes. Consider using UBO.\n", size);
943 pygpu_shader_info_vertex_source_doc,
944 ".. method:: vertex_source(source)\n"
946 " Vertex shader source code written in GLSL.\n"
950 " .. code-block:: python\n"
952 " \"void main {gl_Position = vec4(pos, 1.0);}\"\n"
954 " :arg source: The vertex shader source code.\n"
955 " :type source: str\n"
957 " .. seealso:: `GLSL Cross Compilation "
958 "<https://developer.blender.org/docs/features/gpu/glsl_cross_compilation/>`__\n");
963 PyErr_Format(PyExc_ValueError,
"expected a string, got %s", Py_TYPE(o)->tp_name);
967#ifdef USE_GPU_PY_REFERENCES
968 if (
self->vertex_source) {
969 Py_DECREF(
self->vertex_source);
972 self->vertex_source = o;
985 pygpu_shader_info_compute_source_doc,
986 ".. method:: compute_source(source)\n"
988 " compute shader source code written in GLSL.\n"
992 " .. code-block:: python\n"
994 " \"\"\"void main() {\n"
995 " int2 index = int2(gl_GlobalInvocationID.xy);\n"
996 " vec4 color = vec4(0.0, 0.0, 0.0, 1.0);\n"
997 " imageStore(img_output, index, color);\n"
1000 " :arg source: The compute shader source code.\n"
1001 " :type source: str\n"
1003 " .. seealso:: `GLSL Cross Compilation "
1004 "<https://developer.blender.org/docs/features/gpu/glsl_cross_compilation/>`__\n");
1009 PyErr_Format(PyExc_ValueError,
"expected a string, got %s", Py_TYPE(o)->tp_name);
1013#ifdef USE_GPU_PY_REFERENCES
1014 if (
self->compute_source) {
1015 Py_DECREF(
self->compute_source);
1018 self->compute_source = o;
1031 pygpu_shader_info_fragment_source_doc,
1032 ".. method:: fragment_source(source)\n"
1034 " Fragment shader source code written in GLSL.\n"
1038 " .. code-block:: python\n"
1040 " \"void main {fragColor = vec4(0.0, 0.0, 0.0, 1.0);}\"\n"
1042 " :arg source: The fragment shader source code.\n"
1043 " :type source: str\n"
1045 " .. seealso:: `GLSL Cross Compilation "
1046 "<https://developer.blender.org/docs/features/gpu/glsl_cross_compilation/>`__\n");
1051 PyErr_Format(PyExc_ValueError,
"expected a string, got %s", Py_TYPE(o)->tp_name);
1055#ifdef USE_GPU_PY_REFERENCES
1056 if (
self->fragment_source) {
1057 Py_DECREF(
self->fragment_source);
1060 self->fragment_source = o;
1073 pygpu_shader_info_typedef_source_doc,
1074 ".. method:: typedef_source(source)\n"
1076 " Source code included before resource declaration. "
1077 "Useful for defining structs used by Uniform Buffers.\n"
1081 ".. code-block:: python\n"
1083 " \"struct MyType {int foo; float bar;};\"\n"
1085 " :arg source: The source code defining types.\n"
1086 " :type source: str\n");
1091 PyErr_Format(PyExc_ValueError,
"expected a string, got %s", Py_TYPE(o)->tp_name);
1095#ifdef USE_GPU_PY_REFERENCES
1096 if (
self->typedef_source) {
1097 Py_DECREF(
self->typedef_source);
1100 self->typedef_source = o;
1117 pygpu_shader_info_define_doc,
1118 ".. method:: define(name, value)\n"
1120 " Add a preprocessing define directive. In GLSL it would be something like:\n"
1122 ".. code-block:: glsl\n"
1124 " #define name value\n"
1126 " :arg name: Token name.\n"
1127 " :type name: str\n"
1128 " :arg value: Text that replaces token occurrences.\n"
1129 " :type value: str\n");
1133 const char *value =
nullptr;
1135 if (!PyArg_ParseTuple(args,
"s|s:define", &name, &value)) {
1139#ifdef USE_GPU_PY_REFERENCES
1140 PyList_Append(
self->references, PyTuple_GET_ITEM(args, 0));
1142 PyList_Append(
self->references, PyTuple_GET_ITEM(args, 1));
1148 info->
define(name, value);
1159 pygpu_shader_info_local_group_size_doc,
1160 ".. method:: local_group_size(x, y=-1, z=-1)\n"
1162 " Specify the local group size for compute shaders.\n"
1164 " :arg x: The local group size in the x dimension.\n"
1166 " :arg y: The local group size in the y dimension. Optional. Defaults to -1.\n"
1168 " :arg z: The local group size in the z dimension. Optional. Defaults to -1.\n"
1172 int x = -1, y = -1,
z = -1;
1174 if (!PyArg_ParseTuple(args,
"i|ii:local_group_size", &x, &y, &
z)) {
1188 pygpu_shader_info_vertex_in_doc},
1192 pygpu_shader_info_vertex_out_doc},
1195 METH_VARARGS | METH_KEYWORDS,
1196 pygpu_shader_info_fragment_out_doc},
1200 pygpu_shader_info_uniform_buf_doc},
1201#ifdef USE_PYGPU_SHADER_INFO_IMAGE_METHOD
1204 METH_VARARGS | METH_KEYWORDS,
1205 pygpu_shader_info_image_doc},
1210 pygpu_shader_info_sampler_doc},
1213 METH_VARARGS | METH_KEYWORDS,
1214 pygpu_shader_info_push_constant_doc},
1218 pygpu_shader_info_vertex_source_doc},
1222 pygpu_shader_info_fragment_source_doc},
1226 pygpu_shader_info_compute_source_doc},
1230 pygpu_shader_info_typedef_source_doc},
1232 {
"local_group_size",
1235 pygpu_shader_info_local_group_size_doc},
1236 {
nullptr,
nullptr, 0,
nullptr},
1247 if (PyTuple_Size(args) || kwds) {
1248 PyErr_SetString(PyExc_TypeError,
"no args or keywords are expected");
1253 GPUShaderCreateInfo *shader_info =
reinterpret_cast<GPUShaderCreateInfo *
>(info);
1258#ifdef USE_GPU_PY_REFERENCES
1260static int pygpu_shader_info__tp_traverse(PyObject *
self, visitproc visit,
void *arg)
1270static int pygpu_shader_info__tp_clear(PyObject *
self)
1288#ifdef USE_GPU_PY_REFERENCES
1289 PyObject_GC_UnTrack(
self);
1291 pygpu_shader_info__tp_clear(
self);
1300 Py_TYPE(
self)->tp_free((PyObject *)
self);
1305 pygpu_shader_info__tp_doc,
1306 ".. class:: GPUShaderCreateInfo()\n"
1308 " Stores and describes types and variables that are used in shader sources.\n");
1311 PyVarObject_HEAD_INIT(
nullptr, 0)
1312 "GPUShaderCreateInfo",
1331 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
1335 pygpu_shader_info__tp_doc,
1337 pygpu_shader_info__tp_traverse,
1342 pygpu_shader_info__tp_clear,
1384#ifdef USE_GPU_PY_REFERENCES
1391 self->interface = interface;
1393 return (PyObject *)
self;
1400#ifdef USE_GPU_PY_REFERENCES
1403 self->fragment_source =
nullptr;
1404 self->compute_source =
nullptr;
1405 self->typedef_source =
nullptr;
1406 self->references = PyList_New(0);
1412 self->constants_total_size = 0;
1414 return (PyObject *)
self;
int pad[32 - sizeof(int)]
vertex_source("basic_depth_pointcloud_vert.glsl") .additional_info("draw_pointcloud")
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
SIMD_FORCE_INLINE const btScalar & z() const
Return the z value.
input_tx typedef_source("gpu_shader_compositor_type_conversion.glsl") .compute_source("compositor_convert.glsl")
local_group_size(16, 16) .push_constant(Type local_group_size(16, 16) .push_constant(Type input_tx output_img compute_source("compositor_cryptomatte_image.glsl") .do_static_compilation(true)
fragment_source("eevee_deferred_tile_classify_frag.glsl") .additional_info("eevee_shared"
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
#define USE_GPU_PY_REFERENCES
#define BPyGPUStageInterfaceInfo_Check(v)
PyObject * BPyGPUShaderCreateInfo_CreatePyObject(GPUShaderCreateInfo *info)
static PyObject * pygpu_shader_info__tp_new(PyTypeObject *, PyObject *args, PyObject *kwds)
static PyObject * pygpu_shader_info_vertex_out(BPyGPUShaderCreateInfo *self, BPyGPUStageInterfaceInfo *o)
static PyObject * pygpu_shader_info_uniform_buf(BPyGPUShaderCreateInfo *self, PyObject *args)
static PyObject * pygpu_interface_info__tp_new(PyTypeObject *, PyObject *args, PyObject *kwds)
static PyObject * pygpu_shader_info_compute_source(BPyGPUShaderCreateInfo *self, PyObject *o)
static int constant_type_size(Type type)
static PyObject * pygpu_interface_info_smooth(BPyGPUStageInterfaceInfo *self, PyObject *args)
static PyObject * pygpu_shader_info_local_group_size(BPyGPUShaderCreateInfo *self, PyObject *args)
static PyObject * pygpu_interface_info_no_perspective(BPyGPUStageInterfaceInfo *self, PyObject *args)
static PyObject * pygpu_shader_info_vertex_source(BPyGPUShaderCreateInfo *self, PyObject *o)
static PyObject * pygpu_shader_info_fragment_source(BPyGPUShaderCreateInfo *self, PyObject *o)
PyTypeObject BPyGPUStageInterfaceInfo_Type
static PyObject * pygpu_shader_info_push_constant(BPyGPUShaderCreateInfo *self, PyObject *args, PyObject *kwds)
static PyObject * pygpu_interface_info_flat(BPyGPUStageInterfaceInfo *self, PyObject *args)
static const PyC_StringEnumItems pygpu_imagetype_items[]
static PyObject * pygpu_shader_info_sampler(BPyGPUShaderCreateInfo *self, PyObject *args)
static int constants_calc_size(ShaderCreateInfo *info)
PyObject * BPyGPUStageInterfaceInfo_CreatePyObject(GPUStageInterfaceInfo *interface)
static void pygpu_shader_info__tp_dealloc(PyObject *self)
static PyGetSetDef pygpu_interface_info__tp_getseters[]
static PyObject * pygpu_shader_info_define(BPyGPUShaderCreateInfo *self, PyObject *args)
static PyObject * pygpu_shader_info_fragment_out(BPyGPUShaderCreateInfo *self, PyObject *args, PyObject *kwds)
static PyObject * pygpu_shader_info_image(BPyGPUShaderCreateInfo *self, PyObject *args, PyObject *kwds)
static const PyC_StringEnumItems pygpu_dualblend_items[]
const PyC_StringEnumItems pygpu_tex_format_items[]
static PyObject * pygpu_interface_info_name_get(BPyGPUStageInterfaceInfo *self, void *)
#define PYDOC_IMAGE_TYPES
PyTypeObject BPyGPUShaderCreateInfo_Type
static void pygpu_interface_info__tp_dealloc(PyObject *self)
static PyObject * pygpu_shader_info_typedef_source(BPyGPUShaderCreateInfo *self, PyObject *o)
static PyObject * pygpu_shader_info_vertex_in(BPyGPUShaderCreateInfo *self, PyObject *args)
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" " :arg type: One of these types:\n" "\n" PYDOC_TYPE_LIST "\n" " :type type: str\n" " :arg name: name of the attribute.\n" " :type name: str\n")
#define PYDOC_TEX_FORMAT_ITEMS
static PyMethodDef pygpu_shader_info__tp_methods[]
static const PyC_FlagSet pygpu_qualifiers[]
static PyMethodDef pygpu_interface_info__tp_methods[]
const PyC_StringEnumItems pygpu_attrtype_items[]
static bool pygpu_interface_info_get_args(BPyGPUStageInterfaceInfo *self, PyObject *args, const char *format, Type *r_type, const char **r_name)
const 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)
header-only compatibility defines.
#define PY_ARG_PARSER_HEAD_COMPAT()
PyObject * compute_source
PyObject_VAR_HEAD GPUShaderCreateInfo * info
PyObject * fragment_source
PyObject_VAR_HEAD GPUStageInterfaceInfo * interface
Describe inputs & outputs, stage interfaces, resources and sources of a shader. If all data is correc...
Self & image(int slot, eGPUTextureFormat format, Qualifier qualifiers, ImageType type, StringRefNull name, Frequency freq=Frequency::PASS)
Self & compute_source(StringRefNull filename)
Self & fragment_source(StringRefNull filename)
std::string fragment_source_generated
Self & vertex_in(int slot, Type type, StringRefNull name)
Self & push_constant(Type type, StringRefNull name, int array_size=0)
Self & typedef_source(StringRefNull filename)
Self & fragment_out(int slot, Type type, StringRefNull name, DualBlend blend=DualBlend::NONE, int raster_order_group=-1)
Self & local_group_size(int local_size_x=-1, int local_size_y=-1, int local_size_z=-1)
std::string vertex_source_generated
Self & vertex_out(StageInterfaceInfo &interface)
std::string typedef_source_generated
Self & vertex_source(StringRefNull filename)
Self & sampler(int slot, ImageType type, StringRefNull name, Frequency freq=Frequency::PASS, GPUSamplerState sampler=GPUSamplerState::internal_sampler())
Self & uniform_buf(int slot, StringRefNull type_name, StringRefNull name, Frequency freq=Frequency::PASS)
std::string compute_source_generated
Self & define(StringRefNull name, StringRefNull value="")
Vector< StringRefNull > typedef_sources_
Vector< PushConst > push_constants_
Self & smooth(Type type, StringRefNull _name)
Self & no_perspective(Type type, StringRefNull _name)
Self & flat(Type type, StringRefNull _name)