from typing import Any


class Buffer:
    __slots__ = ['__mglo', 'size', 'extra']

    def __init__(self):
        self.__mglo = None  # type: Any
        self.size = None  # type: int
        self.extra = None  # type: Any

    def write(self, data, offset=0) -> None:
        self.__mglo.write(data, offset)

    def read(self, size=-1, offset=0, dtype=None) -> bytes:
        return self.__mglo.read(size, offset, dtype)

    def read_into(self, buffer, size=-1, offset=0, write_offset=0) -> None:
        write_end = write_offset + (self.size if size < 0 else size)
        memoryview(buffer)[write_offset:write_end] = self.__mglo.map(size, offset, True, False, None)
        self.__mglo.unmap()

    def map(self, size=-1, offset=0, readable=False, writable=False, dtype=None) -> None:
        return self.__mglo.map(size, offset, readable, writable, dtype)

    def unmap(self) -> None:
        self.__mglo.unmap()

    def clear(self) -> None:
        self.__mglo.clear()

    def bind_to_uniform_block(self, binding=0, offset=0, size=-1) -> None:
        self.__mglo.bind_to_uniform_block(binding, offset, size)

    def bind_to_storage_buffer(self, binding=0, offset=0, size=-1) -> None:
        self.__mglo.bind_to_storage_buffer(binding, offset, size)

@@ -1073,33 +1073,16 @@
 glo.bind
-_to_uniform_block
 (binding
@@ -1095,16 +1095,19 @@
 et, size
+, 0
 )%0A%0A    d
@@ -1201,34 +1201,16 @@
 glo.bind
-_to_storage_buffer
 (binding
@@ -1219,14 +1219,17 @@
 offset, size
+, 1
 )%0A

add buffer bind to the python layer