Add .this qualifier to all field accesses
このコミットが含まれているのは:
1 親
f2ed8a2d3b
コミット
b9a133b74c
75ファイル変更
+339
-335
検索条件に一致するファイルはありません
@@ -61,10 +61,10 @@ internal ref struct FormatInterpolatedStringHandler
|
||||
{
|
||||
this.format = format;
|
||||
this.formatProvider = formatProvider;
|
||||
characters = initialBuffer;
|
||||
arrayToReturnToPool = null;
|
||||
position = 0;
|
||||
hasCustomFormatter = formatProvider is not null && HasCustomFormatter(formatProvider);
|
||||
this.characters = initialBuffer;
|
||||
this.arrayToReturnToPool = null;
|
||||
this.position = 0;
|
||||
this.hasCustomFormatter = formatProvider is not null && HasCustomFormatter(formatProvider);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -96,11 +96,11 @@ internal ref struct FormatInterpolatedStringHandler
|
||||
public string ToStringAndClear()
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
string result = new(characters.Slice(0, position));
|
||||
string result = new(this.characters.Slice(0, this.position));
|
||||
#else
|
||||
string result = characters.Slice(0, position).ToString();
|
||||
string result = this.characters.Slice(0, this.position).ToString();
|
||||
#endif
|
||||
char[]? toReturn = arrayToReturnToPool;
|
||||
char[]? toReturn = this.arrayToReturnToPool;
|
||||
|
||||
this = default;
|
||||
|
||||
@@ -121,14 +121,14 @@ internal ref struct FormatInterpolatedStringHandler
|
||||
{
|
||||
if (value.Length == 1)
|
||||
{
|
||||
Span<char> chars = characters;
|
||||
int pos = position;
|
||||
Span<char> chars = this.characters;
|
||||
int pos = this.position;
|
||||
|
||||
if ((uint)pos < (uint)chars.Length)
|
||||
{
|
||||
chars[pos] = value[0];
|
||||
|
||||
position = pos + 1;
|
||||
this.position = pos + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -140,8 +140,8 @@ internal ref struct FormatInterpolatedStringHandler
|
||||
|
||||
if (value.Length == 2)
|
||||
{
|
||||
Span<char> chars = characters;
|
||||
int pos = position;
|
||||
Span<char> chars = this.characters;
|
||||
int pos = this.position;
|
||||
|
||||
if ((uint)pos < chars.Length - 1)
|
||||
{
|
||||
@@ -153,7 +153,7 @@ internal ref struct FormatInterpolatedStringHandler
|
||||
Unsafe.ReadUnaligned<int>(ref Unsafe.As<char, byte>(ref MemoryMarshal.GetReference(value.AsSpan()))));
|
||||
#endif
|
||||
|
||||
position = pos + 2;
|
||||
this.position = pos + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -173,12 +173,12 @@ internal ref struct FormatInterpolatedStringHandler
|
||||
private void AppendStringDirect(string value)
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
if (value.TryCopyTo(characters.Slice(position)))
|
||||
if (value.TryCopyTo(this.characters.Slice(this.position)))
|
||||
#else
|
||||
if (value.AsSpan().TryCopyTo(characters.Slice(position)))
|
||||
if (value.AsSpan().TryCopyTo(this.characters.Slice(this.position)))
|
||||
#endif
|
||||
{
|
||||
position += value.Length;
|
||||
this.position += value.Length;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -206,23 +206,23 @@ internal ref struct FormatInterpolatedStringHandler
|
||||
where T : IFormattable
|
||||
#endif
|
||||
{
|
||||
if (hasCustomFormatter)
|
||||
if (this.hasCustomFormatter)
|
||||
{
|
||||
AppendCustomFormatter(value, format);
|
||||
AppendCustomFormatter(value, this.format);
|
||||
return;
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
int charsWritten;
|
||||
|
||||
while (!value.TryFormat(characters.Slice(position), out charsWritten, format, formatProvider))
|
||||
while (!value.TryFormat(this.characters.Slice(this.position), out charsWritten, this.format, this.formatProvider))
|
||||
{
|
||||
Grow();
|
||||
}
|
||||
|
||||
position += charsWritten;
|
||||
this.position += charsWritten;
|
||||
#else
|
||||
AppendStringDirect(value.ToString(format, formatProvider));
|
||||
AppendStringDirect(value.ToString(this.format, this.formatProvider));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -245,9 +245,9 @@ internal ref struct FormatInterpolatedStringHandler
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
private void AppendCustomFormatter<T>(T value, string? format)
|
||||
{
|
||||
ICustomFormatter? formatter = (ICustomFormatter?)formatProvider?.GetFormat(typeof(ICustomFormatter));
|
||||
ICustomFormatter? formatter = (ICustomFormatter?)this.formatProvider?.GetFormat(typeof(ICustomFormatter));
|
||||
|
||||
if (formatter is not null && formatter.Format(format, value, formatProvider) is string customFormatted)
|
||||
if (formatter is not null && formatter.Format(format, value, this.formatProvider) is string customFormatted)
|
||||
{
|
||||
AppendStringDirect(customFormatted);
|
||||
}
|
||||
@@ -263,12 +263,12 @@ internal ref struct FormatInterpolatedStringHandler
|
||||
Grow(value.Length);
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
value.CopyTo(characters.Slice(position));
|
||||
value.CopyTo(this.characters.Slice(this.position));
|
||||
#else
|
||||
value.AsSpan().CopyTo(characters.Slice(position));
|
||||
value.AsSpan().CopyTo(this.characters.Slice(this.position));
|
||||
#endif
|
||||
|
||||
position += value.Length;
|
||||
this.position += value.Length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -277,7 +277,7 @@ internal ref struct FormatInterpolatedStringHandler
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
private void Grow(int additionalChars)
|
||||
{
|
||||
GrowCore((uint)position + (uint)additionalChars);
|
||||
GrowCore((uint)this.position + (uint)additionalChars);
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
@@ -287,7 +287,7 @@ internal ref struct FormatInterpolatedStringHandler
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
private void Grow()
|
||||
{
|
||||
GrowCore((uint)characters.Length + 1);
|
||||
GrowCore((uint)this.characters.Length + 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -297,7 +297,7 @@ internal ref struct FormatInterpolatedStringHandler
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private void GrowCore(uint requiredMinCapacity)
|
||||
{
|
||||
uint newCapacity = Math.Max(requiredMinCapacity, Math.Min((uint)characters.Length * 2, 0x3FFFFFDF));
|
||||
uint newCapacity = Math.Max(requiredMinCapacity, Math.Min((uint)this.characters.Length * 2, 0x3FFFFFDF));
|
||||
#if NET6_0_OR_GREATER
|
||||
int arraySize = (int)Math.Clamp(newCapacity, MinimumArrayPoolLength, int.MaxValue);
|
||||
#else
|
||||
@@ -305,11 +305,11 @@ internal ref struct FormatInterpolatedStringHandler
|
||||
#endif
|
||||
char[] newArray = ArrayPool<char>.Shared.Rent(arraySize);
|
||||
|
||||
characters.Slice(0, position).CopyTo(newArray);
|
||||
this.characters.Slice(0, this.position).CopyTo(newArray);
|
||||
|
||||
char[]? toReturn = arrayToReturnToPool;
|
||||
char[]? toReturn = this.arrayToReturnToPool;
|
||||
|
||||
characters = arrayToReturnToPool = newArray;
|
||||
this.characters = this.arrayToReturnToPool = newArray;
|
||||
|
||||
if (toReturn is not null)
|
||||
{
|
||||
|
||||
@@ -62,9 +62,9 @@ internal ref struct TryWriteFormatInterpolatedStringHandler
|
||||
this.format = format;
|
||||
this.formatAsString = null;
|
||||
this.formatProvider = formatProvider;
|
||||
position = 0;
|
||||
success = shouldAppend = destination.Length >= literalLength;
|
||||
hasCustomFormatter = formatProvider is not null && FormatInterpolatedStringHandler.HasCustomFormatter(formatProvider);
|
||||
this.position = 0;
|
||||
this.success = shouldAppend = destination.Length >= literalLength;
|
||||
this.hasCustomFormatter = formatProvider is not null && FormatInterpolatedStringHandler.HasCustomFormatter(formatProvider);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -106,13 +106,13 @@ internal ref struct TryWriteFormatInterpolatedStringHandler
|
||||
if (value.Length == 1)
|
||||
{
|
||||
Span<char> destination = this.destination;
|
||||
int pos = position;
|
||||
int pos = this.position;
|
||||
|
||||
if ((uint)pos < (uint)destination.Length)
|
||||
{
|
||||
destination[pos] = value[0];
|
||||
|
||||
position = pos + 1;
|
||||
this.position = pos + 1;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ internal ref struct TryWriteFormatInterpolatedStringHandler
|
||||
if (value.Length == 2)
|
||||
{
|
||||
Span<char> destination = this.destination;
|
||||
int pos = position;
|
||||
int pos = this.position;
|
||||
|
||||
if ((uint)pos < destination.Length - 1)
|
||||
{
|
||||
@@ -135,7 +135,7 @@ internal ref struct TryWriteFormatInterpolatedStringHandler
|
||||
Unsafe.ReadUnaligned<int>(ref Unsafe.As<char, byte>(ref MemoryMarshal.GetReference(value.AsSpan()))));
|
||||
#endif
|
||||
|
||||
position = pos + 2;
|
||||
this.position = pos + 2;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -154,12 +154,12 @@ internal ref struct TryWriteFormatInterpolatedStringHandler
|
||||
private bool AppendStringDirect(string value)
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
if (value.TryCopyTo(destination.Slice(position)))
|
||||
if (value.TryCopyTo(this.destination.Slice(this.position)))
|
||||
#else
|
||||
if (value.AsSpan().TryCopyTo(destination.Slice(position)))
|
||||
if (value.AsSpan().TryCopyTo(this.destination.Slice(this.position)))
|
||||
#endif
|
||||
{
|
||||
position += value.Length;
|
||||
this.position += value.Length;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -177,22 +177,22 @@ internal ref struct TryWriteFormatInterpolatedStringHandler
|
||||
where T : IFormattable
|
||||
#endif
|
||||
{
|
||||
if (hasCustomFormatter)
|
||||
if (this.hasCustomFormatter)
|
||||
{
|
||||
return AppendCustomFormatter(value, formatAsString ??= format.ToString());
|
||||
return AppendCustomFormatter(value, this.formatAsString ??= this.format.ToString());
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
if (value.TryFormat(destination.Slice(position), out int charsWritten, format, formatProvider))
|
||||
if (value.TryFormat(this.destination.Slice(this.position), out int charsWritten, this.format, this.formatProvider))
|
||||
{
|
||||
position += charsWritten;
|
||||
this.position += charsWritten;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return Fail();
|
||||
#else
|
||||
return AppendStringDirect(value.ToString(formatAsString ??= format.ToString(), formatProvider));
|
||||
return AppendStringDirect(value.ToString(this.formatAsString ??= this.format.ToString(), this.formatProvider));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ internal ref struct TryWriteFormatInterpolatedStringHandler
|
||||
/// <param name="value">The value to write.</param>
|
||||
public bool AppendFormatted(string? value)
|
||||
{
|
||||
if (hasCustomFormatter)
|
||||
if (this.hasCustomFormatter)
|
||||
{
|
||||
return AppendCustomFormatter(value, format: null);
|
||||
}
|
||||
@@ -213,12 +213,12 @@ internal ref struct TryWriteFormatInterpolatedStringHandler
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
if (value.TryCopyTo(destination.Slice(position)))
|
||||
if (value.TryCopyTo(this.destination.Slice(this.position)))
|
||||
#else
|
||||
if (value.AsSpan().TryCopyTo(destination.Slice(position)))
|
||||
if (value.AsSpan().TryCopyTo(this.destination.Slice(this.position)))
|
||||
#endif
|
||||
{
|
||||
position += value.Length;
|
||||
this.position += value.Length;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -234,9 +234,9 @@ internal ref struct TryWriteFormatInterpolatedStringHandler
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
private bool AppendCustomFormatter<T>(T value, string? format)
|
||||
{
|
||||
ICustomFormatter? formatter = (ICustomFormatter?)formatProvider?.GetFormat(typeof(ICustomFormatter));
|
||||
ICustomFormatter? formatter = (ICustomFormatter?)this.formatProvider?.GetFormat(typeof(ICustomFormatter));
|
||||
|
||||
if (formatter is not null && formatter.Format(format, value, formatProvider) is string customFormatted)
|
||||
if (formatter is not null && formatter.Format(format, value, this.formatProvider) is string customFormatted)
|
||||
{
|
||||
return AppendStringDirect(customFormatted);
|
||||
}
|
||||
@@ -249,7 +249,7 @@ internal ref struct TryWriteFormatInterpolatedStringHandler
|
||||
/// </summary>
|
||||
private bool Fail()
|
||||
{
|
||||
success = false;
|
||||
this.success = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -27,13 +27,13 @@ public readonly struct Bool
|
||||
/// <inheritdoc/>
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
return obj is Bool x && value == x.value;
|
||||
return obj is Bool x && this.value == x.value;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return value.GetHashCode();
|
||||
return this.value.GetHashCode();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -69,9 +69,9 @@ internal sealed unsafe partial class ShaderCompiler
|
||||
/// </summary>
|
||||
~ShaderCompiler()
|
||||
{
|
||||
dxcCompiler.Dispose();
|
||||
dxcLibrary.Dispose();
|
||||
dxcIncludeHandler.Dispose();
|
||||
this.dxcCompiler.Dispose();
|
||||
this.dxcLibrary.Dispose();
|
||||
this.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(
|
||||
this.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(
|
||||
this.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(),
|
||||
this.dxcIncludeHandler.Get(),
|
||||
dxcOperationResult.GetAddressOf()).Assert();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ using Microsoft.CodeAnalysis.Operations;
|
||||
using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors;
|
||||
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
|
||||
|
||||
#pragma warning disable IDE0052
|
||||
|
||||
namespace ComputeSharp.SourceGeneration.SyntaxRewriters;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -114,10 +114,10 @@ internal unsafe ref struct DynamicResolutionManager
|
||||
// This formula is adapted from https://software.intel.com/content/www/us/en/develop/articles/dynamic-resolution-rendering-article.html.
|
||||
long averageFrameTimeInTicks = this.slidingFrameTimeWindowSum / SlidingFrameTimeWindowLength;
|
||||
|
||||
if (averageFrameTimeInTicks < lowerFrameTimeThresholdInTicks ||
|
||||
averageFrameTimeInTicks > upperFrameTimeThresholdInTicks)
|
||||
if (averageFrameTimeInTicks < this.lowerFrameTimeThresholdInTicks ||
|
||||
averageFrameTimeInTicks > this.upperFrameTimeThresholdInTicks)
|
||||
{
|
||||
float frameTimeDelta = (targetFrameTimeInTicks - averageFrameTimeInTicks) / (float)averageFrameTimeInTicks;
|
||||
float frameTimeDelta = (this.targetFrameTimeInTicks - averageFrameTimeInTicks) / (float)averageFrameTimeInTicks;
|
||||
float scaleFactorDelta = scaleFactor * frameTimeDelta * ScaleFactorDeltaK;
|
||||
float updatedScaleFactor = Math.Clamp(scaleFactor + scaleFactorDelta, 0.10f, 1.0f);
|
||||
|
||||
|
||||
@@ -422,7 +422,7 @@ internal sealed unsafe partial class SwapChainManager<TOwner> : NativeObject
|
||||
/// <inheritdoc/>
|
||||
private unsafe partial void OnWaitForPresent()
|
||||
{
|
||||
_ = Win32.WaitForSingleObjectEx(frameLatencyWaitableObject, Win32.INFINITE, true);
|
||||
_ = Win32.WaitForSingleObjectEx(this.frameLatencyWaitableObject, Win32.INFINITE, true);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -141,8 +141,8 @@ internal readonly unsafe struct ID3D12CommandListPool : IDisposable
|
||||
/// <param name="d3D12CommandAllocator">The <see cref="ID3D12CommandAllocator"/> value to wrap.</param>
|
||||
public D3D12CommandListBundle(ID3D12GraphicsCommandList* d3D12CommandList, ID3D12CommandAllocator* d3D12CommandAllocator)
|
||||
{
|
||||
D3D12CommandList = d3D12CommandList;
|
||||
D3D12CommandAllocator = d3D12CommandAllocator;
|
||||
this.D3D12CommandList = d3D12CommandList;
|
||||
this.D3D12CommandAllocator = d3D12CommandAllocator;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,8 +33,8 @@ internal readonly struct ID3D12ResourceDescriptorHandles
|
||||
D3D12_GPU_DESCRIPTOR_HANDLE d3D12GpuDescriptorHandle,
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE d3D12CpuDescriptorHandleNonShaderVisible)
|
||||
{
|
||||
D3D12CpuDescriptorHandle = d3D12CpuDescriptorHandle;
|
||||
D3D12GpuDescriptorHandle = d3D12GpuDescriptorHandle;
|
||||
D3D12CpuDescriptorHandleNonShaderVisible = d3D12CpuDescriptorHandleNonShaderVisible;
|
||||
this.D3D12CpuDescriptorHandle = d3D12CpuDescriptorHandle;
|
||||
this.D3D12GpuDescriptorHandle = d3D12GpuDescriptorHandle;
|
||||
this.D3D12CpuDescriptorHandleNonShaderVisible = d3D12CpuDescriptorHandleNonShaderVisible;
|
||||
}
|
||||
}
|
||||
@@ -60,14 +60,14 @@ internal static unsafe class AllocatorExtensions
|
||||
(D3D12_HEAP_TYPE d3D12HeapType,
|
||||
D3D12_RESOURCE_FLAGS d3D12ResourceFlags,
|
||||
D3D12_RESOURCE_STATES d3D12ResourceStates) = resourceType switch
|
||||
{
|
||||
{
|
||||
ResourceType.Constant => (D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_GENERIC_READ),
|
||||
ResourceType.ReadOnly => (D3D12_HEAP_TYPE_DEFAULT, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COMMON),
|
||||
ResourceType.ReadWrite => (D3D12_HEAP_TYPE_DEFAULT, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_COMMON),
|
||||
ResourceType.ReadBack => (D3D12_HEAP_TYPE_READBACK, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_COPY_DEST),
|
||||
ResourceType.Upload => (D3D12_HEAP_TYPE_UPLOAD, D3D12_RESOURCE_FLAG_NONE, D3D12_RESOURCE_STATE_GENERIC_READ),
|
||||
_ => ThrowHelper.ThrowArgumentException<(D3D12_HEAP_TYPE, D3D12_RESOURCE_FLAGS, D3D12_RESOURCE_STATES)>()
|
||||
};
|
||||
};
|
||||
|
||||
using ComPtr<D3D12MA_Allocation> allocation = default;
|
||||
|
||||
|
||||
@@ -267,19 +267,19 @@ unsafe partial class IWICStreamExtensions
|
||||
/// <inheritdoc/>
|
||||
public HRESULT QueryInterface(Guid* riid, void** ppvObject)
|
||||
{
|
||||
return ((delegate* unmanaged<IBufferWriterWrapper*, Guid*, void**, HRESULT>)lpVtbl[0])((IBufferWriterWrapper*)Unsafe.AsPointer(ref this), riid, ppvObject);
|
||||
return ((delegate* unmanaged<IBufferWriterWrapper*, Guid*, void**, HRESULT>)this.lpVtbl[0])((IBufferWriterWrapper*)Unsafe.AsPointer(ref this), riid, ppvObject);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint AddRef()
|
||||
{
|
||||
return ((delegate* unmanaged<IBufferWriterWrapper*, uint>)lpVtbl[1])((IBufferWriterWrapper*)Unsafe.AsPointer(ref this));
|
||||
return ((delegate* unmanaged<IBufferWriterWrapper*, uint>)this.lpVtbl[1])((IBufferWriterWrapper*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint Release()
|
||||
{
|
||||
return ((delegate* unmanaged<IBufferWriterWrapper*, uint>)lpVtbl[2])((IBufferWriterWrapper*)Unsafe.AsPointer(ref this));
|
||||
return ((delegate* unmanaged<IBufferWriterWrapper*, uint>)this.lpVtbl[2])((IBufferWriterWrapper*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -270,19 +270,19 @@ internal static unsafe partial class IWICStreamExtensions
|
||||
/// <inheritdoc/>
|
||||
public HRESULT QueryInterface(Guid* riid, void** ppvObject)
|
||||
{
|
||||
return ((delegate* unmanaged<IStreamWrapper*, Guid*, void**, HRESULT>)lpVtbl[0])((IStreamWrapper*)Unsafe.AsPointer(ref this), riid, ppvObject);
|
||||
return ((delegate* unmanaged<IStreamWrapper*, Guid*, void**, HRESULT>)this.lpVtbl[0])((IStreamWrapper*)Unsafe.AsPointer(ref this), riid, ppvObject);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint AddRef()
|
||||
{
|
||||
return ((delegate* unmanaged<IStreamWrapper*, uint>)lpVtbl[1])((IStreamWrapper*)Unsafe.AsPointer(ref this));
|
||||
return ((delegate* unmanaged<IStreamWrapper*, uint>)this.lpVtbl[1])((IStreamWrapper*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint Release()
|
||||
{
|
||||
return ((delegate* unmanaged<IStreamWrapper*, uint>)lpVtbl[2])((IStreamWrapper*)Unsafe.AsPointer(ref this));
|
||||
return ((delegate* unmanaged<IStreamWrapper*, uint>)this.lpVtbl[2])((IStreamWrapper*)Unsafe.AsPointer(ref this));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -97,12 +97,12 @@ public sealed unsafe partial class GraphicsDevice : NativeObject
|
||||
/// <summary>
|
||||
/// The event for the device removed callback.
|
||||
/// </summary>
|
||||
private HANDLE deviceRemovedEvent;
|
||||
private readonly HANDLE deviceRemovedEvent;
|
||||
|
||||
/// <summary>
|
||||
/// The wait handle for the device removed callback.
|
||||
/// </summary>
|
||||
private HANDLE deviceRemovedWaitHandle;
|
||||
private readonly HANDLE deviceRemovedWaitHandle;
|
||||
|
||||
/// <summary>
|
||||
/// The reason the device was removed, if any.
|
||||
|
||||
@@ -89,7 +89,7 @@ public abstract unsafe class Buffer<T> : NativeObject, IGraphicsResource
|
||||
nint usableSizeInBytes = checked((nint)(length * elementSizeInBytes));
|
||||
nint effectiveSizeInBytes = resourceType == ResourceType.Constant ? AlignmentHelper.Pad(usableSizeInBytes, D3D12.D3D12_CONSTANT_BUFFER_DATA_PLACEMENT_ALIGNMENT) : usableSizeInBytes;
|
||||
|
||||
SizeInBytes = usableSizeInBytes;
|
||||
this.SizeInBytes = usableSizeInBytes;
|
||||
GraphicsDevice = device;
|
||||
Length = length;
|
||||
|
||||
@@ -140,7 +140,7 @@ public abstract unsafe class Buffer<T> : NativeObject, IGraphicsResource
|
||||
internal bool IsPaddingPresent
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get => SizeInBytes > (nint)Length * sizeof(T);
|
||||
get => this.SizeInBytes > (nint)Length * sizeof(T);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -30,7 +30,7 @@ internal readonly unsafe ref struct ID3D12ResourceMap
|
||||
{
|
||||
this.d3D12Resource = d3D12Resource;
|
||||
|
||||
Pointer = pointer;
|
||||
this.Pointer = pointer;
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="IDisposable.Dispose"/>
|
||||
|
||||
@@ -130,7 +130,7 @@ public ref struct ArrayPoolStringBuilder
|
||||
|
||||
Array.Copy(this.array, 0, newArray, 0, itemsToCopy);
|
||||
|
||||
ArrayPool<char>.Shared.Return(array);
|
||||
ArrayPool<char>.Shared.Return(this.array);
|
||||
|
||||
this.array = newArray;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
this.id == other.id &&
|
||||
this.threadsX == other.threadsX &&
|
||||
this.threadsY == other.threadsY &&
|
||||
this.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(this.id, this.threadsX, this.threadsY, this.threadsZ);
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする