diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.For{T}.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.For{T}.cs index cc8fbf5a..8ba2107a 100644 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.For{T}.cs +++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.For{T}.cs @@ -89,7 +89,7 @@ internal unsafe partial struct PixelShaderEffect { // Load all shader properties Guid guid = typeof(T).GUID; - int inputCount = ((D2DInputCountAttribute[])typeof(T).GetCustomAttributes(typeof(D2DInputCountAttribute), false))[0].Count; + int inputCount = (int)D2D1InteropServices.GetPixelShaderInputCount(); ReadOnlyMemory buffer = D2D1InteropServices.LoadShaderBytecode(); byte* typeAssociatedMemory = (byte*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(For), buffer.Length);