Enable RVA fields again for generated input types
このコミットが含まれているのは:
1 親
4ecf0b26cb
コミット
d79fdeab71
1ファイル変更
+4
-6
+4
-6
@@ -76,8 +76,8 @@ partial class D2DPixelShaderDescriptorGenerator
|
||||
|
||||
// RVA field
|
||||
writer.WriteLine();
|
||||
writer.WriteLine("/// <summary>The data with the input type info.</summary>");
|
||||
writer.WriteLine("private static D2D1PixelShaderInputType[] Data = new[]");
|
||||
writer.WriteLine("/// <summary>The RVA data with the input type info.</summary>");
|
||||
writer.WriteLine("private static ReadOnlySpan<D2D1PixelShaderInputType> Data => new[]");
|
||||
writer.WriteLine("{");
|
||||
writer.IncreaseIndent();
|
||||
|
||||
@@ -98,7 +98,7 @@ partial class D2DPixelShaderDescriptorGenerator
|
||||
/// <inheritdoc/>
|
||||
public override unsafe Span<D2D1PixelShaderInputType> GetSpan()
|
||||
{
|
||||
return Data;
|
||||
return new(Unsafe.AsPointer(ref MemoryMarshal.GetReference(Data)), Data.Length);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
@@ -111,9 +111,7 @@ partial class D2DPixelShaderDescriptorGenerator
|
||||
/// <inheritdoc/>
|
||||
public override unsafe MemoryHandle Pin(int elementIndex)
|
||||
{
|
||||
GCHandle handle = GCHandle.Alloc(Data, GCHandleType.Pinned);
|
||||
|
||||
return new(Unsafe.AsPointer(ref Data[elementIndex]), handle);
|
||||
return new(Unsafe.AsPointer(ref Unsafe.AsRef(in Data[elementIndex])), pinnable: this);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする