diff --git a/src/ComputeSharp.SourceGenerators/Dxc/DxcShaderCompiler.cs b/src/ComputeSharp.SourceGenerators/Dxc/DxcShaderCompiler.cs index 875d1a7d..ca67c5bd 100644 --- a/src/ComputeSharp.SourceGenerators/Dxc/DxcShaderCompiler.cs +++ b/src/ComputeSharp.SourceGenerators/Dxc/DxcShaderCompiler.cs @@ -42,15 +42,23 @@ internal sealed unsafe class DxcShaderCompiler using ComPtr dxcCompiler = default; using ComPtr dxcUtils = default; - DirectX.DxcCreateInstance( - DirectX.CLSID_DxcCompiler, - IDxcCompiler3.IID_Guid, - out *(void**)dxcCompiler.GetAddressOf()).Assert(); + fixed (Guid* pDxcCompiler = &DirectX.CLSID_DxcCompiler) + fixed (Guid* pDxcCompiler3 = &IDxcCompiler3.IID_Guid) + { + DirectX.DxcCreateInstance( + pDxcCompiler, + pDxcCompiler3, + (void**)dxcCompiler.GetAddressOf()).Assert(); + } - DirectX.DxcCreateInstance( - DirectX.CLSID_DxcLibrary, - IDxcUtils.IID_Guid, - out *(void**)dxcUtils.GetAddressOf()).Assert(); + fixed (Guid* pDxcLibrary = &DirectX.CLSID_DxcLibrary) + fixed (Guid* pDxcUtils = &IDxcUtils.IID_Guid) + { + DirectX.DxcCreateInstance( + pDxcLibrary, + pDxcUtils, + (void**)dxcUtils.GetAddressOf()).Assert(); + } this.dxcCompiler3 = new ComPtr(dxcCompiler.Get()); this.dxcUtils = new ComPtr(dxcUtils.Get()); diff --git a/src/ComputeSharp.SourceGenerators/NativeMethods.json b/src/ComputeSharp.SourceGenerators/NativeMethods.json index f491f43c..b327dc15 100644 --- a/src/ComputeSharp.SourceGenerators/NativeMethods.json +++ b/src/ComputeSharp.SourceGenerators/NativeMethods.json @@ -6,5 +6,8 @@ "preserveSigMethods": [ "*" ] + }, + "friendlyOverloads": { + "enabled": false } } \ No newline at end of file