Add D2D attribute types
このコミットが含まれているのは:
1 親
d605b345df
コミット
0326de6a8c
4ファイル変更
+100
検索条件に一致するファイルはありません
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
|
||||
namespace ComputeSharp.D2D1Interop;
|
||||
|
||||
/// <summary>
|
||||
/// An attribute for a D2D1 shader indicating that an input resource at a specified index uses complex sampling.
|
||||
/// This attribute is optional, and not using it will cause inputs to default to complex sampling as well.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>This attribute directly maps to <c>#define D2D_INPUT<N>_COMPLEX</c>.</para>
|
||||
/// <para>For more info, see <see href="https://docs.microsoft.com/en-us/windows/win32/direct2d/hlsl-helpers"/>.</para></remarks>
|
||||
[AttributeUsage(AttributeTargets.Struct, AllowMultiple = true)]
|
||||
public sealed class D2DInputComplexAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new instance of the <see cref="D2DInputComplexAttribute"/> type with the specified arguments.
|
||||
/// </summary>
|
||||
/// <param name="index">The index of the resource to declare as using complex sampling.</param>
|
||||
public D2DInputComplexAttribute(int index)
|
||||
{
|
||||
Index = index;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the index of the resource declared as using complex sampling.
|
||||
/// </summary>
|
||||
public int Index { get; }
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
|
||||
namespace ComputeSharp.D2D1Interop;
|
||||
|
||||
/// <summary>
|
||||
/// An attribute for a D2D1 shader indicating the number of texture inputs for the shader.
|
||||
/// Using this attribute is mandatory when defining a D2D1 shader.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>This attribute directly maps to <c>#define D2D_INPUT_COUNT <N></c>.</para>
|
||||
/// <para>For more info, see <see href="https://docs.microsoft.com/en-us/windows/win32/direct2d/hlsl-helpers"/>.</para></remarks>
|
||||
[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)]
|
||||
public sealed class D2DInputCountAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new instance of the <see cref="D2DInputCountAttribute"/> type with the specified arguments.
|
||||
/// </summary>
|
||||
/// <param name="count">The number of texture inputs for the shader.</param>
|
||||
public D2DInputCountAttribute(int count)
|
||||
{
|
||||
Count = count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of texture inputs for the shader.
|
||||
/// </summary>
|
||||
public int Count { get; }
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
|
||||
namespace ComputeSharp.D2D1Interop;
|
||||
|
||||
/// <summary>
|
||||
/// An attribute for a D2D1 shader indicating that an input resource at a specified index uses simple
|
||||
/// sampling. This attribute is optional, and not using it will cause inputs to default to complex sampling.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>This attribute directly maps to <c>#define D2D_INPUT<N>_SIMPLE</c>.</para>
|
||||
/// <para>For more info, see <see href="https://docs.microsoft.com/en-us/windows/win32/direct2d/hlsl-helpers"/>.</para></remarks>
|
||||
[AttributeUsage(AttributeTargets.Struct, AllowMultiple = true)]
|
||||
public sealed class D2DInputSimpleAttribute : Attribute
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new instance of the <see cref="D2DInputSimpleAttribute"/> type with the specified arguments.
|
||||
/// </summary>
|
||||
/// <param name="index">The index of the resource to declare as using simple sampling.</param>
|
||||
public D2DInputSimpleAttribute(int index)
|
||||
{
|
||||
Index = index;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the index of the resource declared as using simple sampling.
|
||||
/// </summary>
|
||||
public int Index { get; }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace ComputeSharp.D2D1Interop;
|
||||
|
||||
/// <summary>
|
||||
/// An attribute for a D2D1 shader indicating that the shader function calls helper methods that use the scene position
|
||||
/// value (that is, <see cref="D2D1.GetScenePosition"/>). This parameter should only be included when necessary, since
|
||||
/// only one function per linked shader can utilize this parameter. Defining this value is optional.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>This attribute directly maps to <c>#define D2D_REQUIRES_SCENE_POSITION</c>.</para>
|
||||
/// <para>For more info, see <see href="https://docs.microsoft.com/en-us/windows/win32/direct2d/hlsl-helpers"/>.</para></remarks>
|
||||
[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)]
|
||||
public sealed class D2DRequiresScenePositionAttribute : Attribute
|
||||
{
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする