Switch IShader.BuildHlslSource to a property

このコミットが含まれているのは:
Sergio Pedri committed 2023-10-14 09:58:16 +02:00
1 親 8a4e63fcec
コミット 5b8113c2ce
3ファイル変更
+12 -20

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

+1 -1
ファイルの表示
@@ -104,7 +104,7 @@ public static class ReflectionServices
private static unsafe ShaderInfo GetNonGenericShaderInfo<T>(in T shader)
where T : struct, IShader
{
Unsafe.AsRef(in shader).BuildHlslSource(out string hlslSource);
string hlslSource = Unsafe.AsRef(in shader).HlslSource;
using ComPtr<IDxcBlob> dxcBlobBytecode = Shaders.Translation.ShaderCompiler.Instance.Compile(hlslSource);
+6 -11
ファイルの表示
@@ -19,17 +19,12 @@ partial class IShaderGenerator
{
writer.WriteLine("/// <inheritdoc/>");
writer.WriteGeneratedAttributes(GeneratorName);
writer.WriteLine("readonly void global::ComputeSharp.__Internals.IShader.BuildHlslSource(out string hlslSource)");
using (writer.WriteBlock())
{
writer.WriteLine("hlslSource =");
writer.IncreaseIndent();
writer.WriteLine("\"\"\"");
writer.Write(info.HlslInfoKey.HlslSource, isMultiline: true);
writer.WriteLine("\"\"\";");
writer.DecreaseIndent();
}
writer.WriteLine($"readonly string global::ComputeSharp.__Internals.IShader.HlslSource =>");
writer.IncreaseIndent();
writer.WriteLine("\"\"\"");
writer.Write(info.HlslInfoKey.HlslSource, isMultiline: true);
writer.WriteLine("\"\"\";");
writer.DecreaseIndent();
}
}
}
+5 -8
ファイルの表示
@@ -25,6 +25,11 @@ public interface IShader
/// </summary>
int ThreadsZ { get; }
/// <summary>
/// Gets the HLSL source code for the current shader instance.
/// </summary>
string HlslSource { get; }
/// <summary>
/// Gets the HLSL bytecode for the current shader.
/// </summary>
@@ -54,12 +59,4 @@ public interface IShader
[Obsolete("This method is not intended to be called directly by user code")]
void LoadDispatchMetadata<TLoader>(ref TLoader loader, out IntPtr result)
where TLoader : struct, IDispatchMetadataLoader;
/// <summary>
/// Builds the HLSL source code for the current shader instance.
/// </summary>
/// <param name="hlslSource">The resulting HLSL source.</param>
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("This method is not intended to be called directly by user code")]
void BuildHlslSource(out string hlslSource);
}