Initial draft support for 2D texture sampling
このコミットが含まれているのは:
1 親
5684e68637
コミット
640e612464
14ファイル変更
+194
-52
検索条件に一致するファイルはありません
@@ -33,6 +33,17 @@ namespace ComputeSharp.SourceGenerators.Mappings
|
||||
[$"ComputeSharp.IReadWriteTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3"
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The mapping of supported known samplers to HLSL resource type names.
|
||||
/// </summary>
|
||||
private static readonly IReadOnlyDictionary<string, string?> KnownResourceSamplers = new Dictionary<string, string?>
|
||||
{
|
||||
[$"ComputeSharp.ReadOnlyTexture2D`2.this[{typeof(float).FullName}, {typeof(float).FullName}]"] = "float2",
|
||||
[$"ComputeSharp.ReadOnlyTexture2D`2.this[{typeof(Float2).FullName}]"] = null,
|
||||
[$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(float).FullName}, {typeof(float).FullName}]"] = "float2",
|
||||
[$"ComputeSharp.IReadOnlyTexture2D`1.this[{typeof(Float2).FullName}]"] = null
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// The mapping of supported known size accessors for HLSL resource types.
|
||||
/// </summary>
|
||||
@@ -389,6 +400,18 @@ namespace ComputeSharp.SourceGenerators.Mappings
|
||||
return KnownResourceIndexers.TryGetValue(name, out mapped);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to get the mapped HLSL-compatible sampler resource 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 sampler.</returns>
|
||||
[Pure]
|
||||
public static bool TryGetMappedResourceSamplerAccessType(string name, out string? mapped)
|
||||
{
|
||||
return KnownResourceSamplers.TryGetValue(name, out mapped);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to get the mapped HLSL-compatible indexer vector type name for the input indexer name.
|
||||
/// </summary>
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする