mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-25 01:38:02 +02:00
Release GIL during OpenGL draw calls
This commit is contained in:
@@ -158,7 +158,9 @@ DrawArrays(PyObject UNUSED *self, PyObject *args) {
|
|||||||
int mode, first;
|
int mode, first;
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
if (!PyArg_ParseTuple(args, "iiI", &mode, &first, &count)) return NULL;
|
if (!PyArg_ParseTuple(args, "iiI", &mode, &first, &count)) return NULL;
|
||||||
|
Py_BEGIN_ALLOW_THREADS;
|
||||||
glDrawArrays(mode, first, count);
|
glDrawArrays(mode, first, count);
|
||||||
|
Py_END_ALLOW_THREADS;
|
||||||
CHECK_ERROR;
|
CHECK_ERROR;
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
@@ -169,7 +171,9 @@ MultiDrawArrays(PyObject UNUSED *self, PyObject *args) {
|
|||||||
unsigned int draw_count;
|
unsigned int draw_count;
|
||||||
PyObject *a, *b;
|
PyObject *a, *b;
|
||||||
if (!PyArg_ParseTuple(args, "iO!O!I", &mode, &PyLong_Type, &a, &PyLong_Type, &b, &draw_count)) return NULL;
|
if (!PyArg_ParseTuple(args, "iO!O!I", &mode, &PyLong_Type, &a, &PyLong_Type, &b, &draw_count)) return NULL;
|
||||||
|
Py_BEGIN_ALLOW_THREADS;
|
||||||
glMultiDrawArrays(mode, PyLong_AsVoidPtr(a), PyLong_AsVoidPtr(b), draw_count);
|
glMultiDrawArrays(mode, PyLong_AsVoidPtr(a), PyLong_AsVoidPtr(b), draw_count);
|
||||||
|
Py_END_ALLOW_THREADS;
|
||||||
CHECK_ERROR;
|
CHECK_ERROR;
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
@@ -179,7 +183,9 @@ DrawArraysInstanced(PyObject UNUSED *self, PyObject *args) {
|
|||||||
int mode, first;
|
int mode, first;
|
||||||
unsigned int count, primcount;
|
unsigned int count, primcount;
|
||||||
if (!PyArg_ParseTuple(args, "iiII", &mode, &first, &count, &primcount)) return NULL;
|
if (!PyArg_ParseTuple(args, "iiII", &mode, &first, &count, &primcount)) return NULL;
|
||||||
|
Py_BEGIN_ALLOW_THREADS;
|
||||||
glDrawArraysInstanced(mode, first, count, primcount);
|
glDrawArraysInstanced(mode, first, count, primcount);
|
||||||
|
Py_END_ALLOW_THREADS;
|
||||||
CHECK_ERROR;
|
CHECK_ERROR;
|
||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user