Added specific writeable and readonly buffer types

このコミットが含まれているのは:
Sergio Pedri committed 2019-08-12 13:48:35 +02:00
1 親 acf2aa9fce
コミット 13ee3e9422
7ファイル変更
+74 -31

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

+5 -5
ファイルの表示
@@ -27,7 +27,7 @@ namespace ComputeSharp.Shaders.Mappings
[typeof(Vector4).FullName] = "float4",
[typeof(Matrix4x4).FullName] = "float4x4",
[typeof(ThreadIds).FullName] = "uint3",
[typeof(Buffer<>).FullName] = "RWBuffer"
[typeof(ReadWriteBuffer<>).FullName] = "RWBuffer"
};
/// <summary>
@@ -54,13 +54,13 @@ namespace ComputeSharp.Shaders.Mappings
type == typeof(Matrix4x4);
/// <summary>
/// Checks whether or not the input type is a <see cref="Buffer{T}"/> value
/// Checks whether or not the input type is a <see cref="ReadWriteBuffer{T}"/> value
/// </summary>
/// <param name="type">The input <see cref="Type"/> instance to check</param>
/// <returns>A <see langword="bool"/> indicating whether the input <see cref="Type"/> is in fact a <see cref="Buffer{T}"/> instance</returns>
/// <returns>A <see langword="bool"/> indicating whether the input <see cref="Type"/> is in fact a <see cref="ReadWriteBuffer{T}"/> instance</returns>
[Pure]
public static bool IsBufferType(Type type) => type.IsGenericType &&
type.GetGenericTypeDefinition() == typeof(Buffer<>);
public static bool IsReadWriteBufferType(Type type) => type.IsGenericType &&
type.GetGenericTypeDefinition() == typeof(ReadWriteBuffer<>);
/// <summary>
/// Checks whether or not a given <see cref="Type"/> is an HLSL known type