Skip to content

Windows (AMD Radeon integrated): 3D draws nothing — Vulkan OutOfMemory, DX12 FXC X3511 loop-unroll error #66

Open

Description

@Zeken0

Summary

On Windows 11 with an AMD Ryzen APU, 2D compositions render correctly, but any 3D content fails. The
raea render command still prints APPLIED and exits 0, so the failure is silent apart from the log.

  • Default backend (Vulkan): OutOfMemory RenderError. The whole 3D layer is dropped; only the page (HTML/text) is
    drawn over black. Same result at 640×360.
  • DX12 (WGPU_BACKEND=dx12): a fragment shader fails to compile under FXC with error X3511: unable to unroll loop ... (172 iterations). Some meshes then draw (ground plane, a sphere) but others are missing, and some
    scenes end in Internal RenderError.
  • DX12 + DXC (WGPU_DX12_COMPILER=dxc): no adapter at all, apparently because dxcompiler.dll isn't shipped
    with the release, so this isn't a workaround.

Environment

  • raea 0.1.0-canary.2, installed with irm https://raea.io/install.ps1 | iex
  • Windows 11 Home, build 26300, x86_64
  • CPU/GPU: AMD Ryzen 7 4700U with Radeon Graphics (integrated, shared memory), driver 31.0.21912.14
  • RAM: 15.4 GiB
  • VC++ redistributable present (vcruntime140, vcruntime140_1, msvcp140)

Reproduce

The example from the raea-bevy skill, animation.md → "Example: blocks springing in one after another, then a turn",
copied unchanged into blocks.tsx:

raea render blocks.tsx --frame 80 -o blocks.png
WGPU_BACKEND=dx12 raea render blocks.tsx --frame 80 -o blocks-dx12.png

Expected: four coloured blocks on a floor, plus a dark ball.
Actual:

  • default: frame is the background colour only; no 3D.
  • dx12: floor draws, the four blocks (children of <Entity>) are missing, the ball is a tiny sliver.

raea scene explain on a similar scene reports every part where it should be (pillars resting on the ground, the
sphere in the air), so the scene data is right and the loss happens in rendering.

For comparison, a 2D composition (the README's hello.tsx, and a 1080×1920 motion piece) renders correctly, about
12–19 ms a frame, and passes raea check.

Logs (distinct lines, with counts)

Default backend, --frame 80:

87 ERROR bevy_render::error_handler: Quitting the application due to OutOfMemory RenderError
 9 ERROR bevy_render::error_handler: Caught rendering error: Validation Error
 1 ERROR bevy_render::error_handler: Caught rendering error: Out of Memory
 1 APPLIED  frame 80 rendered to blocks.png (bevy_ui, the page over its 3D)

WGPU_BACKEND=dx12, --frame 80:

86 ERROR bevy_render::error_handler: Quitting the application due to Internal RenderError
 2 [ERROR wgpu::backend::wgpu_core] Please report it to https://github.com/gfx-rs/wgpu
 2 ERROR bevy_render::error_handler: Caught rendering error: Validation Error
 2 [ERROR wgpu::backend::wgpu_core] Shader translation error for stage ShaderStages(FRAGMENT): FXC D3DCompile error
   (0x80004005): Shader@0x...(105,5-15): error X3511: unable to unroll loop, loop does not appear to terminate in a
   timely manner (172 iterations) or unrolled loop is too large, use the [unroll(n)] attribute to force an exact
   higher number
 1 APPLIED  frame 80 rendered to blocks-dx12.png (bevy_ui, the page over its 3D)

WGPU_BACKEND=dx12 WGPU_DX12_COMPILER=dxc:

raea: the shared GPU device isn't there (no GPU adapter: No suitable graphics adapter found; ... dx12
drivers/libraries could not be loaded ...)
thread 'main' panicked at bevy_render-0.20.0/src/renderer/mod.rs:308:36:
Unable to find a GPU! Make sure you have installed required drivers!

Notes

  1. The render exits 0 and prints APPLIED even when the 3D layer failed. A non-zero exit, or a REFUSED line like
    the one for Vello's skipped draws, would stop an agent from shipping a blank video.
  2. Possible fixes on the DX12 path: ship dxcompiler.dll/dxil.dll so DXC can be used, or give the loop at
    fragment line 105 an explicit bound or [loop].
  3. I can test builds on this machine if that helps.

Activity

  1. shinyobjectz commented on Nov 10, 2026

    @shinyobjectz
    Owner

    Thanks for the exact repro and the counted log lines; they made this quick to pin down. There are three separate problems here. Two are fixed on main, and the third needs a test on your machine.

    DX12: fixed (85adac1). I reproduced it on a Windows 11 PC with an RTX 4070 using the blocks example, so it isn't AMD-specific. The shader FXC refused is raea's ink-outline pass. Every 3D scene builds that pipeline, so its X3511 error stopped all 3D drawing on DX12. The pass sampled 16 directions × 3 radii in two nested loops with an early return, which FXC can't unroll; it's now one 48-step loop that draws the same line. I checked it with naga's HLSL (as wgpu hands it to FXC) and the Windows SDK's fxc: the old shader fails with your exact error and the new one compiles.

    APPLIED with exit 0: fixed (aa0a416). Bevy's default response to a GPU error is to ask the app to quit, and raea's renderer never read that request. So it saved whatever half-drawn frame it had and reported success. Now the first GPU error stops the render with a refusal that quotes what the GPU said.

    Vulkan OutOfMemory on the Radeon iGPU: not reproduced yet. It doesn't happen on the NVIDIA card. My best guess is the shadow maps. A directional light with shadows gets 4096² maps by default, four cascades, about 256 MB of GPU memory, and an APU's device-local heap can be small. Could you try this on canary.2 (the prop is already there)? Put this beside the camera in blocks.tsx:

    <Shadows mapSize={1024} />

    (import { Shadows } from "raea/light"). Then also try once with shadow_maps_enabled removed from the DirectionalLight, and say whether the default backend draws the blocks in either case. If one of those fixes it, raea can pick a smaller map on an integrated GPU by default.

    No Windows build with the two fixes is published yet (v0.1.0 shipped without one), so I'll keep this open.

  2. added a commit that references this issue on Nov 10, 2026
  3. shinyobjectz commented on Nov 10, 2026

    @shinyobjectz
    Owner

    An update on the Vulkan OutOfMemory part. It's still not reproduced (I don't have an AMD APU here), but main now has a fix for the likeliest cause (85f20fa).

    What I measured. On the RTX 4070 with Vulkan, the blocks example's first frame holds this much GPU memory, by sun shadow map size:

    shadow maps GPU memory
    4096 (the default) 571 MB
    2048 370 MB
    1024 319 MB

    On Vulkan, an APU's "own" memory is the carve-out the firmware reserves for it, often 512 MB on laptops. wgpu's allocator never puts a GPU-only texture anywhere else, so with the default maps this scene alone already overflows a 512 MB carve-out. A 4096 sun is four 4096² depth cascades, 268 MB on its own.

    What changed. On Vulkan, raea now reads how much memory the GPU calls its own. If a scene doesn't set a shadow size, the sun's and spot lights' maps are 2048 under 2 GB and 1024 under 1 GB, and raea prints one line saying so. <Shadows mapSize> still wins. DX12 isn't affected because it draws in shared system memory. I checked the memory read on Windows: it found 12 GB on the 4070 (which keeps 4096) and drew the 1024 path with its memory forced to 512 MB.

    Since you offered to test, two quick checks on canary.2 would tell us whether this is the right cause:

    1. In Task Manager → Performance → GPU 0 (the Radeon), what does Dedicated GPU memory say?
    2. Does blocks.tsx draw on the default backend with <Shadows mapSize={1024} /> beside the camera (import { Shadows } from "raea/light")?

    If the answer to 2 is yes, the next Windows build should draw it without the prop. That build isn't published yet, so I'll keep this open until you've been able to try it.

  4. shinyobjectz commented on Nov 10, 2026

    @shinyobjectz
    Owner

    The next Windows build is up: v0.1.1-rc1, a pre-release. It has all three fixes from this thread: DX12's shader (85adac1), a GPU error stopping the render instead of saving a half-drawn frame (aa0a416), and smaller default shadow maps on Vulkan when the GPU's own memory is under 2 GB (85f20fa). (raea.io's install.ps1 installs it too, but at the moment it ends with a red Select-String error after everything is installed. That's fixed and goes out with the next site update; the zip avoids it.)

    On the RTX 4070, that zip draws blocks.tsx on Vulkan, on DX12 and on the default backend. Since you offered, could you try blocks.tsx on your Radeon with no <Shadows> prop, both on the default backend and with WGPU_BACKEND=vulkan? If the shadow-map fix kicks in, raea prints one line saying it chose smaller maps. If it still runs out of memory, the Dedicated GPU memory figure from Task Manager would tell me where to look next.

  5. shinyobjectz commented on Nov 12, 2026

    @shinyobjectz
    Owner

    v0.1.1 is out with all three fixes from this thread (the installer and irm https://raea.io/install.ps1 | iex both give it). When you have a moment, could you try blocks.tsx on the Radeon with no <Shadows> prop, on the default backend and with WGPU_BACKEND=vulkan? If the smaller-shadow-map path kicks in, raea prints one line saying so. If it still runs out of memory, Task Manager's Dedicated GPU memory figure for the Radeon tells me where to look next.

  6. added
    needs confirmingFixed in a build; waiting for the reporter to confirm it on their machine
    on Nov 12, 2026
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

    needs confirmingFixed in a build; waiting for the reporter to confirm it on their machine

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions