Summary
rmlui_sample_animation renders incorrectly with the Win32_DX12 backend in optimized builds. After the sample runs for a short time, animated elements begin flickering and sometimes render as white rectangles. Static elements are unaffected.
Environment
- Platform: Windows
- Backend:
Win32_DX12
- Compiler: MSVC
- Build types affected:
Release, RelWithDebInfo
- Build types not affected:
Debug
- Other backend tested:
Win32_GL2 Release does not show the issue
Reproduction
- Configure RmlUi with samples enabled and the
Win32_DX12 backend.
- Build
rmlui_sample_animation in Release or RelWithDebInfo.
- Run
rmlui_sample_animation.exe.
- Wait a few seconds.
Expected Result
Animated elements render normally without flickering or corruption.
Actual Result
After a few seconds, only animated elements begin flickering/corrupting. In some runs, white rectangles appear over animated content. Static UI content remains stable.
Notes / Investigation
The issue appears related to optimized DX12 builds and animated geometry updates.
Observations:
Debug builds are stable.
- Enabling
RMLUI_DX_DEBUG avoids the issue.
- Building Release with optimizations disabled, for example
/Od /Ob0 /DNDEBUG, avoids the issue.
Win32_GL2 Release is stable.
- The issue only affects animated/changing elements, not static elements.
- The corruption can start after a few seconds; in some attempted fixes it was delayed, which suggested a GPU resource lifetime/synchronization problem rather than bad animation data.
A likely cause is that geometry buffers used by animated elements are released/reused before the GPU has finished reading them. Deferring geometry destruction until the relevant fence has completed appears to resolve the issue locally.
Summary
rmlui_sample_animationrenders incorrectly with theWin32_DX12backend in optimized builds. After the sample runs for a short time, animated elements begin flickering and sometimes render as white rectangles. Static elements are unaffected.Environment
Win32_DX12Release,RelWithDebInfoDebugWin32_GL2 Releasedoes not show the issueReproduction
Win32_DX12backend.rmlui_sample_animationinReleaseorRelWithDebInfo.rmlui_sample_animation.exe.Expected Result
Animated elements render normally without flickering or corruption.
Actual Result
After a few seconds, only animated elements begin flickering/corrupting. In some runs, white rectangles appear over animated content. Static UI content remains stable.
Notes / Investigation
The issue appears related to optimized DX12 builds and animated geometry updates.
Observations:
Debugbuilds are stable.RMLUI_DX_DEBUGavoids the issue./Od /Ob0 /DNDEBUG, avoids the issue.Win32_GL2Release is stable.A likely cause is that geometry buffers used by animated elements are released/reused before the GPU has finished reading them. Deferring geometry destruction until the relevant fence has completed appears to resolve the issue locally.