Add ID2D1TransformMapperManager binding type

このコミットが含まれているのは:
Sergio Pedri committed 2022-11-29 22:34:05 +01:00
1 親 f63af3d8d1
コミット bc1a392e9f
3ファイル変更
+120 -7

検索条件に一致するファイルはありません

@@ -15,7 +15,7 @@ namespace ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers;
internal unsafe struct ID2D1ResourceTextureManager
{
/// <summary>
/// Gets the <see cref="System.Guid"/> for <c>ID2D1ResourceTextureManager</c> (<c>3C4FC7E4-A419-46CA-B5F6-66EB4FF18D64</c>).
/// Gets the <see cref="System.Guid"/> for <see cref="ID2D1ResourceTextureManager"/> (<c>3C4FC7E4-A419-46CA-B5F6-66EB4FF18D64</c>).
/// </summary>
public static ref readonly Guid Guid
{
@@ -54,7 +54,7 @@ internal unsafe struct ID2D1ResourceTextureManager
/// <param name="dataSize">The size, in bytes, of the data.</param>
/// <returns>An <see cref="HRESULT"/> for the operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int Initialize(
public HRESULT Initialize(
Guid* resourceId,
D2D1_RESOURCE_TEXTURE_PROPERTIES* resourceTextureProperties,
byte* data,
@@ -81,7 +81,7 @@ internal unsafe struct ID2D1ResourceTextureManager
/// <param name="dataCount">The size of the data buffer to be used to update the resource texture.</param>
/// <returns>An <see cref="HRESULT"/> for the operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int Update(
public HRESULT Update(
uint* minimumExtents,
uint* maximimumExtents,
uint* strides,
@@ -15,7 +15,7 @@ namespace ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers;
internal unsafe struct ID2D1ResourceTextureManagerInternal
{
/// <summary>
/// Gets the <see cref="System.Guid"/> for <c>ID2D1ResourceTextureManagerInternal</c> (<c>5CBB1024-8EA1-4689-81BF-8AD190B5EF5D</c>).
/// Gets the <see cref="System.Guid"/> for <see cref="ID2D1ResourceTextureManagerInternal"/> (<c>5CBB1024-8EA1-4689-81BF-8AD190B5EF5D</c>).
/// </summary>
public static ref readonly Guid Guid
{
@@ -44,13 +44,13 @@ internal unsafe struct ID2D1ResourceTextureManagerInternal
private readonly void** lpVtbl;
/// <summary>
/// Sets the <see cref="ID2D1EffectContext"/> for the current <c>ID2D1ResourceTextureManagerInternal</c> instance.
/// Sets the <see cref="ID2D1EffectContext"/> for the current <see cref="ID2D1ResourceTextureManagerInternal"/> instance.
/// </summary>
/// <param name="effectContext">The input <see cref="ID2D1EffectContext"/> for the manager.</param>
/// <param name="dimensions">A pointer to an optional amount of dimensions for the target resource texture, for validation.</param>
/// <returns>An <see cref="HRESULT"/> for the operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int Initialize(ID2D1EffectContext* effectContext, uint* dimensions)
public HRESULT Initialize(ID2D1EffectContext* effectContext, uint* dimensions)
{
return ((delegate* unmanaged[Stdcall]<ID2D1ResourceTextureManagerInternal*, ID2D1EffectContext*, uint*, int>)this.lpVtbl[3])(
(ID2D1ResourceTextureManagerInternal*)Unsafe.AsPointer(ref this),
@@ -64,7 +64,7 @@ internal unsafe struct ID2D1ResourceTextureManagerInternal
/// <param name="resourceTexture">The resulting <see cref="ID2D1ResourceTexture"/> instance.</param>
/// <returns>An <see cref="HRESULT"/> for the operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public int GetResourceTexture(ID2D1ResourceTexture** resourceTexture)
public HRESULT GetResourceTexture(ID2D1ResourceTexture** resourceTexture)
{
return ((delegate* unmanaged[Stdcall]<ID2D1ResourceTextureManagerInternal*, ID2D1ResourceTexture**, int>)this.lpVtbl[4])(
(ID2D1ResourceTextureManagerInternal*)Unsafe.AsPointer(ref this),
@@ -0,0 +1,113 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using TerraFX.Interop.Windows;
#pragma warning disable CS0649
namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMapperManagers;
/// <summary>
/// The transform mapper manager type to use with built-in effects.
/// </summary>
[Guid("02E6D48D-B892-4FBC-AA54-119203BAB802")]
internal unsafe struct ID2D1TransformMapperManager
{
/// <summary>
/// Gets the <see cref="System.Guid"/> for <see cref="ID2D1TransformMapperManager"/> (<c>02E6D48D-B892-4FBC-AA54-119203BAB802</c>).
/// </summary>
public static ref readonly Guid Guid
{
get
{
ReadOnlySpan<byte> data = new byte[] {
0x02, 0xE6, 0xD4, 0x8D,
0xB8, 0x92,
0x4F, 0xBC,
0xAA, 0x54,
0x11,
0x92,
0x03,
0xBA,
0xB8,
0x02
};
return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
}
}
/// <summary>
/// The vtable for the current instance.
/// </summary>
private readonly void** lpVtbl;
/// <summary>
/// Performs the inverse mapping to <see cref="MapOutputRectToInputRects(RECT*, RECT*, uint)"/>.
/// </summary>
/// <param name="updateContext">The input <see cref="ID2D1DrawInfoUpdateContex"/> instance.</param>
/// <param name="inputRects">An array of input rectangles to be mapped to the output rectangle.</param>
/// <param name="inputOpaqueSubRects">An array of input rectangles to be mapped to the opaque output rectangle.</param>
/// <param name="inputRectCount">The number of inputs specified.</param>
/// <param name="outputRect">The output rectangle that maps to the corresponding input rectangle.</param>
/// <param name="outputOpaqueSubRect">The output rectangle that maps to the corresponding opaque input rectangle.</param>
/// <returns>An <see cref="HRESULT"/> for the operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public HRESULT MapInputRectsToOutputRect(
ID2D1DrawInfoUpdateContex* updateContext,
RECT* inputRects,
RECT* inputOpaqueSubRects,
uint inputRectCount,
RECT* outputRect,
RECT* outputOpaqueSubRect)
{
return ((delegate* unmanaged[Stdcall]<ID2D1TransformMapperManager*, ID2D1DrawInfoUpdateContex*, RECT*, RECT*, uint, RECT*, RECT*, int>)this.lpVtbl[3])(
(ID2D1TransformMapperManager*)Unsafe.AsPointer(ref this),
updateContext,
inputRects,
inputOpaqueSubRects,
inputRectCount,
outputRect,
outputOpaqueSubRect);
}
/// <summary>
/// Allows a transform to state how it would map a rectangle requested on its output to a set of sample rectangles on its input.
/// </summary>
/// <param name="outputRect">The output rectangle from which the inputs must be mapped.</param>
/// <param name="inputRects">The corresponding set of inputs. The inputs will directly correspond to the transform inputs.</param>
/// <param name="inputRectsCount">The number of inputs specified.</param>
/// <returns>An <see cref="HRESULT"/> for the operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public HRESULT MapOutputRectToInputRects(
RECT* outputRect,
RECT* inputRects,
uint inputRectsCount)
{
return ((delegate* unmanaged[Stdcall]<ID2D1TransformMapperManager*, RECT*, RECT*, uint, int>)this.lpVtbl[4])(
(ID2D1TransformMapperManager*)Unsafe.AsPointer(ref this),
outputRect,
inputRects,
inputRectsCount);
}
/// <summary>
/// Sets the input rectangles for this rendering pass into the transform.
/// </summary>
/// <param name="inputIndex">The index of the input rectangle.</param>
/// <param name="invalidInputRect">The invalid input rectangle.</param>
/// <param name="invalidOutputRect">The output rectangle to which the input rectangle must be mapped.</param>
/// <returns>An <see cref="HRESULT"/> for the operation.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public HRESULT MapInputRectsToOutputRect(
uint inputIndex,
RECT invalidInputRect,
RECT* invalidOutputRect)
{
return ((delegate* unmanaged[Stdcall]<ID2D1TransformMapperManager*, uint, RECT, RECT*, int>)this.lpVtbl[5])(
(ID2D1TransformMapperManager*)Unsafe.AsPointer(ref this),
inputIndex,
invalidInputRect,
invalidOutputRect);
}
}