Vireo  0.0
Vireo 3D Rendering Hardware Interface
Buffer Class Referenceabstract

Detailed Description

A GPU buffer allocation. Created by Vireo.create_buffer().

Lua full name: vireo.Buffer

Public Member Functions

nil map ()
 Maps the buffer for CPU read/write access. Must call unmap() when done. More...
 
nil unmap ()
 Unmaps the buffer; CPU access is invalid after this call. More...
 
nil write (data: lightuserdata|any, size: integer|nil, offset: integer|nil)
 Writes data into the mapped buffer. size defaults to the full buffer size; offset defaults to 0. More...
 
VideoMemoryAllocationDesc[] get_memory_allocations ()static
 Returns all current GPU memory allocations for all Buffer objects. More...
 

Properties

integer size
 Total size of the buffer in bytes. (read-only)
 
BufferType type
 Usage type of this buffer (see vireo.BufferType). (read-only)
 
integer instance_size
 Size of a single element before alignment padding in bytes. (read-only)
 
integer instance_size_aligned
 Aligned size of a single element in bytes (may be larger than instance_size). (read-only)
 
integer instance_count
 Number of elements/instances the buffer was allocated for. (read-only)
 
lightuserdata mapped_address
 CPU-side mapped pointer (only valid between map() and unmap(), for upload/download buffers). (read-only)
 

Member Function Documentation

nil map ( )

Maps the buffer for CPU read/write access. Must call unmap() when done.

nil unmap ( )

Unmaps the buffer; CPU access is invalid after this call.

nil write ( lightuserdata|any  data,
integer|nil  size,
integer|nil  offset)

Writes data into the mapped buffer. size defaults to the full buffer size; offset defaults to 0.

Parameters
datalightuserdata|any
sizeinteger|nil
offsetinteger|nil
VideoMemoryAllocationDesc[] get_memory_allocations ( )
static

Returns all current GPU memory allocations for all Buffer objects.

Returns
VideoMemoryAllocationDesc[]

Property Documentation

integer size

Total size of the buffer in bytes. (read-only)

BufferType type

Usage type of this buffer (see vireo.BufferType). (read-only)

integer instance_size

Size of a single element before alignment padding in bytes. (read-only)

integer instance_size_aligned

Aligned size of a single element in bytes (may be larger than instance_size). (read-only)

integer instance_count

Number of elements/instances the buffer was allocated for. (read-only)

lightuserdata mapped_address

CPU-side mapped pointer (only valid between map() and unmap(), for upload/download buffers). (read-only)