From 646426042c56e51ba1f7f5c7320acd73d9297c00 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 25 Nov 2020 15:21:08 +0100 Subject: [PATCH] Added leftover types mapping dictionary --- .../Mappings/HlslKnownTypes.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs index ff4010ae..fd21f6f6 100644 --- a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs +++ b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Numerics; namespace ComputeSharp.SourceGenerators.Mappings @@ -42,6 +43,18 @@ namespace ComputeSharp.SourceGenerators.Mappings ["ComputeSharp.ReadWriteBuffer"] = "RWStructuredBuffer" }; + /// + /// Gets the known HLSL vector types available as mapped types. + /// + public static IReadOnlyCollection HlslMappedVectorTypes { get; } = new HashSet(new[] + { + typeof(Bool2), typeof(Bool3), typeof(Bool4), + typeof(Int2), typeof(Int3), typeof(Int4), + typeof(UInt2), typeof(UInt3), typeof(UInt4), + typeof(Float2), typeof(Float3), typeof(Float4), + typeof(Double2), typeof(Double3), typeof(Double4) + }); + /// /// Gets the mapped HLSL-compatible type name for the input type name. ///