Skip to content

Atmosphere example panics when backend is DX12 instead of Vulkan #17632

Closed
@GitGhillie

Description

@GitGhillie

Bevy version

Bevy main

Relevant system information

cargo 1.83.0

2025-02-01T13:36:42.272310Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Windows 10 Home", kernel: "19045", cpu: "AMD Ryzen 7 7800X3D 8-Core Processor", core_count: "8", memory: "63.1 GiB" }
2025-02-01T13:36:42.417152Z  INFO bevy_render::renderer: AdapterInfo { name: "AMD Radeon RX 7900 XT", vendor: 4098, device: 29772, device_type: DiscreteGpu, driver: "32.0.12033.1030", driver_info: "", backend: Dx12 }

What you did

cargo run --example atmosphere with WGPU_BACKEND set to dx12.

What went wrong

Immediate panic with 2025-02-01T13:36:43.594474Z ERROR wgpu_hal::dx12::device: Naga generated shader for "main" at Fragment:
Then a dump of the atmosphere shader code.
Then this:

2025-02-01T13:36:43.620196Z ERROR wgpu_core::device::global: Device::create_render_pipeline error: Internal error in ShaderStages(FRAGMENT) shader: FXC D3DCompile error (Unspecified error (0x80004005)): C:\Rust\bevy\Shader@0x00000212E3942750(343,32-43): warning X3570: gradient instruction used in a loop with varying iteration, attempting to unroll the loop
C:\Rust\bevy\Shader@0x00000212E3942750(326,5-15): error X3511: unable to unroll loop, loop does not appear to terminate in a timely manner (561 iterations) or unrolled loop is too large, use the [unroll(n)] attribute to force an exact higher number

2025-02-01T13:36:43.620287Z ERROR wgpu::backend::wgpu_core: Shader translation error for stage ShaderStages(FRAGMENT): FXC D3DCompile error (Unspecified error (0x80004005)): C:\Rust\bevy\Shader@0x00000212E3942750(343,32-43): warning X3570: gradient instruction used in a loop with varying iteration, attempting to unroll the loop
C:\Rust\bevy\Shader@0x00000212E3942750(326,5-15): error X3511: unable to unroll loop, loop does not appear to terminate in a timely manner (561 iterations) or unrolled loop is too large, use the [unroll(n)] attribute to force an exact higher number

2025-02-01T13:36:43.621873Z ERROR wgpu::backend::wgpu_core: Please report it to https://github.com/gfx-rs/wgpu
2025-02-01T13:36:43.621948Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default
thread 'Async Compute Task Pool (3)' panicked at C:\Users\jojo_\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-23.0.1\src\backend\wgpu_core.rs:1102:18:
wgpu error: Validation Error

Caused by:
  In Device::create_render_pipeline, label = 'render_sky_pipeline_4'
    Internal error in ShaderStages(FRAGMENT) shader: FXC D3DCompile error (Unspecified error (0x80004005)): C:\Rust\bevy\Shader@0x00000212E3942750(343,32-43): warning X3570: gradient instruction used in a loop with varying iteration, attempting to unroll the loop
C:\Rust\bevy\Shader@0x00000212E3942750(326,5-15): error X3511: unable to unroll loop, loop does not appear to terminate in a timely manner (561 iterations) or unrolled loop is too large, use the [unroll(n)] attribute to force an exact higher number

Additional information

  • Using Vulkan as backend it works perfectly.
  • Atmospheric_fog example runs without issues using dx12.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behaviorC-Machine-SpecificThis bug is isolated to specific hardware or driver configurationsO-DX12Specific to the DX12 render APIS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions