From daaf7da09a45b9e54e804e0eadb6fd9d47349192 Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Fri, 18 Oct 2024 19:44:26 +0200 Subject: [PATCH] print source in log --- wgpu-hal/src/dx12/shader_compilation.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/wgpu-hal/src/dx12/shader_compilation.rs b/wgpu-hal/src/dx12/shader_compilation.rs index e3d4d03c6..b95ccaa5a 100644 --- a/wgpu-hal/src/dx12/shader_compilation.rs +++ b/wgpu-hal/src/dx12/shader_compilation.rs @@ -1,6 +1,6 @@ use crate::auxil::dxgi::result::HResult; -use std::ffi::CStr; use std::path::PathBuf; +use std::{error::Error, ffi::CStr}; use windows::{ core::{Interface, PCSTR, PCWSTR}, Win32::Graphics::Direct3D::{Dxc, Fxc}, @@ -145,8 +145,9 @@ pub(super) fn get_dxc_container( Ok(dxc) => dxc, Err(e) => { log::warn!( - "Failed to load dxcompiler.dll. Defaulting to FXC instead: {}", - e + "Failed to load dxcompiler.dll. Defaulting to FXC instead: {}: {:?}", + e, + e.source() ); return Ok(None); } @@ -155,7 +156,11 @@ pub(super) fn get_dxc_container( let dxil = match DxcLib::new(dxil_path, "dxil.dll") { Ok(dxil) => dxil, Err(e) => { - log::warn!("Failed to load dxil.dll. Defaulting to FXC instead: {}", e); + log::warn!( + "Failed to load dxil.dll. Defaulting to FXC instead: {}: {:?}", + e, + e.source() + ); return Ok(None); } };