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 " :param shader: The shader that you want to dispatch.\n"
34 " :type shader: :class:`gpu.types.GPUShader`\n"
35 " :param groups_x_len: Int for group x length:\n"
36 " :type groups_x_len: int\n"
37 " :param groups_y_len: Int for group y length:\n"
38 " :type groups_y_len: int\n"
39 " :param groups_z_len: Int for group z length:\n"
40 " :type groups_z_len: int\n");
50 static const char *_keywords[] = {
51 "shader",
"groups_x_len",
"groups_y_len",
"groups_z_len",
nullptr};
52 static _PyArg_Parser _parser = {
61 if (_PyArg_ParseTupleAndKeywordsFast(
62 args, kwds, &_parser, &py_shader, &groups_x_len, &groups_y_len, &groups_z_len))
65 PyErr_Format(PyExc_TypeError,
"Expected a GPUShader, got %s", Py_TYPE(py_shader)->tp_name);
76 PyErr_Format(PyExc_ValueError,
77 "groups_x_len (%d) exceeds maximum supported value (max work group count: %d)",
79 max_work_group_count_x);
83 PyErr_Format(PyExc_ValueError,
84 "groups_y_len (%d) exceeds maximum supported value (max work group count: %d)",
86 max_work_group_count_y);
90 PyErr_Format(PyExc_ValueError,
91 "groups_z_len (%d) exceeds maximum supported value (max work group count: %d)",
93 max_work_group_count_z);
111# pragma clang diagnostic push
112# pragma clang diagnostic ignored "-Wcast-function-type"
114# pragma GCC diagnostic push
115# pragma GCC diagnostic ignored "-Wcast-function-type"
122 METH_VARARGS | METH_KEYWORDS,
123 pygpu_compute_dispatch_doc},
124 {
nullptr,
nullptr, 0,
nullptr},
129# pragma clang diagnostic pop
131# pragma GCC diagnostic pop
137 pygpu_compute__tp_doc,
138 "This module provides access to the global GPU compute functions.");
142 pygpu_compute__tp_doc,
#define BPYGPU_IS_INIT_OR_ERROR_OBJ
#define BPyGPUShader_Check(v)
PyDoc_STRVAR(bpy_bm_new_doc, ".. function:: new(*, use_operators=True)\n" "\n" " :param use_operators: Support calling operators in :mod:`bmesh.ops` (uses some " "extra memory per vert/edge/face).\n" " :type use_operators: bool\n" " :return: Return a new, empty BMesh.\n" " :rtype: :class:`bmesh.types.BMesh`\n")
void GPU_compute_dispatch(gpu::Shader *shader, uint groups_x_len, uint groups_y_len, uint groups_z_len, const gpu::shader::SpecializationConstants *constants_state=nullptr)
static PyMethodDef pygpu_compute__tp_methods[]
int GPU_max_work_group_count(int index)
void GPU_memory_barrier(GPUBarrier barrier)
static PyObject * pygpu_compute_dispatch(PyObject *, PyObject *args, PyObject *kwds)
@ GPU_BARRIER_TEXTURE_FETCH
@ GPU_BARRIER_SHADER_STORAGE
@ GPU_BARRIER_SHADER_IMAGE_ACCESS
static PyModuleDef pygpu_compute_module_def
PyObject * bpygpu_compute_init()
header-only compatibility defines.
PyObject_HEAD gpu::Shader * shader