Skip to content

Windows D3D12 player crashes on quit if Rive never rendered (null render target at device shutdown) #178

Closed

Description

@TigerHix

Description

On Windows with D3D12, a player that never renders any Rive content crashes when it quits. The player log ends normally
(PlayerConnection::Cleanup), then the process dies with an access violation (0xc0000005) in rive.dll at offset 0x13068.
It happens on every run. The same player started with -force-d3d11 exits normally.

Expected: the player exits cleanly whether or not Rive drew anything.

Reproduction steps

  1. Add the Rive Unity package to a project. The package loads rive.dll at startup even with no Rive content (its
    BeforeSceneLoad hook calls setUnityLog).
  2. Build a Windows player with a single empty scene: no RiveWidget, RivePanel or RenderQueue.
  3. Run it on D3D12 and close the window, or call Application.Quit().
  4. The process exits with 0xC0000005, and the Windows Application log has an event 1000 for rive.dll at offset 0x13068.

Cause

From the disassembly of rive.dll 0.5.1 (no symbols ship). On kUnityGfxDeviceEventShutdown, the device-event callback
loads the D3D12 renderer's last render target and calls its GPU wait without checking it for null. The wait's first
access reads through that pointer:

180012727: cmp  $0x1,%edx          ; kUnityGfxDeviceEventShutdown
18001272a: je   1800127aa
...
1800127aa: mov  0x88(%rsi),%rcx    ; last render target, null if none was ever created
1800127b1: call 180013050          ; the render target's GPU wait
...
180013068: mov  0x30(%rcx),%rax    ; faults when rcx is null

The pointer at 0x88 is set only when a RenderQueue first renders into a texture, so a session that never drew Rive
reaches this call with null. A null check before the call would fix it.

We ran 0.5.1. In 0.5.2 and 0.5.3-canary.28 we checked the disassembly and found the same code (in the canary the load
is at 0x180012dca and the faulting read at 0x180013688).

Workaround

On D3D12, at BeforeSceneLoad, render one empty RenderQueue into a 1x1 RenderTexture (TextureHelper.Descriptor(1, 1))
so the renderer has a target at shutdown, and dispose the queue on Application.quitting. With that in place, players
that draw Rive and players that don't both exit cleanly.

Rive Unity package version

0.5.1

Unity version

6000.7.0b2

Target platform

Windows

Editor OS & version

Windows 11 (10.0.26200)

Additional context

Activity

  1. damzobridge commented on Oct 26, 2026

    @damzobridge
    Contributor

    Thanks for the detailed report @TigerHix . The issue should now be addressed from v0.5.3-canary.35 onward. Please let us know if it fixes the issue on your end. Please feel free to reopen the issue if it's still happening on your end.

    You can install it using the package manager with:

    https://github.com/rive-app/rive-unity.git?path=package#v0.5.3-canary.35
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions