Skip to content

Commit

Permalink
Merge branch 'main' into hotfix/scalar_as_optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
Perksey authored Jan 2, 2023
2 parents 0d7d5eb + 93b39c4 commit 1c78d04
Show file tree
Hide file tree
Showing 1,273 changed files with 244,089 additions and 227,464 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/bindings-regeneration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Bindings Regeneration
on:
schedule:
- cron: '0 0 * * Fri'
workflow_dispatch:

jobs:
build:
Expand All @@ -17,8 +18,34 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.302
- name: Setup Java JDK 11
uses: actions/setup-java@v2.3.0
with:
java-version: 11
distribution: "temurin"
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.201
- name: Setup .NET 5.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.201
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.404
- name: Setup NUKE
run: dotnet tool install Nuke.GlobalTool --global
- name: Install Workloads
# TODO: This is slow. Maybe we can make a docker container with this already done?
run: dotnet workload install android ios maccatalyst maui
- uses: GuillaumeFalourd/setup-windows10-sdk-action@v1.9
name: Setup Windows 11 SDK
with:
sdk-version: 22621
- name: Run a full run of BuildTools
run: dotnet run --project "src/Core/BuildTools/BuildTools.csproj" -- build/binder_scripts/fullrun.json
run: dotnet run -c Release --project src/Core/Silk.NET.BuildTools/Silk.NET.BuildTools.csproj -- --no-parallel
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%d-%m-%Y')"
Expand All @@ -30,5 +57,5 @@ jobs:
title: Binding and specification updates
body: Regenerates the bindings and the cached specifications with the latest upstream specifications.
branch: patch/spec-updates
author: "Ultz Limited <31213871+UltzLtd@users.noreply.github.com>"
author: "Team Silk.NET <9011267+dotnet-bot@users.noreply.github.com>"
commit-message: Latest bindings as of ${{ steps.date.outputs.date }}
3 changes: 3 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
# OpenGL
/src/OpenGL/**/*.cs @ThomasMiz @Beyley

# WebGPU
/src/WebGPU/**/*.cs @Beyley

# BuildTools
#/src/Core/Silk.NET.BuildTools @Perksey
#/**/*.gen.cs @Perksey
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Silk.NET works on any .NET Standard 2.0 compliant platform, including .NET 6.0,
<br />
<div>
<!-- Begin exclude from NuGet readme. -->
<a href="https://dotnetfoundation.org" align="right"><img src="https://dotnetfoundation.org/img/logo_v4.svg" alt=".NET Foundation" class="logo-footer" width="72" align="left">
<a href="https://dotnetfoundation.org" align="right"><img src="https://github.com/dotnet-foundation/swag/blob/main/logo/dotnetfoundation_v4.svg" alt=".NET Foundation" class="logo-footer" width="72" align="left">
<!-- End exclude from NuGet readme. -->
<!-- Begin include in NuGet readme.
![.NET Foundation](https://raw.githubusercontent.com/dotnet/Silk.NET/main/documentation/readme/dotnetfoundation_v4_horizontal_64.svg)
Expand Down
228 changes: 228 additions & 0 deletions Silk.NET.sln

Large diffs are not rendered by default.

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/d3dcompiler.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 added 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.
11 changes: 3 additions & 8 deletions build/csharp_typemap.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,19 @@
"GLDEBUGPROCKHR": "DebugProcKhr",
"GLvdpauSurfaceNV": "nint",
"PROC": "nint",
"LPCSTR": "string",
"COLORREF": "int",
"BOOL": "bool",
"DWORD": "int",
"COLORREF": "uint",
"BOOL": "Silk.NET.Core.Bool32",
"DWORD": "uint",
"FLOAT": "float",
"HANDLE": "nint",
"HDC": "nint",
"HGLRC": "nint",
"HPBUFFERARB": "nint",
"HPBUFFEREXT": "nint",
"INT32": "int",
"INT64": "long",
"LPVOID": "nint",
"UINT": "uint",
"USHORT": "ushort",
"VOID": "void",
"VoidPointer": "nint",
"Float64": "double",
"Float64Pointer": "double*",
"Float32": "float",
Expand Down Expand Up @@ -102,7 +98,6 @@
"HDC__*": "nint",
"HINSTANCE__*": "nint",
"SECURITY_ATTRIBUTES": "nint",
"LPCWSTR": "nint",
"xcb_connection_t": "nint",
"xcb_window_t": "nint",
"xcb_visualid_t": "nint",
Expand Down
7 changes: 7 additions & 0 deletions build/khronos_typemap.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"VoidPointer": "nint",
"LPCSTR": "string",
"HANDLE": "nint",
"LPVOID": "nint",
"LPCWSTR": "nint"
}
4 changes: 2 additions & 2 deletions build/nuke/Build.ReviewHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ partial class Build
foreach (var file in files)
{
var found = false;
foreach (var project in Solution.GetProjects("*"))
foreach (var project in OriginalSolution.GetProjects("*"))
{
if (new FileInfo(file).FullName.Equals(new FileInfo(project.Path).FullName))
{
Expand All @@ -53,7 +53,7 @@ partial class Build
Logger.Warn("Commands to add these for your convenience:");
foreach (var file in missedOut)
{
Logger.Warn($"dotnet sln \"{Path.GetFileName(Solution.FileName)}\" add \"{file}\"");
Logger.Warn($"dotnet sln \"{Path.GetFileName(OriginalSolution.FileName)}\" add \"{file}\"");
}
ControlFlow.Fail("Action required.");
Expand Down
2 changes: 1 addition & 1 deletion build/nuke/Silk.NET.NUKE.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Build.Locator" Version="1.4.1" />
<PackageReference Include="Nuke.Common" Version="6.2.1" />
<PackageReference Include="Nuke.Common" Version="6.3.0" />
</ItemGroup>

</Project>
37 changes: 19 additions & 18 deletions build/props/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,32 @@
<LangVersion>10</LangVersion>
<Authors>.NET Foundation and Contributors</Authors>
<PackageReleaseNotes>
Silk.NET Summer 2022 Update 1
Silk.NET Winter 2022 Update 1

- Massive project-wide bindings overhaul, making our bindings easier to use and higher quality than before.
- Added grouped OpenCL enums. (thanks @Alexx999)
- Added support for creation of contexts with versions prior to OpenGL 3.2. (thanks @Beyley)
- Added support for multiple ImGuiControllers. (thanks @Beyley)
- Added support for single-file mode. (thanks @kant2002)
- Added shorter names in enums used in bindings.
- Added AspectRatioEstimate API to VideoMode. (thanks @ohtrobinson)
- Update to latest OpenGL specifications
- Update to OpenXR 1.0.24
- Update to Vulkan 1.3.223
- Improved ImGuiController disposal. (thanks @Beyley)
- Fixed incorrect OpenCL functions. This is breaking, but if you were using these functions your code didn't work anyway. (thanks @Alexx999)
- Fixed IsVisible not being respected in some cases. (thanks @paralaxsd)
- Fixed window close events not being respected on the SDL backend. (thanks @paralaxsd)

This update may result in your projects having a lot of deprecation warnings. We believe this update contains much-needed improvements to both Silk.NET and code consuming it, but we appeciate migrating to this version may take time.
- 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 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 support for OpenAL disconnect extension. (thanks @okaniku)
- Added TopMost in Silk.NET Windowing (thanks @MarioGK)
- Improved support for WASM and AOT in the Silk.NET loader.
- 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 DirectStorage 1.1.0.
- Updated to OpenXR 1.0.25.
- Updated to latest OpenCL specifications.
- Updated to latest OpenGL specifications.
- Fixed XInput GetApi not being implemented. (thanks @ohtorobinson)
- Fixed TransparentBuffer not being applied correctly without specifying a PreferredBitDepth. (thanks @MarioGK)
</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.16</VersionPrefix>
<VersionPrefix>2.17</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
2 changes: 1 addition & 1 deletion build/submodules/wgpu-native
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ ref deviceContext
factory.CreateSwapChainForHwnd
(
device,
window.Native!.Win32!.Value.Hwnd,
ref swapChainDesc,
window.Native!.DXHandle!.Value,
in swapChainDesc,
null,
ref Unsafe.NullRef<IDXGIOutput>(),
ref swapchain
Expand All @@ -179,7 +179,7 @@ ref swapchain
PSysMem = vertexData
};

SilkMarshal.ThrowHResult(device.CreateBuffer(ref bufferDesc, ref subresourceData, ref vertexBuffer));
SilkMarshal.ThrowHResult(device.CreateBuffer(in bufferDesc, in subresourceData, ref vertexBuffer));
}

// Create our index buffer.
Expand All @@ -197,7 +197,7 @@ ref swapchain
PSysMem = indexData
};

SilkMarshal.ThrowHResult(device.CreateBuffer(ref bufferDesc, ref subresourceData, ref indexBuffer));
SilkMarshal.ThrowHResult(device.CreateBuffer(in bufferDesc, in subresourceData, ref indexBuffer));
}

var shaderBytes = Encoding.ASCII.GetBytes(shaderSource);
Expand All @@ -207,7 +207,7 @@ ref swapchain
ComPtr<ID3D10Blob> vertexErrors = default;
HResult hr = compiler.Compile
(
ref shaderBytes[0],
in shaderBytes[0],
(nuint) shaderBytes.Length,
nameof(shaderSource),
null,
Expand Down Expand Up @@ -236,7 +236,7 @@ ref vertexErrors
ComPtr<ID3D10Blob> pixelErrors = default;
hr = compiler.Compile
(
ref shaderBytes[0],
in shaderBytes[0],
(nuint)shaderBytes.Length,
nameof(shaderSource),
null,
Expand Down Expand Up @@ -302,7 +302,7 @@ ref pixelShader
(
device.CreateInputLayout
(
ref inputElement,
in inputElement,
1,
vertexCode.GetBufferPointer(),
vertexCode.GetBufferSize(),
Expand Down Expand Up @@ -347,15 +347,15 @@ unsafe void OnRender(double deltaSeconds)

// Update the rasterizer state with the current viewport.
var viewport = new Viewport(0, 0, window.FramebufferSize.X, window.FramebufferSize.Y, 0, 1);
deviceContext.RSSetViewports(1, ref viewport);
deviceContext.RSSetViewports(1, in viewport);

// Tell the output merger about our render target view.
deviceContext.OMSetRenderTargets(1, ref renderTargetView, ref Unsafe.NullRef<ID3D11DepthStencilView>());

// Update the input assembler to use our shader input layout, and associated vertex & index buffers.
deviceContext.IASetPrimitiveTopology(D3DPrimitiveTopology.D3DPrimitiveTopologyTrianglelist);
deviceContext.IASetInputLayout(inputLayout);
deviceContext.IASetVertexBuffers(0, 1, ref vertexBuffer, ref vertexStride, ref vertexOffset);
deviceContext.IASetVertexBuffers(0, 1, vertexBuffer, in vertexStride, in vertexOffset);
deviceContext.IASetIndexBuffer(indexBuffer, Format.FormatR32Uint, 0);

// Bind our shaders.
Expand Down
4 changes: 2 additions & 2 deletions examples/CSharp/OpenAL Demos/WavePlayer/Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Buffers.Binary;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -124,7 +124,7 @@ static unsafe void Main(string[] args)
}
else if (identifier == "data")
{
var data = file.Slice(44, size);
var data = file.Slice(index, size);
index += size;

fixed(byte* pData = data)
Expand Down
Loading

0 comments on commit 1c78d04

Please sign in to comment.