Fixed Bool2 mappings
このコミットが含まれているのは:
1 親
51bfe59ef7
コミット
1b6e7d6a4c
3ファイル変更
+19
-11
検索条件に一致するファイルはありません
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using ComputeSharp.Core;
|
||||
using ComputeSharp.Graphics;
|
||||
using ComputeSharp.Graphics.Buffers.Abstract;
|
||||
|
||||
@@ -128,6 +128,12 @@ namespace ComputeSharp.Shaders.Mappings
|
||||
["System.Numerics.Vector4.Zero"] = "(float4)0",
|
||||
["System.Numerics.Vector4.One"] = "float4(1.0f, 1.0f, 1.0f, 1.0f)",
|
||||
|
||||
// Bool2
|
||||
["ComputeSharp.Bool2.False"] = "(bool2)0",
|
||||
["ComputeSharp.Bool2.True"] = "bool2(true, true)",
|
||||
["ComputeSharp.Bool2.TrueX"] = "bool2(true, false)",
|
||||
["ComputeSharp.Bool2.TrueY"] = "bool2(false, true)",
|
||||
|
||||
// Int2
|
||||
["ComputeSharp.Int2.Zero"] = "(int2)0",
|
||||
["ComputeSharp.Int2.One"] = "int2(1, 1)",
|
||||
|
||||
@@ -17,26 +17,27 @@ namespace ComputeSharp.Shaders.Mappings
|
||||
private static readonly IReadOnlyDictionary<string, string> KnownTypes = new Dictionary<string, string>
|
||||
{
|
||||
[typeof(bool).FullName] = "bool",
|
||||
[typeof(Bool2).FullName] = "bool2",
|
||||
[typeof(int).FullName] = "int",
|
||||
[typeof(uint).FullName] = "uint",
|
||||
[typeof(float).FullName] = "float",
|
||||
[typeof(double).FullName] = "double",
|
||||
[typeof(Vector2).FullName] = "float2",
|
||||
[typeof(Vector3).FullName] = "float3",
|
||||
[typeof(Vector4).FullName] = "float4",
|
||||
[typeof(ThreadIds).FullName] = "uint3",
|
||||
[typeof(Int2).FullName] = "int2",
|
||||
[typeof(Int3).FullName] = "int3",
|
||||
[typeof(Int4).FullName] = "int4",
|
||||
[typeof(uint).FullName] = "uint",
|
||||
[typeof(UInt2).FullName] = "uint2",
|
||||
[typeof(UInt3).FullName] = "uint3",
|
||||
[typeof(UInt4).FullName] = "uint4",
|
||||
[typeof(float).FullName] = "float",
|
||||
[typeof(Float2).FullName] = "float2",
|
||||
[typeof(Float3).FullName] = "float3",
|
||||
[typeof(Float4).FullName] = "float4",
|
||||
[typeof(Vector2).FullName] = "float2",
|
||||
[typeof(Vector3).FullName] = "float3",
|
||||
[typeof(Vector4).FullName] = "float4",
|
||||
[typeof(double).FullName] = "double",
|
||||
[typeof(Double2).FullName] = "double2",
|
||||
[typeof(Double3).FullName] = "double3",
|
||||
[typeof(Double4).FullName] = "double4",
|
||||
[typeof(ThreadIds).FullName] = "uint3",
|
||||
[typeof(ReadOnlyBuffer<>).FullName] = "StructuredBuffer",
|
||||
[typeof(ReadWriteBuffer<>).FullName] = "RWStructuredBuffer"
|
||||
};
|
||||
@@ -46,6 +47,7 @@ namespace ComputeSharp.Shaders.Mappings
|
||||
/// </summary>
|
||||
public static IReadOnlyList<Type> KnownVectorTypes { get; } = new[]
|
||||
{
|
||||
typeof(Bool2),
|
||||
typeof(Int2), typeof(Int3), typeof(Int4),
|
||||
typeof(UInt2), typeof(UInt3), typeof(UInt4),
|
||||
typeof(Float2), typeof(Float3), typeof(Float4),
|
||||
@@ -70,9 +72,7 @@ namespace ComputeSharp.Shaders.Mappings
|
||||
/// <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 known HLSL vector type</returns>
|
||||
[Pure]
|
||||
public static bool IsKnownVectorType(Type type) => type == typeof(Vector2) ||
|
||||
type == typeof(Vector3) ||
|
||||
type == typeof(Vector4) ||
|
||||
public static bool IsKnownVectorType(Type type) => type == typeof(Bool2) ||
|
||||
type == typeof(Int2) ||
|
||||
type == typeof(Int3) ||
|
||||
type == typeof(Int4) ||
|
||||
@@ -82,6 +82,9 @@ namespace ComputeSharp.Shaders.Mappings
|
||||
type == typeof(Float2) ||
|
||||
type == typeof(Float3) ||
|
||||
type == typeof(Float4) ||
|
||||
type == typeof(Vector2) ||
|
||||
type == typeof(Vector3) ||
|
||||
type == typeof(Vector4) ||
|
||||
type == typeof(Double2) ||
|
||||
type == typeof(Double3) ||
|
||||
type == typeof(Double4);
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする