mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-25 17:52:02 +02:00
Remove unused code
This commit is contained in:
28
kitty/gl.h
28
kitty/gl.h
@@ -536,33 +536,6 @@ GetTexImage(PyObject UNUSED *self, PyObject *args) {
|
|||||||
Py_RETURN_NONE;
|
Py_RETURN_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject*
|
|
||||||
NamedBufferData(PyObject UNUSED *self, PyObject *args) {
|
|
||||||
int usage;
|
|
||||||
unsigned long size, target;
|
|
||||||
PyObject *address;
|
|
||||||
if (!PyArg_ParseTuple(args, "kkO!i", &target, &size, &PyLong_Type, &address, &usage)) return NULL;
|
|
||||||
void *data = PyLong_AsVoidPtr(address);
|
|
||||||
if (data == NULL) { PyErr_SetString(PyExc_TypeError, "Not a valid data pointer"); return NULL; }
|
|
||||||
Py_BEGIN_ALLOW_THREADS;
|
|
||||||
#ifdef glNamedBufferData
|
|
||||||
#ifdef __APPLE__
|
|
||||||
if(false) {
|
|
||||||
#else
|
|
||||||
if(GLEW_VERSION_4_5) {
|
|
||||||
#endif
|
|
||||||
glNamedBufferData(target, size, data, usage);
|
|
||||||
} else {
|
|
||||||
glBindBuffer(GL_TEXTURE_BUFFER, target); glBufferData(GL_TEXTURE_BUFFER, size, data, usage); glBindBuffer(GL_TEXTURE_BUFFER, 0);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
glBindBuffer(GL_TEXTURE_BUFFER, target); glBufferData(GL_TEXTURE_BUFFER, size, data, usage); glBindBuffer(GL_TEXTURE_BUFFER, 0);
|
|
||||||
#endif
|
|
||||||
Py_END_ALLOW_THREADS;
|
|
||||||
CHECK_ERROR;
|
|
||||||
Py_RETURN_NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
GetBufferSubData(PyObject UNUSED *self, PyObject *args) {
|
GetBufferSubData(PyObject UNUSED *self, PyObject *args) {
|
||||||
unsigned long size, target, offset;
|
unsigned long size, target, offset;
|
||||||
@@ -825,7 +798,6 @@ int add_module_gl_constants(PyObject *module) {
|
|||||||
METH(CopyImageSubData, METH_VARARGS) \
|
METH(CopyImageSubData, METH_VARARGS) \
|
||||||
METH(TexSubImage3D, METH_VARARGS) \
|
METH(TexSubImage3D, METH_VARARGS) \
|
||||||
METH(GetTexImage, METH_VARARGS) \
|
METH(GetTexImage, METH_VARARGS) \
|
||||||
METH(NamedBufferData, METH_VARARGS) \
|
|
||||||
METH(GetBufferSubData, METH_VARARGS) \
|
METH(GetBufferSubData, METH_VARARGS) \
|
||||||
METH(BlendFunc, METH_VARARGS) \
|
METH(BlendFunc, METH_VARARGS) \
|
||||||
METH(Finish, METH_NOARGS) \
|
METH(Finish, METH_NOARGS) \
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ from .fast_data_types import (
|
|||||||
glDeleteShader, glDeleteTexture, glEnableVertexAttribArray, glGenBuffers,
|
glDeleteShader, glDeleteTexture, glEnableVertexAttribArray, glGenBuffers,
|
||||||
glGenTextures, glGenVertexArrays, glGetAttribLocation, glGetBufferSubData,
|
glGenTextures, glGenVertexArrays, glGetAttribLocation, glGetBufferSubData,
|
||||||
glGetIntegerv, glGetProgramInfoLog, glGetProgramiv, glGetShaderInfoLog,
|
glGetIntegerv, glGetProgramInfoLog, glGetProgramiv, glGetShaderInfoLog,
|
||||||
glGetShaderiv, glGetUniformLocation, glLinkProgram, glNamedBufferData,
|
glGetShaderiv, glGetUniformLocation, glLinkProgram, glPixelStorei,
|
||||||
glPixelStorei, glShaderSource, glTexBuffer, glTexParameteri,
|
glShaderSource, glTexBuffer, glTexParameteri, glTexStorage3D,
|
||||||
glTexStorage3D, glTexSubImage3D, glUseProgram, glVertexAttribDivisor,
|
glTexSubImage3D, glUseProgram, glVertexAttribDivisor,
|
||||||
glVertexAttribPointer, replace_or_create_buffer
|
glVertexAttribPointer, replace_or_create_buffer
|
||||||
)
|
)
|
||||||
from .fonts.render import render_cell
|
from .fonts.render import render_cell
|
||||||
@@ -287,7 +287,7 @@ class ShaderProgram:
|
|||||||
|
|
||||||
def send_vertex_data(self, name, data, usage=GL_STATIC_DRAW):
|
def send_vertex_data(self, name, data, usage=GL_STATIC_DRAW):
|
||||||
bufid = self.buffers[name]
|
bufid = self.buffers[name]
|
||||||
glNamedBufferData(bufid, sizeof(data), addressof(data), usage)
|
buffer_manager.set_data(bufid, data, usage=usage)
|
||||||
|
|
||||||
def __hash__(self) -> int:
|
def __hash__(self) -> int:
|
||||||
return self.program_id
|
return self.program_id
|
||||||
|
|||||||
Reference in New Issue
Block a user