27 pygpu_max_texture_size_get_doc,
28 ".. function:: max_texture_size_get()\n"
30 " Get estimated maximum texture size to be able to handle.\n"
32 " :return: Texture size.\n"
43 pygpu_max_texture_layers_get_doc,
44 ".. function:: max_texture_layers_get()\n"
46 " Get maximum number of layers in texture.\n"
48 " :return: Number of layers.\n"
59 pygpu_max_textures_get_doc,
60 ".. function:: max_textures_get()\n"
62 " Get maximum supported texture image units used for\n"
63 " accessing texture maps from the vertex shader and the\n"
64 " fragment processor.\n"
66 " :return: Texture image units.\n"
77 pygpu_max_textures_vert_get_doc,
78 ".. function:: max_textures_vert_get()\n"
80 " Get maximum supported texture image units used for\n"
81 " accessing texture maps from the vertex shader.\n"
83 " :return: Texture image units.\n"
94 pygpu_max_textures_geom_get_doc,
95 ".. function:: max_textures_geom_get()\n"
97 " Get maximum supported texture image units used for\n"
98 " accessing texture maps from the geometry shader.\n"
100 " :return: Texture image units.\n"
111 pygpu_max_textures_frag_get_doc,
112 ".. function:: max_textures_frag_get()\n"
114 " Get maximum supported texture image units used for\n"
115 " accessing texture maps from the fragment shader.\n"
117 " :return: Texture image units.\n"
128 pygpu_max_images_get_doc,
129 ".. function:: max_images_get()\n"
131 " Get maximum supported number of image units.\n"
133 " :return: Number of image units.\n"
144 pygpu_max_uniforms_vert_get_doc,
145 ".. function:: max_uniforms_vert_get()\n"
147 " Get maximum number of values held in uniform variable\n"
148 " storage for a vertex shader.\n"
150 " :return: Number of values.\n"
161 pygpu_max_uniforms_frag_get_doc,
162 ".. function:: max_uniforms_frag_get()\n"
164 " Get maximum number of values held in uniform variable\n"
165 " storage for a fragment shader.\n"
167 " :return: Number of values.\n"
178 pygpu_max_batch_indices_get_doc,
179 ".. function:: max_batch_indices_get()\n"
181 " Get maximum number of vertex array indices.\n"
183 " :return: Number of indices.\n"
194 pygpu_max_batch_vertices_get_doc,
195 ".. function:: max_batch_vertices_get()\n"
197 " Get maximum number of vertex array vertices.\n"
199 " :return: Number of vertices.\n"
210 pygpu_max_vertex_attribs_get_doc,
211 ".. function:: max_vertex_attribs_get()\n"
213 " Get maximum number of vertex attributes accessible to\n"
214 " a vertex shader.\n"
216 " :return: Number of attributes.\n"
227 pygpu_max_varying_floats_get_doc,
228 ".. function:: max_varying_floats_get()\n"
230 " Get maximum number of varying variables used by\n"
231 " vertex and fragment shaders.\n"
233 " :return: Number of variables.\n"
244 pygpu_extensions_get_doc,
245 ".. function:: extensions_get()\n"
247 " Get supported extensions in the current context.\n"
249 " :return: Extensions.\n"
250 " :rtype: tuple[str]\n");
256 PyObject *
ret = PyTuple_New(extensions_len);
257 PyObject **ob_items = ((PyTupleObject *)
ret)->ob_item;
258 for (
int i = 0; i < extensions_len; i++) {
267 pygpu_compute_shader_support_get_doc,
268 ".. function:: compute_shader_support_get()\n"
270 " Are compute shaders supported.\n"
272 " :return: True when supported, False when not supported.\n"
278 static bool deprecation_warning_issued =
false;
279 if (!deprecation_warning_issued) {
280 PyErr_WarnEx(PyExc_DeprecationWarning,
281 "compute_shader_support_get is deprecated. All platforms have support for "
284 deprecation_warning_issued =
true;
287 return PyBool_FromLong(
true);
292 pygpu_shader_image_load_store_support_get_doc,
293 ".. function:: shader_image_load_store_support_get()\n"
295 " Is image load/store supported.\n"
297 " :return: True when supported, False when not supported.\n"
303 static bool deprecation_warning_issued =
false;
304 if (!deprecation_warning_issued) {
306 PyExc_DeprecationWarning,
307 "shader_image_load_store_support_get is deprecated. All platforms have support for "
310 deprecation_warning_issued =
true;
313 return PyBool_FromLong(
true);
318 pygpu_hdr_support_get_doc,
319 ".. function:: hdr_support_get()\n"
321 " Return whether GPU backend supports High Dynamic range for viewport.\n"
323 " :return: HDR support available.\n"
334 pygpu_max_work_group_count_get_doc,
335 ".. function:: max_work_group_count_get(index)\n"
337 " Get maximum number of work groups that may be dispatched to a compute shader.\n"
339 " :arg index: Index of the dimension.\n"
340 " :type index: int\n"
341 " :return: Maximum number of work groups for the queried dimension.\n"
348 if (!PyArg_ParseTuple(args,
"i", &index)) {
354 return PyLong_FromLong(max_work_group_count);
359 pygpu_max_work_group_size_get_doc,
360 ".. function:: max_work_group_size_get(index)\n"
362 " Get maximum size of a work group that may be dispatched to a compute shader.\n"
364 " :arg index: Index of the dimension.\n"
365 " :type index: int\n"
366 " :return: Maximum size of a work group for the queried dimension.\n"
373 if (!PyArg_ParseTuple(args,
"i", &index)) {
379 return PyLong_FromLong(max_work_group_size);
388#if (defined(__GNUC__) && !defined(__clang__))
389# pragma GCC diagnostic push
390# pragma GCC diagnostic ignored "-Wcast-function-type"
394 {
"max_texture_size_get",
397 pygpu_max_texture_size_get_doc},
398 {
"max_texture_layers_get",
401 pygpu_max_texture_layers_get_doc},
405 pygpu_max_textures_get_doc},
406 {
"max_textures_vert_get",
409 pygpu_max_textures_vert_get_doc},
410 {
"max_textures_geom_get",
413 pygpu_max_textures_geom_get_doc},
414 {
"max_textures_frag_get",
417 pygpu_max_textures_frag_get_doc},
419 {
"max_uniforms_vert_get",
422 pygpu_max_uniforms_vert_get_doc},
423 {
"max_uniforms_frag_get",
426 pygpu_max_uniforms_frag_get_doc},
427 {
"max_batch_indices_get",
430 pygpu_max_batch_indices_get_doc},
431 {
"max_batch_vertices_get",
434 pygpu_max_batch_vertices_get_doc},
435 {
"max_vertex_attribs_get",
438 pygpu_max_vertex_attribs_get_doc},
439 {
"max_varying_floats_get",
442 pygpu_max_varying_floats_get_doc},
445 {
"compute_shader_support_get",
448 pygpu_compute_shader_support_get_doc},
449 {
"shader_image_load_store_support_get",
452 pygpu_shader_image_load_store_support_get_doc},
456 pygpu_hdr_support_get_doc},
458 "max_work_group_count_get",
461 pygpu_max_work_group_count_get_doc,
464 "max_work_group_size_get",
467 pygpu_max_work_group_size_get_doc,
469 {
nullptr,
nullptr, 0,
nullptr},
472#if (defined(__GNUC__) && !defined(__clang__))
473# pragma GCC diagnostic pop
478 pygpu_capabilities__tp_doc,
479 "This module provides access to the GPU capabilities.");
481 PyModuleDef_HEAD_INIT,
483 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 *)