Enable ComputeSharp.D2D1.Tests multi-targeting

このコミットが含まれているのは:
Sergio Pedri committed 2022-09-20 15:29:44 +02:00
1 親 b3a709b78b
コミット c3baa74116
8ファイル変更
+36 -31

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

@@ -1,5 +1,4 @@
using System;
using System.Runtime.CompilerServices;
using System.Runtime.CompilerServices;
using ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers;
#pragma warning disable CS0649
@@ -109,15 +108,5 @@ partial struct PixelShaderEffect
return ref @this[index];
}
}
/// <summary>
/// Gets a <see cref="Span{T}"/> with the <see cref="ID2D1ResourceTextureManager"/> items in the current instance.
/// </summary>
/// <returns>A <see cref="Span{T}"/> with the <see cref="ID2D1ResourceTextureManager"/> items in the current instance.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public Span<ID2D1ResourceTextureManager> AsSpan()
{
return new((ID2D1ResourceTextureManager**)Unsafe.AsPointer(ref this), 16);
}
}
}
+1 -2
ファイルの表示
@@ -286,8 +286,7 @@ internal unsafe partial struct PixelShaderEffect
@this->d2D1TransformMapperHandle = GCHandle.Alloc(d2D1TransformMapper);
@this->d2D1DrawInfo = null;
@this->d2D1EffectContext = null;
@this->resourceTextureManagerBuffer.AsSpan().Clear();
@this->resourceTextureManagerBuffer = default;
*effectImpl = (IUnknown*)@this;
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net472;netcoreapp3.1;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);CS0419;CA1416</NoWarn>
</PropertyGroup>
+9 -3
ファイルの表示
@@ -588,7 +588,9 @@ public partial class D2D1ResourceTextureManagerTests
data: texture,
strides: null);
byte[] data = RandomNumberGenerator.GetBytes(updateLength);
byte[] data = new byte[updateLength];
RandomNumberGenerator.Create().GetBytes(data);
resourceTextureManager.Update(
minimumExtents: stackalloc uint[] { (uint)startOffset },
@@ -674,7 +676,9 @@ public partial class D2D1ResourceTextureManagerTests
data: texture,
strides: stackalloc uint[] { (uint)width });
byte[] data = RandomNumberGenerator.GetBytes(updateLengthX * updateLengthY);
byte[] data = new byte[updateLengthX * updateLengthY];
RandomNumberGenerator.Create().GetBytes(data);
resourceTextureManager.Update(
minimumExtents: stackalloc uint[] { (uint)startOffsetX, (uint)startOffsetY },
@@ -775,7 +779,9 @@ public partial class D2D1ResourceTextureManagerTests
data: texture,
strides: stackalloc uint[] { (uint)width, (uint)(width * height) });
byte[] data = RandomNumberGenerator.GetBytes(updateLengthX * updateLengthY * updateLengthZ);
byte[] data = new byte[updateLengthX * updateLengthY * updateLengthZ];
RandomNumberGenerator.Create().GetBytes(data);
resourceTextureManager.Update(
minimumExtents: stackalloc uint[] { (uint)startOffsetX, (uint)startOffsetY, (uint)startOffsetZ },
+10 -10
ファイルの表示
@@ -27,8 +27,8 @@ public partial class D2D1ShaderCompilerTests
""";
ReadOnlyMemory<byte> bytecode = D2D1ShaderCompiler.Compile(
source,
"PSMain",
source.AsSpan(),
"PSMain".AsSpan(),
D2D1ShaderProfile.PixelShader40Level93,
D2D1CompileOptions.Default);
@@ -79,8 +79,8 @@ public partial class D2D1ShaderCompilerTests
""";
ReadOnlyMemory<byte> bytecode = D2D1ShaderCompiler.Compile(
source,
"PSMain",
source.AsSpan(),
"PSMain".AsSpan(),
D2D1ShaderProfile.PixelShader40Level93,
D2D1CompileOptions.Default | D2D1CompileOptions.EnableLinking);
@@ -106,8 +106,8 @@ public partial class D2D1ShaderCompilerTests
""";
ReadOnlyMemory<byte> bytecode = D2D1ShaderCompiler.Compile(
source,
"Execute",
source.AsSpan(),
"Execute".AsSpan(),
D2D1ShaderProfile.PixelShader40Level93,
D2D1CompileOptions.Default);
@@ -133,8 +133,8 @@ public partial class D2D1ShaderCompilerTests
""";
ReadOnlyMemory<byte> bytecode = D2D1ShaderCompiler.Compile(
source,
"PSMain",
source.AsSpan(),
"PSMain".AsSpan(),
D2D1ShaderProfile.PixelShader40Level93,
D2D1CompileOptions.Default);
@@ -181,8 +181,8 @@ public partial class D2D1ShaderCompilerTests
""";
ReadOnlyMemory<byte> bytecode = D2D1ShaderCompiler.Compile(
source,
"PSMain",
source.AsSpan(),
"PSMain".AsSpan(),
D2D1ShaderProfile.PixelShader40,
D2D1CompileOptions.Default);
+3 -3
ファイルの表示
@@ -325,9 +325,9 @@ public sealed partial class BokehBlurEffect
using ComPtr<ID2D1Effect> compositeEffect = default;
using ComPtr<ID2D1Effect> borderEffect = default;
Span<ComPtr<ID2D1Effect>> verticalConvolutionEffectsForReals = stackalloc ComPtr<ID2D1Effect>[numberOfComponents];
Span<ComPtr<ID2D1Effect>> verticalConvolutionEffectsForImaginaries = stackalloc ComPtr<ID2D1Effect>[numberOfComponents];
Span<ComPtr<ID2D1Effect>> horizontalConvolutionEffects = stackalloc ComPtr<ID2D1Effect>[numberOfComponents];
Span<ComPtr<ID2D1Effect>> verticalConvolutionEffectsForReals = new ComPtr<ID2D1Effect>[numberOfComponents];
Span<ComPtr<ID2D1Effect>> verticalConvolutionEffectsForImaginaries = new ComPtr<ID2D1Effect>[numberOfComponents];
Span<ComPtr<ID2D1Effect>> horizontalConvolutionEffects = new ComPtr<ID2D1Effect>[numberOfComponents];
try
{
+7
ファイルの表示
@@ -2,6 +2,13 @@
namespace ComputeSharp.D2D1.Tests.Effects;
#if !NETCOREAPP3_1_OR_GREATER
internal static class MathF
{
public const float PI = (float)Math.PI;
}
#endif
[D2DInputCount(0)]
[D2DRequiresScenePosition]
[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
+4
ファイルの表示
@@ -1,6 +1,8 @@
using System.ComponentModel;
using System.Diagnostics;
#if NETCOREAPP3_1_OR_GREATER
using System.Diagnostics.CodeAnalysis;
#endif
using System.Runtime.CompilerServices;
namespace ComputeSharp.D2D1.Tests.Extensions;
@@ -46,7 +48,9 @@ internal static class HRESULTExtensions
/// Throws a <see cref="Win32Exception"/>.
/// </summary>
/// <param name="result">The input return code.</param>
#if NETCOREAPP3_1_OR_GREATER
[DoesNotReturn]
#endif
private static void ThrowWin32Exception(int result)
{
throw new Win32Exception(result);