From d220c2eeb18ae727082da5c151867122f1c9cd6e Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 28 Apr 2022 00:03:31 +0200 Subject: [PATCH] Remove Type.GetCustomAttributes use from PixelShaderEffect --- .../Shaders/Interop/Effects/PixelShaderEffect.For{T}.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);