Add unit tests for new buffer output APIs

このコミットが含まれているのは:
Sergio Pedri committed 2022-05-07 21:24:13 +02:00
1 親 80fea25b5a
コミット e292eb6d9d
1ファイル変更
+57
+57
ファイルの表示
@@ -42,4 +42,61 @@ public partial class D2D1InteropServicesTests
return 0;
}
}
[TestMethod]
public unsafe void GetOutputBufferPrecision()
{
Assert.AreEqual(D2D1PixelShader.GetOutputBufferPrecision<ShaderWithMultipleInputs>(), D2D1BufferPrecision.Unknown);
Assert.AreEqual(D2D1PixelShader.GetOutputBufferPrecision<OnlyBufferPrecisionShader>(), D2D1BufferPrecision.Int16Normalized);
Assert.AreEqual(D2D1PixelShader.GetOutputBufferPrecision<OnlyChannelDepthShader>(), D2D1BufferPrecision.Unknown);
Assert.AreEqual(D2D1PixelShader.GetOutputBufferPrecision<CustomBufferOutputShader>(), D2D1BufferPrecision.Int8NormalizedSRGB);
}
[TestMethod]
public unsafe void GetOutputBufferChannelDepth()
{
Assert.AreEqual(D2D1PixelShader.GetOutputBufferChannelDepth<ShaderWithMultipleInputs>(), D2D1ChannelDepth.Default);
Assert.AreEqual(D2D1PixelShader.GetOutputBufferChannelDepth<OnlyBufferPrecisionShader>(), D2D1ChannelDepth.Default);
Assert.AreEqual(D2D1PixelShader.GetOutputBufferChannelDepth<OnlyChannelDepthShader>(), D2D1ChannelDepth.Four);
Assert.AreEqual(D2D1PixelShader.GetOutputBufferChannelDepth<CustomBufferOutputShader>(), D2D1ChannelDepth.One);
}
[D2DInputCount(0)]
partial struct EmptyShader : ID2D1PixelShader
{
public Float4 Execute()
{
return 0;
}
}
[D2DInputCount(0)]
[D2DOutputBuffer(D2D1BufferPrecision.Int16Normalized)]
partial struct OnlyBufferPrecisionShader : ID2D1PixelShader
{
public Float4 Execute()
{
return 0;
}
}
[D2DInputCount(0)]
[D2DOutputBuffer(D2D1ChannelDepth.Four)]
partial struct OnlyChannelDepthShader : ID2D1PixelShader
{
public Float4 Execute()
{
return 0;
}
}
[D2DInputCount(0)]
[D2DOutputBuffer(D2D1BufferPrecision.Int8NormalizedSRGB, D2D1ChannelDepth.One)]
partial struct CustomBufferOutputShader : ID2D1PixelShader
{
public Float4 Execute()
{
return 0;
}
}
}