From 8247d655827f1481b4e53d7bfc7ff764b35d77d3 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 11 Jun 2022 02:29:48 +0200 Subject: [PATCH 1/3] Fix unit tests assembly initialize methods --- tests/ComputeSharp.D2D1.Tests/EndToEndTests.cs | 2 +- tests/ComputeSharp.Tests/ImagingTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ComputeSharp.D2D1.Tests/EndToEndTests.cs b/tests/ComputeSharp.D2D1.Tests/EndToEndTests.cs index c44fb1c0..02a5da36 100644 --- a/tests/ComputeSharp.D2D1.Tests/EndToEndTests.cs +++ b/tests/ComputeSharp.D2D1.Tests/EndToEndTests.cs @@ -15,7 +15,7 @@ namespace ComputeSharp.D2D1.Tests; public class EndToEndTests { [AssemblyInitialize] - public static void ConfigureImageSharp() + public static void ConfigureImageSharp(TestContext _) { Configuration.Default.PreferContiguousImageBuffers = true; } diff --git a/tests/ComputeSharp.Tests/ImagingTests.cs b/tests/ComputeSharp.Tests/ImagingTests.cs index 2ef5ba13..47a7fb3d 100644 --- a/tests/ComputeSharp.Tests/ImagingTests.cs +++ b/tests/ComputeSharp.Tests/ImagingTests.cs @@ -20,7 +20,7 @@ namespace ComputeSharp.Tests; public class ImagingTests { [AssemblyInitialize] - public static void ConfigureImageSharp() + public static void ConfigureImageSharp(TestContext _) { Configuration.Default.PreferContiguousImageBuffers = true; } From 2aa4c5b1d2dedba0b2a9f09a9e928f677ee0cb9e Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 26 Jun 2022 22:42:54 +0200 Subject: [PATCH 2/3] Fix HLSL generation for delegates with captured constants --- .../__Internals/ShaderMethodSourceAttribute.HlslGeneration.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ComputeSharp.Dynamic/Attributes/__Internals/ShaderMethodSourceAttribute.HlslGeneration.cs b/src/ComputeSharp.Dynamic/Attributes/__Internals/ShaderMethodSourceAttribute.HlslGeneration.cs index 5c8031db..71086963 100644 --- a/src/ComputeSharp.Dynamic/Attributes/__Internals/ShaderMethodSourceAttribute.HlslGeneration.cs +++ b/src/ComputeSharp.Dynamic/Attributes/__Internals/ShaderMethodSourceAttribute.HlslGeneration.cs @@ -17,6 +17,7 @@ partial class ShaderMethodSourceAttribute : Attribute { if (mapping.Add(constant.Key)) { + builder.Append('\n'); builder.Append("#define "); builder.Append(constant.Key); builder.Append(' '); From 01a422f7fc4fefc6574d27eef05d1bd63e1f3a58 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 26 Jun 2022 23:18:18 +0200 Subject: [PATCH 3/3] Adjust unit tests delta on .NET Framework --- tests/ComputeSharp.Tests/ImagingTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ComputeSharp.Tests/ImagingTests.cs b/tests/ComputeSharp.Tests/ImagingTests.cs index 47a7fb3d..5b3ce1ab 100644 --- a/tests/ComputeSharp.Tests/ImagingTests.cs +++ b/tests/ComputeSharp.Tests/ImagingTests.cs @@ -516,7 +516,7 @@ public class ImagingTests original.Save(expectedPath); - TolerantImageComparer.AssertEqual(expectedPath, actualPath, 0.00004037f); + TolerantImageComparer.AssertEqual(expectedPath, actualPath, 0.00004038f); } [CombinatorialTestMethod]