diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.Syntax.cs
index 2f65635c..4dc54c8a 100644
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.Syntax.cs
+++ b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.Syntax.cs
@@ -2,6 +2,7 @@ using System.Linq;
using ComputeSharp.D2D1.SourceGenerators.Models;
using ComputeSharp.SourceGeneration.Extensions;
using ComputeSharp.SourceGeneration.Helpers;
+using ComputeSharp.SourceGeneration.Models;
using Microsoft.CodeAnalysis;
namespace ComputeSharp.D2D1.SourceGenerators;
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.cs
index cdefc28c..496d9798 100644
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.cs
+++ b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.cs
@@ -188,7 +188,7 @@ partial class D2DPixelShaderDescriptorGenerator
}
catch (FxcCompilationException e)
{
- return new HlslBytecodeInfo.FxcError(D3DCompiler.PrettifyFxcErrorMessage(e.Message));
+ return new HlslBytecodeInfo.CompilerError(D3DCompiler.PrettifyFxcErrorMessage(e.Message));
}
}
@@ -218,7 +218,7 @@ partial class D2DPixelShaderDescriptorGenerator
structDeclarationSymbol,
new object[] { structDeclarationSymbol, win32Error.HResult, win32Error.Message });
}
- else if (info is HlslBytecodeInfo.FxcError fxcError)
+ else if (info is HlslBytecodeInfo.CompilerError fxcError)
{
diagnostic = DiagnosticInfo.Create(
EmbeddedBytecodeFailedWithFxcCompilationException,
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.Execute.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.Execute.cs
index 3a1e4bc1..813e40ac 100644
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.Execute.cs
+++ b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.Execute.cs
@@ -142,7 +142,7 @@ partial class D2DPixelShaderSourceGenerator
methodSymbol,
new object[] { methodSymbol, methodSymbol.ContainingType, win32Error.HResult, win32Error.Message });
}
- else if (info is HlslBytecodeInfo.FxcError fxcError)
+ else if (info is HlslBytecodeInfo.CompilerError fxcError)
{
diagnostic = DiagnosticInfo.Create(
D2DPixelShaderSourceCompilationFailedWithFxcCompilationException,
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Models/HlslBytecodeInfo.cs b/src/ComputeSharp.D2D1.SourceGenerators/Models/HlslBytecodeInfo.cs
deleted file mode 100644
index fc547efe..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/Models/HlslBytecodeInfo.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using ComputeSharp.SourceGeneration.Helpers;
-
-namespace ComputeSharp.D2D1.SourceGenerators.Models;
-
-///
-/// A model representing info on compiled HLSL bytecode, if available.
-///
-internal abstract record HlslBytecodeInfo
-{
- ///
- /// A successfully compiled HLSL shader.
- ///
- /// The resulting HLSL bytecode.
- public sealed record Success(EquatableArray Bytecode) : HlslBytecodeInfo;
-
- ///
- /// An HLSL shader that failed to compile due to a Win32 error.
- ///
- /// The HRESULT for the error.
- /// The error message from compiling the shader.
- public sealed record Win32Error(int HResult, string Message) : HlslBytecodeInfo;
-
- ///
- /// An HLSL shader that failed to compile due to an FXC compiler error.
- ///
- /// The error message from compiling the shader.
- public sealed record FxcError(string Message) : HlslBytecodeInfo;
-
- ///
- /// No HLSL bytecode is available (ie. compilation was not requested or some other error was detected).
- ///
- public sealed record Missing : HlslBytecodeInfo
- {
- ///
- /// Gets the shared instance.
- ///
- public static Missing Instance { get; } = new();
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.SourceGeneration.Hlsl/ComputeSharp.SourceGeneration.Hlsl.projitems b/src/ComputeSharp.SourceGeneration.Hlsl/ComputeSharp.SourceGeneration.Hlsl.projitems
index 34a382a5..f8c64c28 100644
--- a/src/ComputeSharp.SourceGeneration.Hlsl/ComputeSharp.SourceGeneration.Hlsl.projitems
+++ b/src/ComputeSharp.SourceGeneration.Hlsl/ComputeSharp.SourceGeneration.Hlsl.projitems
@@ -21,6 +21,7 @@
+
diff --git a/src/ComputeSharp.SourceGenerators/Models/HlslBytecodeInfo.cs b/src/ComputeSharp.SourceGeneration.Hlsl/Models/HlslBytecodeInfo.cs
similarity index 86%
rename from src/ComputeSharp.SourceGenerators/Models/HlslBytecodeInfo.cs
rename to src/ComputeSharp.SourceGeneration.Hlsl/Models/HlslBytecodeInfo.cs
index 63fe4e9d..cb8b9bba 100644
--- a/src/ComputeSharp.SourceGenerators/Models/HlslBytecodeInfo.cs
+++ b/src/ComputeSharp.SourceGeneration.Hlsl/Models/HlslBytecodeInfo.cs
@@ -1,6 +1,6 @@
using ComputeSharp.SourceGeneration.Helpers;
-namespace ComputeSharp.SourceGenerators.Models;
+namespace ComputeSharp.SourceGeneration.Models;
///
/// A model representing info on compiled HLSL bytecode, if available.
@@ -21,10 +21,10 @@ internal abstract record HlslBytecodeInfo
public sealed record Win32Error(int HResult, string Message) : HlslBytecodeInfo;
///
- /// An HLSL shader that failed to compile due to an DXC compiler error.
+ /// An HLSL shader that failed to compile due to a compiler error.
///
/// The error message from compiling the shader.
- public sealed record DxcError(string Message) : HlslBytecodeInfo;
+ public sealed record CompilerError(string Message) : HlslBytecodeInfo;
///
/// No HLSL bytecode is available (ie. compilation was not requested or some other error was detected).
diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.Syntax.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.Syntax.cs
index 3ad8bb90..a2bf243c 100644
--- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.Syntax.cs
+++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.Syntax.cs
@@ -1,5 +1,6 @@
using ComputeSharp.SourceGeneration.Extensions;
using ComputeSharp.SourceGeneration.Helpers;
+using ComputeSharp.SourceGeneration.Models;
using ComputeSharp.SourceGenerators.Models;
namespace ComputeSharp.SourceGenerators;
diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.cs
index 3c178945..22451587 100644
--- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.cs
+++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.cs
@@ -160,7 +160,7 @@ partial class IShaderGenerator
}
catch (DxcCompilationException e)
{
- return new HlslBytecodeInfo.DxcError(FixupExceptionMessage(e.Message));
+ return new HlslBytecodeInfo.CompilerError(FixupExceptionMessage(e.Message));
}
}
@@ -184,7 +184,7 @@ partial class IShaderGenerator
structDeclarationSymbol,
new object[] { structDeclarationSymbol, win32Error.HResult, win32Error.Message });
}
- else if (info is HlslBytecodeInfo.DxcError dxcError)
+ else if (info is HlslBytecodeInfo.CompilerError dxcError)
{
diagnostic = DiagnosticInfo.Create(
EmbeddedBytecodeFailedWithDxcCompilationException,