Skip to main content
rive::gpu::RenderContext is the API-agnostic frontend to Rive’s GPU renderer. You create one of the per-backend *Impl::MakeContext factories, hand it to your render loop, and the rest of the C++ API stays identical. RenderContext layering: your code drives RenderContext via beginFrame/flush; RenderContext delegates to a per-backend RenderContextImpl (D3D11, D3D12, Metal, Vulkan, GL), which in turn talks to the underlying GPU API (DXGI, IOSurface, VkSwapchain, ...). RenderContext also implements rive::Factory, so the same object you pass to File::import is the one that owns your GPU resources.
Header: rive/renderer/d3d11/render_context_d3d_impl.hpp
Swap-chain notes:
  • Set BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_UNORDERED_ACCESS.
  • Use DXGI_FORMAT_R8G8B8A8_UNORM (or the _SRGB variant); other formats may force the renderer onto an offscreen path.
  • Set options.isIntel = true on Intel HD Graphics — works around a driver bug in pixel-local-storage emulation.
For a working reference, see Rive’s tests/player sample app and the D3D-specific wiring in tests/common/offscreen_rendertarget_d3d.cpp.

Picking Modes per Frame

RenderContext::FrameDescriptor carries flags that change the rendering algorithm: Most apps leave these at defaults. Override only when you see a specific issue on a specific GPU.

Choosing a Backend