Remove ComPtr<T>.GetVoidAddressOf from D2D1 projects
このコミットが含まれているのは:
1 親
960ce21899
コミット
e89433da46
5ファイル変更
+7
-22
検索条件に一致するファイルはありません
@@ -24,7 +24,7 @@ internal static unsafe class ICanvasDeviceExtensions
|
||||
// Get the ICanvasResourceWrapperNative wrapper around the input device
|
||||
canvasDevice.QueryInterface(
|
||||
riid: Win32.__uuidof<ICanvasResourceWrapperNative>(),
|
||||
ppvObject: canvasDeviceResourceWrapperNative.GetVoidAddressOf()).Assert();
|
||||
ppvObject: (void**)canvasDeviceResourceWrapperNative.GetAddressOf()).Assert();
|
||||
|
||||
// Get the underlying ID2D1Device1 instance in use
|
||||
HRESULT hresult = canvasDeviceResourceWrapperNative.Get()->GetNativeResource(
|
||||
@@ -61,7 +61,7 @@ internal static unsafe class ICanvasDeviceExtensions
|
||||
// Get the ID2D1DeviceContextPool interface reference
|
||||
canvasDevice.QueryInterface(
|
||||
riid: Win32.__uuidof<ID2D1DeviceContextPool>(),
|
||||
ppvObject: d2D1DeviceContextPool.GetVoidAddressOf()).Assert();
|
||||
ppvObject: (void**)d2D1DeviceContextPool.GetAddressOf()).Assert();
|
||||
|
||||
// Get a new ID2D1DeviceContextLease object from the retrieved pool
|
||||
d2D1DeviceContextPool.Get()->GetDeviceContextLease(d2D1DeviceContextLease).Assert();
|
||||
|
||||
@@ -35,8 +35,8 @@ internal static unsafe class IUnknownExtensions
|
||||
using ComPtr<IUnknown> leftUnknown = default;
|
||||
using ComPtr<IUnknown> rightUnknown = default;
|
||||
|
||||
((IUnknown*)Unsafe.AsPointer(ref left))->QueryInterface(Win32.__uuidof<IUnknown>(), leftUnknown.GetVoidAddressOf()).Assert();
|
||||
((IUnknown*)right)->QueryInterface(Win32.__uuidof<IUnknown>(), rightUnknown.GetVoidAddressOf()).Assert();
|
||||
((IUnknown*)Unsafe.AsPointer(ref left))->QueryInterface(Win32.__uuidof<IUnknown>(), (void**)leftUnknown.GetAddressOf()).Assert();
|
||||
((IUnknown*)right)->QueryInterface(Win32.__uuidof<IUnknown>(), (void**)rightUnknown.GetAddressOf()).Assert();
|
||||
|
||||
return leftUnknown.Get() == rightUnknown.Get();
|
||||
}
|
||||
|
||||
@@ -9,20 +9,6 @@ namespace ComputeSharp.D2D1.Extensions;
|
||||
/// <remarks>Trimmed down version of the same file in <c>ComputeSharp</c>.</remarks>
|
||||
internal static class ComPtrExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the address of the current <see cref="ComPtr{T}"/> instance as a raw <see langword="void"/> double pointer.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type to wrap in the current <see cref="ComPtr{T}"/> instance.</typeparam>
|
||||
/// <param name="ptr">The input <see cref="ComPtr{T}"/> instance to get the address for.</param>
|
||||
/// <returns>The raw pointer to the input <see cref="ComPtr{T}"/> instance.</returns>
|
||||
/// <remarks>This method is only valid when the current <see cref="ComPtr{T}"/> instance is on the stack or pinned.</remarks>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe void** GetVoidAddressOf<T>(this in ComPtr<T> ptr)
|
||||
where T : unmanaged
|
||||
{
|
||||
return (void**)Unsafe.AsPointer(ref Unsafe.AsRef(in ptr));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Moves the current <see cref="ComPtr{T}"/> instance and resets it without releasing the reference.
|
||||
/// </summary>
|
||||
|
||||
@@ -44,7 +44,7 @@ public static class D2D1ReflectionServices
|
||||
pSrcData: hlslBytecodePtr,
|
||||
SrcDataSize: (nuint)hlslBytecode.Length,
|
||||
pInterface: Windows.__uuidof<ID3D11ShaderReflection>(),
|
||||
ppReflector: d3D11ShaderReflection.GetVoidAddressOf()).Assert();
|
||||
ppReflector: (void**)d3D11ShaderReflection.GetAddressOf()).Assert();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -59,7 +59,7 @@ public static class D2D1ReflectionServices
|
||||
pSrcData: (byte*)dynamicBytecode.Get()->GetBufferPointer(),
|
||||
SrcDataSize: dynamicBytecode.Get()->GetBufferSize(),
|
||||
pInterface: Windows.__uuidof<ID3D11ShaderReflection>(),
|
||||
ppReflector: d3D11ShaderReflection.GetVoidAddressOf()).Assert();
|
||||
ppReflector: (void**)d3D11ShaderReflection.GetAddressOf()).Assert();
|
||||
}
|
||||
|
||||
D3D11_SHADER_DESC d3D11ShaderDescription;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
using ComputeSharp.D2D1.Extensions;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using TerraFX.Interop.Windows;
|
||||
|
||||
@@ -89,7 +88,7 @@ internal static unsafe class ID2D1EffectContextExtensions
|
||||
pSrcData: bytecode,
|
||||
SrcDataSize: (uint)bytecodeSize,
|
||||
pInterface: Windows.__uuidof<ID3D11ShaderReflection>(),
|
||||
ppReflector: d3D11ShaderReflection.GetVoidAddressOf());
|
||||
ppReflector: (void**)d3D11ShaderReflection.GetAddressOf());
|
||||
|
||||
if (!Windows.SUCCEEDED(hresult))
|
||||
{
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする