Skip to content

Helpers

RI exposes the explicit, controllable form of every mechanism. The automatic form—such as suballocating memory, assigning descriptor slots, managing frames in flight, or profiling GPU work—is a helper: optional code built only on RI's public functions.

Because a helper uses no private RI internals, you can always replace it with your own implementation. Each helper page ends with "How to roll your own", which lists the RI calls the helper makes so you can write a version tailored to your project.

Helpers:

  • Memory and slot allocators: suballocation inside memory blocks, descriptor-slot allocation, and deferred frees.
  • Transfers: one-call buffer and texture uploads and readbacks.
  • Frame ring: managing frames in flight.
  • GPU profiler: recording and reading nested timestamp scopes.
  • Pipeline statistics: reading a pipeline-statistics query's counters into one CPU struct (PipelineStatistics).
  • Shader compiler: compiling HLSL at run time using RI's compile rules.
  • Group grids: folding large dispatches so each dimension stays within 65,535 groups (kMaxGroupsPerDimension).
  • Typed commands: setting root data and writing small buffer data from typed values, with size and alignment checked at compile time.

FrameRing, MemoryAllocator, and Profiler store a pointer to the Device they were created with. Keep that Device alive and at the same address until you destroy those helpers. SlotAllocator similarly stores a pointer to the Queue passed to createSlotAllocator; keep that Queue alive and at the same address while the allocator is in use.

Every helper belongs to the EquineHelpersVulkan or EquineHelpersD3D12 static library, matching the backend you build (with TypedCommands.hpp provided as a header in the same include directory).

A frame graph is not a helper: it decides how a whole frame is organised, which belongs to the layer you build on top of RI. RI provides the primitives a frame graph needs: stage barriers, placed memory, and cmdDiscard for resetting aliased textures.