25 pygpu_max_texture_size_get_doc,
26 ".. function:: max_texture_size_get()\n"
28 " Get estimated maximum texture size to be able to handle.\n"
30 " :return: Texture size.\n"
41 pygpu_max_texture_layers_get_doc,
42 ".. function:: max_texture_layers_get()\n"
44 " Get maximum number of layers in texture.\n"
46 " :return: Number of layers.\n"
57 pygpu_max_textures_get_doc,
58 ".. function:: max_textures_get()\n"
60 " Get maximum supported texture image units used for\n"
61 " accessing texture maps from the vertex shader and the\n"
62 " fragment processor.\n"
64 " :return: Texture image units.\n"
75 pygpu_max_textures_vert_get_doc,
76 ".. function:: max_textures_vert_get()\n"
78 " Get maximum supported texture image units used for\n"
79 " accessing texture maps from the vertex shader.\n"
81 " :return: Texture image units.\n"
92 pygpu_max_textures_geom_get_doc,
93 ".. function:: max_textures_geom_get()\n"
95 " Get maximum supported texture image units used for\n"
96 " accessing texture maps from the geometry shader.\n"
98 " :return: Texture image units.\n"
109 pygpu_max_textures_frag_get_doc,
110 ".. function:: max_textures_frag_get()\n"
112 " Get maximum supported texture image units used for\n"
113 " accessing texture maps from the fragment shader.\n"
115 " :return: Texture image units.\n"
126 pygpu_max_images_get_doc,
127 ".. function:: max_images_get()\n"
129 " Get maximum supported number of image units.\n"
131 " :return: Number of image units.\n"
142 pygpu_max_uniforms_vert_get_doc,
143 ".. function:: max_uniforms_vert_get()\n"
145 " Get maximum number of values held in uniform variable\n"
146 " storage for a vertex shader.\n"
148 " :return: Number of values.\n"
159 pygpu_max_uniforms_frag_get_doc,
160 ".. function:: max_uniforms_frag_get()\n"
162 " Get maximum number of values held in uniform variable\n"
163 " storage for a fragment shader.\n"
165 " :return: Number of values.\n"
176 pygpu_max_batch_indices_get_doc,
177 ".. function:: max_batch_indices_get()\n"
179 " Get maximum number of vertex array indices.\n"
181 " :return: Number of indices.\n"
192 pygpu_max_batch_vertices_get_doc,
193 ".. function:: max_batch_vertices_get()\n"
195 " Get maximum number of vertex array vertices.\n"
197 " :return: Number of vertices.\n"
208 pygpu_max_vertex_attribs_get_doc,
209 ".. function:: max_vertex_attribs_get()\n"
211 " Get maximum number of vertex attributes accessible to\n"
212 " a vertex shader.\n"
214 " :return: Number of attributes.\n"
225 pygpu_max_varying_floats_get_doc,
226 ".. function:: max_varying_floats_get()\n"
228 " Get maximum number of varying variables used by\n"
229 " vertex and fragment shaders.\n"
231 " :return: Number of variables.\n"
242 pygpu_extensions_get_doc,
243 ".. function:: extensions_get()\n"
245 " Get supported extensions in the current context.\n"
247 " :return: Extensions.\n"
248 " :rtype: tuple[str]\n");
254 PyObject *
ret = PyTuple_New(extensions_len);
255 PyObject **ob_items = ((PyTupleObject *)
ret)->ob_item;
256 for (
int i = 0;
i < extensions_len;
i++) {
265 pygpu_compute_shader_support_get_doc,
266 ".. function:: compute_shader_support_get()\n"
268 " Are compute shaders supported.\n"
270 " :return: True when supported, False when not supported.\n"
276 static bool deprecation_warning_issued =
false;
277 if (!deprecation_warning_issued) {
278 PyErr_WarnEx(PyExc_DeprecationWarning,
279 "compute_shader_support_get is deprecated. All platforms have support for "
282 deprecation_warning_issued =
true;
285 return PyBool_FromLong(
true);
290 pygpu_shader_image_load_store_support_get_doc,
291 ".. function:: shader_image_load_store_support_get()\n"
293 " Is image load/store supported.\n"
295 " :return: True when supported, False when not supported.\n"
301 static bool deprecation_warning_issued =
false;
302 if (!deprecation_warning_issued) {
304 PyExc_DeprecationWarning,
305 "shader_image_load_store_support_get is deprecated. All platforms have support for "
308 deprecation_warning_issued =
true;
311 return PyBool_FromLong(
true);
316 pygpu_hdr_support_get_doc,
317 ".. function:: hdr_support_get()\n"
319 " Return whether GPU backend supports High Dynamic range for viewport.\n"
321 " :return: HDR support available.\n"
332 pygpu_max_work_group_count_get_doc,
333 ".. function:: max_work_group_count_get(index)\n"
335 " Get maximum number of work groups that may be dispatched to a compute shader.\n"
337 " :arg index: Index of the dimension.\n"
338 " :type index: int\n"
339 " :return: Maximum number of work groups for the queried dimension.\n"
346 if (!PyArg_ParseTuple(args,
"i", &index)) {
352 return PyLong_FromLong(max_work_group_count);
357 pygpu_max_work_group_size_get_doc,
358 ".. function:: max_work_group_size_get(index)\n"
360 " Get maximum size of a work group that may be dispatched to a compute shader.\n"
362 " :arg index: Index of the dimension.\n"
363 " :type index: int\n"
364 " :return: Maximum size of a work group for the queried dimension.\n"
371 if (!PyArg_ParseTuple(args,
"i", &index)) {
377 return PyLong_FromLong(max_work_group_size);
388# pragma clang diagnostic push
389# pragma clang diagnostic ignored "-Wcast-function-type"
391# pragma GCC diagnostic push
392# pragma GCC diagnostic ignored "-Wcast-function-type"
397 {
"max_texture_size_get",
400 pygpu_max_texture_size_get_doc},
401 {
"max_texture_layers_get",
404 pygpu_max_texture_layers_get_doc},
408 pygpu_max_textures_get_doc},
409 {
"max_textures_vert_get",
412 pygpu_max_textures_vert_get_doc},
413 {
"max_textures_geom_get",
416 pygpu_max_textures_geom_get_doc},
417 {
"max_textures_frag_get",
420 pygpu_max_textures_frag_get_doc},
422 {
"max_uniforms_vert_get",
425 pygpu_max_uniforms_vert_get_doc},
426 {
"max_uniforms_frag_get",
429 pygpu_max_uniforms_frag_get_doc},
430 {
"max_batch_indices_get",
433 pygpu_max_batch_indices_get_doc},
434 {
"max_batch_vertices_get",
437 pygpu_max_batch_vertices_get_doc},
438 {
"max_vertex_attribs_get",
441 pygpu_max_vertex_attribs_get_doc},
442 {
"max_varying_floats_get",
445 pygpu_max_varying_floats_get_doc},
448 {
"compute_shader_support_get",
451 pygpu_compute_shader_support_get_doc},
452 {
"shader_image_load_store_support_get",
455 pygpu_shader_image_load_store_support_get_doc},
459 pygpu_hdr_support_get_doc},
461 "max_work_group_count_get",
464 pygpu_max_work_group_count_get_doc,
467 "max_work_group_size_get",
470 pygpu_max_work_group_size_get_doc,
472 {
nullptr,
nullptr, 0,
nullptr},
477# pragma clang diagnostic pop
479# pragma GCC diagnostic pop
485 pygpu_capabilities__tp_doc,
486 "This module provides access to the GPU capabilities.");
490 pygpu_capabilities__tp_doc,
int GPU_max_batch_indices()
int GPU_max_work_group_size(int index)
int GPU_max_texture_layers()
int GPU_max_uniforms_vert()
int GPU_max_work_group_count(int index)
int GPU_max_textures_geom()
int GPU_max_textures_frag()
int GPU_max_vertex_attribs()
const char * GPU_extension_get(int i)
int GPU_max_varying_floats()
int GPU_max_batch_vertices()
int GPU_max_uniforms_frag()
int GPU_max_texture_size()
int GPU_max_textures_vert()
#define BPYGPU_IS_INIT_OR_ERROR_OBJ
static PyObject * pygpu_max_batch_indices_get(PyObject *)
static PyObject * pygpu_max_batch_vertices_get(PyObject *)
static PyObject * pygpu_max_texture_size_get(PyObject *)
static PyObject * pygpu_max_varying_floats_get(PyObject *)
static PyObject * pygpu_max_textures_get(PyObject *)
PyObject * bpygpu_capabilities_init()
static PyObject * pygpu_max_uniforms_vert_get(PyObject *)
static PyObject * pygpu_max_textures_frag_get(PyObject *)
static PyObject * pygpu_shader_image_load_store_support_get(PyObject *)
static PyObject * pygpu_max_work_group_size_get(PyObject *, PyObject *args)
static PyObject * pygpu_max_images_get(PyObject *)
static PyObject * pygpu_max_vertex_attribs_get(PyObject *)
static PyObject * pygpu_extensions_get(PyObject *)
static PyObject * pygpu_max_work_group_count_get(PyObject *, PyObject *args)
static PyObject * pygpu_max_textures_geom_get(PyObject *)
static PyObject * pygpu_compute_shader_support_get(PyObject *)
static PyObject * pygpu_max_textures_vert_get(PyObject *)
static PyModuleDef pygpu_capabilities_module_def
static PyObject * pygpu_hdr_support_get(PyObject *)
static PyObject * pygpu_max_texture_layers_get(PyObject *)
static PyMethodDef pygpu_capabilities__tp_methods[]
PyDoc_STRVAR(pygpu_max_texture_size_get_doc, ".. function:: max_texture_size_get()\n" "\n" " Get estimated maximum texture size to be able to handle.\n" "\n" " :return: Texture size.\n" " :rtype: int\n")
static PyObject * pygpu_max_uniforms_frag_get(PyObject *)