Disable dynamic shader compilation support

このコミットが含まれているのは:
Sergio Pedri committed 2023-10-13 12:00:15 +02:00
1 親 3db275a157
コミット 490226aa4d
68ファイル変更
+169 -64

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

@@ -28,9 +28,7 @@ partial class IShaderGenerator
public static MethodDeclarationSyntax GetSyntax(HlslShaderSourceInfo hlslSourceInfo, bool supportsDynamicShaders, int hierarchyDepth)
{
// Generate the necessary body statements depending on whether dynamic shaders are supported
ImmutableArray<StatementSyntax> bodyStatements = supportsDynamicShaders
? GenerateRenderMethodBody(hlslSourceInfo, hierarchyDepth)
: GenerateEmptyMethodBody();
ImmutableArray<StatementSyntax> bodyStatements = GenerateRenderMethodBody(hlslSourceInfo, hierarchyDepth);
// This code produces a method declaration as follows:
//
-11
ファイルの表示
@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Linq;
using ComputeSharp.SourceGeneration.Models;
using ComputeSharp.SourceGenerators.Models;
using Microsoft.CodeAnalysis;
@@ -45,16 +44,6 @@ partial class IShaderGenerator
return null;
}
/// <summary>
/// Checks whether dynamic shaders are supported in a given compilation.
/// </summary>
/// <param name="compilation">The <see cref="Compilation"/> instance currently in use.</param>
/// <returns>Whether dynamic shaders are supported in the input compilation.</returns>
private static bool IsDynamicCompilationSupported(Compilation compilation)
{
return compilation.ReferencedAssemblyNames.Any(static identity => identity.Name is "ComputeSharp.Dynamic");
}
/// <summary>
/// Creates a <see cref="CompilationUnitSyntax"/> instance wrapping the given method.
/// </summary>
+2 -2
ファイルの表示
@@ -25,7 +25,7 @@ public sealed partial class IShaderGenerator : IIncrementalGenerator
// Check whether or not dynamic shaders are supported
IncrementalValueProvider<bool> supportsDynamicShaders =
context.CompilationProvider
.Select(static (compilation, _) => IsDynamicCompilationSupported(compilation));
.Select(static (compilation, _) => false);
// Discover all shader types and extract all the necessary info from each of them
IncrementalValuesProvider<ShaderInfo> shaderInfoWithErrors =
@@ -88,7 +88,7 @@ public sealed partial class IShaderGenerator : IIncrementalGenerator
ThreadIdsInfo threadIds = LoadBytecode.GetInfo(
diagnostics,
typeSymbol,
IsDynamicCompilationSupported(context.SemanticModel.Compilation));
false);
token.ThrowIfCancellationRequested();