From 1faa44cef1f7f800b8c471f1acdf167faad7cef5 Mon Sep 17 00:00:00 2001 From: Guus Waals <_@guusw.nl> Date: Mon, 27 May 2024 18:46:23 +0800 Subject: [PATCH] Fix incorrect usage of &str.to_ptr() --- wgpu-hal/src/dx12/shader_compilation.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wgpu-hal/src/dx12/shader_compilation.rs b/wgpu-hal/src/dx12/shader_compilation.rs index 288fc247457..16cf6da1140 100644 --- a/wgpu-hal/src/dx12/shader_compilation.rs +++ b/wgpu-hal/src/dx12/shader_compilation.rs @@ -32,6 +32,9 @@ pub(super) fn compile_fxc( { compile_flags |= d3dcompiler::D3DCOMPILE_DEBUG | d3dcompiler::D3DCOMPILE_SKIP_OPTIMIZATION; } + + let source_name = std::ffi::CString::new(source_name).unwrap(); + let mut error = d3d12::Blob::null(); let hr = unsafe { profiling::scope!("d3dcompiler::D3DCompile");