@@ -0,0 +1,686 @@
+import numpy as np%0A%0Afrom vulk import vulkanconstant as vc%0Afrom vulk import vulkanobject as vo%0A%0A%0Aclass UniformBuffer():%0A    def __init__(self, context, dtype, size=1):%0A        self.uniform_array = np.zeros(size, dtype=dtype)%0A        self.uniform_buffer = vo.HighPerformanceBuffer(%0A            context, self.uniform_array.nbytes, vc.BufferUsage.UNIFORM_BUFFER)%0A%0A    def set_uniforms(self, uniforms, offset=0):%0A        self.uniform_array%5Boffset:%5D = uniforms%0A%0A    def upload(self, context):%0A        with self.uniform_buffer.bind(context) as b:%0A            np.copyto(np.array(b, copy=False),%0A                      self.uniform_array.view(dtype=np.unit8),%0A                      casting='no')%0A

Add uniformbuffer