Skip to content

Commit 7c38fa2

Browse files
PerkseyDylan Perks
andauthored
Use ref readonly instead of in (#1882)
* Regen bindings, update notes, and fix a small maths bug * Use ref readonly instead of in * Our C# isn't cool enough yet * Our C# isn't cool enough yet * Fix attribute accessibility errors --------- Co-authored-by: Dylan Perks <dylan@Dylans-MBP.localdomain>
1 parent f98e5e5 commit 7c38fa2

File tree

1,399 files changed

+104649
-104591
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,399 files changed

+104649
-104591
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,4 +477,7 @@ src/**/build/
477477
# Silk.NET Website Generation Output
478478
/docs/
479479
src/Website/Silk.NET.Statiq/temp
480-
src/Website/Silk.NET.Statiq/cache
480+
src/Website/Silk.NET.Statiq/cache
481+
482+
# As much as I love Mac, really not interested in this litter.
483+
**/.DS_Store

build/props/bindings.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<ItemGroup>
33
<ProjectReference Include="$(MSBuildThisFileDirectory)..\..\src\Core\Silk.NET.Core\Silk.NET.Core.csproj" />
44
<ProjectReference Include="$(MSBuildThisFileDirectory)..\..\src\Core\Silk.NET.SilkTouch\Silk.NET.SilkTouch.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
5+
<Compile Include="$(MSBuildThisFileDirectory)..\..\src\Core\Silk.NET.Core\Attributes\RequiresLocationAttribute.cs" />
56
</ItemGroup>
67
<PropertyGroup>
78
<SilkPublicApiExempt>true</SilkPublicApiExempt>

src/Assimp/Silk.NET.Assimp/Assimp.gen.cs

Lines changed: 473 additions & 473 deletions
Large diffs are not rendered by default.

src/Assimp/Silk.NET.Assimp/AssimpOverloads.gen.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3122,7 +3122,7 @@ public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.
31223122

31233123
/// <summary>To be documented.</summary>
31243124
[NativeName("Src", "Line 1477, Column 28 in material.h")]
3125-
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] Material* pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<byte> pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in MaterialProperty* pPropOut)
3125+
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] Material* pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<byte> pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in MaterialProperty* pPropOut)
31263126
{
31273127
// SpanOverloader
31283128
return thisApi.GetMaterialProperty(pMat, in pKey.GetPinnableReference(), type, index, in pPropOut);
@@ -3138,7 +3138,7 @@ public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.
31383138

31393139
/// <summary>To be documented.</summary>
31403140
[NativeName("Src", "Line 1477, Column 28 in material.h")]
3141-
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<Material> pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In)] byte* pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in MaterialProperty* pPropOut)
3141+
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<Material> pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In)] byte* pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in MaterialProperty* pPropOut)
31423142
{
31433143
// SpanOverloader
31443144
return thisApi.GetMaterialProperty(in pMat.GetPinnableReference(), pKey, type, index, in pPropOut);
@@ -3154,7 +3154,7 @@ public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.
31543154

31553155
/// <summary>To be documented.</summary>
31563156
[NativeName("Src", "Line 1477, Column 28 in material.h")]
3157-
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<Material> pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<byte> pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in MaterialProperty* pPropOut)
3157+
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<Material> pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<byte> pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in MaterialProperty* pPropOut)
31583158
{
31593159
// SpanOverloader
31603160
return thisApi.GetMaterialProperty(in pMat.GetPinnableReference(), in pKey.GetPinnableReference(), type, index, in pPropOut);
@@ -3170,7 +3170,7 @@ public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.
31703170

31713171
/// <summary>To be documented.</summary>
31723172
[NativeName("Src", "Line 1477, Column 28 in material.h")]
3173-
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<Material> pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In), UnmanagedType(Silk.NET.Core.Native.UnmanagedType.LPUTF8Str)] string pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in MaterialProperty* pPropOut)
3173+
public static unsafe Return GetMaterialProperty(this Assimp thisApi, [Flow(Silk.NET.Core.Native.FlowDirection.In)] ReadOnlySpan<Material> pMat, [Flow(Silk.NET.Core.Native.FlowDirection.In), UnmanagedType(Silk.NET.Core.Native.UnmanagedType.LPUTF8Str)] string pKey, uint type, uint index, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in MaterialProperty* pPropOut)
31743174
{
31753175
// SpanOverloader
31763176
return thisApi.GetMaterialProperty(in pMat.GetPinnableReference(), pKey, type, index, in pPropOut);

src/Core/Silk.NET.BuildTools/Common/Functions/Type.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public int IndirectionLevels
118118
public string ToString(bool allowFunctionPointers)
119119
{
120120
return (IsThis ? "this " : string.Empty) +
121-
(IsIn ? "in " : string.Empty) +
121+
(IsIn ? "[RequiresLocation] in " : string.Empty) +
122122
(IsOut ? "out " : string.Empty) +
123123
(IsByRef ? "ref " : string.Empty) +
124124
(IsFunctionPointer && allowFunctionPointers && Name == "void"

src/Core/Silk.NET.Core.Win32Extras/Structs/FillLockBytesVtblExtensions.gen.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public static unsafe int FillAppend(this ComPtr<IFillLockBytes> thisVtbl, [Flow(
106106
}
107107

108108
/// <summary>To be documented.</summary>
109-
public static unsafe int FillAppend<T0>(this ComPtr<IFillLockBytes> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
109+
public static unsafe int FillAppend<T0>(this ComPtr<IFillLockBytes> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
110110
{
111111
var @this = thisVtbl.Handle;
112112
int ret = default;
@@ -118,7 +118,7 @@ public static unsafe int FillAppend<T0>(this ComPtr<IFillLockBytes> thisVtbl, [F
118118
}
119119

120120
/// <summary>To be documented.</summary>
121-
public static int FillAppend<T0>(this ComPtr<IFillLockBytes> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
121+
public static int FillAppend<T0>(this ComPtr<IFillLockBytes> thisVtbl, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
122122
{
123123
var @this = thisVtbl.Handle;
124124
int ret = default;
@@ -154,7 +154,7 @@ public static unsafe int FillAt(this ComPtr<IFillLockBytes> thisVtbl, ulong ulOf
154154
}
155155

156156
/// <summary>To be documented.</summary>
157-
public static unsafe int FillAt<T0>(this ComPtr<IFillLockBytes> thisVtbl, ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
157+
public static unsafe int FillAt<T0>(this ComPtr<IFillLockBytes> thisVtbl, ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
158158
{
159159
var @this = thisVtbl.Handle;
160160
int ret = default;
@@ -166,7 +166,7 @@ public static unsafe int FillAt<T0>(this ComPtr<IFillLockBytes> thisVtbl, ulong
166166
}
167167

168168
/// <summary>To be documented.</summary>
169-
public static int FillAt<T0>(this ComPtr<IFillLockBytes> thisVtbl, ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
169+
public static int FillAt<T0>(this ComPtr<IFillLockBytes> thisVtbl, ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
170170
{
171171
var @this = thisVtbl.Handle;
172172
int ret = default;

src/Core/Silk.NET.Core.Win32Extras/Structs/IFillLockBytes.gen.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public readonly unsafe int FillAppend([Flow(Silk.NET.Core.Native.FlowDirection.I
132132
}
133133

134134
/// <summary>To be documented.</summary>
135-
public readonly unsafe int FillAppend<T0>([Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
135+
public readonly unsafe int FillAppend<T0>([Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
136136
{
137137
var @this = (IFillLockBytes*) Unsafe.AsPointer(ref Unsafe.AsRef(in this));
138138
int ret = default;
@@ -144,7 +144,7 @@ public readonly unsafe int FillAppend<T0>([Flow(Silk.NET.Core.Native.FlowDirecti
144144
}
145145

146146
/// <summary>To be documented.</summary>
147-
public readonly int FillAppend<T0>([Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
147+
public readonly int FillAppend<T0>([Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
148148
{
149149
var @this = (IFillLockBytes*) Unsafe.AsPointer(ref Unsafe.AsRef(in this));
150150
int ret = default;
@@ -180,7 +180,7 @@ public readonly unsafe int FillAt(ulong ulOffset, [Flow(Silk.NET.Core.Native.Flo
180180
}
181181

182182
/// <summary>To be documented.</summary>
183-
public readonly unsafe int FillAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
183+
public readonly unsafe int FillAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
184184
{
185185
var @this = (IFillLockBytes*) Unsafe.AsPointer(ref Unsafe.AsRef(in this));
186186
int ret = default;
@@ -192,7 +192,7 @@ public readonly unsafe int FillAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native
192192
}
193193

194194
/// <summary>To be documented.</summary>
195-
public readonly int FillAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
195+
public readonly int FillAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
196196
{
197197
var @this = (IFillLockBytes*) Unsafe.AsPointer(ref Unsafe.AsRef(in this));
198198
int ret = default;

src/Core/Silk.NET.Core.Win32Extras/Structs/ILockBytes.gen.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public readonly unsafe int WriteAt(ulong ulOffset, [Flow(Silk.NET.Core.Native.Fl
180180
}
181181

182182
/// <summary>To be documented.</summary>
183-
public readonly unsafe int WriteAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
183+
public readonly unsafe int WriteAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, uint* pcbWritten) where T0 : unmanaged
184184
{
185185
var @this = (ILockBytes*) Unsafe.AsPointer(ref Unsafe.AsRef(in this));
186186
int ret = default;
@@ -192,7 +192,7 @@ public readonly unsafe int WriteAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Nativ
192192
}
193193

194194
/// <summary>To be documented.</summary>
195-
public readonly int WriteAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
195+
public readonly int WriteAt<T0>(ulong ulOffset, [Flow(Silk.NET.Core.Native.FlowDirection.In)] [RequiresLocation] in T0 pv, uint cb, ref uint pcbWritten) where T0 : unmanaged
196196
{
197197
var @this = (ILockBytes*) Unsafe.AsPointer(ref Unsafe.AsRef(in this));
198198
int ret = default;

0 commit comments

Comments
 (0)