Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,12 @@ jobs:
path: samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe
if-no-files-found: error

# Publish the NativeAOT CLI sample (optimized for size, and reflection-free).
# Temporarily skip COMPUTESHARP_SWAPCHAIN_CLI_DISABLE_REFLECTION unti code is
# refactored to replace typeof(T).GUID with hardcoded IIDs, or it won't work.
# Publish the NativeAOT CLI sample (optimized for size, and reflection-free)
- name: Publish ComputeSharp.SwapChain.Cli with NativeAOT (size)
run: >
$env:COMPUTESHARP_SWAPCHAIN_CLI_PUBLISH_AOT='true';
$env:COMPUTESHARP_SWAPCHAIN_CLI_SIZE_OPTIMIZED='true';
$env:COMPUTESHARP_SWAPCHAIN_CLI_DISABLE_REFLECTION='true';
git clean -fdx;
dotnet publish samples\ComputeSharp.SwapChain.Cli\ComputeSharp.SwapChain.Cli.csproj -r win-${{matrix.platform}} -v n

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
using WinRT;
using WinRT.Interop;

#pragma warning disable CS0649, IDE1006
#pragma warning disable CS0649, IDE0055, IDE1006

namespace ABI.Microsoft.Graphics.Canvas;

/// <summary>
/// Raw bindings for the interop interface for the <see cref="CanvasDevice"/> activation factory.
/// </summary>
[Guid("695C440D-04B3-4EDD-BFD9-63E51E9F7202")]
internal unsafe struct ICanvasFactoryNative : IUnknown.Interface
{
public void** lpVtbl;
Expand All @@ -23,7 +22,8 @@ static Guid* INativeGuid.NativeGuid
{
get
{
ReadOnlySpan<byte> data = new byte[] {
ReadOnlySpan<byte> data =
[
0x0D, 0x44, 0x5C, 0x69,
0xB3, 0x04,
0xDD, 0x4E,
Expand All @@ -34,7 +34,7 @@ static Guid* INativeGuid.NativeGuid
0x9F,
0x72,
0x02
};
];

return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using ComputeSharp.Win32;

#pragma warning disable CS0649, IDE1006
Expand All @@ -10,7 +9,6 @@ namespace ABI.Microsoft.Graphics.Canvas;
/// <summary>
/// The native WinRT interface for <see cref="global::Microsoft.Graphics.Canvas.CanvasDevice"/> objects.
/// </summary>
[Guid("A27F0B5D-EC2C-4D4F-948F-0AA1E95E33E6")]
[NativeTypeName("class ICanvasDevice : IInspectable")]
[NativeInheritance("IInspectable")]
internal unsafe struct ICanvasDevice
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,42 @@
using System.Runtime.InteropServices;
using ComputeSharp.Win32;

#pragma warning disable CS0649, IDE1006
#pragma warning disable CS0649, IDE0055, IDE1006

namespace ABI.Microsoft.Graphics.Canvas.Effects;

/// <summary>
/// The native WinRT interface for <see cref="global::Microsoft.Graphics.Canvas.Effects.ICanvasEffect"/> objects.
/// </summary>
[Guid("0EF96F8C-9B5E-4BF0-A399-AAD8CE53DB55")]
[NativeTypeName("class ICanvasEffect : IInspectable")]
[NativeInheritance("IInspectable")]
internal unsafe struct ICanvasEffect
internal unsafe struct ICanvasEffect : IComObject
{
/// <inheritdoc/>
static Guid* IComObject.IID
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data =
[
0x8C, 0x6F, 0xF9, 0x0E,
0x5E, 0x9B,
0xF0, 0x4B,
0x99,
0xA3,
0xAA,
0xD8,
0xCE,
0x53,
0xDB,
0x55
];

return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data));
}
}

public void** lpVtbl;

/// <inheritdoc cref="IUnknown.QueryInterface"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,41 @@
using WinRT.Interop;
using IInspectable = ComputeSharp.Win32.IInspectable;

#pragma warning disable CS0649, IDE1006
#pragma warning disable CS0649, IDE0055, IDE1006

namespace ABI.Microsoft.Graphics.Canvas;

/// <summary>
/// The interop Win2D interface for factories of external effects.
/// </summary>
[Guid("29BA1A1F-1CFE-44C3-984D-426D61B51427")]
[NativeTypeName("class ICanvasEffectFactoryNative : IUnknown")]
[NativeInheritance("IUnknown")]
internal unsafe struct ICanvasEffectFactoryNative
internal unsafe struct ICanvasEffectFactoryNative : IComObject
{
/// <inheritdoc/>
static Guid* IComObject.IID
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data =
[
0x1F, 0x1A, 0xBA, 0x29,
0xFE, 0x1C,
0xC3, 0x44,
0x98, 0x4D,
0x42,
0x6D,
0x61,
0xB5,
0x14,
0x27
];

return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data));
}
}

public void** lpVtbl;

/// <inheritdoc cref="IUnknown.QueryInterface"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace ABI.Microsoft.Graphics.Canvas;
/// <summary>
/// The activation factory for <see cref="global::Microsoft.Graphics.Canvas.CanvasDevice"/>.
/// </summary>
[Guid("695C440D-04B3-4EDD-BFD9-63E51E9F7202")]
[NativeTypeName("class ICanvasFactoryNative : public IInspectable")]
[NativeInheritance("IInspectable")]
internal unsafe struct ICanvasFactoryNative
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,41 @@
using WinRT;
using WinRT.Interop;

#pragma warning disable CS0649, IDE1006
#pragma warning disable CS0649, IDE0055, IDE1006

namespace ABI.Microsoft.Graphics.Canvas;

/// <summary>
/// An interop Win2D interface for all images and effects that can be drawn.
/// </summary>
[Guid("E042D1F7-F9AD-4479-A713-67627EA31863")]
[NativeTypeName("class ICanvasImageInterop : IUnknown")]
[NativeInheritance("IUnknown")]
internal unsafe struct ICanvasImageInterop
internal unsafe struct ICanvasImageInterop : IComObject
{
/// <inheritdoc/>
static Guid* IComObject.IID
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data =
[
0xF7, 0xD1, 0x42, 0xE0,
0xAD, 0xF9,
0x79, 0x44,
0xA7, 0x13,
0x67,
0x62,
0x7E,
0xA3,
0x18,
0x63
];

return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data));
}
}

public void** lpVtbl;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,42 @@
using System.Runtime.InteropServices;
using ComputeSharp.Win32;

#pragma warning disable CS0649, IDE1006
#pragma warning disable CS0649, IDE0055, IDE1006

namespace ABI.Microsoft.Graphics.Canvas;

/// <summary>
/// The native WinRT interface for <see cref="global::Microsoft.Graphics.Canvas.ICanvasResourceCreator"/> objects.
/// </summary>
[Guid("8F6D8AA8-492F-4BC6-B3D0-E7F5EAE84B11")]
[NativeTypeName("class ICanvasResourceCreator : IInspectable")]
[NativeInheritance("IInspectable")]
internal unsafe struct ICanvasResourceCreator
internal unsafe struct ICanvasResourceCreator : IComObject
{
/// <inheritdoc/>
static Guid* IComObject.IID
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data =
[
0xA8, 0x8A, 0x6D, 0x8F,
0x2F, 0x49,
0xC6, 0x4B,
0xB3,
0xD0,
0xE7,
0xF5,
0xEA,
0xE8,
0x4B,
0x11
];

return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data));
}
}

public void** lpVtbl;

/// <inheritdoc cref="IUnknown.QueryInterface"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,42 @@
using System.Runtime.InteropServices;
using ComputeSharp.Win32;

#pragma warning disable CS0649, IDE1006
#pragma warning disable CS0649, IDE0055, IDE1006

namespace ABI.Microsoft.Graphics.Canvas;

/// <summary>
/// The native WinRT interface for <see cref="global::Microsoft.Graphics.Canvas.ICanvasResourceCreatorWithDpi"/> objects.
/// </summary>
[Guid("1A75B512-E9FA-49E6-A876-38CAE194013E")]
[NativeTypeName("class ICanvasResourceCreatorWithDpi : IInspectable")]
[NativeInheritance("IInspectable")]
internal unsafe struct ICanvasResourceCreatorWithDpi
internal unsafe struct ICanvasResourceCreatorWithDpi : IComObject
{
/// <inheritdoc/>
static Guid* IComObject.IID
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data =
[
0x12, 0xB5, 0x75, 0x1A,
0xFA, 0xE9,
0xE6, 0x49,
0xA8,
0x76,
0x38,
0xCA,
0xE1,
0x94,
0x01,
0x3E
];

return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data));
}
}

public void** lpVtbl;

/// <inheritdoc cref="IUnknown.QueryInterface"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,42 @@
using System.Runtime.InteropServices;
using ComputeSharp.Win32;

#pragma warning disable CS0649, IDE1006
#pragma warning disable CS0649, IDE0055, IDE1006

namespace ABI.Microsoft.Graphics.Canvas;

/// <summary>
/// An interop wrapper type for Win2D objects (see <see href="https://microsoft.github.io/Win2D/WinUI3/html/Interop.htm"/>).
/// </summary>
[Guid("5F10688D-EA55-4D55-A3B0-4DDB55C0C20A")]
[NativeTypeName("class ICanvasResourceWrapperNative : IUnknown")]
[NativeInheritance("IUnknown")]
internal unsafe struct ICanvasResourceWrapperNative
internal unsafe struct ICanvasResourceWrapperNative : IComObject
{
/// <inheritdoc/>
static Guid* IComObject.IID
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
ReadOnlySpan<byte> data =
[
0x8D, 0x68, 0x10, 0x5F,
0x55, 0xEA,
0x55, 0x4D,
0xA3,
0xB0,
0x4D,
0xDB,
0x55,
0xC0,
0xC2,
0x0A
];

return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data));
}
}

public void** lpVtbl;

/// <inheritdoc cref="IUnknown.QueryInterface"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using ComputeSharp.Win32;

#pragma warning disable CS0649, IDE1006
Expand All @@ -10,7 +9,6 @@ namespace ABI.Microsoft.Graphics.Canvas;
/// <summary>
/// An interface for a COM object that provides access to a pooled <see cref="ID2D1DeviceContext"/> object.
/// </summary>
[Guid("A0928F38-F7D5-44DD-A5C9-E23D94734BBB")]
[NativeTypeName("class ID2D1DeviceContextLease : IUnknown")]
[NativeInheritance("IUnknown")]
internal unsafe struct ID2D1DeviceContextLease
Expand Down
Loading