mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 03:01:57 +02:00
Fix a couple of bugs in the buffer map API
This commit is contained in:
@@ -100,7 +100,7 @@ class BufferManager: # {{{
|
||||
self.unbind(buf_id)
|
||||
|
||||
@contextmanager
|
||||
def mapped_buffer(self, buf_sz, buf_id, usage=GL_STREAM_DRAW, access=GL_WRITE_ONLY):
|
||||
def mapped_buffer(self, buf_id, buf_sz, usage=GL_STREAM_DRAW, access=GL_WRITE_ONLY):
|
||||
prev_sz = self.sizes.get(buf_id, 0)
|
||||
buf_type = self.types[buf_id]
|
||||
if prev_sz != buf_sz:
|
||||
@@ -315,6 +315,10 @@ class ShaderProgram: # {{{
|
||||
bufid = self.vertex_arrays[vao_id][bufnum]
|
||||
buffer_manager.set_data(bufid, data, usage=usage)
|
||||
|
||||
def mapped_vertex_data(self, vao_id, buf_sz, usage=GL_STREAM_DRAW, bufnum=0, access=GL_WRITE_ONLY):
|
||||
bufid = self.vertex_arrays[vao_id][bufnum]
|
||||
return buffer_manager.mapped_buffer(bufid, buf_sz, usage=usage, access=access)
|
||||
|
||||
def get_vertex_data(self, vao_id, bufnum=0):
|
||||
bufid = self.vertex_arrays[vao_id][bufnum]
|
||||
return buffer_manager.get_data(bufid)
|
||||
|
||||
Reference in New Issue
Block a user