bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.34k stars 3.59k forks source link

panic in `bevy_render::renderer::render_system` when running `/examples/3d/*` #16445

Open smokracek opened 2 days ago

smokracek commented 2 days ago

Bevy version

v0.14.2

[Optional] Relevant system information

What you did

Running a copy-paste of bevy/examples/3d/lighting.rs It builds fine, but this is the output of cargo run. I've already checked I'm on Bevy 0.14.2 and run cargo clean && cargo update

What went wrong

$ RUST_BACKTRACE=1 zsh -c 'cargo run'
    Finished `dev` profile [optimized + debuginfo] target(s) in 0.12s
     Running `target/debug/alienlines`
2024-11-20T10:10:58.115461Z  INFO bevy_diagnostic::system_information_diagnostics_plugin::internal: SystemInfo { os: "Linux 24.04 Ubuntu", kernel: "5.15.167.4-microsoft-standard-WSL2", cpu: "12th Gen Intel(R) Core(TM) i7-12700K", core_count: "10", memory: "15.5 GiB" }
2024-11-20T10:10:58.117187Z  WARN winit::platform_impl::linux::x11::xdisplay: error setting XSETTINGS; Xft options won't reload automatically
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen
2024-11-20T10:10:58.298586Z  INFO bevy_render::renderer: AdapterInfo { name: "D3D12 (NVIDIA GeForce RTX 4060 Ti)", vendor: 0, device: 0, device_type: Other, driver: "OpenGL", driver_info: "4.6 (Compatibility Profile) Mesa 24.0.9-0ubuntu0.2", backend: Gl }
ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1342:(snd_func_refer) error evaluating name
ALSA lib conf.c:5204:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5727:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2721:(snd_pcm_open_noupdate) Unknown PCM default
2024-11-20T10:10:58.334268Z  WARN bevy_audio::audio_output: No audio device found.
2024-11-20T10:10:58.366440Z  WARN bevy_pbr::ssao: ScreenSpaceAmbientOcclusionPlugin not loaded. GPU lacks support: TextureFormat::R16Float does not support TextureUsages::STORAGE_BINDING.
2024-11-20T10:10:58.367239Z  INFO bevy_winit::system: Creating new window "App" (Entity { index: 0, generation: 1 })
2024-11-20T10:10:58.367405Z  WARN winit::platform_impl::linux::x11::util::randr: XRandR reported that the display's 0mm in size, which is certifiably insane
2024-11-20T10:10:58.367457Z  INFO winit::platform_impl::linux::x11::window: Guessed window scale factor: 1
2024-11-20T10:10:58.368579Z ERROR bevy_asset::server: Path not found: /home/smokracek/dev/alienlines/assets/branding/bevy_logo_light.png
2024-11-20T10:10:58.499814Z ERROR wgpu_hal::gles: GLES: [ShaderCompiler/Error] ID 1 : 0:3(12): error: extension `GL_EXT_texture_shadow_lod' unsupported in fragment shader    
2024-11-20T10:10:58.499850Z ERROR wgpu_hal::gles::device:       Shader compilation failed: 0:3(12): error: extension `GL_EXT_texture_shadow_lod' unsupported in fragment shader

2024-11-20T10:10:58.500114Z ERROR wgpu_core::device::global: Device::create_render_pipeline error: Internal error in ShaderStages(FRAGMENT) shader: 0:3(12): error: extension `GL_EXT_texture_shadow_lod' unsupported in fragment shader

2024-11-20T10:10:58.500127Z ERROR wgpu::backend::wgpu_core: Shader translation error for stage ShaderStages(FRAGMENT): 0:3(12): error: extension `GL_EXT_texture_shadow_lod' unsupported in fragment shader

2024-11-20T10:10:58.500131Z ERROR wgpu::backend::wgpu_core: Please report it to https://github.com/gfx-rs/wgpu    
2024-11-20T10:10:58.500143Z ERROR wgpu::backend::wgpu_core: Handling wgpu errors as fatal by default    
thread 'Async Compute Task Pool (0)' panicked at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:2996:5:
wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
      note: label = `pbr_opaque_mesh_pipeline`
    Internal error in ShaderStages(FRAGMENT) shader: 0:3(12): error: extension `GL_EXT_texture_shadow_lod' unsupported in fragment shader

stack backtrace:
   0: rust_begin_unwind
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:662:5
   1: core::panicking::panic_fmt
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panicking.rs:74:14
   2: wgpu::backend::wgpu_core::default_error_handler
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:2996:5
   3: core::ops::function::Fn::call
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ops/function.rs:79:5
   4: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/alloc/src/boxed.rs:2245:9
   5: wgpu::backend::wgpu_core::ErrorSinkRaw::handle_error
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:2982:17
   6: wgpu::backend::wgpu_core::ContextWgpuCore::handle_error
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:293:9
   7: <wgpu::backend::wgpu_core::ContextWgpuCore as wgpu::context::Context>::device_create_render_pipeline
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/backend/wgpu_core.rs:1182:13
   8: <T as wgpu::context::DynContext>::device_create_render_pipeline
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/context.rs:2266:13
   9: wgpu::Device::create_render_pipeline
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wgpu-0.20.1/src/lib.rs:2692:26
  10: bevy_render::renderer::render_device::RenderDevice::create_render_pipeline
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.14.2/src/renderer/render_device.rs:131:36
  11: bevy_render::render_resource::pipeline_cache::PipelineCache::start_create_render_pipeline::{{closure}}
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.14.2/src/render_resource/pipeline_cache.rs:773:21
  12: async_executor::Executor::spawn_inner::{{closure}}
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-executor-1.13.1/src/lib.rs:250:20
  13: async_task::raw::RawTask<F,T,S,M>::run::{{closure}}
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-task-4.7.1/src/raw.rs:550:21
  14: core::ops::function::FnOnce::call_once
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ops/function.rs:250:5
  15: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panic/unwind_safe.rs:272:9
  16: std::panicking::try::do_call
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:554:40
  17: std::panicking::try
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:518:19
  18: std::panic::catch_unwind
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panic.rs:345:14
  19: async_task::raw::RawTask<F,T,S,M>::run
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-task-4.7.1/src/raw.rs:549:23
  20: async_task::runnable::Runnable<M>::run
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-task-4.7.1/src/runnable.rs:781:18
  21: async_executor::State::run::{{closure}}::{{closure}}
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-executor-1.13.1/src/lib.rs:741:21
  22: <futures_lite::future::Or<F1,F2> as core::future::future::Future>::poll
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-lite-2.5.0/src/future.rs:457:33
  23: async_executor::State::run::{{closure}}
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-executor-1.13.1/src/lib.rs:748:32
  24: async_executor::Executor::run::{{closure}}
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-executor-1.13.1/src/lib.rs:344:34
  25: futures_lite::future::block_on::{{closure}}
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-lite-2.5.0/src/future.rs:99:19
  26: std::thread::local::LocalKey<T>::try_with
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/thread/local.rs:283:12
  27: std::thread::local::LocalKey<T>::with
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/thread/local.rs:260:9
  28: futures_lite::future::block_on
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/futures-lite-2.5.0/src/future.rs:78:11
  29: bevy_tasks::task_pool::TaskPool::new_internal::{{closure}}::{{closure}}::{{closure}}::{{closure}}
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_tasks-0.14.2/src/task_pool.rs:176:37
  30: std::panicking::try::do_call
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:554:40
  31: std::panicking::try
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:518:19
  32: std::panic::catch_unwind
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panic.rs:345:14
  33: bevy_tasks::task_pool::TaskPool::new_internal::{{closure}}::{{closure}}::{{closure}}
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_tasks-0.14.2/src/task_pool.rs:170:43
  34: std::thread::local::LocalKey<T>::try_with
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/thread/local.rs:283:12
  35: std::thread::local::LocalKey<T>::with
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/thread/local.rs:260:9
  36: bevy_tasks::task_pool::TaskPool::new_internal::{{closure}}::{{closure}}
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_tasks-0.14.2/src/task_pool.rs:163:50
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Encountered a panic in system `bevy_render::render_resource::pipeline_cache::PipelineCache::process_pipeline_queue_system`!
thread '<unnamed>' panicked at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.14.2/src/render_resource/pipeline_cache.rs:553:28:
index out of bounds: the len is 0 but the index is 1
stack backtrace:
   0: rust_begin_unwind
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/std/src/panicking.rs:662:5
   1: core::panicking::panic_fmt
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panicking.rs:74:14
   2: core::panicking::panic_bounds_check
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/panicking.rs:276:5
   3: <usize as core::slice::index::SliceIndex<[T]>>::index
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/slice/index.rs:302:10
   4: core::slice::index::<impl core::ops::index::Index<I> for [T]>::index
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/slice/index.rs:16:9
   5: <alloc::vec::Vec<T,A> as core::ops::index::Index<I>>::index
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/alloc/src/vec/mod.rs:2920:9
   6: bevy_render::render_resource::pipeline_cache::PipelineCache::get_render_pipeline
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.14.2/src/render_resource/pipeline_cache.rs:553:28
   7: <bevy_render::render_phase::SetItemPipeline as bevy_render::render_phase::draw::RenderCommand<P>>::render
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.14.2/src/render_phase/mod.rs:1079:14
   8: <(C0,C1,C2,C3) as bevy_render::render_phase::draw::RenderCommand<P>>::render
   9: <bevy_render::render_phase::draw::RenderCommandState<P,C> as bevy_render::render_phase::draw::Draw<P>>::draw
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.14.2/src/render_phase/draw.rs:298:9
  10: bevy_render::render_phase::SortedRenderPhase<I>::render_range
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.14.2/src/render_phase/mod.rs:801:17
  11: bevy_render::render_phase::SortedRenderPhase<I>::render
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.14.2/src/render_phase/mod.rs:773:9
  12: <bevy_ui::render::render_pass::UiPassNode as bevy_render::render_graph::node::Node>::run
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ui-0.14.2/src/render/render_pass.rs:83:27
  13: bevy_render::renderer::graph_runner::RenderGraphRunner::run_graph
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.14.2/src/renderer/graph_runner.rs:226:21
  14: bevy_render::renderer::graph_runner::RenderGraphRunner::run_graph
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.14.2/src/renderer/graph_runner.rs:233:21
  15: bevy_render::renderer::graph_runner::RenderGraphRunner::run_graph
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.14.2/src/renderer/graph_runner.rs:233:21
  16: bevy_render::renderer::graph_runner::RenderGraphRunner::run
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.14.2/src/renderer/graph_runner.rs:81:9
  17: bevy_render::renderer::render_system
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_render-0.14.2/src/renderer/mod.rs:40:15
  18: core::ops::function::FnMut::call_mut
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ops/function.rs:166:5
  19: core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut
             at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/library/core/src/ops/function.rs:294:13
  20: <Func as bevy_ecs::system::exclusive_function_system::ExclusiveSystemParamFunction<fn(F0) .> Out>>::run::call_inner
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.14.2/src/system/exclusive_function_system.rs:218:21
  21: <Func as bevy_ecs::system::exclusive_function_system::ExclusiveSystemParamFunction<fn(F0) .> Out>>::run
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.14.2/src/system/exclusive_function_system.rs:221:17
  22: <bevy_ecs::system::exclusive_function_system::ExclusiveFunctionSystem<Marker,F> as bevy_ecs::system::system::System>::run::{{closure}}
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.14.2/src/system/exclusive_function_system.rs:111:23
  23: bevy_ecs::world::World::last_change_tick_scope
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.14.2/src/world/mod.rs:2215:9
  24: <bevy_ecs::system::exclusive_function_system::ExclusiveFunctionSystem<Marker,F> as bevy_ecs::system::system::System>::run
             at /home/smokracek/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bevy_ecs-0.14.2/src/system/exclusive_function_system.rs:103:9
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Encountered a panic in system `bevy_render::renderer::render_system`!

Additional information

Unfortunately I'm not too experienced with graphics programming, so I hope I'm not missing anything simple here. Many of the 2D examples have run perfectly on WSL, but so far all the 3D ones fail like this.

All the examples, including the 3D ones, run fine in the browser.

BenjaminBrienen commented 2 days ago

Can you reproduce this on 0.15-rc.3 or main?

atlv24 commented 1 day ago

You need to install/update nvidia drivers, its running in Gl compatibility mode but that has insufficient features for our renderer (missing GL_EXT_texture_shadow_lod).