diff --git a/src/ComputeSharp.Graphics/Buffers/ConstantBuffer{T}.cs b/src/ComputeSharp.Graphics/Buffers/ConstantBuffer{T}.cs index 6e19703b..9a7d76fc 100644 --- a/src/ComputeSharp.Graphics/Buffers/ConstantBuffer{T}.cs +++ b/src/ComputeSharp.Graphics/Buffers/ConstantBuffer{T}.cs @@ -47,7 +47,7 @@ namespace ComputeSharp.Graphics.Buffers { // Create the temporary array byte[] temporaryArray = ArrayPool.Shared.Rent(count * PaddedElementSizeInBytes); - Span temporarySpan = temporaryArray.AsSpan(count * PaddedElementSizeInBytes); + Span temporarySpan = temporaryArray.AsSpan(0, count * PaddedElementSizeInBytes); // Copy the padded data to the temporary array Map(0);