Short info header:
Running cargo run --bin quad --features dx11 produces:
AdapterInfo { name: "Microsoft Basic Render Driver", vendor: 5140, device: 140, device_type: DiscreteGpu }
AdapterInfo { name: "Microsoft Basic Render Driver", vendor: 5140, device: 140, device_type: VirtualGpu }
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: InitializationFailed', src\libcore\result.rs:1165:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: process didn't exit successfully: `C:\Users\PC User\Documents\gfx\target\
debug\quad.exe` (exit code: 101)
The host OS is installed from the Microsoft site (Windows 8.1 Single Language). The tool dxdiag relates Direct3D 11 is the current DirectX version. Before, this laptop had OpenGL 3+ driver, but changed to this OS and thus now only Direct3D 11 can be used to render.
Some softwares detect Direct3D 11 in the current OS and render with it, including Flash Player. I've seen this with a Stage3D library (Starling).
If it's an unrecognized pixel format, that's not the same as the whole backend being unrecognized :)
Thanks for filing!
Looks like I got same issue on Windows 10. DX12/Vulkan version works fine.
Running `C:\Users\shapo\StudioProjects\gfx\target\debug\quad.exe`
[2021-01-27T23:38:23Z INFO gfx_backend_dx11] DXGI version: Dxgi1_5
[2021-01-27T23:38:23Z WARN gfx_backend_dx11] Format Rgb32Sint can't check the features-2: 0x80004005
[2021-01-27T23:38:23Z WARN gfx_backend_dx11] Format Rgb32Sfloat can't check the features-2: 0x80004005
[2021-01-27T23:38:23Z WARN gfx_backend_dx11] Format D32SfloatS8Uint can't check the features-2: 0x80004005
[2021-01-27T23:38:23Z INFO gfx_backend_dx11] AdapterInfo {
name: "Radeon Pro 570",
vendor: 4098,
device: 26591,
device_type: DiscreteGpu,
}
[2021-01-27T23:38:23Z WARN gfx_backend_dx11] Format Rgb32Sint can't check the features-2: 0x80004005
[2021-01-27T23:38:23Z WARN gfx_backend_dx11] Format Rgb32Sfloat can't check the features-2: 0x80004005
[2021-01-27T23:38:23Z WARN gfx_backend_dx11] Format D32SfloatS8Uint can't check the features-2: 0x80004005
[2021-01-27T23:38:23Z INFO gfx_backend_dx11] AdapterInfo {
name: "Microsoft Basic Render Driver",
vendor: 5140,
device: 140,
device_type: VirtualGpu,
}
AdapterInfo { name: "Radeon Pro 570", vendor: 4098, device: 26591, device_type: DiscreteGpu }
AdapterInfo { name: "Microsoft Basic Render Driver", vendor: 5140, device: 140, device_type: VirtualGpu }
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: InitializationFailed', examples\quad/main.rs:235:18
stack backtrace:
0: 0x7ff7847b32ee - std::backtrace_rs::backtrace::dbghelp::trace
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\std\src\..\..\backtrace\src\backtrace\dbghelp.rs:108
1: 0x7ff7847b32ee - std::backtrace_rs::backtrace::trace_unsynchronized
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
2: 0x7ff7847b32ee - std::sys_common::backtrace::_print_fmt
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\std\src\sys_common\backtrace.rs:67
3: 0x7ff7847b32ee - std::sys_common::backtrace::_print::{{impl}}::fmt
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\std\src\sys_common\backtrace.rs:46
4: 0x7ff7847c95cb - core::fmt::write
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\core\src\fmt\mod.rs:1078
5: 0x7ff7847b0188 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\std\src\io\mod.rs:1518
6: 0x7ff7847b5ecd - std::sys_common::backtrace::_print
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\std\src\sys_common\backtrace.rs:49
7: 0x7ff7847b5ecd - std::sys_common::backtrace::print
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\std\src\sys_common\backtrace.rs:36
8: 0x7ff7847b5ecd - std::panicking::default_hook::{{closure}}
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\std\src\panicking.rs:208
9: 0x7ff7847b5aa8 - std::panicking::default_hook
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\std\src\panicking.rs:227
10: 0x7ff7847b683f - std::panicking::rust_panic_with_hook
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\std\src\panicking.rs:593
11: 0x7ff7847b6341 - std::panicking::begin_panic_handler::{{closure}}
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\std\src\panicking.rs:499
12: 0x7ff7847b3c2f - std::sys_common::backtrace::__rust_end_short_backtrace<closure-0,!>
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\std\src\sys_common\backtrace.rs:141
13: 0x7ff7847b6299 - std::panicking::begin_panic_handler
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\std\src\panicking.rs:495
14: 0x7ff7847c7390 - core::panicking::panic_fmt
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\core\src\panicking.rs:92
15: 0x7ff7847c71b3 - core::option::expect_none_failed
at /rustc/e1884a8e3c3e813aada8254edfa120e85bf5ffca\/library\core\src\option.rs:1268
16: 0x7ff7841a7ea5 - core::result::Result<gfx_hal::adapter::Gpu<gfx_backend_dx11::Backend>, gfx_hal::device::CreationError>::unwrap<gfx_hal::adapter::Gpu<gfx_backend_dx11::Backend>,gfx_hal::device::CreationError>
at C:\Users\shapo\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\result.rs:973
17: 0x7ff7841caade - quad::Renderer<gfx_backend_dx11::Backend>::new<gfx_backend_dx11::Backend>
at C:\Users\shapo\StudioProjects\gfx\examples\quad\main.rs:232
18: 0x7ff78418871c - quad::run
@Gordon-F could you run it from Visual Studio and see if anything interesting shows up in the output?
@kvark
cube.exe' (Win32): Loaded 'C:\Windows\System32\amdihk64.dll'. Module was built without symbols.
D3D11CreateDevice: Flags (0x2) were specified which require the D3D11 SDK Layers for Windows 10, but they are not present on the system.
These flags must be removed, or the Windows 10 SDK must be installed.
Flags include: D3D11_CREATE_DEVICE_DEBUG
Should we try to recreate PhysicalDevice without D3D11_CREATE_DEVICE_DEBUG or just log error?
Seems trivial. Want to make a PR? can still sneak it for gfx-0.7 :)
we should just avoid setting D3D11_CREATE_DEVICE_DEBUG based on a condition, where we need to detect the Win8. Not sure how to detect it though! any ideas? I don't think trying to create it and handling failure is a good way to go :/
Alternatively, we can find installed Windows SDK info based on Windows Registry. But I think it's too complicated in this case. Maybe it's fine just to log a warning message?
#[cfg(debug_assertions)]
log::warn!("Failed to create debug device. Maybe Windows 10 SDK is not installed?");
What if we do libloading::load("D3D11_1SDKLayers.dll") and check the result?
I've got the same error, even if sdk layers are present 馃槥.
let has_debug_layers = libloading::Library::new("D3D11_2SDKLayers.dll").is_ok()
|| libloading::Library::new("D3D11_1SDKLayers.dll").is_ok()
|| libloading::Library::new("D3D11SDKLayers.dll").is_ok();
hmm weird. The docs are fairly clear about this:
To use this flag, you must have D3D11*SDKLayers.dll installed; otherwise, device creation fails. To get D3D11_1SDKLayers.dll, install the SDK for Windows 8.
Ok, let's fall back and try to re-create the device without the debug flag (and issue a warn!) if the first attempt fails. I's ok because we are only talking about debug builds.
Looks like Windows 10 specific behavior.
For Windows 10, to create a device that supports the debug layer, enable the "Graphics Tools" optional feature. Go to the Settings panel, under System, Apps & features, Manage optional Features, Add a feature, and then look for "Graphics Tools".
I have D3D11*SDKLayers.dll installed, but I don't have enabled "Graphics Tools".
https://docs.microsoft.com/en-us/windows/win32/direct3d11/overviews-direct3d-11-devices-layers#debug-layer