Enabled shader generation for texture indexer overloads
このコミットが含まれているのは:
1 親
c262cd5519
コミット
c208dc29b1
4ファイル変更
+60
-1
検索条件に一致するファイルはありません
@@ -12,6 +12,17 @@ namespace ComputeSharp.SourceGenerators.Mappings
|
||||
/// </summary>
|
||||
internal static class HlslKnownMembers
|
||||
{
|
||||
/// <summary>
|
||||
/// The mapping of supported known indexers to HLSL vector type names.
|
||||
/// </summary>
|
||||
private static readonly IReadOnlyDictionary<string, string> KnownIndexers = new Dictionary<string, string>
|
||||
{
|
||||
[$"ComputeSharp.ReadOnlyTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2",
|
||||
[$"ComputeSharp.ReadWriteTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2",
|
||||
[$"ComputeSharp.ReadOnlyTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3",
|
||||
[$"ComputeSharp.ReadWriteTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3"
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The mapping of supported known members to HLSL names.
|
||||
/// </summary>
|
||||
@@ -162,5 +173,17 @@ namespace ComputeSharp.SourceGenerators.Mappings
|
||||
{
|
||||
return KnownMembers.TryGetValue(name, out mapped);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to get the mapped HLSL-compatible indexer vector type name for the input indexer name.
|
||||
/// </summary>
|
||||
/// <param name="name">The input fully qualified indexer name.</param>
|
||||
/// <param name="mapped">The mapped type name, if one is found.</param>
|
||||
/// <returns>The HLSL-compatible type name that can be used in an HLSL shader for the given indexer.</returns>
|
||||
[Pure]
|
||||
public static bool TryGetMappedIndexerTypeName(string name, out string? mapped)
|
||||
{
|
||||
return KnownIndexers.TryGetValue(name, out mapped);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,7 +41,7 @@ namespace ComputeSharp.SourceGenerators.Mappings
|
||||
[typeof(Double2).FullName] = "double2",
|
||||
[typeof(Double3).FullName] = "double3",
|
||||
[typeof(Double4).FullName] = "double4",
|
||||
[typeof(ThreadIds).FullName] = "uint3"
|
||||
[typeof(ThreadIds).FullName] = "int3"
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする