MSAA with 8 samples crashes when using vulkan on windows 10
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 161
Description
## Bevy version
0.6
## Operating system & version
Edition Windows 10 Pro
Version 21H2
Installed on 2/27/2021
OS build 19044.1526
Experience Windows Feature Experience Pack 120.2212.4170.0
## What you did
```
let mut app = App::new();
app.insert_resource(Msaa { samples: 8 })
.insert_resource(engine)
.insert_resource(action_sender)
.insert_resource(contract)
.add_plugins(DefaultPlugins)
.add_plugin(ShapePlugin)
.add_startup_system(setup) // initial game logic
.add_system(update_position); // game logic
```
## What you expected to happen
the program runs
## What actually happened
It crashed. I'm sorry I don't have more info! I can't really share my code, but I'm not doing anything fancy with bevy. It looks like it is using vulkan on windows though, when I would have expected it to use directx. I figured I would share the crash log at least in case it is relevant.
**Setting samples to 4 solves the problem.** Why? I'm not sure. I'm also still not sure why its using vulkan. Is that the default?
## Additional information
```
2022-02-16T21:58:21.866581Z INFO bevy_render::renderer: AdapterInfo { name: "NVIDIA GeForce RTX 3090", vendor: 4318, device: 8708, device_type: DiscreteGpu, backend: Vulkan }
2022-02-16T21:58:22.062405Z ERROR wgpu::backend::direct: Handling wgpu errors as fatal by default
The application panicked (crashed).
Message: wgpu error: Validation Error
Caused by:
In a RenderPass
note: encoder = ``
In a pass parameter
note: command buffer = ``
attachment's sample count 8 is invalid
Location: C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\wgpu-0.12.0\src\backend\direct.rs:2273
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⋮ 12 frames hidden ⋮
13: wgpu::backend::direct::default_error_handler
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\wgpu-0.12.0\src\backend\direct.rs:2273
14: core::ops::function::Fn::call),tuple$ > >
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\core\src\ops\function.rs:70
15: alloc::boxed::impl$46::call >,dyn$ > > >,alloc::alloc::Global>
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\alloc\src\boxed.rs:1708
16: wgpu::backend::direct::ErrorSinkRaw::handle_error
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\wgpu-0.12.0\src\backend\direct.rs:2259
17: wgpu::backend::direct::Context::handle_error
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\wgpu-0.12.0\src\backend\direct.rs:194
18: wgpu::backend::direct::impl$3::command_encoder_end_render_pass
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\wgpu-0.12.0\src\backend\direct.rs:2010
19: wgpu::impl$51::drop
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\wgpu-0.12.0\src\lib.rs:2890
20: core::ptr::drop_in_place
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\core\src\ptr\mod.rs:188
21: bevy_core_pipeline::clear_pass::impl$1::run
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_core_pipeline-0.6.0\src\clear_pass.rs:79
22: bevy_render::renderer::graph_runner::RenderGraphRunner::run_graph
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_render-0.6.1\src\renderer\graph_runner.rs:178
23: bevy_render::renderer::graph_runner::RenderGraphRunner::run_graph
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_render-0.6.1\src\renderer\graph_runner.rs:187
24: bevy_render::renderer::graph_runner::RenderGraphRunner::run
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_render-0.6.1\src\renderer\graph_runner.rs:60
25: bevy_render::renderer::render_system
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_render-0.6.1\src\renderer\mod.rs:25
26: core::ops::function::FnMut::call_mut),tuple$ > >
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\core\src\ops\function.rs:150
27: bevy_ecs::system::exclusive_system::impl$0::run)>
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_ecs-0.6.1\src\system\exclusive_system.rs:38
28: bevy_ecs::schedule::stage::impl$1::run
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_ecs-0.6.1\src\schedule\stage.rs:892
29: bevy_render::impl$2::build::closure$1
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_render-0.6.1\src\lib.rs:268
30: alloc::boxed::impl$46::call,ref_mut$ >,dyn$,ref_mut$ >,assoc$ > > >,alloc::alloc::Global>
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\alloc\src\boxed.rs:1708
31: bevy_app::app::App::update
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_app-0.6.0\src\app.rs:114
32: bevy_winit::winit_runner_with::closure$1
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_winit-0.6.1\src\lib.rs:504
33: winit::platform_impl::platform::event_loop::impl$2::run_return::closure$0,bevy_winit::winit_runner_with::closure$1>
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.26.1\src\platform_impl\windows\event_loop.rs:206
34: alloc::boxed::impl$45::call_mut > >,ref_mut$ > >,dyn$ > >,ref_mut$ >
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\alloc\src\boxed.rs:1701
35: winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure$0 >
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.26.1\src\platform_impl\windows\event_loop\runner.rs:245
36: core::panic::unwind_safe::impl$23::call_once,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure$0>
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\core\src\panic\unwind_safe.rs:271
37: std::panicking::try::do_call,tuple$<> >
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\std\src\panicking.rs:406
38: winit::platform_impl::platform::window_state::impl$52::bitand_assign
at :
39: std::panicking::try,core::panic::unwind_safe::AssertUnwindSafe >
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\std\src\panicking.rs:370
40: std::panic::catch_unwind,tuple$<> >
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\std\src\panic.rs:133
41: winit::platform_impl::platform::event_loop::runner::EventLoopRunner >::catch_unwind,tuple$<>,winit::platform_impl::platform::event_loop::runner::impl$3::call_event_handler::closure$0>
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.26.1\src\platform_impl\windows\event_loop\runner.rs:152
42: winit::platform_impl::platform::event_loop::runner::EventLoopRunner >::call_event_handler >
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.26.1\src\platform_impl\windows\event_loop\runner.rs:239
43: winit::platform_impl::platform::event_loop::runner::EventLoopRunner >::move_state_to >
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.26.1\src\platform_impl\windows\event_loop\runner.rs:341
44: winit::platform_impl::platform::event_loop::runner::EventLoopRunner >::main_events_cleared >
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.26.1\src\platform_impl\windows\event_loop\runner.rs:227
45: winit::platform_impl::platform::event_loop::flush_paint_messages >
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.26.1\src\platform_impl\windows\event_loop.rs:726
46: winit::platform_impl::platform::event_loop::public_window_callback_inner::closure$0 >
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.26.1\src\platform_impl\windows\event_loop.rs:941
47: core::ops::function::FnOnce::call_once >
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\core\src\ops\function.rs:227
48: core::panic::unwind_safe::impl$23::call_once
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\core\src\panic\unwind_safe.rs:271
49: std::panicking::try::do_call,isize>
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\std\src\panicking.rs:406
50: core::char::decode::impl$0::next > >
at :
51: std::panicking::try >
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\std\src\panicking.rs:370
52: std::panic::catch_unwind,isize>
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\std\src\panic.rs:133
53: winit::platform_impl::platform::event_loop::runner::EventLoopRunner >::catch_unwind,isize,winit::platform_impl::platform::event_loop::public_window_callback_inner::closure$0>
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.26.1\src\platform_impl\windows\event_loop\runner.rs:152
54: winit::platform_impl::platform::event_loop::public_window_callback_inner >
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.26.1\src\platform_impl\windows\event_loop.rs:2030
55: winit::platform_impl::platform::event_loop::public_window_callback >
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.26.1\src\platform_impl\windows\event_loop.rs:846
56: CallWindowProcW
at :
57: DispatchMessageW
at :
58: SendMessageTimeoutW
at :
59: KiUserCallbackDispatcher
at :
60: NtUserDispatchMessage
at :
61: DispatchMessageW
at :
62: winit::platform_impl::platform::event_loop::EventLoop >::run_return,bevy_winit::winit_runner_with::closure$1>
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.26.1\src\platform_impl\windows\event_loop.rs:221
63: winit::platform_impl::platform::event_loop::EventLoop >::run,bevy_winit::winit_runner_with::closure$1>
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.26.1\src\platform_impl\windows\event_loop.rs:191
64: winit::event_loop::EventLoop >::run,bevy_winit::winit_runner_with::closure$1>
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\winit-0.26.1\src\event_loop.rs:154
65: bevy_winit::run
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_winit-0.6.1\src\lib.rs:171
66: bevy_winit::winit_runner_with
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_winit-0.6.1\src\lib.rs:513
67: bevy_winit::winit_runner
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_winit-0.6.1\src\lib.rs:211
68: core::ops::function::Fn::call >
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\core\src\ops\function.rs:70
69: alloc::boxed::impl$46::call,dyn$,assoc$ > > >,alloc::alloc::Global>
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\alloc\src\boxed.rs:1708
70: bevy_app::app::App::run
at C:\Users\Ryan\.cargo\registry\src\github.com-1ecc6299db9ec823\bevy_app-0.6.0\src\app.rs:130
71: circle_game::main
at D:\Ryan\Programming\tp\platform\circle_game\src\main.rs:6
72: core::ops::function::FnOnce::call_once,eyre::Report>, 1, 18446744073709551615, Err> (*)(),tuple$<> >
at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b\library\core\src\ops\function.rs:227
⋮ 17 frames hidden ⋮
```
```
PS> $env:VK_SDK_PATH
C:\VulkanSDK\1.2.198.1
PS> $env:VULKAN_SDK
C:\VulkanSDK\1.2.198.1
```
Contributor guide
Assessment
This issue has not been assessed yet.