diff --git a/tests/ComputeSharp.D2D1.Tests/D2D1InteropServicesTests.cs b/tests/ComputeSharp.D2D1.Tests/D2D1InteropServicesTests.cs index c797a527..fa89d21e 100644 --- a/tests/ComputeSharp.D2D1.Tests/D2D1InteropServicesTests.cs +++ b/tests/ComputeSharp.D2D1.Tests/D2D1InteropServicesTests.cs @@ -42,4 +42,61 @@ public partial class D2D1InteropServicesTests return 0; } } + + [TestMethod] + public unsafe void GetOutputBufferPrecision() + { + Assert.AreEqual(D2D1PixelShader.GetOutputBufferPrecision(), D2D1BufferPrecision.Unknown); + Assert.AreEqual(D2D1PixelShader.GetOutputBufferPrecision(), D2D1BufferPrecision.Int16Normalized); + Assert.AreEqual(D2D1PixelShader.GetOutputBufferPrecision(), D2D1BufferPrecision.Unknown); + Assert.AreEqual(D2D1PixelShader.GetOutputBufferPrecision(), D2D1BufferPrecision.Int8NormalizedSRGB); + } + + [TestMethod] + public unsafe void GetOutputBufferChannelDepth() + { + Assert.AreEqual(D2D1PixelShader.GetOutputBufferChannelDepth(), D2D1ChannelDepth.Default); + Assert.AreEqual(D2D1PixelShader.GetOutputBufferChannelDepth(), D2D1ChannelDepth.Default); + Assert.AreEqual(D2D1PixelShader.GetOutputBufferChannelDepth(), D2D1ChannelDepth.Four); + Assert.AreEqual(D2D1PixelShader.GetOutputBufferChannelDepth(), 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; + } + } } \ No newline at end of file