Vireo  0.0
Vireo 3D Rendering Hardware Interface
Vireo Class Referenceabstract

Detailed Description

Main RHI entry point. Obtained from the host application; not constructed in Lua.

Lua full name: vireo.Vireo

Public Member Functions

nil wait_idle ()
 Blocks the CPU until the GPU has finished all pending work on all queues. More...
 
SwapChain create_swap_chain (format: ImageFormat, presentQueue: SubmitQueue, windowHandle: any, presentMode: PresentMode|nil, framesInFlight: integer|nil)
 Creates a swap chain for the given OS window handle with optional presentation mode and frame count. More...
 
SubmitQueue create_submit_queue (commandType: CommandType, name: string|nil)
 Creates a GPU command submission queue for the given command type. More...
 
Fence create_fence (createSignaled: boolean|nil, name: string|nil)
 Creates a CPU/GPU fence (unsignaled by default; pass createSignaled=true to start in the signaled state). More...
 
Semaphore create_semaphore (type: SemaphoreType, name: string|nil)
 Creates a GPU synchronization semaphore of the given type. More...
 
CommandAllocator create_command_allocator (type: CommandType)
 Creates a command allocator for the given queue type. More...
 
VertexInputLayout create_vertex_layout (size: integer, attributes: VertexAttributeDesc[])
 Creates a vertex input layout from a per-vertex stride (bytes) and a list of attribute descriptors. More...
 
ShaderModule create_shader_module_from_file (path: string)
 Loads a compiled shader binary from a file path (append shader_file_extension for the correct format). More...
 
ShaderModule create_shader_module_from_data (data: any, name: string)
 Creates a shader module from raw compiled byte data with an optional debug name. More...
 
PipelineResources create_pipeline_resources (layouts: DescriptorLayout[]|nil, pushConstant: PushConstantsDesc|nil, name: string|nil)
 Creates a pipeline layout from an ordered list of descriptor layouts and an optional push-constant range. More...
 
ComputePipeline create_compute_pipeline (resources: PipelineResources, shader: ShaderModule, name: string|nil)
 Compiles and returns a compute pipeline from a layout and a compute shader module. More...
 
GraphicPipeline create_graphic_pipeline (config: GraphicPipelineConfiguration, name: string|nil)
 Compiles and returns a graphics pipeline from a full configuration descriptor. More...
 
Buffer create_buffer (type: BufferType, size: integer, count: integer|nil, name: string|nil)
 Allocates a GPU buffer. size is the per-element byte size; count is the number of elements (default 1). More...
 
Image create_image (format: ImageFormat, width: integer, height: integer, mipLevels: integer|nil, arraySize: integer|nil, name: string|nil)
 Allocates a shader-read-only GPU image. More...
 
Image create_read_write_image (format: ImageFormat, width: integer, height: integer, mipLevels: integer|nil, arraySize: integer|nil, name: string|nil)
 Allocates a GPU read/write image (UAV / storage image). More...
 
RenderTarget create_render_target (format: ImageFormat, width: integer, height: integer, type: RenderTargetType|nil, clearValue: ClearValue|nil, arraySize: integer|nil, msaa: MSAA|nil, name: string|nil)
 Creates a render target of the given format and dimensions. More...
 
RenderTarget create_render_target_from_swap_chain (swapChain: SwapChain, clearValue: ClearValue|nil, msaa: MSAA|nil, name: string|nil)
 Creates a color render target whose format and dimensions match the given swap chain. More...
 
DescriptorLayout create_descriptor_layout (name: string|nil)
 Creates an empty descriptor layout for uniform, storage, image, and sampler bindings. More...
 
DescriptorLayout create_sampler_descriptor_layout (name: string|nil)
 Creates an empty descriptor layout intended for sampler-only bindings. More...
 
DescriptorLayout create_dynamic_uniform_descriptor_layout (name: string|nil)
 Creates an empty descriptor layout for dynamic uniform buffer bindings. More...
 
DescriptorSet create_descriptor_set (layout: DescriptorLayout, name: string|nil)
 Creates a descriptor set from a finalized DescriptorLayout. More...
 
Sampler create_sampler (minFilter: Filter, magFilter: Filter, addressModeU: AddressMode, addressModeV: AddressMode, addressModeW: AddressMode, minLod: number|nil, maxLod: number|nil, anisotropyEnable: boolean|nil, mipMapMode: FilterMode|nil, compareOp: CompareOp|nil)
 Creates an immutable texture sampler with the given filtering, addressing, LOD, and comparison parameters. More...
 
boolean is_backend_supported (backend: Backend)static
 Returns true if the given rendering backend is available and supported on this machine. More...
 

Properties

Backend backend
 The active rendering backend (DIRECTX or VULKAN). (read-only)
 
string shader_file_extension
 File extension for pre-compiled shaders on the active backend (e.g. ".spv" for Vulkan, ".cso" for DirectX). (read-only)
 
PhysicalDevice physical_device
 The PhysicalDevice representing the selected GPU. (read-only)
 
Device device
 The logical Device wrapping the GPU. (read-only)
 
Instance instance
 The underlying API Instance (VkInstance / IDXGIFactory). (read-only)
 

Member Function Documentation

nil wait_idle ( )

Blocks the CPU until the GPU has finished all pending work on all queues.

SwapChain create_swap_chain ( ImageFormat  format,
SubmitQueue  presentQueue,
any  windowHandle,
PresentMode|nil  presentMode,
integer|nil  framesInFlight)

Creates a swap chain for the given OS window handle with optional presentation mode and frame count.

Parameters
formatImageFormat
presentQueueSubmitQueue
windowHandleany
presentModePresentMode|nil
framesInFlightinteger|nil
Returns
SwapChain
SubmitQueue create_submit_queue ( CommandType  commandType,
string|nil  name)

Creates a GPU command submission queue for the given command type.

Parameters
commandTypeCommandType
namestring|nil
Returns
SubmitQueue
Fence create_fence ( boolean|nil  createSignaled,
string|nil  name)

Creates a CPU/GPU fence (unsignaled by default; pass createSignaled=true to start in the signaled state).

Parameters
createSignaledboolean|nil
namestring|nil
Returns
Fence
Semaphore create_semaphore ( SemaphoreType  type,
string|nil  name)

Creates a GPU synchronization semaphore of the given type.

Parameters
typeSemaphoreType
namestring|nil
Returns
Semaphore
CommandAllocator create_command_allocator ( CommandType  type)

Creates a command allocator for the given queue type.

Parameters
typeCommandType
Returns
CommandAllocator
VertexInputLayout create_vertex_layout ( integer  size,
VertexAttributeDesc[]  attributes)

Creates a vertex input layout from a per-vertex stride (bytes) and a list of attribute descriptors.

Parameters
sizeinteger
attributesVertexAttributeDesc[]
Returns
VertexInputLayout
ShaderModule create_shader_module_from_file ( string  path)

Loads a compiled shader binary from a file path (append shader_file_extension for the correct format).

Parameters
pathstring
Returns
ShaderModule
ShaderModule create_shader_module_from_data ( any  data,
string  name)

Creates a shader module from raw compiled byte data with an optional debug name.

Parameters
dataany
namestring
Returns
ShaderModule
PipelineResources create_pipeline_resources ( DescriptorLayout[]|nil  layouts,
PushConstantsDesc|nil  pushConstant,
string|nil  name)

Creates a pipeline layout from an ordered list of descriptor layouts and an optional push-constant range.

Parameters
layoutsDescriptorLayout[]|nil
pushConstantPushConstantsDesc|nil
namestring|nil
Returns
PipelineResources
ComputePipeline create_compute_pipeline ( PipelineResources  resources,
ShaderModule  shader,
string|nil  name)

Compiles and returns a compute pipeline from a layout and a compute shader module.

Parameters
resourcesPipelineResources
shaderShaderModule
namestring|nil
Returns
ComputePipeline
GraphicPipeline create_graphic_pipeline ( GraphicPipelineConfiguration  config,
string|nil  name)

Compiles and returns a graphics pipeline from a full configuration descriptor.

Parameters
configGraphicPipelineConfiguration
namestring|nil
Returns
GraphicPipeline
Buffer create_buffer ( BufferType  type,
integer  size,
integer|nil  count,
string|nil  name)

Allocates a GPU buffer. size is the per-element byte size; count is the number of elements (default 1).

Parameters
typeBufferType
sizeinteger
countinteger|nil
namestring|nil
Returns
Buffer
Image create_image ( ImageFormat  format,
integer  width,
integer  height,
integer|nil  mipLevels,
integer|nil  arraySize,
string|nil  name)

Allocates a shader-read-only GPU image.

Parameters
formatImageFormat
widthinteger
heightinteger
mipLevelsinteger|nil
arraySizeinteger|nil
namestring|nil
Returns
Image
Image create_read_write_image ( ImageFormat  format,
integer  width,
integer  height,
integer|nil  mipLevels,
integer|nil  arraySize,
string|nil  name)

Allocates a GPU read/write image (UAV / storage image).

Parameters
formatImageFormat
widthinteger
heightinteger
mipLevelsinteger|nil
arraySizeinteger|nil
namestring|nil
Returns
Image
RenderTarget create_render_target ( ImageFormat  format,
integer  width,
integer  height,
RenderTargetType|nil  type,
ClearValue|nil  clearValue,
integer|nil  arraySize,
MSAA|nil  msaa,
string|nil  name)

Creates a render target of the given format and dimensions.

Parameters
formatImageFormat
widthinteger
heightinteger
typeRenderTargetType|nil
clearValueClearValue|nil
arraySizeinteger|nil
msaaMSAA|nil
namestring|nil
Returns
RenderTarget
RenderTarget create_render_target_from_swap_chain ( SwapChain  swapChain,
ClearValue|nil  clearValue,
MSAA|nil  msaa,
string|nil  name)

Creates a color render target whose format and dimensions match the given swap chain.

Parameters
swapChainSwapChain
clearValueClearValue|nil
msaaMSAA|nil
namestring|nil
Returns
RenderTarget
DescriptorLayout create_descriptor_layout ( string|nil  name)

Creates an empty descriptor layout for uniform, storage, image, and sampler bindings.

Parameters
namestring|nil
Returns
DescriptorLayout
DescriptorLayout create_sampler_descriptor_layout ( string|nil  name)

Creates an empty descriptor layout intended for sampler-only bindings.

Parameters
namestring|nil
Returns
DescriptorLayout
DescriptorLayout create_dynamic_uniform_descriptor_layout ( string|nil  name)

Creates an empty descriptor layout for dynamic uniform buffer bindings.

Parameters
namestring|nil
Returns
DescriptorLayout
DescriptorSet create_descriptor_set ( DescriptorLayout  layout,
string|nil  name)

Creates a descriptor set from a finalized DescriptorLayout.

Parameters
layoutDescriptorLayout
namestring|nil
Returns
DescriptorSet
Sampler create_sampler ( Filter  minFilter,
Filter  magFilter,
AddressMode  addressModeU,
AddressMode  addressModeV,
AddressMode  addressModeW,
number|nil  minLod,
number|nil  maxLod,
boolean|nil  anisotropyEnable,
FilterMode|nil  mipMapMode,
CompareOp|nil  compareOp)

Creates an immutable texture sampler with the given filtering, addressing, LOD, and comparison parameters.

Parameters
minFilterFilter
magFilterFilter
addressModeUAddressMode
addressModeVAddressMode
addressModeWAddressMode
minLodnumber|nil
maxLodnumber|nil
anisotropyEnableboolean|nil
mipMapModeFilterMode|nil
compareOpCompareOp|nil
Returns
Sampler
boolean is_backend_supported ( Backend  backend)
static

Returns true if the given rendering backend is available and supported on this machine.

Parameters
backendBackend
Returns
boolean

Property Documentation

Backend backend

The active rendering backend (DIRECTX or VULKAN). (read-only)

string shader_file_extension

File extension for pre-compiled shaders on the active backend (e.g. ".spv" for Vulkan, ".cso" for DirectX). (read-only)

PhysicalDevice physical_device

The PhysicalDevice representing the selected GPU. (read-only)

Device device

The logical Device wrapping the GPU. (read-only)

Instance instance

The underlying API Instance (VkInstance / IDXGIFactory). (read-only)