Update Win2D method signatures in all projects

このコミットが含まれているのは:
Sergio Pedri committed 2023-09-30 18:38:36 +02:00
1 親 76df248427
コミット 0fb876fde0
8ファイル変更
+22 -17

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

+5 -6
ファイルの表示
@@ -2,6 +2,7 @@ using System;
using System.Buffers;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using ComputeSharp.D2D1.Descriptors;
using ComputeSharp.D2D1.Extensions;
using ComputeSharp.D2D1.Interop;
using ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers;
@@ -9,8 +10,6 @@ using ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
#pragma warning disable CS0618
#if WINDOWS_UWP
namespace ComputeSharp.D2D1.Uwp.Extensions;
#else
@@ -29,7 +28,7 @@ internal static unsafe class ID2D1EffectExtensions
/// <param name="d2D1Effect">The input <see cref="ID2D1Effect"/> instance.</param>
/// <returns>The constant buffer of type <typeparamref name="T"/> for <paramref name="d2D1Effect"/>.</returns>
public static T GetConstantBuffer<T>(this ref ID2D1Effect d2D1Effect)
where T : unmanaged, ID2D1PixelShader
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor<T>
{
int constantBufferSize = D2D1PixelShader.GetConstantBufferSize<T>();
@@ -55,7 +54,7 @@ internal static unsafe class ID2D1EffectExtensions
Unsafe.SkipInit(out T shader);
shader.InitializeFromDispatchData(buffer.AsSpan(0, constantBufferSize));
shader = shader.CreateFromConstantBuffer(buffer.AsSpan(0, constantBufferSize));
ArrayPool<byte>.Shared.Return(buffer);
@@ -69,7 +68,7 @@ internal static unsafe class ID2D1EffectExtensions
/// <param name="d2D1Effect">The input <see cref="ID2D1Effect"/> instance.</param>
/// <param name="value">The constant buffer value to set.</param>
public static void SetConstantBuffer<T>(this ref ID2D1Effect d2D1Effect, in T value)
where T : unmanaged, ID2D1PixelShader
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor<T>
{
// Same as above, simply do nothing for empty types. This case is still handled to
// avoid crashing when someone's just setting an empty constant buffer, which is
@@ -90,7 +89,7 @@ internal static unsafe class ID2D1EffectExtensions
/// <param name="d2D1Effect">The input <see cref="ID2D1Effect"/> instance.</param>
/// <returns>The <see cref="D2D1TransformMapper{T}"/> instance for <paramref name="d2D1Effect"/>.</returns>
public static D2D1TransformMapper<T>? GetTransformMapper<T>(this ref ID2D1Effect d2D1Effect)
where T : unmanaged, ID2D1PixelShader
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor<T>
{
using ComPtr<ID2D1TransformMapper> d2D1TransformMapper = default;
@@ -13,7 +13,7 @@ using ComputeSharp.D2D1.WinUI.Buffers;
using ComputeSharp.D2D1.WinUI.Collections;
#endif
#pragma warning disable CS0618, CS8767
#pragma warning disable CS8767
#if WINDOWS_UWP
namespace ComputeSharp.D2D1.Uwp;
+2 -1
ファイルの表示
@@ -2,6 +2,7 @@
using System.Diagnostics.CodeAnalysis;
#endif
using ABI.Microsoft.Graphics.Canvas;
using ComputeSharp.D2D1.Descriptors;
using ComputeSharp.D2D1.Interop;
using ComputeSharp.Interop;
using Microsoft.Graphics.Canvas;
@@ -20,7 +21,7 @@ namespace ComputeSharp.D2D1.WinUI;
/// </summary>
/// <typeparam name="T">The type of shader to use to render frames.</typeparam>
public sealed partial class PixelShaderEffect<T> : IReferenceTrackedObject, ICanvasEffect, ICanvasImageInterop.Interface
where T : unmanaged, ID2D1PixelShader
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor<T>
{
/// <summary>
/// The <see cref="ReferenceTracker"/> value for the current instance.