From 068eaef84337c9b02d077cb99e42421f7fec13d8 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 26 Aug 2019 00:30:55 +0200 Subject: [PATCH] Added new HLSL vector types to known types mapping --- .../Mappings/HlslKnownTypes.cs | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/ComputeSharp.Shaders/Mappings/HlslKnownTypes.cs b/src/ComputeSharp.Shaders/Mappings/HlslKnownTypes.cs index 0140ed18..cd318772 100644 --- a/src/ComputeSharp.Shaders/Mappings/HlslKnownTypes.cs +++ b/src/ComputeSharp.Shaders/Mappings/HlslKnownTypes.cs @@ -26,6 +26,18 @@ namespace ComputeSharp.Shaders.Mappings [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(UInt2).FullName] = "uint2", + [typeof(UInt3).FullName] = "uint3", + [typeof(UInt4).FullName] = "uint4", + [typeof(Float2).FullName] = "float2", + [typeof(Float3).FullName] = "float3", + [typeof(Float4).FullName] = "float4", + [typeof(Double2).FullName] = "double2", + [typeof(Double3).FullName] = "double3", + [typeof(Double4).FullName] = "double4", [typeof(ReadOnlyBuffer<>).FullName] = "StructuredBuffer", [typeof(ReadWriteBuffer<>).FullName] = "RWStructuredBuffer" }; @@ -50,7 +62,19 @@ namespace ComputeSharp.Shaders.Mappings [Pure] public static bool IsKnownVectorType(Type type) => type == typeof(Vector2) || type == typeof(Vector3) || - type == typeof(Vector4); + type == typeof(Vector4) || + type == typeof(Int2) || + type == typeof(Int3) || + type == typeof(Int4) || + type == typeof(UInt2) || + type == typeof(UInt3) || + type == typeof(UInt4) || + type == typeof(Float2) || + type == typeof(Float3) || + type == typeof(Float4) || + type == typeof(Double2) || + type == typeof(Double3) || + type == typeof(Double4); /// /// Checks whether or not the input type is a value