From dba631bf3ba3d1a6e38ef41184a1a1b2ce3a3c57 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 1 Oct 2023 11:33:52 +0200 Subject: [PATCH] Rename ArrayPoolBufferWriter type for consistency --- .../Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs | 7 +++---- .../Shaders/Interop/D2D1PixelShaderEffect.cs | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs index 1b65ad4c..c7a95502 100644 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs +++ b/src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs @@ -15,7 +15,7 @@ namespace ComputeSharp.D2D1.Shaders.Interop.Buffers; /// /// Represents a heap-based, array-backed output sink into which binary data can be written. /// -internal ref struct ArrayPoolBufferWriter +internal ref struct ArrayPoolBinaryWriter { /// /// The default buffer size to use to expand empty arrays. @@ -33,9 +33,9 @@ internal ref struct ArrayPoolBufferWriter private int index; /// - /// Initializes a new instance of the type. + /// Initializes a new instance of the type. /// - public ArrayPoolBufferWriter(int capacity) + public ArrayPoolBinaryWriter(int capacity) { this.array = ArrayPool.Shared.Rent(capacity); this.index = 0; @@ -111,7 +111,6 @@ internal ref struct ArrayPoolBufferWriter byte[]? array = this.array; default(ObjectDisposedException).ThrowIfNull(array); - default(ArgumentOutOfRangeException).ThrowIfNegative(count); default(ArgumentException).ThrowIf(this.index > array.Length - count); this.index += count; diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs index a03c6b9e..a248c778 100644 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs +++ b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs @@ -244,7 +244,7 @@ public static unsafe class D2D1PixelShaderEffect public static ReadOnlyMemory GetRegistrationBlob(out Guid effectId) where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor { - ArrayPoolBufferWriter writer = new(ArrayPoolBufferWriter.DefaultInitialBufferSize); + ArrayPoolBinaryWriter writer = new(ArrayPoolBinaryWriter.DefaultInitialBufferSize); // Blob id writer.Write(D2D1EffectRegistrationData.V1.BlobId);