Adjust field visibility, fix naming violations in non test projects
このコミットが含まれているのは:
1 親
f73915bf93
コミット
746f132182
34ファイル変更
+171
-171
検索条件に一致するファイルはありません
@@ -34,12 +34,12 @@ internal ref struct TryWriteFormatInterpolatedStringHandler
|
||||
/// <summary>
|
||||
/// The number of characters written to <see cref="destination"/>.
|
||||
/// </summary>
|
||||
internal int position;
|
||||
private int position;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates whether all formatting operations have succeeded.
|
||||
/// </summary>
|
||||
internal bool success;
|
||||
private bool success;
|
||||
|
||||
/// <summary>
|
||||
/// Whether <see cref="formatProvider"/> provides an <see cref="ICustomFormatter"/>.
|
||||
|
||||
@@ -13,7 +13,7 @@ public readonly struct Bool
|
||||
/// The wrapped <see cref="int"/> value for the current instance.
|
||||
/// </summary>
|
||||
[FieldOffset(0)]
|
||||
private readonly int Value;
|
||||
private readonly int value;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Bool"/> instance for a given <see cref="bool"/> value.
|
||||
@@ -21,19 +21,19 @@ public readonly struct Bool
|
||||
/// <param name="value">.</param>
|
||||
private Bool(bool value)
|
||||
{
|
||||
Value = value ? 1 : 0;
|
||||
this.value = value ? 1 : 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
return obj is Bool x && Value == x.Value;
|
||||
return obj is Bool x && value == x.value;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Value.GetHashCode();
|
||||
return value.GetHashCode();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
@@ -94,20 +94,20 @@ public readonly struct Bool
|
||||
/// </summary>
|
||||
/// <param name="left">The left <see cref="Bool"/> instance.</param>
|
||||
/// <param name="right">The right <see cref="Bool"/> instance.</param>
|
||||
public static bool operator ==(Bool left, Bool right) => left.Value == right.Value;
|
||||
public static bool operator ==(Bool left, Bool right) => left.value == right.value;
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether or not two <see cref="Bool"/> instances represent a different <see cref="bool"/> value.
|
||||
/// </summary>
|
||||
/// <param name="left">The left <see cref="Bool"/> instance.</param>
|
||||
/// <param name="right">The right <see cref="Bool"/> instance.</param>
|
||||
public static bool operator !=(Bool left, Bool right) => left.Value != right.Value;
|
||||
public static bool operator !=(Bool left, Bool right) => left.value != right.value;
|
||||
|
||||
/// <summary>
|
||||
/// Converts a given <see cref="Bool"/> instance to its corresponding <see cref="bool"/> value.
|
||||
/// </summary>
|
||||
/// <param name="x">The input <see cref="Bool"/> instance.</param>
|
||||
public static implicit operator bool(Bool x) => x.Value != 0;
|
||||
public static implicit operator bool(Bool x) => x.value != 0;
|
||||
|
||||
/// <summary>
|
||||
/// Converts a <see cref="bool"/> value to a corresponding <see cref="Bool"/> instance.
|
||||
|
||||
+3
-3
@@ -189,7 +189,7 @@ partial class ID2D1ShaderGenerator
|
||||
/// <summary>
|
||||
/// A mapping of precomputed literals for all <see cref="byte"/> values.
|
||||
/// </summary>
|
||||
private static readonly string[] formattedBytes =
|
||||
private static readonly string[] FormattedBytes =
|
||||
{
|
||||
"0x00", "0x01", "0x02", "0x03", "0x04", "0x05", "0x06", "0x07", "0x08", "0x09", "0x0A", "0x0B", "0x0C", "0x0D", "0x0E", "0x0F",
|
||||
"0x10", "0x11", "0x12", "0x13", "0x14", "0x15", "0x16", "0x17", "0x18", "0x19", "0x1A", "0x1B", "0x1C", "0x1D", "0x1E", "0x1F",
|
||||
@@ -218,12 +218,12 @@ partial class ID2D1ShaderGenerator
|
||||
{
|
||||
using ImmutableArrayBuilder<char> builder = ImmutableArrayBuilder<char>.Rent();
|
||||
|
||||
builder.AddRange(formattedBytes[bytecode[0]].AsSpan());
|
||||
builder.AddRange(FormattedBytes[bytecode[0]].AsSpan());
|
||||
|
||||
foreach (byte b in bytecode.Slice(1))
|
||||
{
|
||||
builder.AddRange(", ".AsSpan());
|
||||
builder.AddRange(formattedBytes[b].AsSpan());
|
||||
builder.AddRange(FormattedBytes[b].AsSpan());
|
||||
}
|
||||
|
||||
return builder.ToString();
|
||||
|
||||
@@ -26,17 +26,17 @@ internal sealed unsafe partial class ShaderCompiler
|
||||
/// <summary>
|
||||
/// The <see cref="IDxcCompiler"/> instance to use to create the bytecode for HLSL sources.
|
||||
/// </summary>
|
||||
private readonly ComPtr<IDxcCompiler> DxcCompiler;
|
||||
private readonly ComPtr<IDxcCompiler> dxcCompiler;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IDxcLibrary"/> instance to use to work with <see cref="DxcCompiler"/>.
|
||||
/// The <see cref="IDxcLibrary"/> instance to use to work with <see cref="dxcCompiler"/>.
|
||||
/// </summary>
|
||||
private readonly ComPtr<IDxcLibrary> DxcLibrary;
|
||||
private readonly ComPtr<IDxcLibrary> dxcLibrary;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="IDxcIncludeHandler"/> instance used to compile shaders with <see cref="DxcCompiler"/>.
|
||||
/// The <see cref="IDxcIncludeHandler"/> instance used to compile shaders with <see cref="dxcCompiler"/>.
|
||||
/// </summary>
|
||||
private readonly ComPtr<IDxcIncludeHandler> DxcIncludeHandler;
|
||||
private readonly ComPtr<IDxcIncludeHandler> dxcIncludeHandler;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="ShaderCompiler"/> instance.
|
||||
@@ -59,9 +59,9 @@ internal sealed unsafe partial class ShaderCompiler
|
||||
|
||||
dxcLibrary.Get()->CreateIncludeHandler(dxcIncludeHandler.GetAddressOf()).Assert();
|
||||
|
||||
DxcCompiler = dxcCompiler.Move();
|
||||
DxcLibrary = dxcLibrary.Move();
|
||||
DxcIncludeHandler = dxcIncludeHandler.Move();
|
||||
this.dxcCompiler = dxcCompiler.Move();
|
||||
this.dxcLibrary = dxcLibrary.Move();
|
||||
this.dxcIncludeHandler = dxcIncludeHandler.Move();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -69,9 +69,9 @@ internal sealed unsafe partial class ShaderCompiler
|
||||
/// </summary>
|
||||
~ShaderCompiler()
|
||||
{
|
||||
DxcCompiler.Dispose();
|
||||
DxcLibrary.Dispose();
|
||||
DxcIncludeHandler.Dispose();
|
||||
dxcCompiler.Dispose();
|
||||
dxcLibrary.Dispose();
|
||||
dxcIncludeHandler.Dispose();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -93,7 +93,7 @@ internal sealed unsafe partial class ShaderCompiler
|
||||
// Get the encoded blob from the source code
|
||||
fixed (char* p = source)
|
||||
{
|
||||
DxcLibrary.Get()->CreateBlobWithEncodingOnHeapCopy(
|
||||
dxcLibrary.Get()->CreateBlobWithEncodingOnHeapCopy(
|
||||
p,
|
||||
(uint)source.Length * 2,
|
||||
1200,
|
||||
@@ -110,7 +110,7 @@ internal sealed unsafe partial class ShaderCompiler
|
||||
{
|
||||
char** arguments = stackalloc char*[3] { optimization, rowMajor, warningsAsErrors };
|
||||
|
||||
DxcCompiler.Get()->Compile(
|
||||
dxcCompiler.Get()->Compile(
|
||||
(IDxcBlob*)dxcBlobEncoding.Get(),
|
||||
(ushort*)shaderName,
|
||||
(ushort*)entryPoint,
|
||||
@@ -119,7 +119,7 @@ internal sealed unsafe partial class ShaderCompiler
|
||||
3,
|
||||
null,
|
||||
0,
|
||||
DxcIncludeHandler.Get(),
|
||||
dxcIncludeHandler.Get(),
|
||||
dxcOperationResult.GetAddressOf()).Assert();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Cryptography;
|
||||
|
||||
#pragma warning disable CS0809
|
||||
#pragma warning disable CS0809, IDE0009, IDE1006
|
||||
|
||||
namespace System;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ internal struct ImmutableArrayBuilder<T> : IDisposable
|
||||
/// <summary>
|
||||
/// The shared <see cref="ObjectPool{T}"/> instance to share <see cref="Writer"/> objects.
|
||||
/// </summary>
|
||||
private static readonly ObjectPool<Writer> sharedObjectPool = new(static () => new Writer());
|
||||
private static readonly ObjectPool<Writer> SharedObjectPool = new(static () => new Writer());
|
||||
|
||||
/// <summary>
|
||||
/// The owner <see cref="ObjectPool{T}"/> instance.
|
||||
@@ -35,7 +35,7 @@ internal struct ImmutableArrayBuilder<T> : IDisposable
|
||||
/// <returns>A <see cref="ImmutableArrayBuilder{T}"/> instance to write data to.</returns>
|
||||
public static ImmutableArrayBuilder<T> Rent()
|
||||
{
|
||||
return new(sharedObjectPool, sharedObjectPool.Allocate());
|
||||
return new(SharedObjectPool, SharedObjectPool.Allocate());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -211,7 +211,7 @@ partial class IShaderGenerator
|
||||
/// <summary>
|
||||
/// A mapping of precomputed literals for all <see cref="byte"/> values.
|
||||
/// </summary>
|
||||
private static readonly string[] formattedBytes =
|
||||
private static readonly string[] FormattedBytes =
|
||||
{
|
||||
"0x00", "0x01", "0x02", "0x03", "0x04", "0x05", "0x06", "0x07", "0x08", "0x09", "0x0A", "0x0B", "0x0C", "0x0D", "0x0E", "0x0F",
|
||||
"0x10", "0x11", "0x12", "0x13", "0x14", "0x15", "0x16", "0x17", "0x18", "0x19", "0x1A", "0x1B", "0x1C", "0x1D", "0x1E", "0x1F",
|
||||
@@ -240,12 +240,12 @@ partial class IShaderGenerator
|
||||
{
|
||||
using ImmutableArrayBuilder<char> builder = ImmutableArrayBuilder<char>.Rent();
|
||||
|
||||
builder.AddRange(formattedBytes[bytecode[0]].AsSpan());
|
||||
builder.AddRange(FormattedBytes[bytecode[0]].AsSpan());
|
||||
|
||||
foreach (byte b in bytecode.Slice(1))
|
||||
{
|
||||
builder.AddRange(", ".AsSpan());
|
||||
builder.AddRange(formattedBytes[b].AsSpan());
|
||||
builder.AddRange(FormattedBytes[b].AsSpan());
|
||||
}
|
||||
|
||||
return builder.ToString();
|
||||
|
||||
@@ -41,7 +41,7 @@ unsafe partial class IWICStreamExtensions
|
||||
/// <summary>
|
||||
/// A manual CCW implementation for an <see cref="IStream"/> object wrapping an <see cref="IBufferWriter{T}"/> instance.
|
||||
/// </summary>
|
||||
internal unsafe partial struct IBufferWriterWrapper
|
||||
private unsafe partial struct IBufferWriterWrapper
|
||||
#if NET6_0_OR_GREATER
|
||||
: IUnknown.Interface
|
||||
#endif
|
||||
@@ -225,17 +225,17 @@ unsafe partial class IWICStreamExtensions
|
||||
/// <summary>
|
||||
/// The vtable pointer for the current instance.
|
||||
/// </summary>
|
||||
public void** lpVtbl;
|
||||
private void** lpVtbl;
|
||||
|
||||
/// <summary>
|
||||
/// The current reference count for the object (from <c>IUnknown</c>).
|
||||
/// </summary>
|
||||
public volatile int referenceCount;
|
||||
private volatile int referenceCount;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="GCHandle"/> to the captured <see cref="IBufferWriter{T}"/>.
|
||||
/// </summary>
|
||||
public GCHandle writerHandle;
|
||||
private GCHandle writerHandle;
|
||||
|
||||
/// <summary>
|
||||
/// Creates and initializes a new <see cref="IBufferWriterWrapper"/> instance.
|
||||
|
||||
@@ -44,7 +44,7 @@ internal static unsafe partial class IWICStreamExtensions
|
||||
/// <summary>
|
||||
/// A manual CCW implementation for an <see cref="IStream"/> object wrapping a <see cref="Stream"/> instance.
|
||||
/// </summary>
|
||||
internal unsafe partial struct IStreamWrapper
|
||||
private unsafe partial struct IStreamWrapper
|
||||
#if NET6_0_OR_GREATER
|
||||
: IUnknown.Interface
|
||||
#endif
|
||||
@@ -228,17 +228,17 @@ internal static unsafe partial class IWICStreamExtensions
|
||||
/// <summary>
|
||||
/// The vtable pointer for the current instance.
|
||||
/// </summary>
|
||||
public void** lpVtbl;
|
||||
private void** lpVtbl;
|
||||
|
||||
/// <summary>
|
||||
/// The current reference count for the object (from <c>IUnknown</c>).
|
||||
/// </summary>
|
||||
public volatile int referenceCount;
|
||||
private volatile int referenceCount;
|
||||
|
||||
/// <summary>
|
||||
/// The <see cref="GCHandle"/> to the captured <see cref="Stream"/>.
|
||||
/// </summary>
|
||||
public GCHandle streamHandle;
|
||||
private GCHandle streamHandle;
|
||||
|
||||
/// <summary>
|
||||
/// Creates and initializes a new <see cref="IStreamWrapper"/> instance.
|
||||
|
||||
@@ -22,7 +22,7 @@ partial class DeviceHelper
|
||||
/// <summary>
|
||||
/// The cached default <see cref="GraphicsDevice"/> instance, if any.
|
||||
/// </summary>
|
||||
internal static GraphicsDevice? defaultDevice;
|
||||
private static GraphicsDevice? defaultDevice;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the cached <see cref="GraphicsDevice"/> instance or creates and caches a new one.
|
||||
|
||||
@@ -204,7 +204,7 @@ partial class DeviceHelper
|
||||
|
||||
/// <inheritdoc cref="IUnknown.Release"/>
|
||||
[UnmanagedCallersOnly]
|
||||
public static uint Release(IDXGIFactory4As6Backcompat* @this)
|
||||
private static uint Release(IDXGIFactory4As6Backcompat* @this)
|
||||
{
|
||||
@this->dxgiFactory4->Release();
|
||||
|
||||
@@ -215,21 +215,21 @@ partial class DeviceHelper
|
||||
|
||||
/// <inheritdoc cref="IDXGIFactory6.EnumAdapters(uint, IDXGIAdapter**)"/>
|
||||
[UnmanagedCallersOnly]
|
||||
public static int EnumAdapters(IDXGIFactory4As6Backcompat* @this, uint Adapter, IDXGIAdapter** ppAdapter)
|
||||
private static int EnumAdapters(IDXGIFactory4As6Backcompat* @this, uint Adapter, IDXGIAdapter** ppAdapter)
|
||||
{
|
||||
return @this->dxgiFactory4->EnumAdapters(Adapter, ppAdapter);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IDXGIFactory6.EnumWarpAdapter(Guid*, void**)"/>
|
||||
[UnmanagedCallersOnly]
|
||||
public static int EnumWarpAdapter(IDXGIFactory4As6Backcompat* @this, Guid* riid, void** ppvAdapter)
|
||||
private static int EnumWarpAdapter(IDXGIFactory4As6Backcompat* @this, Guid* riid, void** ppvAdapter)
|
||||
{
|
||||
return @this->dxgiFactory4->EnumWarpAdapter(riid, ppvAdapter);
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IDXGIFactory6.EnumAdapterByGpuPreference(uint, DXGI_GPU_PREFERENCE, Guid*, void**)"/>
|
||||
[UnmanagedCallersOnly]
|
||||
public static int EnumAdapterByGpuPreference(IDXGIFactory4As6Backcompat* @this, uint Adapter, DXGI_GPU_PREFERENCE GpuPreference, Guid* riid, void** ppvAdapter)
|
||||
private static int EnumAdapterByGpuPreference(IDXGIFactory4As6Backcompat* @this, uint Adapter, DXGI_GPU_PREFERENCE GpuPreference, Guid* riid, void** ppvAdapter)
|
||||
{
|
||||
return @this->dxgiFactory4->EnumAdapters1(Adapter, (IDXGIAdapter1**)ppvAdapter);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ using System.ComponentModel;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using static TerraFX.Interop.DirectX.D3D12_DESCRIPTOR_RANGE_FLAGS;
|
||||
|
||||
#pragma warning disable IDE0052, CS0414
|
||||
#pragma warning disable IDE0052, IDE1006, CS0414
|
||||
|
||||
namespace ComputeSharp.__Internals;
|
||||
|
||||
|
||||
@@ -11,22 +11,22 @@ internal readonly struct ShaderKey : IEquatable<ShaderKey>
|
||||
/// <summary>
|
||||
/// The hashcode of the current shader type.
|
||||
/// </summary>
|
||||
private readonly int Id;
|
||||
private readonly int id;
|
||||
|
||||
/// <summary>
|
||||
/// The number of iterations to run on the X axis.
|
||||
/// </summary>
|
||||
private readonly int ThreadsX;
|
||||
private readonly int threadsX;
|
||||
|
||||
/// <summary>
|
||||
/// The number of iterations to run on the Y axis.
|
||||
/// </summary>
|
||||
private readonly int ThreadsY;
|
||||
private readonly int threadsY;
|
||||
|
||||
/// <summary>
|
||||
/// The number of iterations to run on the Z axis.
|
||||
/// </summary>
|
||||
private readonly int ThreadsZ;
|
||||
private readonly int threadsZ;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="ShaderKey"/> instance with the specified parameters.
|
||||
@@ -38,10 +38,10 @@ internal readonly struct ShaderKey : IEquatable<ShaderKey>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public ShaderKey(int id, int threadsX, int threadsY, int threadsZ)
|
||||
{
|
||||
Id = id;
|
||||
ThreadsX = threadsX;
|
||||
ThreadsY = threadsY;
|
||||
ThreadsZ = threadsZ;
|
||||
this.id = id;
|
||||
this.threadsX = threadsX;
|
||||
this.threadsY = threadsY;
|
||||
this.threadsZ = threadsZ;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
@@ -49,10 +49,10 @@ internal readonly struct ShaderKey : IEquatable<ShaderKey>
|
||||
public bool Equals(ShaderKey other)
|
||||
{
|
||||
return
|
||||
Id == other.Id &&
|
||||
ThreadsX == other.ThreadsX &&
|
||||
ThreadsY == other.ThreadsY &&
|
||||
ThreadsZ == other.ThreadsZ;
|
||||
id == other.id &&
|
||||
threadsX == other.threadsX &&
|
||||
threadsY == other.threadsY &&
|
||||
threadsZ == other.threadsZ;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
@@ -65,6 +65,6 @@ internal readonly struct ShaderKey : IEquatable<ShaderKey>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return HashCode.Combine(Id, ThreadsX, ThreadsY, ThreadsZ);
|
||||
return HashCode.Combine(id, threadsX, threadsY, threadsZ);
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする