Set D2D1 enum values to be the same as D2D1 ones
Also some minor tweaks to the enums
このコミットが含まれているのは:
1 親
966f5ee06d
コミット
e81a39d27a
3ファイル変更
+20
-16
検索条件に一致するファイルはありません
@@ -1,4 +1,6 @@
|
||||
namespace ComputeSharp.D2D1;
|
||||
using static TerraFX.Interop.DirectX.D2D1_BUFFER_PRECISION;
|
||||
|
||||
namespace ComputeSharp.D2D1;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates the bit depth to use in the imaging pipeline in Direct2D to produce the result of a D2D1 shader.
|
||||
@@ -12,30 +14,30 @@ public enum D2D1BufferPrecision
|
||||
/// <summary>
|
||||
/// The buffer precision is not specified.
|
||||
/// </summary>
|
||||
Unknown,
|
||||
Unknown = (int)D2D1_BUFFER_PRECISION_UNKNOWN,
|
||||
|
||||
/// <summary>
|
||||
/// The buffer precision uses 8-bit normalized integer values per channel.
|
||||
/// </summary>
|
||||
Int8Normalized,
|
||||
UInt8Normalized = (int)D2D1_BUFFER_PRECISION_8BPC_UNORM,
|
||||
|
||||
/// <summary>
|
||||
/// The buffer precision uses 8-bit normalized integer values per channel with standard RGB data.
|
||||
/// </summary>
|
||||
Int8NormalizedSRGB,
|
||||
UInt8NormalizedSrgb = (int)D2D1_BUFFER_PRECISION_8BPC_UNORM_SRGB,
|
||||
|
||||
/// <summary>
|
||||
/// The buffer precision uses 16-bit normalized integer values per channel.
|
||||
/// </summary>
|
||||
Int16Normalized,
|
||||
UInt16Normalized = (int)D2D1_BUFFER_PRECISION_16BPC_UNORM,
|
||||
|
||||
/// <summary>
|
||||
/// The buffer precision uses 16-bit float values per channel.
|
||||
/// </summary>
|
||||
Float16,
|
||||
Float16 = (int)D2D1_BUFFER_PRECISION_16BPC_FLOAT,
|
||||
|
||||
/// <summary>
|
||||
/// The buffer precision uses 32-bit float values per channel.
|
||||
/// </summary>
|
||||
Float32
|
||||
Float32 = (int)D2D1_BUFFER_PRECISION_32BPC_FLOAT
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace ComputeSharp.D2D1;
|
||||
using static TerraFX.Interop.DirectX.D2D1_CHANNEL_DEPTH;
|
||||
|
||||
namespace ComputeSharp.D2D1;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates the channel depth of a stage in a Direct2D rendering pipeline.
|
||||
@@ -10,17 +12,17 @@
|
||||
public enum D2D1ChannelDepth
|
||||
{
|
||||
/// <summary>
|
||||
/// The channel depth is the default, and it will be inherited by the inputs.
|
||||
/// The channel depth is the default, and it will be inherited from the inputs.
|
||||
/// </summary>
|
||||
Default = 0,
|
||||
Default = (int)D2D1_CHANNEL_DEPTH_DEFAULT,
|
||||
|
||||
/// <summary>
|
||||
/// The channel depth is 1.
|
||||
/// </summary>
|
||||
One = 1,
|
||||
One = (int)D2D1_CHANNEL_DEPTH_1,
|
||||
|
||||
/// <summary>
|
||||
/// The channel depth is 4.
|
||||
/// </summary>
|
||||
Four = 4
|
||||
Four = (int)D2D1_CHANNEL_DEPTH_4
|
||||
}
|
||||
@@ -47,9 +47,9 @@ public partial class D2D1InteropServicesTests
|
||||
public unsafe void GetOutputBufferPrecision()
|
||||
{
|
||||
Assert.AreEqual(D2D1PixelShader.GetOutputBufferPrecision<ShaderWithMultipleInputs>(), D2D1BufferPrecision.Unknown);
|
||||
Assert.AreEqual(D2D1PixelShader.GetOutputBufferPrecision<OnlyBufferPrecisionShader>(), D2D1BufferPrecision.Int16Normalized);
|
||||
Assert.AreEqual(D2D1PixelShader.GetOutputBufferPrecision<OnlyBufferPrecisionShader>(), D2D1BufferPrecision.UInt16Normalized);
|
||||
Assert.AreEqual(D2D1PixelShader.GetOutputBufferPrecision<OnlyChannelDepthShader>(), D2D1BufferPrecision.Unknown);
|
||||
Assert.AreEqual(D2D1PixelShader.GetOutputBufferPrecision<CustomBufferOutputShader>(), D2D1BufferPrecision.Int8NormalizedSRGB);
|
||||
Assert.AreEqual(D2D1PixelShader.GetOutputBufferPrecision<CustomBufferOutputShader>(), D2D1BufferPrecision.UInt8NormalizedSrgb);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
@@ -71,7 +71,7 @@ public partial class D2D1InteropServicesTests
|
||||
}
|
||||
|
||||
[D2DInputCount(0)]
|
||||
[D2DOutputBuffer(D2D1BufferPrecision.Int16Normalized)]
|
||||
[D2DOutputBuffer(D2D1BufferPrecision.UInt16Normalized)]
|
||||
partial struct OnlyBufferPrecisionShader : ID2D1PixelShader
|
||||
{
|
||||
public Float4 Execute()
|
||||
@@ -91,7 +91,7 @@ public partial class D2D1InteropServicesTests
|
||||
}
|
||||
|
||||
[D2DInputCount(0)]
|
||||
[D2DOutputBuffer(D2D1BufferPrecision.Int8NormalizedSRGB, D2D1ChannelDepth.One)]
|
||||
[D2DOutputBuffer(D2D1BufferPrecision.UInt8NormalizedSrgb, D2D1ChannelDepth.One)]
|
||||
partial struct CustomBufferOutputShader : ID2D1PixelShader
|
||||
{
|
||||
public Float4 Execute()
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする