From 0c097c3eb890ed6d418103f7721657929d79e3ce Mon Sep 17 00:00:00 2001 From: routersys Date: Tue, 13 Oct 2026 15:59:39 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=B7=E3=82=A7=E3=83=BC=E3=83=80=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E5=80=8B=E6=95=B0=E3=81=AE=E4=B8=80=E8=A6=A7=E3=82=92?= =?UTF-8?q?=E5=85=B1=E6=9C=89=E3=81=AE=E8=A8=AD=E5=AE=9A=E3=81=AB=E9=9B=86?= =?UTF-8?q?=E3=82=81=E3=80=81=E5=90=8C=E6=A2=B1=E3=81=99=E3=82=8B=E3=82=B7?= =?UTF-8?q?=E3=82=A7=E3=83=BC=E3=83=80=E3=83=BC=E3=82=92=E4=B8=80=E8=A6=A7?= =?UTF-8?q?=E3=81=8B=E3=82=89=E6=B1=BA=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SpectrumColorShift.Shader/ShaderVariants.props | 6 ++++++ .../SpectrumColorShift.Shader.vcxproj | 11 ++++++----- SpectrumColorShift.Tests/ShaderVariantsTests.cs | 10 +++++++--- SpectrumColorShift/SpectrumColorShift.csproj | 11 ++++++++++- 4 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 SpectrumColorShift.Shader/ShaderVariants.props diff --git a/SpectrumColorShift.Shader/ShaderVariants.props b/SpectrumColorShift.Shader/ShaderVariants.props new file mode 100644 index 0000000..e212ba0 --- /dev/null +++ b/SpectrumColorShift.Shader/ShaderVariants.props @@ -0,0 +1,6 @@ + + + + + + diff --git a/SpectrumColorShift.Shader/SpectrumColorShift.Shader.vcxproj b/SpectrumColorShift.Shader/SpectrumColorShift.Shader.vcxproj index a9c21e5..b4e29a2 100644 --- a/SpectrumColorShift.Shader/SpectrumColorShift.Shader.vcxproj +++ b/SpectrumColorShift.Shader/SpectrumColorShift.Shader.vcxproj @@ -158,11 +158,12 @@ - - - - - + + + + + + Pixel diff --git a/SpectrumColorShift.Tests/ShaderVariantsTests.cs b/SpectrumColorShift.Tests/ShaderVariantsTests.cs index e90cd40..f327a4d 100644 --- a/SpectrumColorShift.Tests/ShaderVariantsTests.cs +++ b/SpectrumColorShift.Tests/ShaderVariantsTests.cs @@ -8,7 +8,11 @@ namespace SpectrumColorShift.Tests; public sealed partial class ShaderVariantsTests { - static string Project { get; } = File.ReadAllText(Path.Combine(Path.GetDirectoryName(Here())!, "..", "SpectrumColorShift.Shader", "SpectrumColorShift.Shader.vcxproj")); + static string Project { get; } = ShaderProjectFile("SpectrumColorShift.Shader.vcxproj"); + + static string Props { get; } = ShaderProjectFile("ShaderVariants.props"); + + static string ShaderProjectFile(string name) => File.ReadAllText(Path.Combine(Path.GetDirectoryName(Here())!, "..", "SpectrumColorShift.Shader", name)); static string Here([CallerFilePath] string path = "") => path; @@ -23,7 +27,7 @@ public sealed partial class ShaderVariantsTests [GeneratedRegex(@"ShaderMode=(?\d+)\s*\$\(OutDir\)(?SpectrumColorShiftPhysicalFilter|SpectrumColorShiftPhysical|SpectrumColorShift)(?[A-Za-z]+)%\((?StepCount|TapCount)\.Identity\)\.cso")] private static partial Regex VariantPattern(); - static IEnumerable Listed(Regex pattern) => pattern.Match(Project).Groups["counts"].Value.Split(';').Select(count => int.Parse(count, CultureInfo.InvariantCulture)); + static IEnumerable Listed(Regex pattern) => pattern.Match(Props).Groups["counts"].Value.Split(';').Select(count => int.Parse(count, CultureInfo.InvariantCulture)); [Fact] public void TheStepCountsCoverTheWholeRangeInWholeQuanta() @@ -42,7 +46,7 @@ public sealed partial class ShaderVariantsTests } [Fact] - public void TheShaderProjectCompilesExactlyTheseCounts() + public void TheSharedPropsListExactlyTheseCounts() { Assert.Equal(ShaderVariants.Legacy.Counts, Listed(StepCountsPattern())); Assert.Equal(ShaderVariants.Filter.Counts, Listed(TapCountsPattern())); diff --git a/SpectrumColorShift/SpectrumColorShift.csproj b/SpectrumColorShift/SpectrumColorShift.csproj index 054f72d..1aaac70 100644 --- a/SpectrumColorShift/SpectrumColorShift.csproj +++ b/SpectrumColorShift/SpectrumColorShift.csproj @@ -11,6 +11,8 @@ ..\Release\ + + <_Parameter1>SpectrumColorShift.Tests @@ -61,7 +63,14 @@ - + + + + + + + +