From 2cffb02f9ffd19fb24e82ad7aa971db546c832c2 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 13 Aug 2022 16:12:49 +0200 Subject: [PATCH] Fix build errors in ComputeSharp.D2D1 Adjust scoping rules for ArrayPoolBinaryWriter --- .../Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs index dfc2c329..3999b1d9 100644 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs +++ b/src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs @@ -46,6 +46,7 @@ internal ref struct ArrayPoolBinaryWriter /// /// Gets the data written to the underlying buffer so far, as a . /// + [UnscopedRef] public ReadOnlySpan WrittenSpan { [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -67,7 +68,7 @@ internal ref struct ArrayPoolBinaryWriter /// /// The type of value to write. /// The value to write. - public unsafe void Write(in T value) + public unsafe void Write(scoped in T value) where T : unmanaged { Span span = GetSpan(sizeof(T));