Skip to content

Commit

Permalink
Silly fixes (#1251)
Browse files Browse the repository at this point in the history
* Start of silly fixes

* Fixes #1249

* Fixes #1155

* Add a comments section to the website

* Fix #821, fix #1094

* Fix #1093, fix #960

* Fix #1070

* Fix #1091

* Review comment, apply NativeAOT fix only on NS21+

* Add support for Vulkan specification specialization (SC), full regen

* Fix build

* Last silly fix

* Calm down

* Address review comments

* Build fixes

* How did that not work...

* Fix regen CI, only add None enum if there isn't a 0, update patch notes

* Include the pushable token for CI

* Don't remove the Flags attribute where unnecessary

* Remove problematic type, remove erroneous additions of None in enums

* New binaries for Assimp on Darwin 21.6.0 Darwin Kernel Version 21.6.0: Mon Dec 19 20:44:01 PST 2022; root:xnu-8020.240.18~2/RELEASE_X86_64 (#1310)

Co-authored-by: The Silk.NET Automaton <[email protected]>
Co-authored-by: Dylan Perks <[email protected]>

* Regenerate bindings as of 10/03/2023 (#1324)

* Regenerated bindings as of 10/03/2023 (16:54:01)

* Regenerated bindings as of 10/03/2023 (17:35:57)

* Regenerated bindings as of 10/03/2023 (18:27:27)

---------

Co-authored-by: The Silk.NET Automaton <[email protected]>

* Build fixes

* Review comments, update WebGPU?

* Fix Vulkan build errors

---------

Co-authored-by: silkdotnet <[email protected]>
Co-authored-by: The Silk.NET Automaton <[email protected]>
  • Loading branch information
3 people committed Mar 19, 2023
1 parent 4f4c9db commit 4b7976b
Show file tree
Hide file tree
Showing 1,044 changed files with 23,426 additions and 27,867 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/bindings-regeneration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ jobs:
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
token: ${{ secrets.PUSHABLE_GITHUB_TOKEN }}
- name: Checkout submodules, configure git.
run: |
git -c submodule.third_party/git-hooks.update=none submodule update --init --recursive
git config --local user.email "[email protected]"
git config --local user.name "The Silk.NET Automaton"
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
Expand Down Expand Up @@ -49,17 +54,6 @@ jobs:
with:
sdk-version: 22621
- name: Run a full run of BuildTools
run: dotnet run -c Release --project src/Core/Silk.NET.BuildTools/Silk.NET.BuildTools.csproj -- generator.json --no-parallel
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%d-%m-%Y')"
- name: Create or Update Pull Request
uses: gr2m/create-or-update-pull-request-action@v1
run: ./build.cmd regenerate-bindings --create-bindings-pr --no-parallel-generation
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: Binding and specification updates
body: Regenerates the bindings and the cached specifications with the latest upstream specifications.
branch: patch/spec-updates
author: "Team Silk.NET <[email protected]>"
commit-message: Latest bindings as of ${{ steps.date.outputs.date }}
PUSHABLE_GITHUB_TOKEN: ${{ secrets.PUSHABLE_GITHUB_TOKEN }}
8 changes: 8 additions & 0 deletions .nuke/build.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"type": "boolean",
"description": "Indicates to continue a previously failed build attempt"
},
"CreateBindingsPr": {
"type": "boolean",
"description": "Create a PR after bindings regeneration completes"
},
"Help": {
"type": "boolean",
"description": "Shows the help text for this build assembly"
Expand Down Expand Up @@ -58,6 +62,10 @@
"type": "boolean",
"description": "Disables displaying the NUKE logo"
},
"NoParallelGeneration": {
"type": "boolean",
"description": "Don't let BuildTools parallelize"
},
"NugetApiKey": {
"type": "string",
"description": "The API key used to push packages and symbols packages to NuGet"
Expand Down
Binary file modified build/cache/assimp.json.gz
Binary file not shown.
Binary file modified build/cache/cl.json.gz
Binary file not shown.
Binary file modified build/cache/core.json.gz
Binary file not shown.
Binary file modified build/cache/d2d.json.gz
Binary file not shown.
Binary file modified build/cache/d3d11.json.gz
Binary file not shown.
Binary file modified build/cache/d3d12.json.gz
Binary file not shown.
Binary file modified build/cache/d3d9.json.gz
Binary file not shown.
Binary file modified build/cache/dcomp.json.gz
Binary file not shown.
Binary file modified build/cache/dstorage.json.gz
Binary file not shown.
Binary file modified build/cache/dxc.json.gz
Binary file not shown.
Binary file modified build/cache/dxgi.json.gz
Binary file not shown.
Binary file modified build/cache/dxva.json.gz
Binary file not shown.
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.
Binary file modified build/cache/openxr.json.gz
Binary file not shown.
Binary file modified build/cache/sdl.json.gz
Binary file not shown.
Binary file modified build/cache/vulkan.json.gz
Binary file not shown.
Binary file modified build/cache/vulkan_video.json.gz
Binary file not shown.
Binary file modified build/cache/webgpu.json.gz
Binary file not shown.
Binary file modified build/cache/wgl.json.gz
Binary file not shown.
Binary file modified build/cache/win32extras.json.gz
Binary file not shown.
Binary file modified build/cache/xaudio.json.gz
Binary file not shown.
Binary file modified build/cache/xinput.json.gz
Binary file not shown.
1 change: 0 additions & 1 deletion build/gl_typemap.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"Boolean": "GLboolean",
"BooleanPointer": "GLboolean*",
"Char": "GLchar",
"CharPointer": "GLchar*",
Expand Down
9 changes: 7 additions & 2 deletions build/khronos_typemap.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
"LPCSTR": "string",
"HANDLE": "nint",
"LPVOID": "nint",
"LPCWSTR": "nint"
}
"LPCWSTR": "nint",
"NvSciSyncAttrList": "nint",
"NvSciSyncObj": "nint",
"NvSciSyncFence": "nint",
"NvSciBufAttrList": "nint",
"NvSciBufObj": "nint"
}
87 changes: 86 additions & 1 deletion build/nuke/Build.Generation.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using Nuke.Common;
using Nuke.Common.CI.GitHubActions;
using Nuke.Common.Tooling;
using Nuke.Common.Tools.DotNet;
using Octokit;
using Octokit.Internal;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
using static Nuke.Common.Tools.Git.GitTasks;
using static Nuke.Common.Tooling.ProcessTasks;

partial class Build
{
[Nuke.Common.Parameter("Create a PR after bindings regeneration completes")] readonly bool CreateBindingsPr;
[Nuke.Common.Parameter("Don't let BuildTools parallelize")] readonly bool NoParallelGeneration;

Target RegenerateBindings => CommonTarget
(
x => x.After(Clean)
Expand All @@ -27,10 +39,83 @@ partial class Build
(
s => s.SetProjectFile(project)
.SetConfiguration("Release")
.SetApplicationArguments(Path.Combine(RootDirectory, "generator.json"))
.SetApplicationArguments
(
Path.Combine(RootDirectory, "generator.json") +
(NoParallelGeneration ? " --no-parallel" : "")
)
);
if (CreateBindingsPr)
{
foreach (var missedOut in GetNewProjects())
{
DotNet($"sln \"{Path.GetFileName(OriginalSolution.FileName)}\" add \"{missedOut}\"");
}
PrUpdatedBindings();
}
}
)
);


void PrUpdatedBindings()
{
var pushableToken = EnvironmentInfo.GetVariable<string>("PUSHABLE_GITHUB_TOKEN");
var curBranch = GitCurrentBranch(RootDirectory);
if (!string.IsNullOrWhiteSpace(pushableToken) &&
GitHubActions.Instance?.Repository == "dotnet/Silk.NET" &&
curBranch != "HEAD" &&
!string.IsNullOrWhiteSpace(curBranch))
{
Git("fetch --all", RootDirectory);
Git("pull");
Git("add src build/cache Silk.NET.sln", RootDirectory);
var newBranch = $"ci/{curBranch}/bindings_regen";
var curCommit = GitCurrentCommit(RootDirectory);
var commitCmd = InheritedShell
(
$"git commit -m \"Regenerated bindings as of {DateTime.UtcNow:dd/MM/yyyy (HH:mm:ss)}\""
)
.AssertWaitForExit();
if (!commitCmd.Output.Any(x => x.Text.Contains("nothing to commit", StringComparison.OrdinalIgnoreCase)))
{
commitCmd.AssertZeroExitCode();
}

// ensure there are no other changes
Git("checkout HEAD .nuke/", RootDirectory);
Git("reset --hard", RootDirectory);
if (GitCurrentCommit(RootDirectory) != curCommit) // might get "nothing to commit", you never know...
{
Logger.Info("Checking for existing branch...");
var exists = StartProcess("git", $"checkout \"{newBranch}\"", RootDirectory)
.AssertWaitForExit()
.ExitCode == 0;
if (!exists)
{
Logger.Info("None found, creating a new one...");
Git($"checkout -b \"{newBranch}\"");
}

Git($"merge -X theirs \"{curBranch}\" --allow-unrelated-histories");
Git($"push --set-upstream origin \"{newBranch}\"");
if (!exists)
{
var github = new GitHubClient
(
new ProductHeaderValue("Silk.NET-CI"),
new InMemoryCredentialStore(new Credentials(pushableToken))
);

var pr = github.PullRequest.Create
("dotnet", "Silk.NET", new($"Regenerate bindings as of {DateTime.UtcNow:dd/MM/yyyy}", newBranch, curBranch))
.GetAwaiter()
.GetResult();
}
}
}
}

}
65 changes: 37 additions & 28 deletions build/nuke/Build.ReviewHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,7 @@ partial class Build
(
() =>
{
var files = RootDirectory.GlobFiles("**\\*.csproj").Concat(RootDirectory.GlobFiles("**/*.csproj")).ToArray();
Logger.Info($"Found {files.Length} csproj files in \"{RootDirectory}\"");
var missedOut = new List<string>();
foreach (var file in files)
{
var found = false;
foreach (var project in OriginalSolution.GetProjects("*"))
{
if (new FileInfo(file).FullName.Equals(new FileInfo(project.Path).FullName))
{
found = true;
break;
}
}
if (!found && !AllowedExclusions.Contains(Path.GetFileNameWithoutExtension(file)))
{
Logger.Error
(
"A project has not been included in the solution and will not be shipped! " +
$"\"{file}\" if this is acceptable please add the project name (excluding the path and " +
"extension) to the AllowedExclusions array in the NUKE Build.ReviewHelpers.cs file."
);
missedOut.Add(Path.GetRelativePath(RootDirectory, file).Replace('\\', '/'));
}
}
var missedOut = GetNewProjects();
if (missedOut.Any())
{
Logger.Warn("Commands to add these for your convenience:");
Expand All @@ -65,4 +38,40 @@ partial class Build
}
)
);

List<string> GetNewProjects()
{
var missedOut = new List<string>();
var files = RootDirectory.GlobFiles("**\\*.csproj")
.Concat(RootDirectory.GlobFiles("**/*.csproj"))
.Where(x => !x.ToString().Contains("submodules"))
.ToArray();
Logger.Info($"Found {files.Length} csproj files in \"{RootDirectory}\"");
foreach (var file in files)
{
var found = false;
foreach (var project in OriginalSolution.GetProjects("*"))
{
if (new FileInfo(file).FullName.Equals(new FileInfo(project.Path).FullName))
{
found = true;
break;
}
}

if (!found && !AllowedExclusions.Contains(Path.GetFileNameWithoutExtension(file)))
{
Logger.Error
(
"A project has not been included in the solution and will not be shipped! " +
$"\"{file}\" if this is acceptable please add the project name (excluding the path and " +
"extension) to the AllowedExclusions array in the NUKE Build.ReviewHelpers.cs file."
);

missedOut.Add(Path.GetRelativePath(RootDirectory, file).Replace('\\', '/'));
}
}

return missedOut;
}
}
25 changes: 19 additions & 6 deletions build/props/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,46 @@
<LangVersion>10</LangVersion>
<Authors>.NET Foundation and Contributors</Authors>
<PackageReleaseNotes>
Silk.NET Winter 2022 Update 1
Silk.NET Spring 2023 Update 1 (EARLY PREVIEW)

- Added zero-cost extension methods for ComPtrs, making our DirectX bindings easier to use and higher quality than ever before.
- Added WebGPU bindings for Emscripten, Dawn, and WGPU.
- Added WebGPU bindings for Dawn and WGPU.
- Added Direct2D bindings. (massive thank you to @curin)
- Added an explicit check against calling Reset on a window while within the render loop of said window.
- Added DirectComposition bindings. (again, massive preesh to @curin)
- Added d3d11on12 bindings.
- Added WGL bindings.
- Added support for OpenAL disconnect extension. (thanks @okaniku)
- Added extension functions for OpenAL BufferData to make use of AL_EXT_float32 enums.
- Added ReopenDevices extension for OpenAL Soft. (thanks @LeNitrous)
- Added BufferCallback extension for OpenAL Soft.
- Added Vulkan structure chain polymorphism. (thanks @Khitiara for the proposal)
- Added SDL/GLFW native libraries for Windows on ARM64.
- Added IsScancodePressed function in Silk.NET Input.
- Added TopMost in Silk.NET Windowing (thanks @MarioGK)
- Added EGL display and surface to INativeWindow.
- Added an explicit check against calling Reset on a window while within the render loop of said window.
- Improved support for WASM and AOT in the Silk.NET loader.
- Improved support for Windows on ARM64.
- Improved Silk.NET.Maths generic specialization codegen.
- Improved support for DXVK, including a new DXHandle property in INativeWindow for getting Linux HWND equivalents.
- Updated to SDL 2.24.
- Updated to Vulkan 1.3.233.
- Updated to Vulkan 1.3.242.
- Updated to DirectStorage 1.1.0.
- Updated to OpenXR 1.0.25.
- Updated to OpenXR 1.0.26.
- Updated to latest OpenCL specifications.
- Updated to latest OpenGL specifications.
- Updated to latest ImGui.
- Fixed XInput GetApi not being implemented. (thanks @ohtorobinson)
- Fixed TransparentBuffer not being applied correctly without specifying a PreferredBitDepth. (thanks @MarioGK)
- Fixed wide string marshalling.
</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.17</VersionPrefix>
<VersionSuffix Condition="'$(VersionSuffix)' == ''"></VersionSuffix>
<VersionSuffix Condition="'$(VersionSuffix)' == ''">preview</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.
</Description>
Expand Down
2 changes: 1 addition & 1 deletion build/submodules/Vulkan-Headers
Submodule Vulkan-Headers updated 55 files
+5 −3 .github/workflows/linux.yml
+5 −0 BUILD.gn
+5 −13 CMakeLists.txt
+0 −9 README.md
+1 −1 include/vk_video/vulkan_video_codec_h264std.h
+1 −1 include/vk_video/vulkan_video_codec_h264std_decode.h
+21 −12 include/vk_video/vulkan_video_codec_h264std_encode.h
+1 −1 include/vk_video/vulkan_video_codec_h265std.h
+1 −1 include/vk_video/vulkan_video_codec_h265std_decode.h
+18 −14 include/vk_video/vulkan_video_codec_h265std_encode.h
+1 −1 include/vk_video/vulkan_video_codecs_common.h
+0 −8 include/vulkan/vk_layer.h
+1 −1 include/vulkan/vk_platform.h
+9 −1 include/vulkan/vulkan.h
+301 −150 include/vulkan/vulkan.hpp
+1 −1 include/vulkan/vulkan_android.h
+83 −144 include/vulkan/vulkan_beta.h
+152 −32 include/vulkan/vulkan_core.h
+1 −1 include/vulkan/vulkan_directfb.h
+747 −765 include/vulkan/vulkan_enums.hpp
+1 −1 include/vulkan/vulkan_format_traits.hpp
+1 −1 include/vulkan/vulkan_fuchsia.h
+1,633 −1,539 include/vulkan/vulkan_funcs.hpp
+1 −1 include/vulkan/vulkan_ggp.h
+2,480 −2,309 include/vulkan/vulkan_handles.hpp
+150 −99 include/vulkan/vulkan_hash.hpp
+1 −1 include/vulkan/vulkan_ios.h
+1 −1 include/vulkan/vulkan_macos.h
+1 −1 include/vulkan/vulkan_metal.h
+2,489 −2,095 include/vulkan/vulkan_raii.hpp
+1 −1 include/vulkan/vulkan_screen.h
+129 −89 include/vulkan/vulkan_static_assertions.hpp
+1,234 −1,027 include/vulkan/vulkan_structs.hpp
+95 −140 include/vulkan/vulkan_to_string.hpp
+1 −1 include/vulkan/vulkan_vi.h
+1 −1 include/vulkan/vulkan_wayland.h
+1 −1 include/vulkan/vulkan_win32.h
+1 −1 include/vulkan/vulkan_xcb.h
+1 −1 include/vulkan/vulkan_xlib.h
+1 −1 include/vulkan/vulkan_xlib_xrandr.h
+1 −1 registry/apiconventions.py
+3 −1 registry/cgenerator.py
+1 −1 registry/generator.py
+10 −3 registry/genvk.py
+354 −0 registry/parse_dependency.py
+25 −24 registry/reg.py
+10 −1 registry/spec_tools/conventions.py
+1 −1 registry/spec_tools/util.py
+3,289 −1,617 registry/validusage.json
+42 −29 registry/video.xml
+1,433 −597 registry/vk.xml
+3 −1 registry/vkconventions.py
+6 −0 tests/CMakeLists.txt
+11 −2 tests/find_package/CMakeLists.txt
+1 −2 tests/vk_layer.c
Loading

0 comments on commit 4b7976b

Please sign in to comment.