Fix handling empty shaders with just artificial fields

このコミットが含まれているのは:
Sergio Pedri committed 2023-11-20 21:11:45 +01:00
1 親 777f8537f2
コミット 940cdfdcdc
4ファイル変更
+46 -13

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

@@ -7,6 +7,12 @@ namespace ComputeSharp.SourceGeneration.SyntaxProcessors;
/// <inheritdoc/>
partial class ConstantBufferSyntaxProcessor
{
/// <inheritdoc/>
private static partial bool HasArtificialFields()
{
return true;
}
/// <inheritdoc/>
static partial void AppendArtificialFields(IConstantBufferInfo info, IndentedTextWriter writer)
{
@@ -22,6 +28,7 @@ partial class ConstantBufferSyntaxProcessor
""", isMultiline: true);
// The Z axis is only present for non pixel-shader-like compute shaders
writer.WriteLineIf(!((ShaderInfo)info).IsPixelShaderLike);
writer.WriteLineIf(
condition: !((ShaderInfo)info).IsPixelShaderLike,
"""