Worker. The setting applies to every File loaded by that worker and every Rive object created from those files.
GPU Canvas is required to render 3D content.
Enabling GPU Canvas
Pass a configuration withenableGPUCanvas set to true when creating a worker:
File created with the worker uses the same setting:
RiveUIView, RiveUIViewRepresentable, or AsyncRiveUIViewRepresentable. Each view inherits the GPU Canvas setting from the worker associated with its Rive object.
Default Behavior
GPU Canvas is disabled by default. Continue to create a worker without a configuration when your content does not require it:Sharing a GPU Canvas Worker
Share a GPU Canvas worker when multiple files or views can use the same worker. An example implementation is shown below.AsyncShared and the Worker extensions below are application-level helpers. They are not included with RiveRuntime.Worker.sharedGPUCanvas() when loading files that require GPU Canvas: