Hi! I'm the co-creator of G3N, a 3D game engine for Go. I'm very interested in building a cross-platform game engine for Rust on top of wgpu-rs. I think the WebGPU API is the right level of abstraction to build upon, specially with hopes of targeting browsers later on.
I started diving into the examples and noticed the following failures (on Windows 10):
| Example | GL | DX11 | DX12 | Vulkan |
|---|---|---|---|---|
| capture | :x: Instance::new() | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| cube | :x: Bgra8Unorm | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| hello-triangle | :x: int overflow | :x: OutOfPoolMemory | :heavy_check_mark: | :heavy_check_mark: |
| hello-compute | :x: Instance::new() | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| mipmap | :x: Bgra8Unorm | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| msaa-line | :x: Bgra8Unorm | :x: sample_count | :heavy_check_mark: :heavy_exclamation_mark: no visual change? | :heavy_check_mark: crashes when samples=32 |
| shadow | :x: Bgra8Unorm | :heavy_check_mark: has artifacts | :heavy_check_mark: | :heavy_check_mark: |
Each failure has a link to the associated log.
Apparently there has been some improvement since https://github.com/gfx-rs/wgpu-rs/issues/27.
Hope this helps!
Edit: updated the table!
Hi @danaugrs !
That's a very nice table, thank you for testing this! We are aware of some of the issues:
The failure of hello-compute on DX11 has been recently mentioned as well but not investigated.
Everything else is unexpected. The cube/mipmap/shadow examples should work on DX11 and DX12, and I recall testing them on the backends. Will take another look ASAP to see why they regressed.
Hi!
Thanks for the nice table, looking really good! As Kvark told, I also stumbled on the DX11 failure for the compute example. I will create an issue for this and look into that one this week.
For DX12:
@danaugrs DX12 updates:
cargo update -p gfx-backend-dx12 away for you ;)With this, DX12 appears to be all good for me. Please double check on your side. I'll do some more testing of the shadow example as well. Will also fix Metal to run the msaa example.
@kvark You're right - I double checked and shadow on DX12 is actually working for me (even before the update).
After the update mipmap now works on DX12!
However msaa-line fails with what seems like the same error as before:
C:\projects\wgpu-rs>cargo run --example msaa-line --features dx12
Compiling wgpu v0.2.2 (C:\projects\wgpu-rs)
warning: constant item is never used: `OPENGL_TO_WGPU_MATRIX`
--> examples\msaa-line\..\framework.rs:4:1
|
4 | / pub const OPENGL_TO_WGPU_MATRIX: cgmath::Matrix4<f32> = cgmath::Matrix4::new(
5 | | 1.0, 0.0, 0.0, 0.0,
6 | | 0.0, -1.0, 0.0, 0.0,
7 | | 0.0, 0.0, 0.5, 0.0,
8 | | 0.0, 0.0, 0.5, 1.0,
9 | | );
| |__^
|
= note: #[warn(dead_code)] on by default
Finished dev [unoptimized + debuginfo] target(s) in 2.29s
Running `target\debug\examples\msaa-line.exe`
Press left/right arrow keys to change sample_count.
sample_count: 2
thread 'main' panicked at 'Attachment sample_count must be supported by physical device limits', C:\Users\danau\.cargo\git\checkouts\wgpu-53e70f8674b08dd4\5224bb8\wgpu-native\src\command\mod.rs:206:5
stack backtrace:
0: std::sys::windows::backtrace::set_frames
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\sys\windows\backtrace\mod.rs:95
1: std::sys::windows::backtrace::unwind_backtrace
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\sys\windows\backtrace\mod.rs:82
2: std::sys_common::backtrace::_print
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\sys_common\backtrace.rs:71
3: std::sys_common::backtrace::print
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\sys_common\backtrace.rs:59
4: std::panicking::default_hook::{{closure}}
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panicking.rs:197
5: std::panicking::default_hook
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panicking.rs:211
6: std::panicking::rust_panic_with_hook
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panicking.rs:474
7: std::panicking::begin_panic<str*>
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\src\libstd\panicking.rs:408
8: wgpu_native::command::command_encoder_begin_render_pass
at C:\Users\danau\.cargo\git\checkouts\wgpu-53e70f8674b08dd4\5224bb8\wgpu-native\src\command\mod.rs:206
9: wgpu_native::command::wgpu_command_encoder_begin_render_pass
at C:\Users\danau\.cargo\git\checkouts\wgpu-53e70f8674b08dd4\5224bb8\wgpu-native\src\command\mod.rs:574
10: wgpu::CommandEncoder::begin_render_pass
at .\src\lib.rs:1024
11: msaa_line::{{impl}}::render
at .\examples\msaa-line\main.rs:210
12: msaa_line::framework::run<msaa_line::Example>
at .\examples\framework.rs:159
13: msaa_line::main
at .\examples\msaa-line\main.rs:224
14: std::rt::lang_start::{{closure}}<()>
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\src\libstd\rt.rs:64
15: std::rt::lang_start_internal::{{closure}}
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\rt.rs:49
16: std::panicking::try::do_call<closure,i32>
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panicking.rs:293
17: panic_unwind::__rust_maybe_catch_panic
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libpanic_unwind\lib.rs:85
18: std::panicking::try
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panicking.rs:272
19: std::panic::catch_unwind
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panic.rs:394
20: std::rt::lang_start_internal
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\rt.rs:48
21: std::rt::lang_start<()>
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\src\libstd\rt.rs:64
22: main
23: invoke_main
at d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
24: __scrt_common_main_seh
at d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
25: BaseThreadInitThunk
26: RtlUserThreadStart
thread 'main' panicked at 'No rendering work has been submitted for the presented frame (image 0)', C:\Users\danau\.cargo\git\checkouts\wgpu-53e70f8674b08dd4\5224bb8\wgpu-native\src\swap_chain.rs:231:5
stack backtrace:
0: 0x7ff6f582f99d - std::sys::windows::backtrace::set_frames
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\sys\windows\backtrace\mod.rs:95
1: 0x7ff6f582f99d - std::sys::windows::backtrace::unwind_backtrace
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\sys\windows\backtrace\mod.rs:82
2: 0x7ff6f582f99d - std::sys_common::backtrace::_print
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\sys_common\backtrace.rs:71
3: 0x7ff6f5832b8d - std::sys_common::backtrace::print
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\sys_common\backtrace.rs:59
4: 0x7ff6f5832b8d - std::panicking::default_hook::{{closure}}
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panicking.rs:197
5: 0x7ff6f583288a - std::panicking::default_hook
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panicking.rs:211
6: 0x7ff6f583341f - std::panicking::rust_panic_with_hook
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panicking.rs:474
7: 0x7ff6f5832f53 - std::panicking::continue_panic_fmt
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panicking.rs:381
8: 0x7ff6f5832ea1 - std::panicking::begin_panic_fmt
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panicking.rs:336
9: 0x7ff6f5590666 - wgpu_native::swap_chain::wgpu_swap_chain_present
at C:\Users\danau\.cargo\git\checkouts\wgpu-53e70f8674b08dd4\5224bb8\wgpu-native\src\swap_chain.rs:231
10: 0x7ff6f54a7ba7 - wgpu::{{impl}}::drop
at C:\projects\wgpu-rs\src\lib.rs:1272
11: 0x7ff6f5242ade - core::ptr::real_drop_in_place<wgpu::SwapChainOutput>
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\src\libcore\ptr.rs:195
12: 0x7ff6f524caec - msaa_line::framework::run<msaa_line::Example>
at C:\projects\wgpu-rs\examples\framework.rs:161
13: 0x7ffdfe59102f - <unknown>
14: 0x7ffdfe59359e - is_exception_typeof
15: 0x7ffdfe59bca3 - _C_specific_handler
16: 0x7ffdfe592fe8 - is_exception_typeof
17: 0x7ffdfe59c16c - _CxxFrameHandler3
18: 0x7ffe0f82f85c - _chkstk
19: 0x7ffe0f79e23f - RtlUnwindEx
20: 0x7ffdfe59bfe4 - _C_specific_handler
21: 0x7ffdfe5926e3 - is_exception_typeof
22: 0x7ffdfe5929da - is_exception_typeof
23: 0x7ffdfe5930ee - is_exception_typeof
24: 0x7ffdfe59c16c - _CxxFrameHandler3
25: 0x7ffe0f82f7dc - _chkstk
26: 0x7ffe0f79d855 - RtlWalkFrameChain
27: 0x7ffe0f79be99 - RtlRaiseException
28: 0x7ffe0c93a387 - RaiseException
29: 0x7ffdfe59486c - CxxThrowException
30: 0x7ff6f583da87 - panic_unwind::imp::panic
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libpanic_unwind\seh.rs:281
31: 0x7ff6f583da87 - panic_unwind::__rust_start_panic
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libpanic_unwind\lib.rs:101
32: 0x7ff6f58335f7 - std::panicking::rust_panic
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panicking.rs:523
33: 0x7ff6f58334cd - std::panicking::rust_panic_with_hook
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panicking.rs:494
34: 0x7ff6f575cd00 - std::panicking::begin_panic<str*>
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\src\libstd\panicking.rs:408
35: 0x7ff6f5543d9b - wgpu_native::command::command_encoder_begin_render_pass
at C:\Users\danau\.cargo\git\checkouts\wgpu-53e70f8674b08dd4\5224bb8\wgpu-native\src\command\mod.rs:206
36: 0x7ff6f5548232 - wgpu_native::command::wgpu_command_encoder_begin_render_pass
at C:\Users\danau\.cargo\git\checkouts\wgpu-53e70f8674b08dd4\5224bb8\wgpu-native\src\command\mod.rs:574
37: 0x7ff6f54a767c - wgpu::CommandEncoder::begin_render_pass
at C:\projects\wgpu-rs\src\lib.rs:1024
38: 0x7ff6f524abea - msaa_line::{{impl}}::render
at C:\projects\wgpu-rs\examples\msaa-line\main.rs:210
39: 0x7ff6f524c98c - msaa_line::framework::run<msaa_line::Example>
at C:\projects\wgpu-rs\examples\framework.rs:159
40: 0x7ff6f524adb7 - msaa_line::main
at C:\projects\wgpu-rs\examples\msaa-line\main.rs:224
41: 0x7ff6f524489f - std::rt::lang_start::{{closure}}<()>
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\src\libstd\rt.rs:64
42: 0x7ff6f5832d96 - std::rt::lang_start_internal::{{closure}}
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\rt.rs:49
43: 0x7ff6f5832d96 - std::panicking::try::do_call<closure,i32>
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panicking.rs:293
44: 0x7ff6f583d9a1 - panic_unwind::__rust_maybe_catch_panic
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libpanic_unwind\lib.rs:85
45: 0x7ff6f5833751 - std::panicking::try
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panicking.rs:272
46: 0x7ff6f5833751 - std::panic::catch_unwind
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\panic.rs:394
47: 0x7ff6f5833751 - std::rt::lang_start_internal
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\/src\libstd\rt.rs:48
48: 0x7ff6f524487a - std::rt::lang_start<()>
at /rustc/a53f9df32fbb0b5f4382caaad8f1a46f36ea887c\src\libstd\rt.rs:64
49: 0x7ff6f524addf - main
50: 0x7ff6f59d67a3 - invoke_main
at d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
51: 0x7ff6f59d67a3 - __scrt_common_main_seh
at d:\agent\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
52: 0x7ffe0d144033 - BaseThreadInitThunk
53: 0x7ffe0f803690 - RtlUserThreadStart
thread panicked while panicking. aborting.
error: process didn't exit successfully: `target\debug\examples\msaa-line.exe` (exit code: 0xc000001d, STATUS_ILLEGAL_INSTRUCTION)
@danaugrs you appear to be running without this change - https://github.com/gfx-rs/wgpu-rs/commit/5522c912f7e2f4f33a1167fb0c8ee4549f066dcf
Also, fwiw, Metal backend will be able to run the msaa-line example as soon as https://github.com/gfx-rs/gfx/pull/2924 is landed and published.
@kvark ah yes - it starts up now. Thanks!
Would be nice if you could update the table, to reflect the latest changes.
Thanks!
Updated! 馃槃
With DX12 and Metal updates published, we get a;; the examples running on the 1-st tier backends:
The table can be updated to remove "crashes when samples!=4" note from DX12.
@kvark Great! I updated gfx-backend-dx12 to latest and now msaa-line(DX12) only crashes when >= 32 as expected. However, changing the sample_count doesn't seem to change anything visually for me (like it does in the vulkan backend). Am I missing something?
However, changing the sample_count doesn't seem to change anything visually for me (like it does in the vulkan backend).
That's interesting. Must be a bug, but a cursory look at our code shows that we are specifying the sample descriptor correctly. Needs to be investigated. Perhaps, you could file this to gfx-rs repo?
MSAA does work correctly on my Radeon Vega card.
Updated the table for gfx-backend-dx11-0.4.4, which has https://github.com/gfx-rs/gfx/pull/3118. DX11 is mostly good now :tada:
DX12 multisampling fix is coming in https://github.com/gfx-rs/gfx/pull/3343
As of right now (gfx-backend-dx11 v0.6.6 and gfx-backend-dx12 v0.6.9) all examples pass Vulkan, DX11, and DX12. GL is now entirely disabled. I think this issue can be closed until the GL backend is brought back online!
Most helpful comment
As of right now (gfx-backend-dx11 v0.6.6 and gfx-backend-dx12 v0.6.9) all examples pass Vulkan, DX11, and DX12. GL is now entirely disabled. I think this issue can be closed until the GL backend is brought back online!