Fix trimming annotations, use [RequiresUnreferencedCode]

このコミットが含まれているのは:
Sergio Pedri committed 2022-08-05 14:11:35 +02:00
1 親 be62eed772
コミット 3deaeb0328
21ファイル変更
+112 -188

検索条件に一致するファイルはありません

+1 -2
ファイルの表示
@@ -11,9 +11,8 @@
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)System\Collections.Generic\DictionaryExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Collections.Generic\QueueExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics.CodeAnalysis\DynamicallyAccessedMembersAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics.CodeAnalysis\DynamicallyAccessedMemberTypes.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics.CodeAnalysis\MemberNotNullAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics.CodeAnalysis\RequiresUnreferencedCodeAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics.CodeAnalysis\UnconditionalSuppressMessageAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Enum.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\GC.cs" />
@@ -1,91 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Diagnostics.CodeAnalysis;
/// <summary>
/// Specifies the types of members that are dynamically accessed.
/// </summary>
[Flags]
internal enum DynamicallyAccessedMemberTypes
{
/// <summary>
/// Specifies no members.
/// </summary>
None = 0,
/// <summary>
/// Specifies the default, parameterless public constructor.
/// </summary>
PublicParameterlessConstructor = 0x0001,
/// <summary>
/// Specifies all public constructors.
/// </summary>
PublicConstructors = 0x0002 | PublicParameterlessConstructor,
/// <summary>
/// Specifies all non-public constructors.
/// </summary>
NonPublicConstructors = 0x0004,
/// <summary>
/// Specifies all public methods.
/// </summary>
PublicMethods = 0x0008,
/// <summary>
/// Specifies all non-public methods.
/// </summary>
NonPublicMethods = 0x0010,
/// <summary>
/// Specifies all public fields.
/// </summary>
PublicFields = 0x0020,
/// <summary>
/// Specifies all non-public fields.
/// </summary>
NonPublicFields = 0x0040,
/// <summary>
/// Specifies all public nested types.
/// </summary>
PublicNestedTypes = 0x0080,
/// <summary>
/// Specifies all non-public nested types.
/// </summary>
NonPublicNestedTypes = 0x0100,
/// <summary>
/// Specifies all public properties.
/// </summary>
PublicProperties = 0x0200,
/// <summary>
/// Specifies all non-public properties.
/// </summary>
NonPublicProperties = 0x0400,
/// <summary>
/// Specifies all public events.
/// </summary>
PublicEvents = 0x0800,
/// <summary>
/// Specifies all non-public events.
/// </summary>
NonPublicEvents = 0x1000,
/// <summary>
/// Specifies all interfaces implemented by the type.
/// </summary>
Interfaces = 0x2000,
/// <summary>
/// Specifies all members.
/// </summary>
All = ~None
}
@@ -1,30 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Diagnostics.CodeAnalysis;
/// <summary>
/// Indicates that certain members on a specified <see cref="Type"/> are accessed dynamically,
/// for example through <see cref="System.Reflection"/>.
/// </summary>
[AttributeUsage(
AttributeTargets.Field | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter |
AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.Method |
AttributeTargets.Class | AttributeTargets.Interface | AttributeTargets.Struct,
Inherited = false)]
internal sealed class DynamicallyAccessedMembersAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="DynamicallyAccessedMembersAttribute"/> class with the specified member types.
/// </summary>
/// <param name="memberTypes">The types of members dynamically accessed.</param>
public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes)
{
MemberTypes = memberTypes;
}
/// <summary>
/// Gets the <see cref="DynamicallyAccessedMemberTypes"/> which specifies the type of members dynamically accessed.
/// </summary>
public DynamicallyAccessedMemberTypes MemberTypes { get; }
}
@@ -0,0 +1,40 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Diagnostics.CodeAnalysis
{
/// <summary>
/// Indicates that the specified method requires dynamic access to code that is not referenced
/// statically, for example through <see cref="System.Reflection"/>.
/// </summary>
/// <remarks>
/// This allows tools to understand which methods are unsafe to call when removing unreferenced
/// code from an application.
/// </remarks>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Class, Inherited = false)]
internal sealed class RequiresUnreferencedCodeAttribute : Attribute
{
/// <summary>
/// Initializes a new instance of the <see cref="RequiresUnreferencedCodeAttribute"/> class
/// with the specified message.
/// </summary>
/// <param name="message">
/// A message that contains information about the usage of unreferenced code.
/// </param>
public RequiresUnreferencedCodeAttribute(string message)
{
Message = message;
}
/// <summary>
/// Gets a message that contains information about the usage of unreferenced code.
/// </summary>
public string Message { get; }
/// <summary>
/// Gets or sets an optional URL that contains more information about the method,
/// why it requires unreferenced code, and what options a consumer has to deal with it.
/// </summary>
public string? Url { get; set; }
}
}
@@ -4,8 +4,7 @@
namespace System.Diagnostics.CodeAnalysis;
/// <summary>
/// Suppresses reporting of a specific rule violation, allowing multiple suppressions on a
/// single code artifact.
/// Suppresses reporting of a specific rule violation, allowing multiple suppressions on a single code artifact.
/// </summary>
/// <remarks>
/// <see cref="UnconditionalSuppressMessageAttribute"/> is different than
+1 -2
ファイルの表示
@@ -1,5 +1,4 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Text;
using ComputeSharp.Interop;
using ComputeSharp.Resources;
@@ -50,7 +49,7 @@ public sealed class GraphicsDeviceMismatchException : InvalidOperationException
/// <typeparam name="T">The type of values in the input buffer.</typeparam>
/// <param name="buffer">The input <see cref="Buffer{T}"/> that was used.</param>
/// <param name="device">The target <see cref="GraphicsDevice"/> instance that was used.</param>
internal static void Throw<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(Buffer<T> buffer, GraphicsDevice device)
internal static void Throw<T>(Buffer<T> buffer, GraphicsDevice device)
where T : unmanaged
{
throw Create(buffer, buffer.GraphicsDevice, device);
+14 -15
ファイルの表示
@@ -1,5 +1,4 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using CommunityToolkit.Diagnostics;
using ComputeSharp.Resources;
@@ -20,7 +19,7 @@ public static class BufferExtensions
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
/// <param name="source">The input <see cref="Buffer{T}"/> instance to read data from.</param>
/// <returns>A <typeparamref name="T"/> array with the contents of the input buffer.</returns>
public static T[] ToArray<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this Buffer<T> source)
public static T[] ToArray<T>(this Buffer<T> source)
where T : unmanaged
{
Guard.IsNotNull(source);
@@ -36,7 +35,7 @@ public static class BufferExtensions
/// <param name="offset">The offset to start reading data from.</param>
/// <param name="count">The number of items to read.</param>
/// <returns>A <typeparamref name="T"/> array with the contents of the specified range from the current buffer.</returns>
public static T[] ToArray<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this Buffer<T> source, int offset, int count)
public static T[] ToArray<T>(this Buffer<T> source, int offset, int count)
where T : unmanaged
{
Guard.IsNotNull(source);
@@ -55,7 +54,7 @@ public static class BufferExtensions
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
/// <param name="source">The input <see cref="Buffer{T}"/> instance to read data from.</param>
/// <param name="destination">The input array to write data to.</param>
public static void CopyTo<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this Buffer<T> source, T[] destination)
public static void CopyTo<T>(this Buffer<T> source, T[] destination)
where T : unmanaged
{
Guard.IsNotNull(source);
@@ -73,7 +72,7 @@ public static class BufferExtensions
/// <param name="sourceOffset">The offset to start reading data from.</param>
/// <param name="destinationOffset">The starting offset within <paramref name="destination"/> to write data to.</param>
/// <param name="count">The number of items to read.</param>
public static void CopyTo<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this Buffer<T> source, T[] destination, int sourceOffset, int destinationOffset, int count)
public static void CopyTo<T>(this Buffer<T> source, T[] destination, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(source);
@@ -90,7 +89,7 @@ public static class BufferExtensions
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
/// <param name="source">The input <see cref="Buffer{T}"/> instance to read data from.</param>
/// <param name="destination">The input <see cref="Span{T}"/> to write data to.</param>
public static void CopyTo<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this Buffer<T> source, Span<T> destination)
public static void CopyTo<T>(this Buffer<T> source, Span<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source);
@@ -105,7 +104,7 @@ public static class BufferExtensions
/// <param name="source">The input <see cref="Buffer{T}"/> instance to read data from.</param>
/// <param name="destination">The input <see cref="Span{T}"/> to write data to.</param>
/// <param name="sourceOffset">The offset to start reading data from.</param>
public static void CopyTo<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this Buffer<T> source, Span<T> destination, int sourceOffset)
public static void CopyTo<T>(this Buffer<T> source, Span<T> destination, int sourceOffset)
where T : unmanaged
{
Guard.IsNotNull(source);
@@ -119,7 +118,7 @@ public static class BufferExtensions
/// <typeparam name="T">The type of items stored on the buffers.</typeparam>
/// <param name="source">The input <see cref="Buffer{T}"/> instance to read data from.</param>
/// <param name="destination">The target <see cref="Buffer{T}"/> instance to write data to.</param>
public static void CopyTo<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this Buffer<T> source, Buffer<T> destination)
public static void CopyTo<T>(this Buffer<T> source, Buffer<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source);
@@ -137,7 +136,7 @@ public static class BufferExtensions
/// <param name="sourceOffset">The offset to start reading data from.</param>
/// <param name="destinationOffset">The starting offset within <paramref name="destination"/> to write data to.</param>
/// <param name="count">The number of items to read.</param>
public static void CopyTo<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this Buffer<T> source, Buffer<T> destination, int sourceOffset, int destinationOffset, int count)
public static void CopyTo<T>(this Buffer<T> source, Buffer<T> destination, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(source);
@@ -152,7 +151,7 @@ public static class BufferExtensions
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
/// <param name="destination">The target <see cref="Buffer{T}"/> instance to write data to.</param>
/// <param name="source">The input <typeparamref name="T"/> array to read data from.</param>
public static void CopyFrom<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this Buffer<T> destination, T[] source)
public static void CopyFrom<T>(this Buffer<T> destination, T[] source)
where T : unmanaged
{
Guard.IsNotNull(destination);
@@ -170,7 +169,7 @@ public static class BufferExtensions
/// <param name="sourceOffset">The starting offset within <paramref name="source"/> to read data from.</param>
/// <param name="destinationOffset">The offset to start writing data to.</param>
/// <param name="count">The number of items to write.</param>
public static void CopyFrom<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this Buffer<T> destination, T[] source, int sourceOffset, int destinationOffset, int count)
public static void CopyFrom<T>(this Buffer<T> destination, T[] source, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(destination);
@@ -187,7 +186,7 @@ public static class BufferExtensions
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
/// <param name="destination">The target <see cref="Buffer{T}"/> instance to write data to.</param>
/// <param name="source">The input <see cref="ReadOnlySpan{T}"/> to read data from.</param>
public static void CopyFrom<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this Buffer<T> destination, ReadOnlySpan<T> source)
public static void CopyFrom<T>(this Buffer<T> destination, ReadOnlySpan<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination);
@@ -202,7 +201,7 @@ public static class BufferExtensions
/// <param name="destination">The target <see cref="Buffer{T}"/> instance to write data to.</param>
/// <param name="source">The input <see cref="ReadOnlySpan{T}"/> to read data from.</param>
/// <param name="destinationOffset">The offset to start writing data to.</param>
public static void CopyFrom<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this Buffer<T> destination, ReadOnlySpan<T> source, int destinationOffset)
public static void CopyFrom<T>(this Buffer<T> destination, ReadOnlySpan<T> source, int destinationOffset)
where T : unmanaged
{
Guard.IsNotNull(destination);
@@ -216,7 +215,7 @@ public static class BufferExtensions
/// <typeparam name="T">The type of items stored on the buffers.</typeparam>
/// <param name="destination">The input <see cref="Buffer{T}"/> instance to write data data to.</param>
/// <param name="source">The source <see cref="Buffer{T}"/> instance to read data from.</param>
public static void CopyFrom<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this Buffer<T> destination, Buffer<T> source)
public static void CopyFrom<T>(this Buffer<T> destination, Buffer<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination);
@@ -234,7 +233,7 @@ public static class BufferExtensions
/// <param name="sourceOffset">The offset to start reading data from.</param>
/// <param name="destinationOffset">The starting offset within <paramref name="destination"/> to write data to.</param>
/// <param name="count">The number of items to read.</param>
public static void CopyFrom<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this Buffer<T> destination, Buffer<T> source, int sourceOffset, int destinationOffset, int count)
public static void CopyFrom<T>(this Buffer<T> destination, Buffer<T> source, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(destination);
+24 -12
ファイルの表示
@@ -18,7 +18,8 @@ partial class GraphicsDeviceExtensions
/// <param name="length">The length of the buffer to allocate.</param>
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
/// <returns>A zeroed <see cref="ConstantBuffer{T}"/> instance of size <paramref name="length"/>.</returns>
public static ConstantBuffer<T> AllocateConstantBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
public static ConstantBuffer<T> AllocateConstantBuffer<T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device);
@@ -33,7 +34,8 @@ partial class GraphicsDeviceExtensions
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
/// <param name="source">The input <typeparamref name="T"/> array with the data to copy on the allocated buffer.</param>
/// <returns>A constant <see cref="ConstantBuffer{T}"/> instance with the contents of the input array.</returns>
public static ConstantBuffer<T> AllocateConstantBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this GraphicsDevice device, T[] source)
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
public static ConstantBuffer<T> AllocateConstantBuffer<T>(this GraphicsDevice device, T[] source)
where T : unmanaged
{
Guard.IsNotNull(device);
@@ -49,7 +51,8 @@ partial class GraphicsDeviceExtensions
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
/// <param name="source">The input <see cref="ReadOnlySpan{T}"/> with the data to copy on the allocated buffer.</param>
/// <returns>A constant <see cref="ConstantBuffer{T}"/> instance with the contents of the input <see cref="ReadOnlySpan{T}"/>.</returns>
public static ConstantBuffer<T> AllocateConstantBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this GraphicsDevice device, ReadOnlySpan<T> source)
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
public static ConstantBuffer<T> AllocateConstantBuffer<T>(this GraphicsDevice device, ReadOnlySpan<T> source)
where T : unmanaged
{
Guard.IsNotNull(device);
@@ -68,7 +71,8 @@ partial class GraphicsDeviceExtensions
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
/// <param name="source">The input <see cref="Buffer{T}"/> with the data to copy on the allocated buffer.</param>
/// <returns>A constant <see cref="ConstantBuffer{T}"/> instance with the contents of the input <see cref="Buffer{T}"/>.</returns>
public static ConstantBuffer<T> AllocateConstantBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this GraphicsDevice device, Buffer<T> source)
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
public static ConstantBuffer<T> AllocateConstantBuffer<T>(this GraphicsDevice device, Buffer<T> source)
where T : unmanaged
{
Guard.IsNotNull(device);
@@ -89,7 +93,8 @@ partial class GraphicsDeviceExtensions
/// <param name="length">The length of the buffer to allocate.</param>
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
/// <returns>A zeroed <see cref="ReadOnlyBuffer{T}"/> instance of size <paramref name="length"/>.</returns>
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device);
@@ -104,7 +109,8 @@ partial class GraphicsDeviceExtensions
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
/// <param name="source">The input <typeparamref name="T"/> array with the data to copy on the allocated buffer.</param>
/// <returns>A read write <see cref="ReadOnlyBuffer{T}"/> instance with the contents of the input array.</returns>
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this GraphicsDevice device, T[] source)
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<T>(this GraphicsDevice device, T[] source)
where T : unmanaged
{
Guard.IsNotNull(device);
@@ -120,7 +126,8 @@ partial class GraphicsDeviceExtensions
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
/// <param name="source">The input <see cref="ReadOnlySpan{T}"/> with the data to copy on the allocated buffer.</param>
/// <returns>A read write <see cref="ReadOnlyBuffer{T}"/> instance with the contents of the input <see cref="ReadOnlySpan{T}"/>.</returns>
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this GraphicsDevice device, ReadOnlySpan<T> source)
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<T>(this GraphicsDevice device, ReadOnlySpan<T> source)
where T : unmanaged
{
Guard.IsNotNull(device);
@@ -139,7 +146,8 @@ partial class GraphicsDeviceExtensions
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
/// <param name="source">The input <see cref="Buffer{T}"/> with the data to copy on the allocated buffer.</param>
/// <returns>A read write <see cref="ReadOnlyBuffer{T}"/> instance with the contents of the input <see cref="Buffer{T}"/>.</returns>
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this GraphicsDevice device, Buffer<T> source)
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<T>(this GraphicsDevice device, Buffer<T> source)
where T : unmanaged
{
Guard.IsNotNull(device);
@@ -576,7 +584,8 @@ partial class GraphicsDeviceExtensions
/// <param name="length">The length of the buffer to allocate.</param>
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
/// <returns>A zeroed <see cref="ReadWriteBuffer{T}"/> instance of size <paramref name="length"/>.</returns>
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<T>(this GraphicsDevice device, int length, AllocationMode allocationMode = AllocationMode.Default)
where T : unmanaged
{
Guard.IsNotNull(device);
@@ -591,7 +600,8 @@ partial class GraphicsDeviceExtensions
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
/// <param name="source">The input <typeparamref name="T"/> array with the data to copy on the allocated buffer.</param>
/// <returns>A read write <see cref="ReadWriteBuffer{T}"/> instance with the contents of the input array.</returns>
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this GraphicsDevice device, T[] source)
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<T>(this GraphicsDevice device, T[] source)
where T : unmanaged
{
Guard.IsNotNull(device);
@@ -607,7 +617,8 @@ partial class GraphicsDeviceExtensions
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
/// <param name="source">The input <see cref="ReadOnlySpan{T}"/> with the data to copy on the allocated buffer.</param>
/// <returns>A read write <see cref="ReadWriteBuffer{T}"/> instance with the contents of the input <see cref="ReadOnlySpan{T}"/>.</returns>
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this GraphicsDevice device, ReadOnlySpan<T> source)
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<T>(this GraphicsDevice device, ReadOnlySpan<T> source)
where T : unmanaged
{
Guard.IsNotNull(device);
@@ -626,7 +637,8 @@ partial class GraphicsDeviceExtensions
/// <param name="device">The <see cref="GraphicsDevice"/> instance to use to allocate the buffer.</param>
/// <param name="source">The input <see cref="Buffer{T}"/> with the data to copy on the allocated buffer.</param>
/// <returns>A read write <see cref="ReadWriteBuffer{T}"/> instance with the contents of the input <see cref="Buffer{T}"/>.</returns>
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this GraphicsDevice device, Buffer<T> source)
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
public static ReadWriteBuffer<T> AllocateReadWriteBuffer<T>(this GraphicsDevice device, Buffer<T> source)
where T : unmanaged
{
Guard.IsNotNull(device);
+3 -4
ファイルの表示
@@ -1,5 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using CommunityToolkit.Diagnostics;
using CommunityToolkit.Diagnostics;
using ComputeSharp.Resources;
namespace ComputeSharp;
@@ -15,7 +14,7 @@ public static class ReadBackBufferExtensions
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
/// <param name="destination">The target <see cref="StructuredBuffer{T}"/> instance to write data to.</param>
/// <param name="source">The input <see cref="UploadBuffer{T}"/> instance to read data from.</param>
public static void CopyFrom<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this ReadBackBuffer<T> destination, StructuredBuffer<T> source)
public static void CopyFrom<T>(this ReadBackBuffer<T> destination, StructuredBuffer<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination);
@@ -33,7 +32,7 @@ public static class ReadBackBufferExtensions
/// <param name="sourceOffset">The offset to start reading data from.</param>
/// <param name="destinationOffset">The starting offset within <paramref name="destination"/> to write data to.</param>
/// <param name="count">The number of items to read.</param>
public static void CopyFrom<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this ReadBackBuffer<T> destination, StructuredBuffer<T> source, int sourceOffset, int destinationOffset, int count)
public static void CopyFrom<T>(this ReadBackBuffer<T> destination, StructuredBuffer<T> source, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(destination);
+5 -6
ファイルの表示
@@ -1,5 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using CommunityToolkit.Diagnostics;
using CommunityToolkit.Diagnostics;
using ComputeSharp.Resources;
namespace ComputeSharp;
@@ -15,7 +14,7 @@ public static class StructuredBufferExtensions
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
/// <param name="source">The input <see cref="StructuredBuffer{T}"/> instance to read data from.</param>
/// <param name="destination">The target <see cref="ReadBackBuffer{T}"/> instance to write data to.</param>
public static void CopyTo<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this StructuredBuffer<T> source, ReadBackBuffer<T> destination)
public static void CopyTo<T>(this StructuredBuffer<T> source, ReadBackBuffer<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source);
@@ -33,7 +32,7 @@ public static class StructuredBufferExtensions
/// <param name="sourceOffset">The offset to start reading data from.</param>
/// <param name="destinationOffset">The starting offset within <paramref name="destination"/> to write data to.</param>
/// <param name="count">The number of items to read.</param>
public static void CopyTo<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this StructuredBuffer<T> source, ReadBackBuffer<T> destination, int sourceOffset, int destinationOffset, int count)
public static void CopyTo<T>(this StructuredBuffer<T> source, ReadBackBuffer<T> destination, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(source);
@@ -48,7 +47,7 @@ public static class StructuredBufferExtensions
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
/// <param name="destination">The target <see cref="StructuredBuffer{T}"/> instance to write data to.</param>
/// <param name="source">The input <see cref="UploadBuffer{T}"/> instance to read data from.</param>
public static void CopyFrom<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this StructuredBuffer<T> destination, UploadBuffer<T> source)
public static void CopyFrom<T>(this StructuredBuffer<T> destination, UploadBuffer<T> source)
where T : unmanaged
{
Guard.IsNotNull(destination);
@@ -66,7 +65,7 @@ public static class StructuredBufferExtensions
/// <param name="sourceOffset">The offset to start reading data from.</param>
/// <param name="destinationOffset">The starting offset within <paramref name="destination"/> to write data to.</param>
/// <param name="count">The number of items to read.</param>
public static void CopyFrom<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this StructuredBuffer<T> destination, UploadBuffer<T> source, int sourceOffset, int destinationOffset, int count)
public static void CopyFrom<T>(this StructuredBuffer<T> destination, UploadBuffer<T> source, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(destination);
+3 -4
ファイルの表示
@@ -1,5 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using CommunityToolkit.Diagnostics;
using CommunityToolkit.Diagnostics;
using ComputeSharp.Resources;
namespace ComputeSharp;
@@ -15,7 +14,7 @@ public static class UploadBufferExtensions
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
/// <param name="source">The input <see cref="UploadBuffer{T}"/> instance to read data from.</param>
/// <param name="destination">The target <see cref="StructuredBuffer{T}"/> instance to write data to.</param>
public static void CopyTo<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this UploadBuffer<T> source, StructuredBuffer<T> destination)
public static void CopyTo<T>(this UploadBuffer<T> source, StructuredBuffer<T> destination)
where T : unmanaged
{
Guard.IsNotNull(source);
@@ -33,7 +32,7 @@ public static class UploadBufferExtensions
/// <param name="sourceOffset">The offset to start reading data from.</param>
/// <param name="destinationOffset">The starting offset within <paramref name="destination"/> to write data to.</param>
/// <param name="count">The number of items to read.</param>
public static void CopyTo<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this UploadBuffer<T> source, StructuredBuffer<T> destination, int sourceOffset, int destinationOffset, int count)
public static void CopyTo<T>(this UploadBuffer<T> source, StructuredBuffer<T> destination, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
Guard.IsNotNull(source);
+4 -6
ファイルの表示
@@ -8,7 +8,8 @@ namespace ComputeSharp.Graphics.Helpers;
/// A class providing info on specific types.
/// </summary>
/// <typeparam name="T">The input type to extract info for.</typeparam>
internal static class TypeInfo<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>
[RequiresUnreferencedCode("This method reads type info of all fields of the input type (recursively).")]
internal static class TypeInfo<T>
where T : unmanaged
{
/// <summary>
@@ -21,11 +22,8 @@ internal static class TypeInfo<[DynamicallyAccessedMembers(DynamicallyAccessedMe
/// </summary>
/// <param name="type">The current type to check.</param>
/// <returns>Whether or not <paramref name="type"/> is <see cref="double"/> or contains a <see cref="double"/> field.</returns>
[UnconditionalSuppressMessage(
"ReflectionAnalysis",
"IL2026:RequiresUnreferencedCode",
Justification = "The types of all fields (recursively) are already guaranteed to be preserved given it's all value types (plus T is already annotated).")]
private static bool ChecksIsDoubleOrContainsDoubles([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] Type type)
[RequiresUnreferencedCode("This method reads type info of all fields of the input type (recursively).")]
private static bool ChecksIsDoubleOrContainsDoubles(Type type)
{
if (type == typeof(double)) return true;
+1 -2
ファイルの表示
@@ -1,6 +1,5 @@
using System;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using CommunityToolkit.Diagnostics;
using ComputeSharp.Interop;
@@ -63,7 +62,7 @@ public static class GraphicsResourceHelper
/// <param name="device">The target <see cref="GraphicsDevice"/> instance in use.</param>
/// <returns>The GPU descriptor handle for the buffer.</returns>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(Buffer<T> buffer, GraphicsDevice device)
public static unsafe ulong ValidateAndGetGpuDescriptorHandle<T>(Buffer<T> buffer, GraphicsDevice device)
where T : unmanaged
{
Guard.IsNotNull(buffer);
+2 -3
ファイルの表示
@@ -1,6 +1,5 @@
using System;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using ComputeSharp.Core.Extensions;
using ComputeSharp.Resources;
@@ -50,7 +49,7 @@ public static unsafe class InteropServices
/// <param name="ppvObject">The address of a pointer to an interface with the IID specified in <paramref name="riid"/>.</param>
/// <exception cref="ObjectDisposedException">The <paramref name="buffer"/> instance has been disposed.</exception>
/// <exception cref="Win32Exception">Thrown if the <c>IUnknown::QueryInterface</c> call doesn't return <c>S_OK</c>.</exception>
public static void GetID3D12Resource<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(Buffer<T> buffer, Guid* riid, void** ppvObject)
public static void GetID3D12Resource<T>(Buffer<T> buffer, Guid* riid, void** ppvObject)
where T : unmanaged
{
using var _0 = buffer.GetReferenceTrackingLease();
@@ -180,7 +179,7 @@ public static unsafe class InteropServices
/// If ppvObject (the address) is nullptr, then this method returns <c>E_POINTER</c>.
/// </returns>
/// <exception cref="ObjectDisposedException">The <paramref name="buffer"/> instance has been disposed.</exception>
public static int TryGetID3D12Resource<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(Buffer<T> buffer, Guid* riid, void** ppvObject)
public static int TryGetID3D12Resource<T>(Buffer<T> buffer, Guid* riid, void** ppvObject)
where T : unmanaged
{
using var _0 = buffer.GetReferenceTrackingLease();
+2 -1
ファイルの表示
@@ -25,7 +25,7 @@ namespace ComputeSharp.Resources;
/// A <see langword="class"/> representing a typed buffer stored on GPU memory.
/// </summary>
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
public unsafe abstract class Buffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T> : NativeObject, IGraphicsResource
public unsafe abstract class Buffer<T> : NativeObject, IGraphicsResource
where T : unmanaged
{
#if NET6_0_OR_GREATER
@@ -63,6 +63,7 @@ public unsafe abstract class Buffer<[DynamicallyAccessedMembers(DynamicallyAcces
/// <param name="elementSizeInBytes">The size in bytes of each buffer item (including padding, if any).</param>
/// <param name="resourceType">The resource type for the current buffer.</param>
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
private protected Buffer(GraphicsDevice device, int length, uint elementSizeInBytes, ResourceType resourceType, AllocationMode allocationMode)
{
if (resourceType == ResourceType.Constant)
+2 -1
ファイルの表示
@@ -15,7 +15,7 @@ namespace ComputeSharp.Resources;
/// A <see langword="class"/> representing a typed structured buffer stored on GPU memory.
/// </summary>
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
public abstract class StructuredBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T> : Buffer<T>
public abstract class StructuredBuffer<T> : Buffer<T>
where T : unmanaged
{
/// <summary>
@@ -25,6 +25,7 @@ public abstract class StructuredBuffer<[DynamicallyAccessedMembers(DynamicallyAc
/// <param name="length">The number of items to store in the current buffer.</param>
/// <param name="resourceType">The buffer type for the current buffer.</param>
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
private protected unsafe StructuredBuffer(GraphicsDevice device, int length, ResourceType resourceType, AllocationMode allocationMode)
: base(device, length, (uint)sizeof(T), resourceType, allocationMode)
{
+2 -1
ファイルの表示
@@ -20,7 +20,7 @@ namespace ComputeSharp;
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
[DebuggerTypeProxy(typeof(BufferDebugView<>))]
[DebuggerDisplay("{ToString(),raw}")]
public sealed class ConstantBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T> : Buffer<T>
public sealed class ConstantBuffer<T> : Buffer<T>
where T : unmanaged
{
/// <summary>
@@ -34,6 +34,7 @@ public sealed class ConstantBuffer<[DynamicallyAccessedMembers(DynamicallyAccess
/// <param name="device">The <see cref="GraphicsDevice"/> associated with the current instance.</param>
/// <param name="length">The number of items to store in the current buffer.</param>
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
internal ConstantBuffer(GraphicsDevice device, int length, AllocationMode allocationMode)
: base(device, length, (uint)GetPaddedSize(), ResourceType.Constant, allocationMode)
{
+1 -2
ファイルの表示
@@ -1,5 +1,4 @@
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
#if NET6_0_OR_GREATER
using GC = System.GC;
#else
@@ -12,7 +11,7 @@ namespace ComputeSharp.Resources.Debug;
/// A debug proxy used to display items in a <see cref="Buffer{T}"/> instance.
/// </summary>
/// <typeparam name="T">The type of items to display.</typeparam>
internal sealed class BufferDebugView<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>
internal sealed class BufferDebugView<T>
where T : unmanaged
{
/// <summary>
+2 -1
ファイルの表示
@@ -13,7 +13,7 @@ namespace ComputeSharp;
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
[DebuggerTypeProxy(typeof(BufferDebugView<>))]
[DebuggerDisplay("{ToString(),raw}")]
public sealed class ReadOnlyBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T> : StructuredBuffer<T>
public sealed class ReadOnlyBuffer<T> : StructuredBuffer<T>
where T : unmanaged
{
/// <summary>
@@ -22,6 +22,7 @@ public sealed class ReadOnlyBuffer<[DynamicallyAccessedMembers(DynamicallyAccess
/// <param name="device">The <see cref="GraphicsDevice"/> associated with the current instance.</param>
/// <param name="length">The number of items to store in the current buffer.</param>
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
internal ReadOnlyBuffer(GraphicsDevice device, int length, AllocationMode allocationMode)
: base(device, length, ResourceType.ReadOnly, allocationMode)
{
+2 -1
ファイルの表示
@@ -13,7 +13,7 @@ namespace ComputeSharp;
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
[DebuggerTypeProxy(typeof(BufferDebugView<>))]
[DebuggerDisplay("{ToString(),raw}")]
public sealed class ReadWriteBuffer<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T> : StructuredBuffer<T>
public sealed class ReadWriteBuffer<T> : StructuredBuffer<T>
where T : unmanaged
{
/// <summary>
@@ -22,6 +22,7 @@ public sealed class ReadWriteBuffer<[DynamicallyAccessedMembers(DynamicallyAcces
/// <param name="device">The <see cref="GraphicsDevice"/> associated with the current instance.</param>
/// <param name="length">The number of items to store in the current buffer.</param>
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
[RequiresUnreferencedCode("This method reads type info of all fields of the resource element type (recursively).")]
internal ReadWriteBuffer(GraphicsDevice device, int length, AllocationMode allocationMode)
: base(device, length, ResourceType.ReadWrite, allocationMode)
{
+2 -2
ファイルの表示
@@ -21,7 +21,7 @@ public static class ComputeContextExtensions
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
/// <param name="context">The <see cref="ComputeContext"/> to use to insert the resource barrier.</param>
/// <param name="buffer">The input <see cref="ReadWriteBuffer{T}"/> instance to insert the barrier for.</param>
public static unsafe void Barrier<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this in ComputeContext context, ReadWriteBuffer<T> buffer)
public static unsafe void Barrier<T>(this in ComputeContext context, ReadWriteBuffer<T> buffer)
where T : unmanaged
{
Guard.IsNotNull(buffer);
@@ -137,7 +137,7 @@ public static class ComputeContextExtensions
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
/// <param name="context">The <see cref="ComputeContext"/> to use to clear the resource.</param>
/// <param name="buffer">The input <see cref="ReadWriteBuffer{T}"/> instance to clear.</param>
public static unsafe void Clear<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicFields | DynamicallyAccessedMemberTypes.NonPublicFields)] T>(this in ComputeContext context, ReadWriteBuffer<T> buffer)
public static unsafe void Clear<T>(this in ComputeContext context, ReadWriteBuffer<T> buffer)
where T : unmanaged
{
Guard.IsNotNull(buffer);