Update Win2D method signatures in all projects
このコミットが含まれているのは:
1 親
76df248427
コミット
0fb876fde0
8ファイル変更
+22
-17
検索条件に一致するファイルはありません
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using ComputeSharp.D2D1;
|
||||
using ComputeSharp.D2D1.Descriptors;
|
||||
#if WINDOWS_UWP
|
||||
using ComputeSharp.D2D1.Uwp;
|
||||
#else
|
||||
@@ -62,7 +63,7 @@ public abstract class PixelShaderEffect : CanvasEffect
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of pixel shader to render.</typeparam>
|
||||
public sealed class For<T> : PixelShaderEffect
|
||||
where T : unmanaged, ID2D1PixelShader
|
||||
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="PixelShaderEffect{T}"/> node in use.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using ComputeSharp.D2D1;
|
||||
using ComputeSharp.D2D1.Descriptors;
|
||||
using ComputeSharp.D2D1.WinUI;
|
||||
|
||||
namespace ComputeSharp.SwapChain.D2D1.Backend;
|
||||
@@ -56,7 +57,7 @@ internal abstract class PixelShaderEffect : CanvasEffect
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of pixel shader to render.</typeparam>
|
||||
public sealed class For<T> : PixelShaderEffect
|
||||
where T : unmanaged, ID2D1PixelShader
|
||||
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// The <see cref="PixelShaderEffect{T}"/> node in use.
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
+1
-1
@@ -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,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.
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using ComputeSharp.D2D1.Descriptors;
|
||||
using ComputeSharp.D2D1.Interop;
|
||||
using ComputeSharp.Tests.Helpers;
|
||||
using Win32;
|
||||
@@ -32,7 +33,7 @@ internal static class D2D1TestRunner
|
||||
string expectedFileName,
|
||||
[CallerMemberName] string destinationFileName = "",
|
||||
float threshold = 0.00001f)
|
||||
where T : unmanaged, ID2D1PixelShader
|
||||
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor<T>
|
||||
{
|
||||
string assetsPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Assets");
|
||||
string temporaryPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "temp");
|
||||
@@ -73,7 +74,7 @@ internal static class D2D1TestRunner
|
||||
[CallerMemberName] string destinationFileName = "",
|
||||
float threshold = 0.00001f,
|
||||
params (int Index, D2D1ResourceTextureManager ResourceTextureManager)[] resourceTextures)
|
||||
where T : unmanaged, ID2D1PixelShader
|
||||
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor<T>
|
||||
{
|
||||
string assetsPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Assets");
|
||||
string temporaryPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "temp");
|
||||
@@ -109,7 +110,7 @@ internal static class D2D1TestRunner
|
||||
D2D1TransformMapper<T>? transformMapper,
|
||||
string sourcePath,
|
||||
string destinationPath)
|
||||
where T : unmanaged, ID2D1PixelShader
|
||||
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor<T>
|
||||
{
|
||||
using ComPtr<ID2D1Factory2> d2D1Factory2 = D2D1Helper.CreateD2D1Factory2();
|
||||
using ComPtr<ID2D1Device> d2D1Device = D2D1Helper.CreateD2D1Device(d2D1Factory2.Get());
|
||||
@@ -158,7 +159,7 @@ internal static class D2D1TestRunner
|
||||
int height,
|
||||
string destinationPath,
|
||||
params (int Index, D2D1ResourceTextureManager ResourceTextureManager)[] resourceTextures)
|
||||
where T : unmanaged, ID2D1PixelShader
|
||||
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor<T>
|
||||
{
|
||||
using ComPtr<ID2D1Factory2> d2D1Factory2 = D2D1Helper.CreateD2D1Factory2();
|
||||
using ComPtr<ID2D1Device> d2D1Device = D2D1Helper.CreateD2D1Device(d2D1Factory2.Get());
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.D2D1.Descriptors;
|
||||
using ComputeSharp.D2D1.Interop;
|
||||
using ComputeSharp.D2D1.Tests.Helpers;
|
||||
using ComputeSharp.SwapChain.Shaders.D2D1;
|
||||
@@ -114,7 +115,7 @@ public class ShadersTests
|
||||
}
|
||||
|
||||
private static void RunTest<T>(float threshold = 0.00001f)
|
||||
where T : unmanaged, ID2D1PixelShader
|
||||
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor<T>
|
||||
{
|
||||
T shader = (T)Activator.CreateInstance(typeof(T), 0f, new int2(1280, 720))!;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using ComputeSharp.D2D1.Descriptors;
|
||||
using ComputeSharp.D2D1.UI.Tests.Helpers;
|
||||
#if WINDOWS_UWP
|
||||
using ComputeSharp.D2D1.Uwp;
|
||||
@@ -79,7 +80,7 @@ public class ShadersTests
|
||||
}
|
||||
|
||||
private static async Task RunTestAsync<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(WrapperType wrapperType, float threshold = 0.00001f)
|
||||
where T : unmanaged, ID2D1PixelShader
|
||||
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor<T>
|
||||
{
|
||||
T shader = (T)Activator.CreateInstance(typeof(T), 0f, new int2(1280, 720))!;
|
||||
|
||||
@@ -118,7 +119,7 @@ public class ShadersTests
|
||||
}
|
||||
|
||||
private sealed class TestCanvasEffect<T> : CanvasEffect
|
||||
where T : unmanaged, ID2D1PixelShader
|
||||
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor<T>
|
||||
{
|
||||
private static readonly EffectNode<PixelShaderEffect<T>> Effect = new();
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする