diff --git a/src/ComputeSharp.Graphics/Commands/CommandList.cs b/src/ComputeSharp.Graphics/Commands/CommandList.cs index 13bc89bc..3b30eca0 100644 --- a/src/ComputeSharp.Graphics/Commands/CommandList.cs +++ b/src/ComputeSharp.Graphics/Commands/CommandList.cs @@ -75,7 +75,7 @@ namespace ComputeSharp.Graphics.Commands [MethodImpl(MethodImplOptions.AggressiveInlining)] public readonly ID3D12CommandList** GetD3D12CommandListAddressOf() { - return this.d3D12GraphicsCommandList.Upcast().GetAddressOf(); + return (ID3D12CommandList**)this.d3D12GraphicsCommandList.GetAddressOf(); } /// diff --git a/src/ComputeSharp.Graphics/Extensions/ComPtrExtensions.cs b/src/ComputeSharp.Graphics/Extensions/ComPtrExtensions.cs index c21a29bb..7388fdb8 100644 --- a/src/ComputeSharp.Graphics/Extensions/ComPtrExtensions.cs +++ b/src/ComputeSharp.Graphics/Extensions/ComPtrExtensions.cs @@ -7,7 +7,7 @@ namespace ComputeSharp.Core.Extensions /// /// Helper methods for working with the type. /// - public static class ComPtrExtensions + internal static class ComPtrExtensions { /// /// Reinterprets the current instance as one of type . @@ -59,25 +59,5 @@ namespace ComputeSharp.Core.Extensions return copy; } - - /// - /// Upcasts the current instance as a base type. - /// - /// The type of the current instance. - /// The type to cast the input instance to. - /// The input instance to upcast. - /// A instance of type . - /// - /// This method is meant to be used in a chained expression and it does not increment the reference - /// count for the input pointer. Do not expose the return value of this extension to consumers. - /// - [Pure] - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe ref readonly ComPtr Upcast(this in ComPtr ptr) - where T : unmanaged - where U : unmanaged - { - return ref Unsafe.As, ComPtr>(ref Unsafe.AsRef(in ptr)); - } } } diff --git a/src/ComputeSharp.Shaders/Translation/ShaderCompiler.cs b/src/ComputeSharp.Shaders/Translation/ShaderCompiler.cs index dedc20a0..321e4548 100644 --- a/src/ComputeSharp.Shaders/Translation/ShaderCompiler.cs +++ b/src/ComputeSharp.Shaders/Translation/ShaderCompiler.cs @@ -81,7 +81,7 @@ namespace ComputeSharp.Shaders.Translation fixed (char* optimization = "-O3") { DxcCompiler.Get()->Compile( - dxcBlobEncoding.Upcast().Get(), + (IDxcBlob*)dxcBlobEncoding.Get(), (ushort*)shaderName, (ushort*)entryPoint, (ushort*)shaderProfile,