Rename [D2DEmbeddedBytecode] to [D2DShaderProfile]

このコミットが含まれているのは:
Sergio Pedri committed 2022-08-18 14:26:10 +02:00
1 親 140aa10a12
コミット 1738f36455
18ファイル変更
+29 -29

検索条件に一致するファイルはありません

+1 -1
ファイルの表示
@@ -72,7 +72,7 @@
<Compile Include="..\ComputeSharp.D2D1\Attributes\Enums\D2D1Filter.cs" Link="ComputeSharp.D2D1\Attributes\Enums\D2D1Filter.cs" />
<Compile Include="..\ComputeSharp.D2D1\Attributes\Enums\D2D1PixelOptions.cs" Link="ComputeSharp.D2D1\Attributes\Enums\D2D1PixelOptions.cs" />
<Compile Include="..\ComputeSharp.D2D1\Attributes\D2DCompileOptionsAttribute.cs" Link="ComputeSharp.D2D1\Attributes\D2DCompileOptionsAttribute.cs" />
<Compile Include="..\ComputeSharp.D2D1\Attributes\D2DEmbeddedBytecodeAttribute.cs" Link="ComputeSharp.D2D1\Attributes\D2DEmbeddedBytecodeAttribute.cs" />
<Compile Include="..\ComputeSharp.D2D1\Attributes\D2DShaderProfileAttribute.cs" Link="ComputeSharp.D2D1\Attributes\D2DShaderProfileAttribute.cs" />
<Compile Include="..\ComputeSharp.D2D1\Attributes\D2DInputComplexAttribute.cs" Link="ComputeSharp.D2D1\Attributes\D2DInputComplexAttribute.cs" />
<Compile Include="..\ComputeSharp.D2D1\Attributes\D2DInputCountAttribute.cs" Link="ComputeSharp.D2D1\Attributes\D2DInputCountAttribute.cs" />
<Compile Include="..\ComputeSharp.D2D1\Attributes\D2DInputSimpleAttribute.cs" Link="ComputeSharp.D2D1\Attributes\D2DInputSimpleAttribute.cs" />
+2 -2
ファイルの表示
@@ -82,12 +82,12 @@ partial class D2DPixelShaderSourceGenerator
/// <returns>The shader profile to use to compile the shader, if present.</returns>
public static D2D1ShaderProfile GetShaderProfile(ImmutableArray<Diagnostic>.Builder diagnostics, IMethodSymbol methodSymbol)
{
if (methodSymbol.TryGetAttributeWithFullMetadataName("ComputeSharp.D2D1.D2DEmbeddedBytecodeAttribute", out AttributeData? attributeData))
if (methodSymbol.TryGetAttributeWithFullMetadataName("ComputeSharp.D2D1.D2DShaderProfileAttribute", out AttributeData? attributeData))
{
return (D2D1ShaderProfile)attributeData!.ConstructorArguments[0].Value!;
}
if (methodSymbol.ContainingAssembly.TryGetAttributeWithFullMetadataName("ComputeSharp.D2D1.D2DEmbeddedBytecodeAttribute", out attributeData))
if (methodSymbol.ContainingAssembly.TryGetAttributeWithFullMetadataName("ComputeSharp.D2D1.D2DShaderProfileAttribute", out attributeData))
{
return (D2D1ShaderProfile)attributeData!.ConstructorArguments[0].Value!;
}
@@ -32,12 +32,12 @@ partial class ID2D1ShaderGenerator
/// <returns>The shader profile to use to compile the shader, if present.</returns>
public static D2D1ShaderProfile? GetShaderProfile(INamedTypeSymbol structDeclarationSymbol)
{
if (structDeclarationSymbol.TryGetAttributeWithFullMetadataName("ComputeSharp.D2D1.D2DEmbeddedBytecodeAttribute", out AttributeData? attributeData))
if (structDeclarationSymbol.TryGetAttributeWithFullMetadataName("ComputeSharp.D2D1.D2DShaderProfileAttribute", out AttributeData? attributeData))
{
return (D2D1ShaderProfile)attributeData!.ConstructorArguments[0].Value!;
}
if (structDeclarationSymbol.ContainingAssembly.TryGetAttributeWithFullMetadataName("ComputeSharp.D2D1.D2DEmbeddedBytecodeAttribute", out attributeData))
if (structDeclarationSymbol.ContainingAssembly.TryGetAttributeWithFullMetadataName("ComputeSharp.D2D1.D2DShaderProfileAttribute", out attributeData))
{
return (D2D1ShaderProfile)attributeData!.ConstructorArguments[0].Value!;
}
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ namespace ComputeSharp.D2D1;
/// <summary>
/// An attribute that indicates the compile options that should be used when compiling a given D2D1 shader.
/// This applies when the shader is precompiled (through <see cref="D2DEmbeddedBytecodeAttribute"/>) as well.
/// This applies when the shader is precompiled (through <see cref="D2DShaderProfileAttribute"/>) as well.
/// <para>
/// This attribute can be used to annotate shader types as follows:
/// <code>
+1 -1
ファイルの表示
@@ -28,7 +28,7 @@ namespace ComputeSharp.D2D1;
/// <para>
/// </para>
/// <para>
/// Methods can also be annotated with <see cref="D2DEmbeddedBytecodeAttribute"/> and <see cref="D2DCompileOptionsAttribute"/>
/// Methods can also be annotated with <see cref="D2DShaderProfileAttribute"/> and <see cref="D2DCompileOptionsAttribute"/>
/// to further customize the shader profile to use when compiling the HLSL source, and the compile options to use.
/// </para>
/// </summary>
@@ -3,12 +3,12 @@
namespace ComputeSharp.D2D1;
/// <summary>
/// An attribute that indicates that a given D2D1 shader should be precompiled at build time and embedded
/// directly into the containing assembly as static bytecode, to avoid compiling it at runtime.
/// An attribute that indicates that a given D2D1 shader should be precompiled at build time using a specific shader
/// profile and embedded directly into the containing assembly as static bytecode, to avoid compiling it at runtime.
/// <para>
/// This attribute can be used to annotate shader types as follows:
/// <code>
/// [D2DEmbeddedBytecode(D2D1ShaderProfile.PixelShader50)]
/// [D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
/// struct MyShader : ID2D1PixelShader
/// {
/// }
@@ -25,19 +25,19 @@ namespace ComputeSharp.D2D1;
/// </para>
/// </summary>
[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Assembly | AttributeTargets.Method, AllowMultiple = false)]
public sealed class D2DEmbeddedBytecodeAttribute : Attribute
public sealed class D2DShaderProfileAttribute : Attribute
{
/// <summary>
/// Creates a new <see cref="D2DEmbeddedBytecodeAttribute"/> instance with the specified parameters.
/// Creates a new <see cref="D2DShaderProfileAttribute"/> instance with the specified parameters.
/// </summary>
/// <param name="shaderProfile">The target shader profile to use to compile the shader.</param>
public D2DEmbeddedBytecodeAttribute(D2D1ShaderProfile shaderProfile)
public D2DShaderProfileAttribute(D2D1ShaderProfile shaderProfile)
{
ShaderProfile = shaderProfile;
}
/// <summary>
/// Gets the number of threads in each thread group for the X axis
/// The shader profile used to compile the annotated D2D1 pixel shader.
/// </summary>
public D2D1ShaderProfile ShaderProfile { get; }
}
+1 -1
ファイルの表示
@@ -163,7 +163,7 @@ public enum D2D1CompileOptions
/// <summary>
/// The default options for shaders compiled by ComputeSharp.D2D1. Specifically, this combination
/// of options is the one used by precompiled shaders (ie. when using <see cref="D2DEmbeddedBytecodeAttribute"/>),
/// of options is the one used by precompiled shaders (ie. when using <see cref="D2DShaderProfileAttribute"/>),
/// and when using <see cref="D2D1PixelShader.LoadBytecode{T}()"/> or any of the overloads.
/// </summary>
/// <remarks>
+1 -1
ファイルの表示
@@ -1,7 +1,7 @@
namespace ComputeSharp.D2D1;
/// <summary>
/// A <see langword="enum"/> to be used with <see cref="D2DEmbeddedBytecodeAttribute"/> to indicate the shader profile to use to precompile a shader.
/// A <see langword="enum"/> to be used with <see cref="D2DShaderProfileAttribute"/> to indicate the shader profile to use to precompile a shader.
/// </summary>
public enum D2D1ShaderProfile
{
+1 -1
ファイルの表示
@@ -21,7 +21,7 @@ public static class D2D1ReflectionServices
/// <typeparam name="T">The type of D2D1 shader to retrieve info for.</typeparam>
/// <returns>The resulting <see cref="D2D1ShaderInfo"/> instance.</returns>
/// <remarks>
/// If the target shader type <typeparamref name="T"/> is precompiled (ie. it's annotated with <see cref="D2DEmbeddedBytecodeAttribute"/>), that bytecode will
/// If the target shader type <typeparamref name="T"/> is precompiled (ie. it's annotated with <see cref="D2DShaderProfileAttribute"/>), that bytecode will
/// be reused to reflect on the shader, so the same shader profile and compile options will be reused, which can make the returned metadata more accurate.
/// <para>
/// If the shader is not precompiled, it will be compiled on the fly using the default settings for both the shader profile and the compile options. That is,
+2 -2
ファイルの表示
@@ -65,7 +65,7 @@ public partial class D2D1PixelShaderTests
[D2DInputSimple(0)]
[D2DInputSimple(1)]
[D2DInputSimple(2)]
[D2DEmbeddedBytecode(D2D1ShaderProfile.PixelShader50)]
[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
private readonly partial struct ShaderWithOverriddenProfile : ID2D1PixelShader
{
public float4 Execute()
@@ -133,7 +133,7 @@ public partial class D2D1PixelShaderTests
[D2DInputSimple(0)]
[D2DInputSimple(1)]
[D2DInputSimple(2)]
[D2DEmbeddedBytecode(D2D1ShaderProfile.PixelShader50)]
[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
[D2DCompileOptions(D2D1CompileOptions.Debug | D2D1CompileOptions.AvoidFlowControl | D2D1CompileOptions.PartialPrecision)]
private readonly partial struct ShaderWithOverriddenProfileAndOptions : ID2D1PixelShader
{
+1 -1
ファイルの表示
@@ -1,4 +1,4 @@
using ComputeSharp.D2D1;
[assembly: D2DEmbeddedBytecode(D2D1ShaderProfile.PixelShader41)]
[assembly: D2DShaderProfile(D2D1ShaderProfile.PixelShader41)]
[assembly: D2DCompileOptions(D2D1CompileOptions.IeeeStrictness | D2D1CompileOptions.OptimizationLevel2 | D2D1CompileOptions.PartialPrecision)]
+3 -3
ファイルの表示
@@ -212,7 +212,7 @@ public partial class D2D1PixelShaderTests
[D2DInputSimple(2)]
[D2DInputComplex(1)]
[D2DInputComplex(3)]
[D2DEmbeddedBytecode(D2D1ShaderProfile.PixelShader50)]
[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
[AutoConstructor]
partial struct ShaderWithResourceTextures : ID2D1PixelShader
{
@@ -291,7 +291,7 @@ public partial class D2D1PixelShaderTests
[D2DInputSimple(0)]
[D2DInputSimple(1)]
[D2DInputSimple(2)]
[D2DEmbeddedBytecode(D2D1ShaderProfile.PixelShader40Level91)]
[D2DShaderProfile(D2D1ShaderProfile.PixelShader40Level91)]
private readonly partial struct ShaderWithEmbeddedBytecode : ID2D1PixelShader
{
public float4 Execute()
@@ -337,7 +337,7 @@ public partial class D2D1PixelShaderTests
[D2DInputSimple(0)]
[D2DInputSimple(1)]
[D2DInputSimple(2)]
[D2DEmbeddedBytecode(D2D1ShaderProfile.PixelShader40Level91)]
[D2DShaderProfile(D2D1ShaderProfile.PixelShader40Level91)]
[D2DCompileOptions(D2D1CompileOptions.IeeeStrictness | D2D1CompileOptions.OptimizationLevel2)]
private readonly partial struct ShaderWithEmbeddedBytecodeAndCompileOptions : ID2D1PixelShader
{
+1 -1
ファイルの表示
@@ -20,7 +20,7 @@ public partial class D2DPixelShaderSourceTests
return float4(rgb, 1);
}
")]
[D2DEmbeddedBytecode(D2D1ShaderProfile.PixelShader50)]
[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
[D2DCompileOptions(D2D1CompileOptions.OptimizationLevel0)]
private static partial ReadOnlySpan<byte> InvertEffect();
+1 -1
ファイルの表示
@@ -3,7 +3,7 @@
[D2DInputCount(1)]
[D2DInputSimple(0)]
[D2DRequiresScenePosition]
[D2DEmbeddedBytecode(D2D1ShaderProfile.PixelShader50)]
[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
[AutoConstructor]
public partial struct CheckerboardClipEffect : ID2D1PixelShader
{
+1 -1
ファイルの表示
@@ -2,7 +2,7 @@
[D2DInputCount(1)]
[D2DInputSimple(0)]
[D2DEmbeddedBytecode(D2D1ShaderProfile.PixelShader50)]
[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
public partial struct InvertEffect : ID2D1PixelShader
{
/// <inheritdoc/>
+1 -1
ファイルの表示
@@ -2,7 +2,7 @@
[D2DInputCount(1)]
[D2DInputSimple(0)]
[D2DEmbeddedBytecode(D2D1ShaderProfile.PixelShader50)]
[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
[AutoConstructor]
public partial struct InvertWithThresholdEffect : ID2D1PixelShader
{
+1 -1
ファイルの表示
@@ -27,7 +27,7 @@ public sealed partial class PixelateEffect : ID2D1TransformMapper<PixelateEffect
[D2DInputCount(1)]
[D2DInputComplex(0)]
[D2DRequiresScenePosition]
[D2DEmbeddedBytecode(D2D1ShaderProfile.PixelShader40)]
[D2DShaderProfile(D2D1ShaderProfile.PixelShader40)]
[AutoConstructor]
public partial struct Shader : ID2D1PixelShader
{
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ namespace ComputeSharp.D2D1.Tests.Effects;
[D2DInputCount(0)]
[D2DRequiresScenePosition]
[D2DEmbeddedBytecode(D2D1ShaderProfile.PixelShader50)]
[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
[AutoConstructor]
public readonly partial struct ZonePlateEffect : ID2D1PixelShader
{