Add unit test for [D2DPixelShaderSource]
このコミットが含まれているのは:
1 親
c998002f90
コミット
7576cc3045
1ファイル変更
+34
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace ComputeSharp.D2D1.Tests;
|
||||
|
||||
[TestClass]
|
||||
[TestCategory("D2DPixelShaderSource")]
|
||||
public partial class D2DPixelShaderSourceTests
|
||||
{
|
||||
[D2DPixelShaderSource(@"
|
||||
#define D2D_INPUT_COUNT 1
|
||||
#define D2D_INPUT0_SIMPLE
|
||||
|
||||
#include ""d2d1effecthelpers.hlsli""
|
||||
|
||||
D2D_PS_ENTRY(Execute)
|
||||
{
|
||||
float4 color = D2DGetInput(0);
|
||||
float3 rgb = saturate(1.0 - color.rgb);
|
||||
return float4(rgb, 1);
|
||||
}
|
||||
")]
|
||||
[D2DEmbeddedBytecode(D2D1ShaderProfile.PixelShader50)]
|
||||
[D2DCompileOptions(D2D1CompileOptions.OptimizationLevel0)]
|
||||
private static partial ReadOnlySpan<byte> InvertEffect();
|
||||
|
||||
[TestMethod]
|
||||
public void VerifyInvertEffectBytecode()
|
||||
{
|
||||
ReadOnlySpan<byte> bytecode = InvertEffect();
|
||||
|
||||
Assert.IsTrue(bytecode.Length > 0);
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする