Skip to content

Reference

One page per public function, structure, or closely related group in RI. Every page has the same shape:

  1. What it does: a plain explanation.
  2. Signature: generated from the header, so it is always current.
  3. Example: RI code taken from a source file that compiles.
  4. The same in native code: tabs with a canonical Vulkan and D3D12 version.
  5. Rules and errors: what RI checks and which error it reports.

How names work

You write RI::createDevice, regardless of the backend. Each backend defines its own functions in its own namespace (RI::Vk:: or RI::D3D12::), and <RI/RI.hpp> aliases RI:: to the backend your target links. Functions that expose Vulkan or D3D12 types are not reachable through RI::; they live under Native access.

RI objects are plain structs with public fields and operations are free functions. Descriptions are filled with C++20 designated initializers, and fields you leave out keep their defaults:

RI::Device device = RI::createDevice({.gpu = chosen});

GPUs and devices

Page What it is for
RI::listGpus The GPUs that can run RI.
RI::createDevice, RI::destroyDevice Open a GPU for use, and close it.
RI::Gpu The facts about one GPU: name, vendor, memory, ID.
RI::DeviceDesc, RI::Device What you pass to createDevice, and what you get back.
RI::DeviceLimits Descriptor heap limits, root data size, eGPUUpload availability, timestamp frequency, and optional feature flags.
RI::Window A window's OS handles, passed when creating a swapchain.

Memory and buffers

Page What it is for
RI::allocateMemory, RI::freeMemory Memory blocks for GPU-only, upload, GPU-upload, or readback use.
RI::bufferRequirements Size and alignment of a buffer before placing it.
RI::createBuffer, RI::destroyBuffer Buffers placed in memory, with usage flags.

Textures and views

Page What it is for
RI::formatSupported Whether the GPU supports a format for a set of uses.
RI::textureRequirements, RI::fits Size, alignment and memory kinds of a texture before placing it.
RI::createTexture, RI::destroyTexture Textures placed in memory, with usage flags and formats.
RI::createView, RI::destroyView Mip ranges, layer ranges, aspects and other formats of a texture.

Descriptors

Page What it is for
RI::createDescriptorHeap, RI::destroyDescriptorHeap Create and destroy the descriptor heap that bindless shaders index.
RI::writeDescriptors Write texture and buffer views into descriptor heap slots.
RI::writeSamplers Write sampler descriptions into the heap's sampler slots.

Pipelines

Page What it is for
RI::createComputePipeline, RI::destroyPipeline A compute shader ready to run.
RI::createGraphicsPipeline Vertex and pixel shaders with all their state.

Command lists

Page What it is for
RI::createCommandList, RI::resetCommandList, RI::destroyCommandList Lists to record GPU work into, reused after their timeline point.
RI::cmdBegin, RI::cmdEnd Open and close a list for recording.
RI::cmdSetHeap Bind the descriptor heap that shaders index (must be called before cmdSetPipeline).
RI::cmdSetPipeline Bind the compute or graphics pipeline that subsequent dispatches or draws run.
RI::cmdSetRootData Set the root data passed to shaders.
RI::cmdDispatch Run a compute shader.
RI::cmdBarrier Make earlier writes visible to later commands.
RI::cmdCopyBuffer Copy bytes between buffers.
RI::copyLayout and texture copies Copy texels between buffers and textures, or between two textures.
RI::cmdBeginRendering, RI::cmdEndRendering Rendering sections: attachments, load and store operations.
RI::cmdSetViewport, RI::cmdSetScissor, RI::cmdSetStencilReference Override a rendering section's viewport, scissor, or stencil reference.
RI::cmdDraw, RI::cmdDrawIndexed, RI::cmdDrawMesh Draw vertices, indexed geometry, or mesh shaders in a rendering section.
RI::cmdExecuteIndirect, RI::cmdExecuteIndirectWithRootData Run draws or dispatches whose arguments the GPU wrote into a buffer.
RI::cmdDiscard Reset a texture that takes over another resource's memory.
RI::cmdResolve, resolveTo Turn a multisampled texture into a single-sampled one.
RI::cmdClearTexture, RI::cmdClearBuffer Clear textures or buffers outside rendering sections.
RI::cmdWriteSmallData A few values written into a buffer from the command list.
RI::cmdWriteTimestamp, RI::cmdResolveQueries, RI::cmdResetQueries Record GPU timestamps, and resolve or reset queries.

Queries

Page What it is for
RI::createQueryPool, RI::destroyQueryPool, RI::resetQueries Pools of timestamp, occlusion, or pipeline-statistics queries.
RI::cmdBeginQuery, RI::cmdEndQuery, RI::pipelineStatisticsLayout Occlusion, pipeline-statistics, and mesh-primitives queries, and how to read their results.

Submission

Page What it is for
RI::submit, RI::wait, RI::isReached Send work to the GPU; know when it is done.

Ray tracing

Page What it is for
Acceleration structures Inline ray tracing: build acceleration structures and cast rays with RayQuery from any shader.

Work graphs

Page What it is for
RI::createWorkGraph, RI::cmdDispatchGraph Compute shaders that launch each other on the GPU (D3D12 only).

Swapchains

Page What it is for
RI::createSwapchain, RI::acquire, RI::present Show rendered frames in a window.

Debugging

Page What it is for
RI::setName, RI::cmdBeginMarker, RI::cmdEndMarker Name objects and mark regions of command lists for debugging tools.