From 91ef70907b86d6c5f1676e2955333ab909ca6e63 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 3 Dec 2022 03:26:04 +0100 Subject: [PATCH] Remove unnecessary constructors --- .../Shaders/Interop/D2D1InputDescription.cs | 16 +++------------- .../Interop/D2D1ResourceTextureDescription.cs | 14 +++----------- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1InputDescription.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1InputDescription.cs index fb23e794..26a1909e 100644 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1InputDescription.cs +++ b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1InputDescription.cs @@ -1,3 +1,5 @@ +using System.Runtime.InteropServices; + namespace ComputeSharp.D2D1.Interop; /// @@ -7,6 +9,7 @@ namespace ComputeSharp.D2D1.Interop; /// This type exposes the values that can be set via ID2D1RenderInfo::SetInputDescription. /// For more info, see . /// +[StructLayout(LayoutKind.Sequential)] public readonly struct D2D1InputDescription { /// @@ -30,19 +33,6 @@ public readonly struct D2D1InputDescription /// private readonly int levelOfDetailCount; - /// - /// Creates a new instance with the specified parameters. - /// - /// The index of the resource the description belongs to. - /// The type of filter to apply to the input texture. - /// The mip level to retrieve from the upstream transform, if specified. - internal D2D1InputDescription(int index, D2D1Filter filter, int levelOfDetailCount) - { - this.index = index; - this.filter = filter; - this.levelOfDetailCount = levelOfDetailCount; - } - /// /// Gets the index of the resource the description belongs to. /// diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ResourceTextureDescription.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ResourceTextureDescription.cs index 0acf68e4..f842ec65 100644 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ResourceTextureDescription.cs +++ b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ResourceTextureDescription.cs @@ -1,8 +1,11 @@ +using System.Runtime.InteropServices; + namespace ComputeSharp.D2D1.Interop; /// /// A type containing info on a description for a given D2D1 pixel shader resource resource. /// +[StructLayout(LayoutKind.Sequential)] public readonly struct D2D1ResourceTextureDescription { /// @@ -16,17 +19,6 @@ public readonly struct D2D1ResourceTextureDescription /// private readonly int dimensions; - /// - /// Creates a new instance with the specified parameters. - /// - /// The index of the resource texture the description belongs to. - /// The number of dimensions of the resource texture the description belongs to. - internal D2D1ResourceTextureDescription(int index, int dimensions) - { - this.index = index; - this.dimensions = dimensions; - } - /// /// Gets the index of the resource texture the description belongs to. ///