From dec4ed805675711d14ccd8fa5d80d3f4209fb5a6 Mon Sep 17 00:00:00 2001 From: Amer Koleci Date: Thu, 17 Nov 2022 14:14:45 +0100 Subject: [PATCH] Update to official .NET 7 SDK and improve bindings. --- .github/workflows/build.yml | 26 +++++++------ Directory.Build.props | 39 +++++++++++-------- Directory.Packages.props | 33 ++++++++++++++++ LICENSE | 2 +- Vortice.Win32.sln | 2 + global.json | 9 +++++ src/Generator/Generator.csproj | 6 +-- src/Generator/Program.cs | 9 +++-- .../Vortice.Win32.Graphics.Direct2D.csproj | 2 +- ...Vortice.Win32.Graphics.Direct3D.Dxc.csproj | 2 +- ...Vortice.Win32.Graphics.Direct3D.Fxc.csproj | 2 +- .../Generated/ID3D11Device.cs | 4 +- .../Generated/ID3D11Device1.cs | 4 +- .../Generated/ID3D11Device2.cs | 4 +- .../Generated/ID3D11Device3.cs | 4 +- .../Generated/ID3D11Device4.cs | 4 +- .../Generated/ID3D11Device5.cs | 4 +- .../Generated/ID3D11VideoDevice2.cs | 4 +- .../Vortice.Win32.Graphics.Direct3D11.csproj | 2 +- ...rtice.Win32.Graphics.Direct3D11on12.csproj | 2 +- src/Vortice.Win32.Graphics.Direct3D12/Apis.cs | 2 +- .../CommandQueueDescription.cs | 35 +++++++++++++++++ .../DepthStencilDescription.cs | 2 +- .../DepthStencilDescription1.cs | 2 +- .../Generated/ID3D12Device.cs | 4 +- .../Generated/ID3D12Device1.cs | 4 +- .../Generated/ID3D12Device2.cs | 4 +- .../Generated/ID3D12Device3.cs | 4 +- .../Generated/ID3D12Device4.cs | 4 +- .../Generated/ID3D12Device5.cs | 4 +- .../Generated/ID3D12Device6.cs | 4 +- .../Generated/ID3D12Device7.cs | 4 +- .../Generated/ID3D12Device8.cs | 4 +- .../Generated/ID3D12Device9.cs | 4 +- .../ID3D12Device.cs | 11 +++++- .../ResourceDescription.cs | 2 +- .../SamplerDescription.cs | 8 ++-- .../Vortice.Win32.Graphics.Direct3D12.csproj | 2 +- ...ce.Win32.Graphics.DirectComposition.csproj | 2 +- .../Vortice.Win32.Graphics.DirectWrite.csproj | 2 +- .../Dxgi.Manual.cs | 2 +- .../Generated/IDXGIFactory5.cs | 4 +- .../Generated/IDXGIFactory6.cs | 4 +- .../Generated/IDXGIFactory7.cs | 4 +- .../IDXGIInfoQueue.cs | 9 +++++ .../Vortice.Win32.Graphics.Dxgi.csproj | 2 +- .../Vortice.Win32.Graphics.Imaging.csproj | 2 +- .../Graphics/Gdi/PaletteEntry.cs | 31 +++++++++++++++ src/Vortice.Win32/Graphics/Gdi/RgnData.cs | 20 ++++++++++ .../Graphics/Gdi/RgnDataHeader.cs | 34 ++++++++++++++++ src/Vortice.Win32/UnscopedRefAttribute.cs | 36 ----------------- src/Vortice.Win32/Vortice.Win32.csproj | 15 +++---- 52 files changed, 293 insertions(+), 142 deletions(-) create mode 100644 Directory.Packages.props create mode 100644 global.json create mode 100644 src/Vortice.Win32.Graphics.Direct3D12/CommandQueueDescription.cs create mode 100644 src/Vortice.Win32.Graphics.Dxgi/IDXGIInfoQueue.cs create mode 100644 src/Vortice.Win32/Graphics/Gdi/PaletteEntry.cs create mode 100644 src/Vortice.Win32/Graphics/Gdi/RgnData.cs create mode 100644 src/Vortice.Win32/Graphics/Gdi/RgnDataHeader.cs delete mode 100644 src/Vortice.Win32/UnscopedRefAttribute.cs diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 943eaa5..0bc80b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,15 +5,16 @@ on: branches: - 'main' paths-ignore: + - 'docs/**' - '*.md' - - 'LICENSE' pull_request: paths-ignore: + - 'docs/**' - '*.md' - - 'LICENSE' env: DOTNET_CLI_TELEMETRY_OPTOUT: false + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true jobs: build: @@ -22,18 +23,21 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - with: - submodules: recursive - - name: Install .NET 7.0.x + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.1 + + - name: Install .NET 7 SDK uses: actions/setup-dotnet@v2 with: - dotnet-version: 7.0.x - include-prerelease: true + dotnet-version: 7.0.100 - name: Pack - run: dotnet pack Vortice.Win32.sln --configuration Release --output build/packages + run: dotnet pack Vortice.Win32.sln --configuration Release --output artifacts - - name: Publish to NuGet - if: github.event_name == 'push' - run: dotnet nuget push build/packages/**/*.nupkg -k ${{secrets.NUGET_TOKEN}} --skip-duplicate --source https://api.nuget.org/v3/index.json + - name: Upload Package Artifacts + uses: actions/upload-artifact@v3 + with: + name: Packages + path: artifacts\*.nupkg + if-no-files-found: error diff --git a/Directory.Build.props b/Directory.Build.props index 7f817c3..e457fcb 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,31 +1,38 @@ - preview + https://github.com/amerkoleci/Vortice.Win32 + git + + + + true + 11.0 enable enable - true - true + embedded + strict + true + true + $(MSBuildThisFileDirectory)NuGet.config - 1.8.4 + 1.8.5 true $(NoWarn);AD0001;CS1591;CS1701;CA2252; - true + + + + true - https://github.com/amerkoleci/Vortice.Win32 - git - - https://github.com/amerkoleci/Vortice.Win32 - Amer Koleci - Amer Koleci + Amer Koleci and Contributors Amer Koleci - Copyright © 2022 Amer Koleci + Copyright © Amer Koleci and Contributors MIT true - win32 graphics gamedev core standard game vortice + $(RepositoryUrl) @@ -38,10 +45,8 @@ - - all - runtime; build; native; contentfiles; analyzers - + + diff --git a/Directory.Packages.props b/Directory.Packages.props new file mode 100644 index 0000000..9873016 --- /dev/null +++ b/Directory.Packages.props @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/LICENSE b/LICENSE index 01d2d1c..d8f627d 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Amer Koleci +Copyright (c) 2022 Amer Koleci and Contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), diff --git a/Vortice.Win32.sln b/Vortice.Win32.sln index 8f8ff3c..4450cef 100644 --- a/Vortice.Win32.sln +++ b/Vortice.Win32.sln @@ -17,6 +17,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{065268A8 .gitignore = .gitignore Directory.Build.props = Directory.Build.props Directory.Build.targets = Directory.Build.targets + Directory.Packages.props = Directory.Packages.props + global.json = global.json LICENSE = LICENSE NuGet.config = NuGet.config README.md = README.md diff --git a/global.json b/global.json new file mode 100644 index 0000000..a870941 --- /dev/null +++ b/global.json @@ -0,0 +1,9 @@ +{ + "sdk": { + "version": "7.0.100", + "rollForward": "latestFeature" + }, + "msbuild-sdks": { + "MSBuild.Sdk.Extras": "3.0.44" + } +} diff --git a/src/Generator/Generator.csproj b/src/Generator/Generator.csproj index 2d2c2f9..99c05cc 100644 --- a/src/Generator/Generator.csproj +++ b/src/Generator/Generator.csproj @@ -8,9 +8,9 @@ - - - + + + diff --git a/src/Generator/Program.cs b/src/Generator/Program.cs index 9b90236..ddd2665 100644 --- a/src/Generator/Program.cs +++ b/src/Generator/Program.cs @@ -26,7 +26,7 @@ public static class Program "Graphics.Direct2D.json", "Graphics.Imaging.D2D.json", "Graphics.DirectComposition.json", - "Graphics.Direct3D9.json", + //"Graphics.Direct3D9.json", // Media //"Media.Audio.json", @@ -1117,7 +1117,7 @@ public static class Program //DocGenerator.Generate(new[] { "DWRITE" }, Path.Combine(repoRoot, "Generated", "Graphics", "DirectWrite.xml")); //DocGenerator.Generate(new[] { "WIC" }, Path.Combine(repoRoot, "Generated", "Graphics", "Imaging.xml")); - DocGenerator.Generate(new[] { "D3D9" }, Path.Combine(d3d9Path, "Direct3D9.xml")); + //DocGenerator.Generate(new[] { "D3D9" }, Path.Combine(d3d9Path, "Direct3D9.xml")); //DocGenerator.Generate(new[] { "D3D11" }, Path.Combine(d3d11Path, "Direct3D11.xml")); //DocGenerator.Generate(new[] { "D3D12" }, Path.Combine(d3d12Path, "Direct3D12.xml")); //DocGenerator.Generate(new[] { "DComposition" }, Path.Combine(directCompositionPath, "DirectComposition.xml")); @@ -2391,9 +2391,10 @@ public static class Program out string parameterType, out string parameterName); - if (method.Name == "CreateWrappedResource") + if (method.Name == "CheckFeatureSupport" && + parameterName == "FeatureSupportDataSize") { - + parameterType = "int"; } argumentBuilder diff --git a/src/Vortice.Win32.Graphics.Direct2D/Vortice.Win32.Graphics.Direct2D.csproj b/src/Vortice.Win32.Graphics.Direct2D/Vortice.Win32.Graphics.Direct2D.csproj index d520ec5..1cf0cb9 100644 --- a/src/Vortice.Win32.Graphics.Direct2D/Vortice.Win32.Graphics.Direct2D.csproj +++ b/src/Vortice.Win32.Graphics.Direct2D/Vortice.Win32.Graphics.Direct2D.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netstandard2.1;net6.0;net7.0 + netstandard2.0;net6.0;net7.0 Direct2D1 bindings. $(NoWarn);CS0419;IDE0017 diff --git a/src/Vortice.Win32.Graphics.Direct3D.Dxc/Vortice.Win32.Graphics.Direct3D.Dxc.csproj b/src/Vortice.Win32.Graphics.Direct3D.Dxc/Vortice.Win32.Graphics.Direct3D.Dxc.csproj index 65bf16c..1812ea9 100644 --- a/src/Vortice.Win32.Graphics.Direct3D.Dxc/Vortice.Win32.Graphics.Direct3D.Dxc.csproj +++ b/src/Vortice.Win32.Graphics.Direct3D.Dxc/Vortice.Win32.Graphics.Direct3D.Dxc.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netstandard2.1;net6.0;net7.0 + netstandard2.0;net6.0;net7.0 DXC bindings. $(NoWarn);CS0419;IDE0017 diff --git a/src/Vortice.Win32.Graphics.Direct3D.Fxc/Vortice.Win32.Graphics.Direct3D.Fxc.csproj b/src/Vortice.Win32.Graphics.Direct3D.Fxc/Vortice.Win32.Graphics.Direct3D.Fxc.csproj index 3ebf372..51e12d8 100644 --- a/src/Vortice.Win32.Graphics.Direct3D.Fxc/Vortice.Win32.Graphics.Direct3D.Fxc.csproj +++ b/src/Vortice.Win32.Graphics.Direct3D.Fxc/Vortice.Win32.Graphics.Direct3D.Fxc.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netstandard2.1;net6.0;net7.0 + netstandard2.0;net6.0;net7.0 FXC bindings. $(NoWarn);CS0419;IDE0017 diff --git a/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device.cs b/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device.cs index 1b413ee..8b99b03 100644 --- a/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device.cs +++ b/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device.cs @@ -317,9 +317,9 @@ public unsafe partial struct ID3D11Device : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(33)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[33]))((ID3D11Device*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[33]))((ID3D11Device*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device1.cs b/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device1.cs index 024f25a..7efe277 100644 --- a/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device1.cs +++ b/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device1.cs @@ -317,9 +317,9 @@ public unsafe partial struct ID3D11Device1 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(33)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[33]))((ID3D11Device1*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[33]))((ID3D11Device1*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device2.cs b/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device2.cs index c45f63c..71d2686 100644 --- a/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device2.cs +++ b/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device2.cs @@ -317,9 +317,9 @@ public unsafe partial struct ID3D11Device2 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(33)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[33]))((ID3D11Device2*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[33]))((ID3D11Device2*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device3.cs b/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device3.cs index d2278b1..29e6966 100644 --- a/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device3.cs +++ b/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device3.cs @@ -317,9 +317,9 @@ public unsafe partial struct ID3D11Device3 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(33)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[33]))((ID3D11Device3*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[33]))((ID3D11Device3*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device4.cs b/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device4.cs index c7d8d4c..253ed20 100644 --- a/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device4.cs +++ b/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device4.cs @@ -317,9 +317,9 @@ public unsafe partial struct ID3D11Device4 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(33)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[33]))((ID3D11Device4*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[33]))((ID3D11Device4*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device5.cs b/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device5.cs index 9d0684c..9ff167e 100644 --- a/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device5.cs +++ b/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11Device5.cs @@ -317,9 +317,9 @@ public unsafe partial struct ID3D11Device5 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(33)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[33]))((ID3D11Device5*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[33]))((ID3D11Device5*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11VideoDevice2.cs b/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11VideoDevice2.cs index 05fe565..8af069b 100644 --- a/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11VideoDevice2.cs +++ b/src/Vortice.Win32.Graphics.Direct3D11/Generated/ID3D11VideoDevice2.cs @@ -245,9 +245,9 @@ public unsafe partial struct ID3D11VideoDevice2 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(24)] - public HResult CheckFeatureSupport(FeatureVideo Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(FeatureVideo Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[24]))((ID3D11VideoDevice2*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[24]))((ID3D11VideoDevice2*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D11/Vortice.Win32.Graphics.Direct3D11.csproj b/src/Vortice.Win32.Graphics.Direct3D11/Vortice.Win32.Graphics.Direct3D11.csproj index 062a819..a17e51e 100644 --- a/src/Vortice.Win32.Graphics.Direct3D11/Vortice.Win32.Graphics.Direct3D11.csproj +++ b/src/Vortice.Win32.Graphics.Direct3D11/Vortice.Win32.Graphics.Direct3D11.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netstandard2.1;net6.0;net7.0 + netstandard2.0;net6.0;net7.0 Direct3D11 bindings. $(NoWarn);CS0419;IDE0017 diff --git a/src/Vortice.Win32.Graphics.Direct3D11on12/Vortice.Win32.Graphics.Direct3D11on12.csproj b/src/Vortice.Win32.Graphics.Direct3D11on12/Vortice.Win32.Graphics.Direct3D11on12.csproj index fd752a6..907a776 100644 --- a/src/Vortice.Win32.Graphics.Direct3D11on12/Vortice.Win32.Graphics.Direct3D11on12.csproj +++ b/src/Vortice.Win32.Graphics.Direct3D11on12/Vortice.Win32.Graphics.Direct3D11on12.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netstandard2.1;net6.0;net7.0 + netstandard2.0;net6.0;net7.0 Direct3D11on12 bindings. $(NoWarn);CS0419;IDE0017 diff --git a/src/Vortice.Win32.Graphics.Direct3D12/Apis.cs b/src/Vortice.Win32.Graphics.Direct3D12/Apis.cs index c1f18ed..897346b 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/Apis.cs +++ b/src/Vortice.Win32.Graphics.Direct3D12/Apis.cs @@ -91,7 +91,7 @@ public static unsafe partial class Apis PlaneCount = 0, }; - if (device->CheckFeatureSupport(Feature.FormatInfo, &formatInfo, (uint)(sizeof(FeatureDataFormatInfo))).Failure) + if (device->CheckFeatureSupport(Feature.FormatInfo, &formatInfo, sizeof(FeatureDataFormatInfo)).Failure) { return 0; } diff --git a/src/Vortice.Win32.Graphics.Direct3D12/CommandQueueDescription.cs b/src/Vortice.Win32.Graphics.Direct3D12/CommandQueueDescription.cs new file mode 100644 index 0000000..08f7f39 --- /dev/null +++ b/src/Vortice.Win32.Graphics.Direct3D12/CommandQueueDescription.cs @@ -0,0 +1,35 @@ +// Copyright © Amer Koleci and Contributors. +// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. + +using static Win32.Graphics.Direct3D12.Apis; + +namespace Win32.Graphics.Direct3D12; + +public partial struct CommandQueueDescription +{ + /// + /// Initializes a new instance of the struct. + /// + public CommandQueueDescription(CommandListType type, int priority = 0, CommandQueueFlags flags = CommandQueueFlags.None, uint nodeMask = 0) + { + Type = type; + Priority = priority; + Flags = flags; + NodeMask = nodeMask; + } + + /// + /// Initializes a new instance of the struct. + /// + /// The queue type. + /// The priority. + /// Options flags. + /// Node mask. + public CommandQueueDescription(CommandListType type, CommandQueuePriority priority, CommandQueueFlags flags = CommandQueueFlags.None, uint nodeMask = 0) + { + Type = type; + Priority = (int)priority; + Flags = flags; + NodeMask = nodeMask; + } +} diff --git a/src/Vortice.Win32.Graphics.Direct3D12/DepthStencilDescription.cs b/src/Vortice.Win32.Graphics.Direct3D12/DepthStencilDescription.cs index e8af6b2..b8b2849 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/DepthStencilDescription.cs +++ b/src/Vortice.Win32.Graphics.Direct3D12/DepthStencilDescription.cs @@ -5,7 +5,7 @@ using static Win32.Graphics.Direct3D12.Apis; namespace Win32.Graphics.Direct3D12; -public unsafe partial struct DepthStencilDescription +public partial struct DepthStencilDescription { /// /// A built-in description with settings for not using a depth stencil buffer. diff --git a/src/Vortice.Win32.Graphics.Direct3D12/DepthStencilDescription1.cs b/src/Vortice.Win32.Graphics.Direct3D12/DepthStencilDescription1.cs index 682411a..ddbd235 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/DepthStencilDescription1.cs +++ b/src/Vortice.Win32.Graphics.Direct3D12/DepthStencilDescription1.cs @@ -5,7 +5,7 @@ using static Win32.Graphics.Direct3D12.Apis; namespace Win32.Graphics.Direct3D12; -public unsafe partial struct DepthStencilDescription1 +public partial struct DepthStencilDescription1 { /// /// A built-in description with settings for not using a depth stencil buffer. diff --git a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device.cs b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device.cs index cfe6256..a862ea1 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device.cs +++ b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device.cs @@ -157,9 +157,9 @@ public unsafe partial struct ID3D12Device : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(13)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device1.cs b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device1.cs index 14ec6a2..b750656 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device1.cs +++ b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device1.cs @@ -157,9 +157,9 @@ public unsafe partial struct ID3D12Device1 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(13)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device1*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device1*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device2.cs b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device2.cs index 77083c0..44b6e65 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device2.cs +++ b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device2.cs @@ -157,9 +157,9 @@ public unsafe partial struct ID3D12Device2 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(13)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device2*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device2*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device3.cs b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device3.cs index b6c359e..016945d 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device3.cs +++ b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device3.cs @@ -157,9 +157,9 @@ public unsafe partial struct ID3D12Device3 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(13)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device3*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device3*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device4.cs b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device4.cs index e0cb5bb..f548efb 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device4.cs +++ b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device4.cs @@ -157,9 +157,9 @@ public unsafe partial struct ID3D12Device4 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(13)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device4*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device4*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device5.cs b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device5.cs index 06ba113..2c53705 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device5.cs +++ b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device5.cs @@ -157,9 +157,9 @@ public unsafe partial struct ID3D12Device5 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(13)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device5*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device5*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device6.cs b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device6.cs index 80a364b..fd25e80 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device6.cs +++ b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device6.cs @@ -157,9 +157,9 @@ public unsafe partial struct ID3D12Device6 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(13)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device6*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device6*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device7.cs b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device7.cs index f977256..647c3a6 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device7.cs +++ b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device7.cs @@ -157,9 +157,9 @@ public unsafe partial struct ID3D12Device7 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(13)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device7*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device7*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device8.cs b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device8.cs index d5897f1..9623e64 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device8.cs +++ b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device8.cs @@ -157,9 +157,9 @@ public unsafe partial struct ID3D12Device8 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(13)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device8*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device8*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device9.cs b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device9.cs index 8ad3bf1..089c028 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device9.cs +++ b/src/Vortice.Win32.Graphics.Direct3D12/Generated/ID3D12Device9.cs @@ -157,9 +157,9 @@ public unsafe partial struct ID3D12Device9 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(13)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device9*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((ID3D12Device9*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Direct3D12/ID3D12Device.cs b/src/Vortice.Win32.Graphics.Direct3D12/ID3D12Device.cs index 9c5ea91..d4c7a32 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/ID3D12Device.cs +++ b/src/Vortice.Win32.Graphics.Direct3D12/ID3D12Device.cs @@ -11,10 +11,19 @@ public unsafe partial struct ID3D12Device where TFeature : unmanaged { TFeature featureData = default; - CheckFeatureSupport(feature, &featureData, (uint)sizeof(TFeature)).ThrowIfFailed(); + CheckFeatureSupport(feature, &featureData, sizeof(TFeature)).ThrowIfFailed(); return featureData; } + public HResult CheckFeatureSupport(Feature feature, ref TFeature featureData) + where TFeature : unmanaged + { + fixed (TFeature* featureDataPtr = &featureData) + { + return CheckFeatureSupport(feature, featureDataPtr, sizeof(TFeature)); + } + } + public HResult CreateCommittedResource(HeapType heapType, ResourceDescription* pDesc, ResourceStates InitialResourceState, ClearValue* pOptimizedClearValue, Guid* riidResource, void** ppvResource) { HeapProperties heapProperties = new(heapType); diff --git a/src/Vortice.Win32.Graphics.Direct3D12/ResourceDescription.cs b/src/Vortice.Win32.Graphics.Direct3D12/ResourceDescription.cs index 77eab01..d1040ff 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/ResourceDescription.cs +++ b/src/Vortice.Win32.Graphics.Direct3D12/ResourceDescription.cs @@ -99,7 +99,7 @@ public unsafe partial struct ResourceDescription : IEquatableBorder color to use if is specified for AddressU, AddressV, or AddressW. /// Lower end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed. /// Upper end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed. This value must be greater than or equal to MinLOD. - public SamplerDescription( + public unsafe SamplerDescription( Filter filter, TextureAddressMode addressU, TextureAddressMode addressV, @@ -68,7 +68,7 @@ public unsafe partial struct SamplerDescription /// A function that compares sampled data against existing sampled data. /// Lower end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed. /// Upper end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed. This value must be greater than or equal to MinLOD. - public SamplerDescription( + public unsafe SamplerDescription( Filter filter, TextureAddressMode addressU, TextureAddressMode addressV, @@ -104,7 +104,7 @@ public unsafe partial struct SamplerDescription /// A function that compares sampled data against existing sampled data. /// Lower end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed. /// Upper end of the mipmap range to clamp access to, where 0 is the largest and most detailed mipmap level and any level higher than that is less detailed. This value must be greater than or equal to MinLOD. - public SamplerDescription( + public unsafe SamplerDescription( Filter filter, TextureAddressMode address, float mipLODBias = 0.0f, diff --git a/src/Vortice.Win32.Graphics.Direct3D12/Vortice.Win32.Graphics.Direct3D12.csproj b/src/Vortice.Win32.Graphics.Direct3D12/Vortice.Win32.Graphics.Direct3D12.csproj index 614d146..5c896bc 100644 --- a/src/Vortice.Win32.Graphics.Direct3D12/Vortice.Win32.Graphics.Direct3D12.csproj +++ b/src/Vortice.Win32.Graphics.Direct3D12/Vortice.Win32.Graphics.Direct3D12.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netstandard2.1;net6.0;net7.0 + netstandard2.0;net6.0;net7.0 Direct3D12 bindings. $(NoWarn);CS0419;IDE0017 diff --git a/src/Vortice.Win32.Graphics.DirectComposition/Vortice.Win32.Graphics.DirectComposition.csproj b/src/Vortice.Win32.Graphics.DirectComposition/Vortice.Win32.Graphics.DirectComposition.csproj index ae8bd1e..37c3dc1 100644 --- a/src/Vortice.Win32.Graphics.DirectComposition/Vortice.Win32.Graphics.DirectComposition.csproj +++ b/src/Vortice.Win32.Graphics.DirectComposition/Vortice.Win32.Graphics.DirectComposition.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netstandard2.1;net6.0;net7.0 + netstandard2.0;net6.0;net7.0 DirectComposition bindings. $(NoWarn);CS0419;IDE0017 diff --git a/src/Vortice.Win32.Graphics.DirectWrite/Vortice.Win32.Graphics.DirectWrite.csproj b/src/Vortice.Win32.Graphics.DirectWrite/Vortice.Win32.Graphics.DirectWrite.csproj index 7e66129..95bbc2b 100644 --- a/src/Vortice.Win32.Graphics.DirectWrite/Vortice.Win32.Graphics.DirectWrite.csproj +++ b/src/Vortice.Win32.Graphics.DirectWrite/Vortice.Win32.Graphics.DirectWrite.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netstandard2.1;net6.0;net7.0 + netstandard2.0;net6.0;net7.0 DirectWrite bindings. $(NoWarn);CS0419;IDE0017 diff --git a/src/Vortice.Win32.Graphics.Dxgi/Dxgi.Manual.cs b/src/Vortice.Win32.Graphics.Dxgi/Dxgi.Manual.cs index d3ac093..eb35614 100644 --- a/src/Vortice.Win32.Graphics.Dxgi/Dxgi.Manual.cs +++ b/src/Vortice.Win32.Graphics.Dxgi/Dxgi.Manual.cs @@ -48,7 +48,7 @@ public static unsafe class IDXGIFactory5Extensions where TFeature : unmanaged { TFeature featureData = default; - factory.CheckFeatureSupport(feature, &featureData, (uint)sizeof(TFeature)).ThrowIfFailed(); + factory.CheckFeatureSupport(feature, &featureData, sizeof(TFeature)).ThrowIfFailed(); return featureData; } } diff --git a/src/Vortice.Win32.Graphics.Dxgi/Generated/IDXGIFactory5.cs b/src/Vortice.Win32.Graphics.Dxgi/Generated/IDXGIFactory5.cs index b8d7abb..f16afc3 100644 --- a/src/Vortice.Win32.Graphics.Dxgi/Generated/IDXGIFactory5.cs +++ b/src/Vortice.Win32.Graphics.Dxgi/Generated/IDXGIFactory5.cs @@ -277,9 +277,9 @@ public unsafe partial struct IDXGIFactory5 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(28)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[28]))((IDXGIFactory5*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[28]))((IDXGIFactory5*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } } diff --git a/src/Vortice.Win32.Graphics.Dxgi/Generated/IDXGIFactory6.cs b/src/Vortice.Win32.Graphics.Dxgi/Generated/IDXGIFactory6.cs index 87178a8..b532050 100644 --- a/src/Vortice.Win32.Graphics.Dxgi/Generated/IDXGIFactory6.cs +++ b/src/Vortice.Win32.Graphics.Dxgi/Generated/IDXGIFactory6.cs @@ -277,9 +277,9 @@ public unsafe partial struct IDXGIFactory6 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(28)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[28]))((IDXGIFactory6*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[28]))((IDXGIFactory6*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Dxgi/Generated/IDXGIFactory7.cs b/src/Vortice.Win32.Graphics.Dxgi/Generated/IDXGIFactory7.cs index 38152c7..183ab63 100644 --- a/src/Vortice.Win32.Graphics.Dxgi/Generated/IDXGIFactory7.cs +++ b/src/Vortice.Win32.Graphics.Dxgi/Generated/IDXGIFactory7.cs @@ -277,9 +277,9 @@ public unsafe partial struct IDXGIFactory7 : INativeGuid /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [VtblIndex(28)] - public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, uint FeatureSupportDataSize) + public HResult CheckFeatureSupport(Feature Feature, void* pFeatureSupportData, int FeatureSupportDataSize) { - return ((delegate* unmanaged[Stdcall])(lpVtbl[28]))((IDXGIFactory7*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); + return ((delegate* unmanaged[Stdcall])(lpVtbl[28]))((IDXGIFactory7*)Unsafe.AsPointer(ref this), Feature, pFeatureSupportData, FeatureSupportDataSize); } /// diff --git a/src/Vortice.Win32.Graphics.Dxgi/IDXGIInfoQueue.cs b/src/Vortice.Win32.Graphics.Dxgi/IDXGIInfoQueue.cs new file mode 100644 index 0000000..c734eab --- /dev/null +++ b/src/Vortice.Win32.Graphics.Dxgi/IDXGIInfoQueue.cs @@ -0,0 +1,9 @@ +// Copyright © Amer Koleci and Contributors. +// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. + +namespace Win32.Graphics.Dxgi; + +public partial struct IDXGIInfoQueue +{ + +} diff --git a/src/Vortice.Win32.Graphics.Dxgi/Vortice.Win32.Graphics.Dxgi.csproj b/src/Vortice.Win32.Graphics.Dxgi/Vortice.Win32.Graphics.Dxgi.csproj index 2cde3ed..b786af0 100644 --- a/src/Vortice.Win32.Graphics.Dxgi/Vortice.Win32.Graphics.Dxgi.csproj +++ b/src/Vortice.Win32.Graphics.Dxgi/Vortice.Win32.Graphics.Dxgi.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netstandard2.1;net6.0;net7.0 + netstandard2.0;net6.0;net7.0 Dxgi bindings. $(NoWarn);CS0419;IDE0017 diff --git a/src/Vortice.Win32.Graphics.Imaging/Vortice.Win32.Graphics.Imaging.csproj b/src/Vortice.Win32.Graphics.Imaging/Vortice.Win32.Graphics.Imaging.csproj index 2123a72..874ac94 100644 --- a/src/Vortice.Win32.Graphics.Imaging/Vortice.Win32.Graphics.Imaging.csproj +++ b/src/Vortice.Win32.Graphics.Imaging/Vortice.Win32.Graphics.Imaging.csproj @@ -1,7 +1,7 @@ - netstandard2.0;netstandard2.1;net6.0;net7.0 + netstandard2.0;net6.0;net7.0 DXC bindings. $(NoWarn);CS0419;IDE0017 diff --git a/src/Vortice.Win32/Graphics/Gdi/PaletteEntry.cs b/src/Vortice.Win32/Graphics/Gdi/PaletteEntry.cs new file mode 100644 index 0000000..4f366e5 --- /dev/null +++ b/src/Vortice.Win32/Graphics/Gdi/PaletteEntry.cs @@ -0,0 +1,31 @@ +// Copyright © Amer Koleci and Contributors. +// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. + +namespace Win32.Graphics.Gdi; + +/// +/// Specifies the color and usage of an entry in a logical palette. +/// +/// PALETTEENTRY +public partial struct PaletteEntry +{ + /// + /// The red intensity value for the palette entry. + /// + public byte Red; + + /// + /// The green intensity value for the palette entry. + /// + public byte Green; + + /// + /// The blue intensity value for the palette entry. + /// + public byte Blue; + + /// + /// The alpha intensity value for the palette entry. Note that as of DirectX 8, this member is treated differently than documented for Windows. + /// + public byte Flags; +} diff --git a/src/Vortice.Win32/Graphics/Gdi/RgnData.cs b/src/Vortice.Win32/Graphics/Gdi/RgnData.cs new file mode 100644 index 0000000..1a11031 --- /dev/null +++ b/src/Vortice.Win32/Graphics/Gdi/RgnData.cs @@ -0,0 +1,20 @@ +// Copyright © Amer Koleci and Contributors. +// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. + +namespace Win32.Graphics.Gdi; + +/// +/// The RGNDATA structure contains a header and an array of rectangles that compose a region. +/// The rectangles are sorted top to bottom, left to right. They do not overlap. +/// +/// RGNDATA +public unsafe partial struct RgnData +{ + public RgnDataHeader rdh; + + /// + /// Specifies an arbitrary-size buffer that contains the RECT structures that make up the region. + /// + [NativeTypeName("char[1]")] + public fixed sbyte Buffer[1]; +} diff --git a/src/Vortice.Win32/Graphics/Gdi/RgnDataHeader.cs b/src/Vortice.Win32/Graphics/Gdi/RgnDataHeader.cs new file mode 100644 index 0000000..499a407 --- /dev/null +++ b/src/Vortice.Win32/Graphics/Gdi/RgnDataHeader.cs @@ -0,0 +1,34 @@ +// Copyright © Amer Koleci and Contributors. +// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information. + +namespace Win32.Graphics.Gdi; + +/// RGNDATAHEADER +public partial struct RgnDataHeader +{ + /// + /// The size, in bytes, of the header. + /// + public uint Size; + + /// + /// The type of region. This value must be RDH_RECTANGLES. + /// + public uint iType; + + /// + /// The number of rectangles that make up the region. + /// + public uint nCount; + + /// + /// The size of the buffer required to receive the structures that make up the region. + /// If the size is not known, this member can be zero. + /// + public uint nRgnSize; + + /// + /// A bounding rectangle for the region in logical units. + /// + public RawRect rcBound; +} diff --git a/src/Vortice.Win32/UnscopedRefAttribute.cs b/src/Vortice.Win32/UnscopedRefAttribute.cs deleted file mode 100644 index 08abfa8..0000000 --- a/src/Vortice.Win32/UnscopedRefAttribute.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Diagnostics.CodeAnalysis; - -/// -/// Used to indicate a byref escapes and is not scoped. -/// -/// -/// -/// There are several cases where the C# compiler treats a as implicitly -/// - where the compiler does not allow the to escape the method. -/// -/// -/// For example: -/// -/// for instance methods. -/// parameters that refer to types. -/// parameters. -/// -/// -/// -/// This attribute is used in those instances where the should be allowed to escape. -/// -/// -/// Applying this attribute, in any form, has impact on consumers of the applicable API. It is necessary for -/// API authors to understand the lifetime implications of applying this attribute and how it may impact their users. -/// -/// -[AttributeUsage( - AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Parameter, - AllowMultiple = false, - Inherited = false)] -internal sealed class UnscopedRefAttribute : Attribute -{ -} diff --git a/src/Vortice.Win32/Vortice.Win32.csproj b/src/Vortice.Win32/Vortice.Win32.csproj index 0249bc4..f4d4abd 100644 --- a/src/Vortice.Win32/Vortice.Win32.csproj +++ b/src/Vortice.Win32/Vortice.Win32.csproj @@ -1,9 +1,9 @@ - netstandard2.0;netstandard2.1;net6.0;net7.0 + netstandard2.0;net6.0;net7.0 Windows API low level bindings. - + true $(NoWarn);CS0419;IDE0017 @@ -17,18 +17,13 @@ - - - - - - - + + - +