diff --git a/src/ImageSharp/Colors/Color.BulkOperations.cs b/src/ImageSharp/Colors/Color.BulkOperations.cs index 039fafced..7d3b12ea0 100644 --- a/src/ImageSharp/Colors/Color.BulkOperations.cs +++ b/src/ImageSharp/Colors/Color.BulkOperations.cs @@ -42,6 +42,12 @@ namespace ImageSharp BufferSpan destVectors, int count) { + if (!Vector.IsHardwareAccelerated) + { + throw new InvalidOperationException( + "Color.BulkOperations.ToVector4SimdAligned() should not be called when Vector.IsHardwareAccelerated == false!"); + } + int vecSize = Vector.Count; DebugGuard.IsTrue( @@ -92,7 +98,7 @@ namespace ImageSharp /// internal override void ToVector4(BufferSpan sourceColors, BufferSpan destVectors, int count) { - if (count < 256) + if (count < 256 || !Vector.IsHardwareAccelerated) { // Doesn't worth to bother with SIMD: base.ToVector4(sourceColors, destVectors, count);