Added source generator support for shared buffers

このコミットが含まれているのは:
Sergio Pedri committed 2021-01-12 16:22:23 +01:00
1 親 80fd4d96e0
コミット 67d1d92cae
6ファイル変更
+53 -10

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

+9 -1
ファイルの表示
@@ -25,13 +25,15 @@ namespace ComputeSharp.__Internals
/// <param name="executeMethod">The source code for the <see cref="IComputeShader.Execute"/> method.</param>
/// <param name="methods">The collection of processed methods.</param>
/// <param name="constants">The collection of discovered constants.</param>
/// <param name="sharedBuffers">The collection of group shared buffers</param>
public IComputeShaderSourceAttribute(
string shaderTypeName,
string[] types,
object[] args,
string executeMethod,
string[] methods,
object[] constants)
object[] constants,
object[] sharedBuffers)
{
ShaderTypeName = shaderTypeName;
Types = types;
@@ -39,6 +41,7 @@ namespace ComputeSharp.__Internals
ExecuteMethod = executeMethod;
Methods = methods;
Constants = constants.Cast<string[]>().ToDictionary(static c => c[0], static c => c[1]);
SharedBuffers = sharedBuffers.Cast<object[]>().ToDictionary(static t => (string)t[0], static t => ((string)t[1], (int?)t[2]));
}
/// <summary>
@@ -71,6 +74,11 @@ namespace ComputeSharp.__Internals
/// </summary>
internal IReadOnlyDictionary<string, string> Constants { get; }
/// <summary>
/// Gets the collection of discovered constants.
/// </summary>
internal IReadOnlyDictionary<string, (string Type, int? Count)> SharedBuffers { get; }
/// <summary>
/// Gets the associated <see cref="IComputeShaderSourceAttribute"/> instance for a specified type.
/// </summary>