diff --git a/src/ComputeSharp.Shaders/Extensions/TypeExtensions.cs b/src/ComputeSharp.Shaders/Extensions/TypeExtensions.cs
new file mode 100644
index 00000000..852dd8b1
--- /dev/null
+++ b/src/ComputeSharp.Shaders/Extensions/TypeExtensions.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics.Contracts;
+using System.Linq;
+
+namespace ComputeSharp.Shaders.Extensions
+{
+ ///
+ /// A that provides extension methods for the type
+ ///
+ internal static class TypeExtensions
+ {
+ ///
+ /// The mapping of supported known types to display string
+ ///
+ private static readonly IReadOnlyDictionary KnownTypes = new Dictionary
+ {
+ [typeof(bool)] = "bool",
+ [typeof(int)] = "int",
+ [typeof(uint)] = "uint",
+ [typeof(float)] = "float",
+ [typeof(double)] = "double"
+ };
+
+ ///
+ /// Gets a friendly display for the input type
+ ///
+ /// The input type to analyze
+ [Pure]
+ public static string ToFriendlyString(this Type type)
+ {
+ // Array types of arbitrary rank
+ if (type.IsArray)
+ {
+ int rank = type.GetArrayRank();
+ return $"{type.GetElementType().ToFriendlyString()}[{new string(Enumerable.Repeat(',', rank - 1).ToArray())}]";
+ }
+
+ // Non generic types
+ string name;
+ if (type.GetGenericArguments().Length == 0) return KnownTypes.TryGetValue(type, out name) ? name : type.Name;
+
+ // Generic types
+ Type[] genericArguments = type.GetGenericArguments();
+ string typeDefeninition = KnownTypes.TryGetValue(type, out name) ? name : type.Name;
+ string polishedName = typeDefeninition.Substring(0, typeDefeninition.IndexOf("`"));
+ return $"{polishedName}<{string.Join(",", genericArguments.Select(ToFriendlyString))}>";
+ }
+ }
+}
diff --git a/src/ComputeSharp.Shaders/Renderer/Models/Fields/CapturedFieldInfo.cs b/src/ComputeSharp.Shaders/Renderer/Models/Fields/CapturedFieldInfo.cs
index ba1f4092..b0226ac3 100644
--- a/src/ComputeSharp.Shaders/Renderer/Models/Fields/CapturedFieldInfo.cs
+++ b/src/ComputeSharp.Shaders/Renderer/Models/Fields/CapturedFieldInfo.cs
@@ -1,4 +1,5 @@
using System;
+using ComputeSharp.Shaders.Extensions;
namespace ComputeSharp.Shaders.Renderer.Models.Fields
{
@@ -10,7 +11,7 @@ namespace ComputeSharp.Shaders.Renderer.Models.Fields
///
/// Gets the type of the current field in the C# source
///
- public Type FieldCsharpType { get; }
+ public string FieldCsharpType { get; }
///
/// Gets the type of the current field in the HLSL shader
@@ -30,7 +31,7 @@ namespace ComputeSharp.Shaders.Renderer.Models.Fields
/// The name to use for the current field
public CapturedFieldInfo(Type fieldCsharpType, string fieldHlslType, string fieldName)
{
- FieldCsharpType = fieldCsharpType;
+ FieldCsharpType = fieldCsharpType.ToFriendlyString();
FieldHlslType = fieldHlslType;
FieldName = fieldName;
}