diff --git a/src/ComputeSharp.Graphics/Buffers/Abstract/Buffer{T}.cs b/src/ComputeSharp.Graphics/Buffers/Abstract/Buffer{T}.cs index b04c95b4..5331e22d 100644 --- a/src/ComputeSharp.Graphics/Buffers/Abstract/Buffer{T}.cs +++ b/src/ComputeSharp.Graphics/Buffers/Abstract/Buffer{T}.cs @@ -45,7 +45,7 @@ namespace ComputeSharp.Graphics.Buffers.Abstract { device.ThrowIfDisposed(); - Guard.IsGreaterThanOrEqualTo(length, 0, nameof(length)); + Guard.IsGreaterThan(length, 0, nameof(length)); SizeInBytes = checked((nint)(length * elementSizeInBytes)); GraphicsDevice = device; diff --git a/src/ComputeSharp.Graphics/Buffers/Abstract/Texture2D{T}.cs b/src/ComputeSharp.Graphics/Buffers/Abstract/Texture2D{T}.cs index 1140055e..d8305f6e 100644 --- a/src/ComputeSharp.Graphics/Buffers/Abstract/Texture2D{T}.cs +++ b/src/ComputeSharp.Graphics/Buffers/Abstract/Texture2D{T}.cs @@ -52,8 +52,8 @@ namespace ComputeSharp.Graphics.Buffers.Abstract { device.ThrowIfDisposed(); - Guard.IsGreaterThanOrEqualTo(width, 0, nameof(width)); - Guard.IsGreaterThanOrEqualTo(height, 0, nameof(height)); + Guard.IsGreaterThan(width, 0, nameof(width)); + Guard.IsGreaterThan(height, 0, nameof(height)); GraphicsDevice = device; Width = width; @@ -237,8 +237,8 @@ namespace ComputeSharp.Graphics.Buffers.Abstract Guard.IsInRange(x, 0, Width, nameof(x)); Guard.IsInRange(y, 0, Height, nameof(y)); - Guard.IsBetweenOrEqualTo(width, 0, Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 0, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); Guard.HasSizeGreaterThanOrEqualTo(destination, width * height, nameof(destination)); @@ -389,8 +389,8 @@ namespace ComputeSharp.Graphics.Buffers.Abstract Guard.IsInRange(x, 0, Width, nameof(x)); Guard.IsInRange(y, 0, Height, nameof(y)); - Guard.IsBetweenOrEqualTo(width, 0, Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 0, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); Guard.HasSizeGreaterThanOrEqualTo(source, width * height, nameof(source)); diff --git a/src/ComputeSharp.Graphics/Buffers/Abstract/Texture3D{T}.cs b/src/ComputeSharp.Graphics/Buffers/Abstract/Texture3D{T}.cs index f386bdfe..e65ee1ab 100644 --- a/src/ComputeSharp.Graphics/Buffers/Abstract/Texture3D{T}.cs +++ b/src/ComputeSharp.Graphics/Buffers/Abstract/Texture3D{T}.cs @@ -52,9 +52,9 @@ namespace ComputeSharp.Graphics.Buffers.Abstract { device.ThrowIfDisposed(); - Guard.IsGreaterThanOrEqualTo(width, 0, nameof(width)); - Guard.IsGreaterThanOrEqualTo(height, 0, nameof(height)); - Guard.IsBetweenOrEqualTo(depth, 0, ushort.MaxValue, nameof(depth)); + Guard.IsGreaterThan(width, 0, nameof(width)); + Guard.IsGreaterThan(height, 0, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, ushort.MaxValue, nameof(depth)); GraphicsDevice = device; Width = width; @@ -229,9 +229,9 @@ namespace ComputeSharp.Graphics.Buffers.Abstract Guard.IsInRange(x, 0, Width, nameof(x)); Guard.IsInRange(y, 0, Height, nameof(y)); Guard.IsInRange(z, 0, Depth, nameof(z)); - Guard.IsBetweenOrEqualTo(width, 0, Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 0, Height, nameof(height)); - Guard.IsBetweenOrEqualTo(depth, 0, Depth, nameof(depth)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth)); Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); Guard.IsLessThanOrEqualTo(z + depth, Depth, nameof(z)); @@ -411,9 +411,9 @@ namespace ComputeSharp.Graphics.Buffers.Abstract Guard.IsInRange(x, 0, Width, nameof(x)); Guard.IsInRange(y, 0, Height, nameof(y)); Guard.IsInRange(z, 0, Depth, nameof(z)); - Guard.IsBetweenOrEqualTo(width, 0, Width, nameof(width)); - Guard.IsBetweenOrEqualTo(height, 0, Height, nameof(height)); - Guard.IsBetweenOrEqualTo(depth, 0, Depth, nameof(depth)); + Guard.IsBetweenOrEqualTo(width, 1, Width, nameof(width)); + Guard.IsBetweenOrEqualTo(height, 1, Height, nameof(height)); + Guard.IsBetweenOrEqualTo(depth, 1, Depth, nameof(depth)); Guard.IsLessThanOrEqualTo(x + width, Width, nameof(x)); Guard.IsLessThanOrEqualTo(y + height, Height, nameof(y)); Guard.IsLessThanOrEqualTo(z + depth, Depth, nameof(z));