MXVK Vulkan Framework 0.35.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mxvk_wrap.graphics.GpuBuffer Class Reference

Public Member Functions

None __init__ (self, "App" app, int size, *, bool storage=False)
 A small host-writable uniform or storage buffer.
None close (self)
None write (self, bytes data)

Public Attributes

 native = None
 Allocate a buffer with size bytes.

Detailed Description

Definition at line 187 of file graphics.py.

Constructor & Destructor Documentation

◆ __init__()

None mxvk_wrap.graphics.GpuBuffer.__init__ ( self,
"App" app,
int size,
* ,
bool storage = False )

A small host-writable uniform or storage buffer.

Definition at line 190 of file graphics.py.

190 def __init__(self, app: "App", size: int, *, storage: bool = False) -> None:
191 ## @brief Allocate a buffer with @p size bytes.
192 self.native = None
193 try:
194 self.native = mxvk.create_storage_buffer(app, size) if storage else mxvk.create_uniform_buffer(app, size)
195 except Exception:
196 _abort_failed_resource(app)
197 raise
198 app.add(self)
199

Member Function Documentation

◆ close()

None mxvk_wrap.graphics.GpuBuffer.close ( self)

Definition at line 204 of file graphics.py.

204 def close(self) -> None:
205 ## @brief Release the underlying Vulkan buffer early.
206 if self.native is not None:
207 self.native.close()
208 self.native = None
209
210

◆ write()

None mxvk_wrap.graphics.GpuBuffer.write ( self,
bytes data )

Definition at line 200 of file graphics.py.

200 def write(self, data: bytes) -> None:
201 ## @brief Upload bytes to the buffer.
202 self.native.write(data)
203

Member Data Documentation

◆ native

mxvk_wrap.graphics.GpuBuffer.native = None

Allocate a buffer with size bytes.

Definition at line 192 of file graphics.py.


The documentation for this class was generated from the following file: