diff --git a/tests/ComputeSharp.Tests/Assets/ColorfulInfinity.jpg b/tests/ComputeSharp.Tests/Assets/ColorfulInfinity.jpg deleted file mode 100644 index 50e964e2..00000000 Binary files a/tests/ComputeSharp.Tests/Assets/ColorfulInfinity.jpg and /dev/null differ diff --git a/tests/ComputeSharp.Tests/Assets/ColorfulInfinity.png b/tests/ComputeSharp.Tests/Assets/ColorfulInfinity.png new file mode 100644 index 00000000..54f423cb Binary files /dev/null and b/tests/ComputeSharp.Tests/Assets/ColorfulInfinity.png differ diff --git a/tests/ComputeSharp.Tests/Assets/FractalTiling.jpg b/tests/ComputeSharp.Tests/Assets/FractalTiling.jpg deleted file mode 100644 index 8926cf69..00000000 Binary files a/tests/ComputeSharp.Tests/Assets/FractalTiling.jpg and /dev/null differ diff --git a/tests/ComputeSharp.Tests/Assets/FractalTiling.png b/tests/ComputeSharp.Tests/Assets/FractalTiling.png new file mode 100644 index 00000000..0585b928 Binary files /dev/null and b/tests/ComputeSharp.Tests/Assets/FractalTiling.png differ diff --git a/tests/ComputeSharp.Tests/Assets/MengerJourney.jpg b/tests/ComputeSharp.Tests/Assets/MengerJourney.jpg deleted file mode 100644 index ee41ffe1..00000000 Binary files a/tests/ComputeSharp.Tests/Assets/MengerJourney.jpg and /dev/null differ diff --git a/tests/ComputeSharp.Tests/Assets/MengerJourney.png b/tests/ComputeSharp.Tests/Assets/MengerJourney.png new file mode 100644 index 00000000..967dbd0c Binary files /dev/null and b/tests/ComputeSharp.Tests/Assets/MengerJourney.png differ diff --git a/tests/ComputeSharp.Tests/Assets/Octagrams.jpg b/tests/ComputeSharp.Tests/Assets/Octagrams.jpg deleted file mode 100644 index bef5e971..00000000 Binary files a/tests/ComputeSharp.Tests/Assets/Octagrams.jpg and /dev/null differ diff --git a/tests/ComputeSharp.Tests/Assets/Octagrams.png b/tests/ComputeSharp.Tests/Assets/Octagrams.png new file mode 100644 index 00000000..fe59ef37 Binary files /dev/null and b/tests/ComputeSharp.Tests/Assets/Octagrams.png differ diff --git a/tests/ComputeSharp.Tests/Assets/ProteanClouds.jpg b/tests/ComputeSharp.Tests/Assets/ProteanClouds.jpg deleted file mode 100644 index 9a0d508e..00000000 Binary files a/tests/ComputeSharp.Tests/Assets/ProteanClouds.jpg and /dev/null differ diff --git a/tests/ComputeSharp.Tests/Assets/ProteanClouds.png b/tests/ComputeSharp.Tests/Assets/ProteanClouds.png new file mode 100644 index 00000000..d5ec9839 Binary files /dev/null and b/tests/ComputeSharp.Tests/Assets/ProteanClouds.png differ diff --git a/tests/ComputeSharp.Tests/Assets/TwoTiledTruchet.jpg b/tests/ComputeSharp.Tests/Assets/TwoTiledTruchet.jpg deleted file mode 100644 index fb107ddc..00000000 Binary files a/tests/ComputeSharp.Tests/Assets/TwoTiledTruchet.jpg and /dev/null differ diff --git a/tests/ComputeSharp.Tests/Assets/TwoTiledTruchet.png b/tests/ComputeSharp.Tests/Assets/TwoTiledTruchet.png new file mode 100644 index 00000000..ecfdb773 Binary files /dev/null and b/tests/ComputeSharp.Tests/Assets/TwoTiledTruchet.png differ diff --git a/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj b/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj index f7f49214..12ff3527 100644 --- a/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj +++ b/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj @@ -40,25 +40,25 @@ - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest diff --git a/tests/ComputeSharp.Tests/ShadersTests.cs b/tests/ComputeSharp.Tests/ShadersTests.cs index 703aba93..45478d64 100644 --- a/tests/ComputeSharp.Tests/ShadersTests.cs +++ b/tests/ComputeSharp.Tests/ShadersTests.cs @@ -7,6 +7,7 @@ using ComputeSharp.Tests.Attributes; using ComputeSharp.Tests.Extensions; using Microsoft.VisualStudio.TestTools.UnitTesting; using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Formats.Png; using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; namespace ComputeSharp.Tests @@ -19,42 +20,42 @@ namespace ComputeSharp.Tests [AllDevices] public void ColorfulInfinity(Device device) { - RunAndCompareShader(device, static texture => new ColorfulInfinity(texture, 0), 0.0000193f); + RunAndCompareShader(device, static texture => new ColorfulInfinity(texture, 0), 0.0000004f); } [CombinatorialTestMethod] [AllDevices] public void FractalTiling(Device device) { - RunAndCompareShader(device, static texture => new FractalTiling(texture, 0), 0.0000282f); + RunAndCompareShader(device, static texture => new FractalTiling(texture, 0), 0.0000005f); } [CombinatorialTestMethod] [AllDevices] public void MengerJourney(Device device) { - RunAndCompareShader(device, static texture => new MengerJourney(texture, 0), 0.0000864f); + RunAndCompareShader(device, static texture => new MengerJourney(texture, 0), 0.000011f); } [CombinatorialTestMethod] [AllDevices] public void TwoTiledTruchet(Device device) { - RunAndCompareShader(device, static texture => new TwoTiledTruchet(texture, 0), 0.00033f); + RunAndCompareShader(device, static texture => new TwoTiledTruchet(texture, 0), 0.00032f); } [CombinatorialTestMethod] [AllDevices] public void Octagrams(Device device) { - RunAndCompareShader(device, static texture => new Octagrams(texture, 0), 0.00000586f); + RunAndCompareShader(device, static texture => new Octagrams(texture, 0), 0.0000006f); } [CombinatorialTestMethod] [AllDevices] public void ProteanClouds(Device device) { - RunAndCompareShader(device, static texture => new ProteanClouds(texture, 0), 0.00000107f); + RunAndCompareShader(device, static texture => new ProteanClouds(texture, 0), 0.0000004f); } /// @@ -69,7 +70,7 @@ namespace ComputeSharp.Tests { _ = device.Get(); - string expectedPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Assets", $"{typeof(T).Name}.jpg"); + string expectedPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Assets", $"{typeof(T).Name}.png"); IImageInfo imageInfo = Image.Identify(expectedPath); @@ -84,11 +85,11 @@ namespace ComputeSharp.Tests texture.CopyTo(MemoryMarshal.Cast(span)); } - string actualPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Shaders", $"{typeof(T).Name}.jpg"); + string actualPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Shaders", $"{typeof(T).Name}.png"); _ = Directory.CreateDirectory(Path.GetDirectoryName(actualPath)!); - image.Save(actualPath); + image.SaveAsPng(actualPath, new PngEncoder() { CompressionLevel = PngCompressionLevel.BestCompression, ColorType = PngColorType.Rgb }); ImagingTests.TolerantImageComparer.AssertEqual(expectedPath, actualPath, delta); }