28 pygpu_compute_dispatch_doc,
29 ".. function:: dispatch(shader, groups_x_len, groups_y_len, groups_z_len)\n"
31 " Dispatches GPU compute.\n"
33 " :arg shader: The shader that you want to dispatch.\n"
34 " :type shader: :class:`gpu.types.GPUShader`\n"
35 " :arg groups_x_len: Int for group x length:\n"
36 " :type groups_x_len: int\n"
37 " :arg groups_y_len: Int for group y length:\n"
38 " :type groups_y_len: int\n"
39 " :arg groups_z_len: Int for group z length:\n"
40 " :type groups_z_len: int\n"
41 " :return: Shader object.\n"
42 " :rtype: :class:`gpu.types.GPUShader`\n");
52 static const char *_keywords[] = {
53 "shader",
"groups_x_len",
"groups_y_len",
"groups_z_len",
nullptr};
54 static _PyArg_Parser _parser = {
64 if (_PyArg_ParseTupleAndKeywordsFast(
65 args, kwds, &_parser, &py_shader, &groups_x_len, &groups_y_len, &groups_z_len))
68 PyErr_Format(PyExc_TypeError,
"Expected a GPUShader, got %s", Py_TYPE(py_shader)->tp_name);
79 PyErr_Format(PyExc_ValueError,
80 "groups_x_len (%d) exceeds maximum supported value (max work group count: %d)",
82 max_work_group_count_x);
86 PyErr_Format(PyExc_ValueError,
87 "groups_y_len (%d) exceeds maximum supported value (max work group count: %d)",
89 max_work_group_count_y);
93 PyErr_Format(PyExc_ValueError,
94 "groups_z_len (%d) exceeds maximum supported value (max work group count: %d)",
96 max_work_group_count_z);
114 METH_VARARGS | METH_KEYWORDS,
115 pygpu_compute_dispatch_doc},
116 {
nullptr,
nullptr, 0,
nullptr},
119#if (defined(__GNUC__) && !defined(__clang__))
120# pragma GCC diagnostic pop
125 pygpu_compute__tp_doc,
126 "This module provides access to the global GPU compute functions");
128 PyModuleDef_HEAD_INIT,
130 pygpu_compute__tp_doc,
int GPU_max_work_group_count(int index)
void GPU_compute_dispatch(GPUShader *shader, uint groups_x_len, uint groups_y_len, uint groups_z_len)
void GPU_memory_barrier(eGPUBarrier barrier)
@ GPU_BARRIER_TEXTURE_FETCH
@ GPU_BARRIER_SHADER_IMAGE_ACCESS
struct GPUShader GPUShader
#define BPYGPU_IS_INIT_OR_ERROR_OBJ
PyDoc_STRVAR(pygpu_compute_dispatch_doc, ".. function:: dispatch(shader, groups_x_len, groups_y_len, groups_z_len)\n" "\n" " Dispatches GPU compute.\n" "\n" " :arg shader: The shader that you want to dispatch.\n" " :type shader: :class:`gpu.types.GPUShader`\n" " :arg groups_x_len: Int for group x length:\n" " :type groups_x_len: int\n" " :arg groups_y_len: Int for group y length:\n" " :type groups_y_len: int\n" " :arg groups_z_len: Int for group z length:\n" " :type groups_z_len: int\n" " :return: Shader object.\n" " :rtype: :class:`gpu.types.GPUShader`\n")
static PyMethodDef pygpu_compute__tp_methods[]
PyObject * bpygpu_compute_init()
static PyObject * pygpu_compute_dispatch(PyObject *, PyObject *args, PyObject *kwds)
static PyModuleDef pygpu_compute_module_def
#define BPyGPUShader_Check(v)
header-only compatibility defines.
#define PY_ARG_PARSER_HEAD_COMPAT()
PyObject_VAR_HEAD struct GPUShader * shader