Update unit test projects
このコミットが含まれているのは:
1 親
ea65177941
コミット
a48290873e
7ファイル変更
+6
-165
検索条件に一致するファイルはありません
-5
@@ -22,11 +22,6 @@
|
||||
PrivateAssets="contentfiles;build" />
|
||||
</ItemGroup>
|
||||
|
||||
<!-- Define DISABLE_RUNTIME_SHADER_COMPILATION_SUPPORT if requested -->
|
||||
<PropertyGroup Condition="'$(DisableShaderCompilationSupport)' == 'true'">
|
||||
<DefineConstants>$(DefineConstants);DISABLE_RUNTIME_SHADER_COMPILATION_SUPPORT</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- When the .NET Standard 2.0 version of ComputeSharp is resolved, the TerraFX APIs are internal, as they
|
||||
are referenced from the shared project. The same reference is needed here to make all tests build fine. -->
|
||||
<Import Condition="'$(TargetFramework)' != 'net6.0'" Project="..\..\src\TerraFX.Interop.Windows\TerraFX.Interop.Windows.projitems" />
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using ComputeSharp.Interop;
|
||||
using ComputeSharp.Tests.Attributes;
|
||||
using ComputeSharp.Tests.Extensions;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -11,22 +10,10 @@ namespace ComputeSharp.Tests.DisableDynamicCompilation;
|
||||
[TestCategory("Dispatch")]
|
||||
public partial class DispatchTests
|
||||
{
|
||||
private static readonly bool IsDynamicCompilationDisabled =
|
||||
#if DISABLE_RUNTIME_SHADER_COMPILATION_SUPPORT
|
||||
true;
|
||||
#else
|
||||
false;
|
||||
#endif
|
||||
|
||||
[CombinatorialTestMethod]
|
||||
[AllDevices]
|
||||
public void ComputeShader_Test_Ok(Device device)
|
||||
{
|
||||
if (!IsDynamicCompilationDisabled)
|
||||
{
|
||||
Assert.Inconclusive();
|
||||
}
|
||||
|
||||
float[] array = Enumerable.Range(0, 128).Select(static i => (float)i).ToArray();
|
||||
|
||||
using ReadWriteBuffer<float> buffer = device.Get().AllocateReadWriteBuffer(array);
|
||||
@@ -48,11 +35,6 @@ public partial class DispatchTests
|
||||
[ExpectedException(typeof(NotSupportedException))]
|
||||
public void ComputeShader_Test_Fail(Device device)
|
||||
{
|
||||
if (!IsDynamicCompilationDisabled)
|
||||
{
|
||||
Assert.Inconclusive();
|
||||
}
|
||||
|
||||
using ReadWriteBuffer<float> buffer = device.Get().AllocateReadWriteBuffer<float>(128);
|
||||
|
||||
device.Get().For(128, 1, 1, 64, 1, 1, new ComputeShader(buffer, 2.0f));
|
||||
@@ -76,11 +58,6 @@ public partial class DispatchTests
|
||||
[AllDevices]
|
||||
public void PixelShader_Test_Ok(Device device)
|
||||
{
|
||||
if (!IsDynamicCompilationDisabled)
|
||||
{
|
||||
Assert.Inconclusive();
|
||||
}
|
||||
|
||||
using ReadWriteTexture2D<Rgba32, float4> texture = device.Get().AllocateReadWriteTexture2D<Rgba32, float4>(128, 128);
|
||||
|
||||
device.Get().ForEach(texture, new PixelShader(0.3f, 0.6f));
|
||||
@@ -120,28 +97,4 @@ public partial class DispatchTests
|
||||
return new(ThreadIds.Normalized.X, ThreadIds.Normalized.Y, b, a);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[ExpectedException(typeof(NotSupportedException))]
|
||||
public void ReflectionService_ComputeShader()
|
||||
{
|
||||
if (!IsDynamicCompilationDisabled)
|
||||
{
|
||||
Assert.Inconclusive();
|
||||
}
|
||||
|
||||
ReflectionServices.GetShaderInfo<ComputeShader>(out _);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[ExpectedException(typeof(NotSupportedException))]
|
||||
public void ReflectionService_PixelShader()
|
||||
{
|
||||
if (!IsDynamicCompilationDisabled)
|
||||
{
|
||||
Assert.Inconclusive();
|
||||
}
|
||||
|
||||
ReflectionServices.GetShaderInfo<PixelShader, float4>(out _);
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする