Skip to content

Win32_DX12 Release build flickers/corrupts animated geometry in rmlui_sample_animation #970

Description

@BaiFeng666

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

  1. Configure RmlUi with samples enabled and the Win32_DX12 backend.
  2. Build rmlui_sample_animation in Release or RelWithDebInfo.
  3. Run rmlui_sample_animation.exe.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendsPlatforms and renderers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions