Skip to content

Commit

Permalink
This is the April 2024 Update (v2.21.0) (#2115)
Browse files Browse the repository at this point in the history
* Fix #2026

* Fix #2000, closes #2005

* Fix #2010

* Fix added AL bug (good thing we had tests!)

* Fix #1500

* Undo any unintentional changes

* Add nint overloads for things like VertexAttribPointer

* Fix build errors

* Add more standard cursor shapes

* Upversion natives where necessary

* Patch notes for 2.21

* Reorder literally a single line

* Incorporate #2143/#2066/#2090 in patch notes

* Implement IsExtensionPresent for WGL

* nit

* OpenXR updates?

* Fix flawed constant parsing for Vk/XR

* Add openxr to patch notes

* Update patch notes for 2.21
  • Loading branch information
Perksey committed Apr 23, 2024
1 parent 0e8e039 commit ff35bea
Show file tree
Hide file tree
Showing 174 changed files with 6,339 additions and 134 deletions.
45 changes: 45 additions & 0 deletions Silk.NET.sln
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorld", "examples\CSha
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenXR.Extensions.NV", "src\OpenXR\Extensions\Silk.NET.OpenXR.Extensions.NV\Silk.NET.OpenXR.Extensions.NV.csproj", "{34D35A41-E974-40C9-8888-3510A0F074AA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenXR.Extensions.LEIA", "src\OpenXR\Extensions\Silk.NET.OpenXR.Extensions.LEIA\Silk.NET.OpenXR.Extensions.LEIA.csproj", "{B70533BB-FB84-4BC3-888C-88E5F40FD22D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenXR.Extensions.ANDROIDX", "src\OpenXR\Extensions\Silk.NET.OpenXR.Extensions.ANDROIDX\Silk.NET.OpenXR.Extensions.ANDROIDX.csproj", "{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenXR.Extensions.ANDROIDSYS", "src\OpenXR\Extensions\Silk.NET.OpenXR.Extensions.ANDROIDSYS\Silk.NET.OpenXR.Extensions.ANDROIDSYS.csproj", "{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -3715,6 +3721,42 @@ Global
{34D35A41-E974-40C9-8888-3510A0F074AA}.Release|x64.Build.0 = Release|Any CPU
{34D35A41-E974-40C9-8888-3510A0F074AA}.Release|x86.ActiveCfg = Release|Any CPU
{34D35A41-E974-40C9-8888-3510A0F074AA}.Release|x86.Build.0 = Release|Any CPU
{B70533BB-FB84-4BC3-888C-88E5F40FD22D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B70533BB-FB84-4BC3-888C-88E5F40FD22D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B70533BB-FB84-4BC3-888C-88E5F40FD22D}.Debug|x64.ActiveCfg = Debug|Any CPU
{B70533BB-FB84-4BC3-888C-88E5F40FD22D}.Debug|x64.Build.0 = Debug|Any CPU
{B70533BB-FB84-4BC3-888C-88E5F40FD22D}.Debug|x86.ActiveCfg = Debug|Any CPU
{B70533BB-FB84-4BC3-888C-88E5F40FD22D}.Debug|x86.Build.0 = Debug|Any CPU
{B70533BB-FB84-4BC3-888C-88E5F40FD22D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B70533BB-FB84-4BC3-888C-88E5F40FD22D}.Release|Any CPU.Build.0 = Release|Any CPU
{B70533BB-FB84-4BC3-888C-88E5F40FD22D}.Release|x64.ActiveCfg = Release|Any CPU
{B70533BB-FB84-4BC3-888C-88E5F40FD22D}.Release|x64.Build.0 = Release|Any CPU
{B70533BB-FB84-4BC3-888C-88E5F40FD22D}.Release|x86.ActiveCfg = Release|Any CPU
{B70533BB-FB84-4BC3-888C-88E5F40FD22D}.Release|x86.Build.0 = Release|Any CPU
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C}.Debug|x64.ActiveCfg = Debug|Any CPU
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C}.Debug|x64.Build.0 = Debug|Any CPU
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C}.Debug|x86.ActiveCfg = Debug|Any CPU
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C}.Debug|x86.Build.0 = Debug|Any CPU
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C}.Release|Any CPU.Build.0 = Release|Any CPU
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C}.Release|x64.ActiveCfg = Release|Any CPU
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C}.Release|x64.Build.0 = Release|Any CPU
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C}.Release|x86.ActiveCfg = Release|Any CPU
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C}.Release|x86.Build.0 = Release|Any CPU
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Debug|x64.ActiveCfg = Debug|Any CPU
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Debug|x64.Build.0 = Debug|Any CPU
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Debug|x86.ActiveCfg = Debug|Any CPU
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Debug|x86.Build.0 = Debug|Any CPU
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Release|Any CPU.Build.0 = Release|Any CPU
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Release|x64.ActiveCfg = Release|Any CPU
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Release|x64.Build.0 = Release|Any CPU
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Release|x86.ActiveCfg = Release|Any CPU
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -4012,6 +4054,9 @@ Global
{FD0C9C4B-3777-4755-A87B-60FE65D92750} = {6842A2C6-5C7B-42DD-9825-0EDE91BFEBF7}
{9CB90BB8-946F-4962-9365-A97BF5C6550A} = {FD0C9C4B-3777-4755-A87B-60FE65D92750}
{34D35A41-E974-40C9-8888-3510A0F074AA} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
{B70533BB-FB84-4BC3-888C-88E5F40FD22D} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
{25ABCA5E-4FF6-43ED-9A5E-443E1373EC5C} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
{01B6FFA0-5B37-44EA-ABDF-7BABD05874C5} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F5273D7F-3334-48DF-94E3-41AE6816CD4D}
Expand Down
Binary file modified build/cache/gl.json.gz
Binary file not shown.
Binary file modified build/cache/glcore.json.gz
Binary file not shown.
Binary file modified build/cache/gles2.json.gz
Binary file not shown.
45 changes: 36 additions & 9 deletions build/props/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,49 @@
<LangVersion>10</LangVersion>
<Authors>.NET Foundation and Contributors</Authors>
<PackageReleaseNotes>
Silk.NET December 2023 Update
Silk.NET April 2024 Update

- Added support for UTF-8 file paths in GLFW and SDL windows (thanks @WinstonMao)
- Updated to OpenXR 1.0.32.1
- Updated to Vulkan 1.3.273
- Updated to latest OpenGL specifications
- Updated to latest OpenCL specifications
- Fixed Matrix2X2.GetDeterminant returning incorrect values
- Fixed ALC_SOFT_reopen_device being a non-context extension (thanks @okaniku, @doobah)
- Added nint overloads for the cases where OpenGL represents a native-sized integer as a void pointer.
- Added support for executing Windowing loops during repaint and drag events on GLFW in some cases. (thanks @otac0n)
- Added a distinction between "unset" (-1) and "default" (null) for Windowing depth/stencil buffer bits, defaulting to 24/8 on all platforms unless overridden.
- Added support for 64-bit Arm Linux for Assimp, GLFW (+ Windowing &amp; Input), OpenAL Soft, SDL, Vkd3d, Vulkan Loader, SwiftShader, and WGPU. (thanks @alexrp)
- Added support for Apple Silicon Macs for OpenAL Soft, Vulkan Loader, and SwiftShader. (thanks @alexrp)
- Added support for 32-bit Arm Linux for Assimp, GLFW, OpenAL Soft, SDL, Shaderc, SPIR-V Cross, SPIR-V Reflect, Vkd3d, SwiftShader, and WGPU. (thanks @alexrp)
- Added support for 64-bit Windows on Arm for Assimp, OpenAL Soft, VulkanLoader, and SwiftShader. (thanks @alexrp)
- Added limited native library support (SPIR-V Tools and Shaderc) for glibc versions as old as 2.17 on Linux platforms.
- Added support for new standard cursor shapes in Input and GLFW.
- Updated to use `ref readonly` instead of `in`.
- Updated to OpenXR 1.1.36.
- Updated to DirectStorage 1.2.2.
- Updated to Vulkan 1.3.281.
- Updated to SDL 2.30.1.
- Updated to latest OpenCL specifications.
- Updated to latest SPIR-V Reflect.
- Updated to latest WebGPU/Dawn/WGPU headers.
- Updated Vkd3d native binaries.
- Fixed string marshalling occasionally resulting in memory access violations on newer .NET 8 versions.
- Fixed Windowing crashing on .NET Framework builds with prefer 32-bit set using GLFW.
- Fixed extension loading generic type usage issues with full IL trimming enabled.
- Fixed erroneous BreakneckLock acquisition logic slowing input events on mobile/SDL. (thanks @ZingBallyhoo)
- Fixed windowing losing events when using multiple windows on desktop with the mobile/SDL implementation. (thanks @ZingBallyhoo)
- Fixed some packages not referencing their native counterparts where appropriate. (thanks @alexrp)
- Fixed Input events for standalone joysticks not being tracked on GLFW.
- Fixed Input events no longer being tracked after 3-10 reopens of the same window on GLFW.
- Fixed V-Sync configuration not persisting over window state changes in Windowing.
- Fixed Circle.Contains erroneously comparing the squared vector distance from its center against its non-squared radius. (thanks @djoyahoy)

After this update:
- Apple Silicon support is complete except for missing ANGLE binaries.
- Arm Linux support is complete except for missing DXVK, ANGLE, and Vulkan Loader (missing on 32-bit only) binaries.
- 64-bit Windows on Arm support is complete except for missing DXVK and ANGLE binaries.
- 32-bit Windows on Arm remains unsupported except for DirectStorage.
</PackageReleaseNotes>
<PackageTags Condition="'$(PackageTags)' == ''">OpenCL;OpenGL;OpenAL;OpenGLES;GLES;Vulkan;Assimp;DirectX;GLFW;SDL;Windowing;Input;Gamepad;Joystick;Keyboard;Mouse;SilkTouch;Source;Generator;C#;F#;.NET;DotNet;Mono;Vector;Math;Maths;Numerics;Game;Graphics;Compute;Audio;Sound;Engine;Silk;Silk.NET;Slim.NET;ElgarTK;GPU;Sharp;Science;Scientific;Visualization;Visual;Audiovisual;Windows;macOS;Linux;Android;Bindings;OSX;Wrapper;Native</PackageTags>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageOutputPath>$(MSBuildThisFileDirectory)/../output_packages</PackageOutputPath>
<RepositoryUrl>https://github.com/dotnet/Silk.NET</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<VersionPrefix>2.20.0</VersionPrefix>
<VersionPrefix>2.21.0</VersionPrefix>
<VersionSuffix Condition="'$(VersionSuffix)' == ''"></VersionSuffix>
<Description Condition="'$(Description)' == ''">
Silk.NET is a high-speed, advanced library, providing bindings to popular low-level APIs such as OpenGL, OpenCL, OpenAL, OpenXR, GLFW, SDL, Vulkan, Assimp, and DirectX.
Expand Down
117 changes: 117 additions & 0 deletions generator.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,44 @@
"glPointSizePointerOES"
]
},
"glIntAsPtr": {
"EdgeFlagPointer": ["pointer"],
"EdgeFlagPointerEXT": ["pointer"],
"EdgeFlagPointerListIBM": ["pointer"],
"VertexPointer": ["pointer"],
"VertexPointerEXT": ["pointer"],
"VertexPointerListIBM": ["pointer"],
"VertexPointervINTEL": ["pointer"],
"ColorPointer": ["pointer"],
"ColorPointerEXT": ["pointer"],
"ColorPointerListIBM": ["pointer"],
"ColorPointervINTEL": ["pointer"],
"IndexPointer": ["pointer"],
"IndexPointerEXT": ["pointer"],
"IndexPointerListIBM": ["pointer"],
"NormalPointer": ["pointer"],
"NormalPointerEXT": ["pointer"],
"NormalPointerListIBM": ["pointer"],
"NormalPointervINTEL": ["pointer"],
"TexCoordPointer": ["pointer"],
"TexCoordPointerEXT": ["pointer"],
"TexCoordPointerListIBM": ["pointer"],
"TexCoordPointervINTEL": ["pointer"],
"MultiTexCoordPointerEXT": ["pointer"],
"FogCoordPointer": ["pointer"],
"FogCoordPointerEXT": ["pointer"],
"FogCoordPointerListIBM": ["pointer"],
"SecondaryColorPointer": ["pointer"],
"SecondaryColorPointerEXT": ["pointer"],
"SecondaryColorPointerListIBM": ["pointer"],
"VertexAttribPointer": ["pointer"],
"VertexAttribPointerARB": ["pointer"],
"VertexAttribPointerNV": ["pointer"],
"VertexAttribIPointer": ["pointer"],
"VertexAttribIPointerEXT": ["pointer"],
"TangentPointerEXT": ["pointer"],
"BinormalPointerEXT": ["pointer"]
},
"extensionsNamespace": "Silk.NET.OpenGL.Extensions",
"typeMaps": [
{
Expand Down Expand Up @@ -124,6 +162,44 @@
"Boolean"
],
"namespace": "Silk.NET.OpenGL.Legacy",
"glIntAsPtr": {
"EdgeFlagPointer": ["pointer"],
"EdgeFlagPointerEXT": ["pointer"],
"EdgeFlagPointerListIBM": ["pointer"],
"VertexPointer": ["pointer"],
"VertexPointerEXT": ["pointer"],
"VertexPointerListIBM": ["pointer"],
"VertexPointervINTEL": ["pointer"],
"ColorPointer": ["pointer"],
"ColorPointerEXT": ["pointer"],
"ColorPointerListIBM": ["pointer"],
"ColorPointervINTEL": ["pointer"],
"IndexPointer": ["pointer"],
"IndexPointerEXT": ["pointer"],
"IndexPointerListIBM": ["pointer"],
"NormalPointer": ["pointer"],
"NormalPointerEXT": ["pointer"],
"NormalPointerListIBM": ["pointer"],
"NormalPointervINTEL": ["pointer"],
"TexCoordPointer": ["pointer"],
"TexCoordPointerEXT": ["pointer"],
"TexCoordPointerListIBM": ["pointer"],
"TexCoordPointervINTEL": ["pointer"],
"MultiTexCoordPointerEXT": ["pointer"],
"FogCoordPointer": ["pointer"],
"FogCoordPointerEXT": ["pointer"],
"FogCoordPointerListIBM": ["pointer"],
"SecondaryColorPointer": ["pointer"],
"SecondaryColorPointerEXT": ["pointer"],
"SecondaryColorPointerListIBM": ["pointer"],
"VertexAttribPointer": ["pointer"],
"VertexAttribPointerARB": ["pointer"],
"VertexAttribPointerNV": ["pointer"],
"VertexAttribIPointer": ["pointer"],
"VertexAttribIPointerEXT": ["pointer"],
"TangentPointerEXT": ["pointer"],
"BinormalPointerEXT": ["pointer"]
},
"extensionsNamespace": "Silk.NET.OpenGL.Legacy.Extensions",
"overloadExclusions": {
"RefOverloader": [
Expand Down Expand Up @@ -212,6 +288,44 @@
"Boolean"
],
"namespace": "Silk.NET.OpenGLES",
"glIntAsPtr": {
"EdgeFlagPointer": ["pointer"],
"EdgeFlagPointerEXT": ["pointer"],
"EdgeFlagPointerListIBM": ["pointer"],
"VertexPointer": ["pointer"],
"VertexPointerEXT": ["pointer"],
"VertexPointerListIBM": ["pointer"],
"VertexPointervINTEL": ["pointer"],
"ColorPointer": ["pointer"],
"ColorPointerEXT": ["pointer"],
"ColorPointerListIBM": ["pointer"],
"ColorPointervINTEL": ["pointer"],
"IndexPointer": ["pointer"],
"IndexPointerEXT": ["pointer"],
"IndexPointerListIBM": ["pointer"],
"NormalPointer": ["pointer"],
"NormalPointerEXT": ["pointer"],
"NormalPointerListIBM": ["pointer"],
"NormalPointervINTEL": ["pointer"],
"TexCoordPointer": ["pointer"],
"TexCoordPointerEXT": ["pointer"],
"TexCoordPointerListIBM": ["pointer"],
"TexCoordPointervINTEL": ["pointer"],
"MultiTexCoordPointerEXT": ["pointer"],
"FogCoordPointer": ["pointer"],
"FogCoordPointerEXT": ["pointer"],
"FogCoordPointerListIBM": ["pointer"],
"SecondaryColorPointer": ["pointer"],
"SecondaryColorPointerEXT": ["pointer"],
"SecondaryColorPointerListIBM": ["pointer"],
"VertexAttribPointer": ["pointer"],
"VertexAttribPointerARB": ["pointer"],
"VertexAttribPointerNV": ["pointer"],
"VertexAttribIPointer": ["pointer"],
"VertexAttribIPointerEXT": ["pointer"],
"TangentPointerEXT": ["pointer"],
"BinormalPointerEXT": ["pointer"]
},
"extensionsNamespace": "Silk.NET.OpenGLES.Extensions",
"overloadExclusions": {
"RefOverloader": [
Expand Down Expand Up @@ -763,6 +877,9 @@
"typeMaps": [
{
"$typemapPrecedesInjections": "true",
"XrFutureEXT": "FutureEXT",
"PFN_xrGetInstanceProcAddr": "PfnGetInstanceProcAddr",
"PFN_xrCreateApiLayerInstance": "PfnCreateApiLayerInstance",
"char": "byte",
"XR_DEFINE_ATOM": "uint64_t",
"LUID": "ulong",
Expand Down
5 changes: 1 addition & 4 deletions src/Core/Silk.NET.BuildTools/Bind/ClassWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,7 @@ static string GetSignature(Function func)
sw.WriteLine(" public bool TryGetExtension<T>(out T ext)");
sw.WriteLine($" where T:NativeExtension<{@class.ClassName}>");
sw.WriteLine(" {");
sw.WriteLine(" ext = IsExtensionPresent(GetExtensionAttribute(typeof(T)).Name)");
sw.WriteLine(" ? (T) Activator.CreateInstance(typeof(T), Context)");
sw.WriteLine(" : null;");
sw.WriteLine(" return ext is not null;");
sw.WriteLine(" throw new NotImplementedException();");
sw.WriteLine(" }");
sw.WriteLine();
sw.WriteLine(" public override bool IsExtensionPresent(string extension)");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public sealed class TypeSignatureBuilder
private Function _newFunctionPointerSignature;

private List<Type> _newGenericParams;

private bool _newIsIntAsPtr;

/// <summary>
/// Initializes a new instance of the <see cref="TypeSignatureBuilder" /> class.
Expand All @@ -56,6 +58,7 @@ public TypeSignatureBuilder(Type typeSignature)
_newIsGenericType = typeSignature.IsGenericTypeParameterReference;
_newFunctionPointerSignature = typeSignature.FunctionPointerSignature;
_newGenericParams = typeSignature.GenericTypes;
_newIsIntAsPtr = typeSignature.IsIntAsPtr;
}

/// <summary>
Expand Down Expand Up @@ -142,7 +145,8 @@ public Type Build()
OriginalGroup = _newOriginalGroup,
OriginalClass = _newOriginalClass,
IsGenericTypeParameterReference = _newIsGenericType,
GenericTypes = _newGenericParams
GenericTypes = _newGenericParams,
IsIntAsPtr = _newIsIntAsPtr
};
}

Expand Down Expand Up @@ -191,6 +195,12 @@ public TypeSignatureBuilder WithGenericTypes(params Type[] parameters)
_newGenericParams = parameters.ToList();
return this;
}

public TypeSignatureBuilder WithIsIntAsPtr(bool isIntAsPtr)
{
_newIsIntAsPtr = isIntAsPtr;
return this;
}
// ReSharper restore UnusedParameter.Global
}
}
6 changes: 6 additions & 0 deletions src/Core/Silk.NET.BuildTools/Common/Functions/Type.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ public int IndirectionLevels
/// </summary>
public bool IsThis { get; set; }

/// <summary>
/// Gets or sets a value indicating whether this is a pointer that is actually an integer and not a pointer to a
/// memory location.
/// </summary>
public bool IsIntAsPtr { get; set; }

/// <summary>
/// Gets or sets the function pointer signature if this type is a function pointer. May be null.
/// </summary>
Expand Down
Loading

0 comments on commit ff35bea

Please sign in to comment.