Rename and update D2D1 generator files
このコミットが含まれているのは:
1 親
0fb876fde0
コミット
c9cb83724a
6ファイル変更
+23
-23
検索条件に一致するファイルはありません
+1
-1
@@ -8,7 +8,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
|
||||
partial class ID2D1ShaderGenerator
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
partial class InitializeFromDispatchData
|
||||
partial class CreateFromConstantBuffer
|
||||
{
|
||||
/// <summary>
|
||||
/// Writes the <c>CreateFromConstantBuffer</c> method.
|
||||
+1
-1
@@ -10,7 +10,7 @@ namespace ComputeSharp.D2D1.SourceGenerators;
|
||||
partial class ID2D1ShaderGenerator
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
partial class LoadBytecode
|
||||
partial class HlslBytecode
|
||||
{
|
||||
/// <summary>
|
||||
/// Writes the <c>ShaderProfile</c> property.
|
||||
+2
-2
@@ -21,9 +21,9 @@ namespace ComputeSharp.D2D1.SourceGenerators;
|
||||
partial class ID2D1ShaderGenerator
|
||||
{
|
||||
/// <summary>
|
||||
/// A helper with all logic to generate the <c>LoadBytecode</c> method.
|
||||
/// A helper with all logic to generate the HLSL bytecode properties.
|
||||
/// </summary>
|
||||
internal static partial class LoadBytecode
|
||||
internal static partial class HlslBytecode
|
||||
{
|
||||
/// <summary>
|
||||
/// The shared cache of <see cref="HlslBytecodeInfo"/> values.
|
||||
+2
-2
@@ -9,10 +9,10 @@ namespace ComputeSharp.D2D1.SourceGenerators;
|
||||
partial class ID2D1ShaderGenerator
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
partial class LoadDispatchData
|
||||
partial class LoadConstantBuffer
|
||||
{
|
||||
/// <summary>
|
||||
/// Writes the <c>LoadDispatchData</c> method.
|
||||
/// Writes the <c>LoadConstantBuffer</c> method.
|
||||
/// </summary>
|
||||
/// <param name="info">The input <see cref="D2D1ShaderInfo"/> instance with gathered shader info.</param>
|
||||
/// <param name="writer">The <see cref="IndentedTextWriter"/> instance to write into.</param>
|
||||
+2
-2
@@ -18,9 +18,9 @@ namespace ComputeSharp.D2D1.SourceGenerators;
|
||||
partial class ID2D1ShaderGenerator
|
||||
{
|
||||
/// <summary>
|
||||
/// A helper with all logic to generate the <c>LoadDispatchData</c> method.
|
||||
/// A helper with all logic to generate the <c>LoadConstantBuffer</c> method.
|
||||
/// </summary>
|
||||
private static partial class LoadDispatchData
|
||||
private static partial class LoadConstantBuffer
|
||||
{
|
||||
/// <summary>
|
||||
/// Explores a given type hierarchy and generates statements to load fields.
|
||||
@@ -74,7 +74,7 @@ public sealed partial class ID2D1ShaderGenerator : IIncrementalGenerator
|
||||
using ImmutableArrayBuilder<DiagnosticInfo> diagnostics = ImmutableArrayBuilder<DiagnosticInfo>.Rent();
|
||||
|
||||
// LoadDispatchData() info
|
||||
ImmutableArray<FieldInfo> fieldInfos = LoadDispatchData.GetInfo(
|
||||
ImmutableArray<FieldInfo> fieldInfos = LoadConstantBuffer.GetInfo(
|
||||
diagnostics,
|
||||
typeSymbol,
|
||||
out int constantBufferSizeInBytes);
|
||||
@@ -132,11 +132,11 @@ public sealed partial class ID2D1ShaderGenerator : IIncrementalGenerator
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
// Get the shader profile and linking info for LoadBytecode()
|
||||
bool isLinkingSupported = LoadBytecode.IsSimpleInputShader(typeSymbol, inputCount);
|
||||
D2D1ShaderProfile? requestedShaderProfile = LoadBytecode.GetRequestedShaderProfile(typeSymbol);
|
||||
D2D1CompileOptions? requestedCompileOptions = LoadBytecode.GetRequestedCompileOptions(diagnostics, typeSymbol);
|
||||
D2D1ShaderProfile effectiveShaderProfile = LoadBytecode.GetEffectiveShaderProfile(requestedShaderProfile);
|
||||
D2D1CompileOptions effectiveCompileOptions = LoadBytecode.GetEffectiveCompileOptions(requestedCompileOptions, isLinkingSupported);
|
||||
bool isLinkingSupported = HlslBytecode.IsSimpleInputShader(typeSymbol, inputCount);
|
||||
D2D1ShaderProfile? requestedShaderProfile = HlslBytecode.GetRequestedShaderProfile(typeSymbol);
|
||||
D2D1CompileOptions? requestedCompileOptions = HlslBytecode.GetRequestedCompileOptions(diagnostics, typeSymbol);
|
||||
D2D1ShaderProfile effectiveShaderProfile = HlslBytecode.GetEffectiveShaderProfile(requestedShaderProfile);
|
||||
D2D1CompileOptions effectiveCompileOptions = HlslBytecode.GetEffectiveCompileOptions(requestedCompileOptions, isLinkingSupported);
|
||||
bool hasErrors = diagnostics.Count > 0;
|
||||
|
||||
token.ThrowIfCancellationRequested();
|
||||
@@ -152,12 +152,12 @@ public sealed partial class ID2D1ShaderGenerator : IIncrementalGenerator
|
||||
hasErrors);
|
||||
|
||||
// TODO: cache this across transform runs
|
||||
HlslBytecodeInfo hlslInfo = LoadBytecode.GetInfo(ref hlslInfoKey, token);
|
||||
HlslBytecodeInfo hlslInfo = HlslBytecode.GetInfo(ref hlslInfoKey, token);
|
||||
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
// Append any diagnostic for the shader compilation
|
||||
LoadBytecode.GetInfoDiagnostics(typeSymbol, hlslInfo, diagnostics);
|
||||
HlslBytecode.GetInfoDiagnostics(typeSymbol, hlslInfo, diagnostics);
|
||||
|
||||
token.ThrowIfCancellationRequested();
|
||||
|
||||
@@ -210,20 +210,20 @@ public sealed partial class ID2D1ShaderGenerator : IIncrementalGenerator
|
||||
declaredMembers.Add(PixelOptions.WriteSyntax);
|
||||
declaredMembers.Add(OutputBuffer.WriteBufferPrecisionSyntax);
|
||||
declaredMembers.Add(OutputBuffer.WriteChannelDepthSyntax);
|
||||
declaredMembers.Add(LoadBytecode.WriteShaderProfileSyntax);
|
||||
declaredMembers.Add(LoadBytecode.WriteCompileOptionsSyntax);
|
||||
declaredMembers.Add(HlslBytecode.WriteShaderProfileSyntax);
|
||||
declaredMembers.Add(HlslBytecode.WriteCompileOptionsSyntax);
|
||||
declaredMembers.Add(HlslSource.WriteSyntax);
|
||||
declaredMembers.Add(LoadBytecode.WriteHlslBytecodeSyntax);
|
||||
declaredMembers.Add(InitializeFromDispatchData.WriteSyntax);
|
||||
declaredMembers.Add(LoadDispatchData.WriteSyntax);
|
||||
declaredMembers.Add(HlslBytecode.WriteHlslBytecodeSyntax);
|
||||
declaredMembers.Add(CreateFromConstantBuffer.WriteSyntax);
|
||||
declaredMembers.Add(LoadConstantBuffer.WriteSyntax);
|
||||
|
||||
using ImmutableArrayBuilder<IndentedTextWriter.Callback<D2D1ShaderInfo>> additionalTypes = ImmutableArrayBuilder<IndentedTextWriter.Callback<D2D1ShaderInfo>>.Rent();
|
||||
using ImmutableHashSetBuilder<string> usingDirectives = ImmutableHashSetBuilder<string>.Rent();
|
||||
|
||||
LoadDispatchData.RegisterAdditionalTypeSyntax(item, additionalTypes, usingDirectives);
|
||||
LoadConstantBuffer.RegisterAdditionalTypeSyntax(item, additionalTypes, usingDirectives);
|
||||
InputDescriptions.RegisterAdditionalTypeSyntax(item, additionalTypes, usingDirectives);
|
||||
InputTypes.RegisterAdditionalTypeSyntax(item, additionalTypes, usingDirectives);
|
||||
LoadBytecode.RegisterAdditionalTypeSyntax(item, additionalTypes, usingDirectives);
|
||||
HlslBytecode.RegisterAdditionalTypeSyntax(item, additionalTypes, usingDirectives);
|
||||
|
||||
using IndentedTextWriter writer = IndentedTextWriter.Rent();
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする