diff --git a/Silk.NET.sln b/Silk.NET.sln index 78bccfff41..92d599de4e 100644 --- a/Silk.NET.sln +++ b/Silk.NET.sln @@ -270,9 +270,9 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.NUKE", "build\nuke\Silk.NET.NUKE.csproj", "{B9A8D738-FE7D-4860-A446-4A03E3DDEB74}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Microsoft", "Microsoft", "{F2CF5D32-4B41-425E-B229-8FFC48F88063}" -ProjectSection(SolutionItems) = preProject - src\Microsoft\dxva.h = src\Microsoft\dxva.h -EndProjectSection + ProjectSection(SolutionItems) = preProject + src\Microsoft\dxva.h = src\Microsoft\dxva.h + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Silk.NET.Direct3D11", "src\Microsoft\Silk.NET.Direct3D11\Silk.NET.Direct3D11.csproj", "{F3B7A9D6-5B15-45E8-925B-20B5BBD33428}" EndProject @@ -474,6 +474,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenXR.Extensions. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Silk.NET.OpenXR.Extensions.HTCX", "src\OpenXR\Extensions\Silk.NET.OpenXR.Extensions.HTCX\Silk.NET.OpenXR.Extensions.HTCX.csproj", "{782B6A7E-9F04-429A-9DCD-D7273AA3882E}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PrototypeStructChaining", "PrototypeStructChaining", "{B15922CB-815C-4038-B635-EE2D8A8F700B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrototypeStructChaining", "src\Lab\Experiments\PrototypeStructChaining\PrototypeStructChaining\PrototypeStructChaining.csproj", "{EEFF37DA-E4F2-406E-AF97-8615BB7BC34C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrototypeStructChaining.Test", "src\Lab\Experiments\PrototypeStructChaining\PrototypeStructChaining.Test\PrototypeStructChaining.Test.csproj", "{BD19250B-E143-4F4E-9E1D-18829CCB3642}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -2823,6 +2829,30 @@ Global {782B6A7E-9F04-429A-9DCD-D7273AA3882E}.Release|x64.Build.0 = Release|Any CPU {782B6A7E-9F04-429A-9DCD-D7273AA3882E}.Release|x86.ActiveCfg = Release|Any CPU {782B6A7E-9F04-429A-9DCD-D7273AA3882E}.Release|x86.Build.0 = Release|Any CPU + {EEFF37DA-E4F2-406E-AF97-8615BB7BC34C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EEFF37DA-E4F2-406E-AF97-8615BB7BC34C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EEFF37DA-E4F2-406E-AF97-8615BB7BC34C}.Debug|x64.ActiveCfg = Debug|Any CPU + {EEFF37DA-E4F2-406E-AF97-8615BB7BC34C}.Debug|x64.Build.0 = Debug|Any CPU + {EEFF37DA-E4F2-406E-AF97-8615BB7BC34C}.Debug|x86.ActiveCfg = Debug|Any CPU + {EEFF37DA-E4F2-406E-AF97-8615BB7BC34C}.Debug|x86.Build.0 = Debug|Any CPU + {EEFF37DA-E4F2-406E-AF97-8615BB7BC34C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EEFF37DA-E4F2-406E-AF97-8615BB7BC34C}.Release|Any CPU.Build.0 = Release|Any CPU + {EEFF37DA-E4F2-406E-AF97-8615BB7BC34C}.Release|x64.ActiveCfg = Release|Any CPU + {EEFF37DA-E4F2-406E-AF97-8615BB7BC34C}.Release|x64.Build.0 = Release|Any CPU + {EEFF37DA-E4F2-406E-AF97-8615BB7BC34C}.Release|x86.ActiveCfg = Release|Any CPU + {EEFF37DA-E4F2-406E-AF97-8615BB7BC34C}.Release|x86.Build.0 = Release|Any CPU + {BD19250B-E143-4F4E-9E1D-18829CCB3642}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD19250B-E143-4F4E-9E1D-18829CCB3642}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD19250B-E143-4F4E-9E1D-18829CCB3642}.Debug|x64.ActiveCfg = Debug|Any CPU + {BD19250B-E143-4F4E-9E1D-18829CCB3642}.Debug|x64.Build.0 = Debug|Any CPU + {BD19250B-E143-4F4E-9E1D-18829CCB3642}.Debug|x86.ActiveCfg = Debug|Any CPU + {BD19250B-E143-4F4E-9E1D-18829CCB3642}.Debug|x86.Build.0 = Debug|Any CPU + {BD19250B-E143-4F4E-9E1D-18829CCB3642}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD19250B-E143-4F4E-9E1D-18829CCB3642}.Release|Any CPU.Build.0 = Release|Any CPU + {BD19250B-E143-4F4E-9E1D-18829CCB3642}.Release|x64.ActiveCfg = Release|Any CPU + {BD19250B-E143-4F4E-9E1D-18829CCB3642}.Release|x64.Build.0 = Release|Any CPU + {BD19250B-E143-4F4E-9E1D-18829CCB3642}.Release|x86.ActiveCfg = Release|Any CPU + {BD19250B-E143-4F4E-9E1D-18829CCB3642}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -3052,6 +3082,9 @@ Global {3E30D674-9282-4297-AD1F-9B233A166308} = {0651C5EF-50AA-4598-8D9C-8F210ADD8490} {606214B8-07FC-436F-9523-02AF32E1AB1E} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0} {782B6A7E-9F04-429A-9DCD-D7273AA3882E} = {90471225-AC23-424E-B62E-F6EC4C6ECAC0} + {B15922CB-815C-4038-B635-EE2D8A8F700B} = {39B598E9-44BA-4A61-A1BB-7C543734DBA6} + {EEFF37DA-E4F2-406E-AF97-8615BB7BC34C} = {B15922CB-815C-4038-B635-EE2D8A8F700B} + {BD19250B-E143-4F4E-9E1D-18829CCB3642} = {B15922CB-815C-4038-B635-EE2D8A8F700B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {F5273D7F-3334-48DF-94E3-41AE6816CD4D} diff --git a/build/cache/vulkan.json.gz b/build/cache/vulkan.json.gz index 98d27c384c..5a4565b913 100644 Binary files a/build/cache/vulkan.json.gz and b/build/cache/vulkan.json.gz differ diff --git a/documentation/proposals/Proposal - Vulkan Struct Chaining - #1 StructureType correction.md b/documentation/proposals/Proposal - Vulkan Struct Chaining - #1 StructureType correction.md new file mode 100644 index 0000000000..092e78bbf5 --- /dev/null +++ b/documentation/proposals/Proposal - Vulkan Struct Chaining - #1 StructureType correction.md @@ -0,0 +1,92 @@ +# Summary + +This proposal is a minimal enhancement to [`Silk.Net.Vulkan`](../../src/Vulkan/Silk.NET.Vulkan) to mark all structures +that contain a `StructureType SType` field as implementing the interface `IStructuredType`. + +This is a tiny pre-requisite for +[Proposal - Vulkan Struct Chaining - #2 Unmanaged Chaining.md](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%232%20Unmanaged%20Chaining.md) +and is of limited value otherwise. Its primary purpose is to mark any structure that requires it's `SType` field to be +correctly set when passing to Vulkan, and to provide a mechanism for doing so. + +A full implementation can be found [in Pull Request 680](https://github.com/dotnet/Silk.NET/pull/680). + +# Contributors + +- [Craig Dean, DevDecoder](https://github.com/thargy) + +# Current Status + +- [x] Proposed +- [ ] Discussed with API Review Board (ARB) +- [ ] Approved +- [x] Implemented + +# Design Decisions + +- The `IStructuredType` interface will usually not be implemented directly, instead `IChainable` (from + the [unmanaged chaining proposal](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%232%20Unmanaged%20Chaining.md)) + will extend this interface. +- Whenever the `IStructuredType` is added to an interface (either directly or indirectly) the + corresponding `StructureType()` method should also be explicitly + implemented ([see below](#istructuretype-implementation)). +- This proposed interface could easily be combined/merged with the `IChainable` + interface which [is proposed](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%232%20Unmanaged%20Chaining.md) as an + extension. However, that interface marks a struct as having a second field `void* PNext`, as well as requiring + that `StructureType sType` field is in the first position, which is not required by this proposal (but is allowed). + Keeping the two concepts separate is good encapsulation and good for supporting future changes. The concept + that an `SType` must be correct is somewhat different to the concept of a chain (implied by `void* PNext`). +- To be clear, this proposal does not need to guarantee that the `SType` field is in position 0 (i.e. first), + that requirement is only necessary to implement the functionality + [proposed by the unmanaged chaining system](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%232%20Unmanaged%20Chaining.md) +- Not all structures exposed by Vulkan have a default value for the `SType`, (e.g. `BaseOutStructure` and `BaseInStructure`), + where no default is available, the `StructureType()` method only returns the current value, rather than setting it. + +# Implementation Notes + +- BuildTools already contains enough information to determine whether the interface should be added to a structure, and + already knows which `StructureType` the structure should use. +- A working example of such a struct can + be [found in the labs.](../../src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PhysicalDeviceFeatures2.cs) + +# Proposed API + +## StructureType structures + +### IStructuredType + +This proposal adds a single interface `IStructuredType`, the primary purpose of which is to mark any structure that +requires it's `SType` to be correctly set when passing to Vulkan. It adds a single +method `void IStructuredType.StructureType()` +which sets the `SType` correctly and returns it to the caller. + +```csharp +namespace Silk.Net.Vulkan; + +/// +/// Base interface for any struct that has a field called `SType`, that must be correctly +/// set when passing into the Vulkan API. +/// +public interface IStructuredType +{ + /// + /// Gets the structured type's enum value. + /// + /// + /// Retrieving the also ensures it is set to the correct value (if any). + /// + StructureType StructureType(); +} +``` + +### IStructureType implementation + +Each struct generated that implements `IStructuredType` should also have the following code auto-generated, to +explicitly implement the interface. The method sets and returns the `SType` correctly (if any) for the current structure. + +```csharp +/// +StructureType IStructuredType.StructureType() +{ + return SType = StructureType.; +} +``` diff --git a/documentation/proposals/Proposal - Vulkan Struct Chaining - #2 Unmanaged Chaining.md b/documentation/proposals/Proposal - Vulkan Struct Chaining - #2 Unmanaged Chaining.md new file mode 100644 index 0000000000..35f13a7d9b --- /dev/null +++ b/documentation/proposals/Proposal - Vulkan Struct Chaining - #2 Unmanaged Chaining.md @@ -0,0 +1,735 @@ +# Summary + +**_This proposal is dependent +on [Proposal - Vulkan Struct Chaining - #1 StructureType correction](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%231%20StructureType%20correction.md) +._** + +This proposal presents a lightweight mechanism for fluently building Vulkan Structure Chains. You may wish to start with +the [Usage section below](#Usage) to aid understanding. There is also a fully working prototype +[in Pull Request 683](https://github.com/dotnet/Silk.NET/pull/683). + +To do so it marks any structure that meets the following requirements as being `IChainable`: + +* Is a struct. +* Has a `StructureType SType` field in position 0 (first field) +* Has a `void* PNext` field in position 1 (second field) + +The `IChainable` interface extends the `IStructuredType` interface +from [Proposal - Vulkan Struct Chaining - #1 StructureType correction](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%231%20StructureType%20correction.md) +and so the explicit implementation of `IChainable.StructureType()` from +[that proposal](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%231%20StructureType%20correction.md#istructuretype-implementation) +is triggerred for the structure, providing a mechanism for ensuring the `SType` is correctly set. It then exposes +a `BaseInStructure* PNext { get; set; }` property for easy access to the next item in the chain. + +The presence of the `IChainable` interface, also acts as a **guarantee** that it is safe to cast any pointer of a struct +implementing it to a pointer to a `BaseInStructure` struct, which is a struct which has just the `SType` and `PNext` +fields present. Therefore it is always possible to cast `void* PNext` of an `IChainable` struct to `BaseInStructure*`. +It is this guarantee that requires the position of the fields to be fixed (which they are in practice). However, by +ensuring we validate the constraints at build time (when choosing to add the interface), we can prevent downstream bugs +occurring at run time. + +**Note** that the `IChainable` interface adds the additional constraint that the `StructureType SType` field must be at +offset 0, i.e. in the first position to facilitate this functionality - which is not a constraint of `IStructuredType`. + +However, rather than extending `IChainable` directly, where +the [Vulkan Specification](https://raw.githubusercontent.com/KhronosGroup/Vulkan-Headers/master/registry/vk.xml)) +specifies chaining constraints, via the presence of the `structextends` attribute, `BuildTools` chooses one +of `IChainStart` or `IExtendsChain` (both of which extend `IChainable`). The specification has nearly 100 chains +defined in this manner, and many of the >700 structures form part of these chains. However, over 200 structures are not +curretnly defined as part of a chain, and as such, all the utilities proposed have a 'looser' mechanism for working +with `IChainable` directly when it is necessary to do so. + +For example, if `struct B` extends `struct A`, then `struct B` will be marked with `IExtendsChain` and `struct A` +will be marked with `IChainStart`. A struct may only extend `IChainStart` once (even though it may appear in +the `structextends` attribute of many structs), but is may implement multiple `IExtendsChain` interfaces. It is +also feasible for a struct to implement both (i.e. be able to extend other chains, as well as being a chain start), a +real example of this can be seen +[in the labs](../../src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PhysicalDeviceFeatures2.cs). + +As a result, `IChainable` will not usually be directly implemented (just as it is unlikely to see `IStructuredType` +[implemented directly]((Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%231%20StructureType%20correction.md))). +However, if +the [Vulkan Specification](https://raw.githubusercontent.com/KhronosGroup/Vulkan-Headers/master/registry/vk.xml) ever +includes a struct that meets the above constraints, but doesn't have, or appear in, a `structsextend` attribute, then it +will be explicitly marked as `IChainable`. + +Whenever a struct is marked as `IChainStart` a static `ref [StructType] Chain(out [StructType]) capture);` method is +also added, providing an easy form of starting a chain with default values. As `IChainStart` also +implements `IChainable`, which implements `IStructuredType`, then a chain start will have three additional methods +generated (the static `Chain(out)` method and the explicit `IStructuredType.StructureType()` and `IChainable.PNext` +implementation); as compared to all other `IChainable` structs, which will only have the +explicit `IStructuredType.StructureType()` implementation from +[Proposal - Vulkan Struct Chaining - #1 StructureType correction](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%231%20StructureType%20correction.md) +and the explicit `BaseInStructure* IChainable.PNext { get; set;}` property from this proposal. + +The remaining functionality is provided entirely by the following new extension methods: + +```csharp +public static unsafe ref TChain SetNext(this ref TChain chain, ref TNext value, + bool alwaysAdd = false) + where TChain : struct, IChainStart + where TNext : struct, IExtendsChain {...} + +public static unsafe ref TChain SetNextAny(this ref TChain chain, ref TNext value, + where TChain : struct, IChainable + where TNext : struct, IChainable {...} + +public static unsafe ref TChain AddNext(this ref TChain chain, out TNext next) + where TChain : struct, IChainStart + where TNext : struct, IExtendsChain {...} + +public static unsafe ref TChain AddNextAny(this ref TChain chain, out TNext next) + where TChain : struct, IChainable + where TNext : struct, IChainable {...} + +public static unsafe ref TChain TryAddNext(this ref TChain chain, out TNext next, out bool added) + where TChain : struct, IChainStart + where TNext : struct, IExtendsChain {...} + +public static unsafe ref TChain TryAddNextAny(this ref TChain chain, out TNext next, out bool added) + where TChain : struct, IChainable + where TNext : struct, IChainable {...} + +public static unsafe int IndexOf(this ref TChain chain, ref TNext value) + where TChain : struct, IChainStart + where TNext : struct, IExtendsChain {...} + +public static unsafe int IndexOfAny(this ref TChain chain, ref TNext value) + where TChain : struct, IChainable + where TNext : struct, IChainable {...} +``` + +An implementation can be found [in Pull Request 683](https://github.com/dotnet/Silk.NET/pull/683) and their use is +detailed below. + +# Contributors + +- [Craig Dean, DevDecoder](https://github.com/thargy) + +# Current Status + +- [x] Proposed +- [ ] Discussed with API Review Board (ARB) +- [ ] Approved +- [x] Implemented + +# Design Decisions + +The following requirements are achieved by this proposal: + +- **Backward compatibility** - the chaining system should not modify the existing structs, but add functionality. +- **Minimal bloat** - the minimum amount of new generated code was sought. +- **Discoverability** - it should be as easy as possible for a new user to discover. +- **Compile-time Validation** - it should prevent chaining invalid structures (as much as possible) during compilation. +- **SType coercion** - it should always set the `SType` of chained structures. +- **Pointer management** - it should handle setting the `PNext` pointer of structures. +- **Compact usage** - it should reduce copy-pasta code. +- **Avoids the heap** - boxing should be avoided. +- **Well Tested** - tests were added to ensure pointers are correctly set, and compilation failures occur. + +What this proposal does not do (some of these _are_ addressed +in [Proposal - Vulkan Struct Chaining - #3 Managed Chaining](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%233%20Managed%20Chaining.md)) +is manage pointers of structures that find themselves on the heap. Any supplied structures should be held on the stack, +once moved to the heap their `PNext` values can no longer be trusted as the GC is free to move structures in heap +memory. The proposed extension methods make it difficult to use with heap objects, but it is not impossible. The +presence of the `ManagedChain` classes +from [the proposal for managed chains](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%233%20Managed%20Chaining.md), +along with a well documented API should highlight the danger of such practices. + +Indeed, it is important to remember that such dangers are already part of the existing implementation and are a feature +of using unmanaged pointers in .NET rather than a limitation of this proposal. + +To be discussed: + +- Whether to include [specific chain interfaces](#chain-interfaces-optional). + +# Usage + +The proposal provides for the following usages. Note that where an `Any` extension method is mentioned, it is identical +to the non-`Any` version (e.g. `AddNext` and `AddNextAny` are equivalent), save that the `Any` version does not +constrain the types to those associated with a defined chain, instead types only need to be `IChainable`. + +### Chain Building + +You can happily create the start of a chain as usual, by declaring a variable first. Indeed it is necessary to do so if +you wish to specify non-default values (though you can also make use of `SetNext`s replace functionality). You also need +to use this approach when starting a chain which is not explicitly defined as a chain start by the specification. If you +do start a chain with such a structure, you will have to use the `Any` versions of the extension methods below to +continue manipulating it. + +Regardless, the `SType` and `PNext` will be overwritten whenever you start manipulating the chain, so you should never +set them manually. For example: + +```csharp +var createInfo = new DeviceCreateInfo +{ + Flags = 1U +}; +// When you call any chaining method it will set the chain's SType automatically. +createinfo.AddNext... +``` + +In many cases, we only want to create a default structure for population by the API. To do so, we use the +static `BaseInStructure` method like so: + +```csharp +PhysicalDeviceFeatures2.Chain(out var features2) +``` + +This has several advantages: + +- The method is only available for structures that are valid at the start of a chain; providing compile-time validation. +- The structure's `SType` will be correctly set immediately. +- The syntax is fluent, and creates more readable code when used with the other chaining methods (see below). + +**Note** All the chaining methods return the current start of the chain by reference (including `BaseInStructure`). This +allows each method to scan the entire chain. More importantly, it allows the Type constraints to be checked during +compile time to ensure that a type actually can extend the chain. One side effect is that `ref Chain(out)` outputs the +newly created chain _and_ returns a reference to it. This can cause confusion to less experienced C# devs, for example: + +```csharp +// Don't do this, it is harmless but unnecessary and confusing! +var a = ChainStart.Chain(out var b).AddNext(out ChainExtension c); +``` + +Both `a` and `b` will appear to be identical structures; however 'a' is actually a copy of 'b', being separate locations +on the current stack frame. In most cases, that is really no problem at all as both point to the _start_ of a chain, and +so there are no unmanaged pointers pointing _to them_, therefore using _either_ is fine (though completely unnecessary). + +However, for deeper understanding the chain extension methods actually _take a reference_ to `this`, so `AddNext` +actually updates the `PNext` of variable `b`. Once the chain is built the final assignment _to_ `a` _copies_ `b` +into `a`. None of this is undefined behaviour, but as it is generally poorly understood so none of the examples ever +recommend assigning the output of a chain. + +The `Chain` method is a static method implemented on `IChainStart` structures, the remaining methods are actually +extension methods. The methods ending with `Any` can be used with any `IChainable` structure, but they do not constrain +the entries, or the head of the chain to being structures explicitly mentioned by the specification. The non-`Any` +methods are more restrictive, and should usually be used in preference. + +### AddNext / AddNextAny + +The most common use case is to add an empty structure to the end of a chain for it to be populated by the Vulkan API, +this can now be done like so: + +```csharp +PhysicalDeviceFeatures2 + .Chain(out var features2) + // CreateNext will create an empty struct, with the correct SType (as well as ensuring the + // chain's SType is set correctly). + .AddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures) + .AddNext(out PhysicalDeviceAccelerationStructureFeaturesKHR accelerationStructureFeaturesKhr); +``` + +Each method `out` puts a struct into the local stack frame for querying once populated, and the pointers point to this +local variable. Despite generics and interfaces being used, the chain methods avoid the heap entirely. + +### TryAddNext / TryAddNextAny + +You may only want to add a structure if it doesn't already exist in the chain, this can be done with `TryAddNext`, e.g.: + +```csharp +PhysicalDeviceFeatures2 + .Chain(out var features2) + .AddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures) + // As there is already a PhysicalDeviceDescriptorIndexingFeatures structure the following + // will not add anything to the chain and `added` will be `false`. + .TryAddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures2, out bool added); +``` + +### SetNext / SetNextAny + +Sometimes we may wish to set the initial state of a structure, or replace any existing item within the structure that +has the same `StructureType` we can do this with `SetNext`: + +```csharp +var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures +{ + ShaderInputAttachmentArrayDynamicIndexing = true +}; + +// Unlike AddNext, SetNext will only add the structure if isn't already present, otherwise it will overwrite it. +// So we can provide a default to SetNext like so: +var accelerationStructureFeaturesKhr = default(PhysicalDeviceAccelerationStructureFeaturesKHR); + +PhysicalDeviceFeatures2 + .Chain(out var features2) + // SetNext accepts an existing struct, note, it will coerce the SType and blank the PNext + .SetNext(ref indexingFeatures) + .SetNext(ref default(PhysicalDeviceAccelerationStructureFeaturesKHR)); +``` + +*NOTE* you can mix and match `AddNext` and `SetNext` (and any chaining method) in the same method chain. + +By default, `SetNext` will _replace_ any item in the chain with a matching `SType`, this behaviour can be changed by +setting the optional `alwaysAdd` parameter to `true`; + +```csharp +var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures +{ + ShaderInputAttachmentArrayDynamicIndexing = true +}; +var indexingFeatures2 = new PhysicalDeviceDescriptorIndexingFeatures +{ + ShaderInputAttachmentArrayDynamicIndexing = false +}; +var accelerationStructureFeaturesKhr = new PhysicalDeviceAccelerationStructureFeaturesKHR +{ + AccelerationStructure = true +}; + +PhysicalDeviceFeatures2 + .Chain(out var features2) + .SetNext(ref indexingFeatures) + // This will add the second 'indexingFeatures' struct, even though one is already present in the chain. + .SetNext(ref indexingFeatures2, true); +``` + +### IndexOf / IndexOfAny + +Sometimes it's useful to know if a structure you previously supplied is still in a chain, this can be done +with `IndexOf`, which returns a non-negative index (zero-indexed) if the structure is found, eg.: + +```csharp +PhysicalDeviceFeatures2 + .Chain(out var features2) + .AddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures) + .AddNext(out PhysicalDeviceAccelerationStructureFeaturesKHR accelerationStructureFeaturesKhr); + +// Check indices +Assert.Equal(1, features2.IndexOf(ref indexingFeatures)); +Assert.Equal(2, features2.IndexOf(ref accelerationStructureFeaturesKhr)); +``` + +### Validation + +Due to the generic constraints, all the chain extensions are only valid on a struct that implements `IChainStart` and +only accept struct that implement `IExtends` where `TChain` is the chain type. This means that it is impossible +to add invalid structs to a chain with these methods. Further, using any of the chain extension methods guarantees that +the chain, and the supplied item have the correct `SType`, **and** that the `PNext` pointers along the chain are valid. + +# Proposed API + +## Chaining interfaces + +### IChainable + +The base interface of chaining interfaces: + +```csharp +namespace Silk.Net.Vulkan; + +/// +/// Base interface for any struct that has can set the next value. +/// +/// Note that any structure marked must start with a +/// and a void* field, in that order. This is so that a pointer to it can be coerced +/// to a pointer to a . +public interface IChainable : IStructuredType +{ + /// + /// Points to the next in this chain, if any; otherwise . + /// + unsafe BaseInStructure* PNext { get; set; } +} + +``` + +### IChainStart + +Implemented by any struct that can be used as the start of a chain: + +```csharp +namespace Silk.Net.Vulkan; + +/// +/// Marks a chainable struct as being allowed at the start of a chain. +/// +/// Any will have a corresponding static `Chain(out var chain)` +/// convenience method. +public interface IChainStart : IChainable +{ +} +``` + +### IExtendsChain + +Implemented by any struct that can be added to a chain. + +```csharp +namespace Silk.Net.Vulkan; + +/// +/// Marks a chainable struct indicating which chain this type +/// extends. +/// +/// A chain start structure. +public interface IExtendsChain : IChainable + where TChain : IChainable +{ +} +``` + +### Chain Extension Methods + +Provides the struct chaining functionality, the full implementation can be +found [in the labs](../../src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/ChainExtensions.cs): + +```csharp +namespace Silk.NET.Vulkan; + +/// +/// Extension methods and utilities for building unmanaged structure chains. +/// +public static class Chain +{ + /// + /// Replaces a structure in the chain (if present, and is false), or adds it to the end. + /// + /// The current chain + /// A reference to the structure to update + /// Always adds to the end of the chain, even if an equivalent structure is present. + /// The type of the current chain + /// The type of the value + /// A reference to the value value in the chain + /// + /// Note that both the supplied chain, and the supplied value will have their `SType` correctly set. Further, + /// the supplied structure's will be overwritten. + /// To use + /// + /// var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures + /// { + /// ShaderInputAttachmentArrayDynamicIndexing = true + /// }; + /// var accelerationStructureFeaturesKhr = new PhysicalDeviceAccelerationStructureFeaturesKhr + /// { + /// AccelerationStructure = true + /// }; + /// + /// PhysicalDeviceFeatures2 + /// .BaseInStructure(out var features2) + /// .SetNext(ref indexingFeatures) + /// .SetNext(ref accelerationStructureFeaturesKhr); + /// + /// + /// + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ref TChain SetNext + ( + this ref TChain chain, + ref TNext value, + bool alwaysAdd = false + ) + where TChain : struct, IChainStart + where TNext : struct, IExtendsChain + => ref SetNextAny(ref chain, ref value, alwaysAdd); + + /// + /// Replaces a structure in the chain (if present, and is false), or adds it to the end. + /// + /// The current chain + /// A reference to the structure to update + /// Always adds to the end of the chain, even if an equivalent structure is present. + /// The type of the current chain + /// The type of the value + /// A reference to the value value in the chain + /// + /// Note that both the supplied chain, and the supplied value will have their `SType` correctly set. Further, + /// the supplied structure's will be overwritten. + /// To use + /// + /// var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures + /// { + /// ShaderInputAttachmentArrayDynamicIndexing = true + /// }; + /// var accelerationStructureFeaturesKhr = new PhysicalDeviceAccelerationStructureFeaturesKhr + /// { + /// AccelerationStructure = true + /// }; + /// + /// PhysicalDeviceFeatures2 + /// .BaseInStructure(out var features2) + /// .SetNext(ref indexingFeatures) + /// .SetNext(ref accelerationStructureFeaturesKhr); + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static unsafe ref TChain SetNextAny + ( + this ref TChain chain, + ref TNext value, + bool alwaysAdd = false + ) + where TChain : struct, IChainable + where TNext : struct, IChainable + {...} + + /// + /// Adds a structure to the end of the chain. + /// + /// The current chain + /// The structure added to the end of the chain + /// The type of the current chain + /// The type of the structure to add + /// The reference to the chain. + /// + /// Note that both the supplied chain, and the added structure will have their `SType` correctly set + /// To use specify the output type required, e.g.: + /// + /// PhysicalDeviceFeatures2 + /// .BaseInStructure(out var features2) + /// .AddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures) + /// .AddNext(out PhysicalDeviceAccelerationStructureFeaturesKhr accelerationStructureFeaturesKhr); + /// + /// Note, the value is always added, even if an equivalent value is added in the chain already. Use + /// to only add if not already present. + /// + /// + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ref TChain AddNext(this ref TChain chain, out TNext next) + where TChain : struct, IChainStart + where TNext : struct, IExtendsChain + => ref AddNextAny(ref chain, out next); + + /// + /// Adds a structure to the end of the chain. + /// + /// The current chain + /// The structure added to the end of the chain + /// The type of the current chain + /// The type of the structure to add + /// The reference to the chain. + /// + /// Note that both the supplied chain, and the added structure will have their `SType` correctly set + /// To use specify the output type required, e.g.: + /// + /// PhysicalDeviceFeatures2 + /// .BaseInStructure(out var features2) + /// .AddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures) + /// .AddNext(out PhysicalDeviceAccelerationStructureFeaturesKhr accelerationStructureFeaturesKhr); + /// + /// Note, the value is always added, even if an equivalent value is added in the chain already. Use + /// to only add if not already present. + /// + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + /// + /// + /// + public static unsafe ref TChain AddNextAny(this ref TChain chain, out TNext next) + where TChain : struct, IChainable + where TNext : struct, IChainable + {...} + + /// + /// Tries to add a structure to the end of the chain. + /// + /// The current chain + /// The structure added to the end of the chain + /// Whether the structure was actually added + /// The type of the current chain + /// The type of the structure to add + /// The reference to the chain. + /// + /// Note that both the supplied chain, and the added structure will have their `SType` correctly set + /// To use specify the output type required, e.g.: + /// + /// PhysicalDeviceFeatures2 + /// .BaseInStructure(out var features2) + /// .TryAddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures, out var added); + /// + /// + /// + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ref TChain TryAddNext(this ref TChain chain, out TNext next, out bool added) + where TChain : struct, IChainStart + where TNext : struct, IExtendsChain + => ref TryAddNextAny(ref chain, out next, out added); + + /// + /// Tries to add a structure to the end of the chain. + /// + /// The current chain + /// The structure added to the end of the chain + /// Whether the structure was actually added + /// The type of the current chain + /// The type of the structure to add + /// The reference to the chain. + /// + /// Note that both the supplied chain, and the added structure will have their `SType` correctly set + /// To use specify the output type required, e.g.: + /// + /// PhysicalDeviceFeatures2 + /// .BaseInStructure(out var features2) + /// .TryAddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures, out var added); + /// + /// + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + /// + /// + /// + public static unsafe ref TChain TryAddNextAny(this ref TChain chain, out TNext next, out bool added) + where TChain : struct, IChainable + where TNext : struct, IChainable + {...} + + /// + /// Returns the index of the in the , if present. + /// + /// The chain + /// The structure value + /// The type of the current chain + /// The type of the value + /// The zero-indexed index if found; otherwise -1. + /// + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int IndexOf(this ref TChain chain, ref TNext value) + where TChain : struct, IChainStart + where TNext : struct, IExtendsChain + => IndexOfAny(ref chain, ref value); + + /// + /// Returns the index of the in the , if present. + /// + /// The chain + /// The structure value + /// The type of the current chain + /// The type of the value + /// The zero-indexed index if found; otherwise -1. + /// + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + /// + /// + /// + public static unsafe int IndexOfAny(this ref TChain chain, ref TNext value) + where TChain : struct, IChainable + where TNext : struct, IChainable + {...} +} +``` + +### Chain Structure + +The `BaseInStructure` struct makes it easy to access the `SType` and `PNext` of a structure pointed to by `void* PNext`, +although it is used internally, it is useful for consumers of Silk.Net to have access to use in their own scenarios, +that is because the `IChainable` interface does not directly expose the underlying `SType` and `PNext` fields; as they +are fields (not properties), and this proposal aims to avoid boxing (so we try not to use the interface directly +unnecessarily). + +```csharp +namespace Silk.Net.Vulkan; + +/// +/// Header struct of all structs. +/// +/// +/// Any pointer to a structure marked as can safely be cast to a pointer to this type. +/// In particular, this means that the void* PNext field can always be safely cast to BaseInStructure*, providing +/// access to the `SType` and `PNext` fields. +/// +/// +public struct Chain : IChainable +{ + /// + /// The structure type. + /// + public StructureType SType; + /// + /// The next struct in the chain, if any; otherwise . + /// + public unsafe BaseInStructure* PNext; + + /// + /// Note, this cannot coerce the type as 'guaranteed by the `IStructuredType` interface. + StructureType IStructuredType.StructureType() + { + return SType; + } +} +``` + +### Static Chain implementation + +Whenever the `IChainStart` interface is added to an `IChainable` struct, the following static convenience methods is +also added: + +```csharp +/// +/// Convenience method to start a chain. +/// +/// The newly created chain root +/// A reference to the newly created chain. +public static unsafe ref [StrucType] Chain( + out [StructType] capture) +{ + capture = new [StructType](StructureType.[StructureType]); + return ref capture; +} +``` + +### Chain interfaces (Optional) + +As a useful optional extra, whenever an `IChainStart` struct is found, a corresponding `I[StructName]Chain` is created, +that extends from `IChainable`, e.g.: + +```csharp +namespace Silk.Net.Vulkan; + +/// +/// Marks a chainable struct as being part of the `DeviceCreateInfo` chain. +/// +public interface IDeviceCreateInfoChain : IChainable +{ +} +``` + +This interface is then added to the corresponding `IChainStart` _and_ any struct that implements the +corresponding `IExtendsChain`. The primary benefit of this approach is to make it significantly easier to write +code that accepts any part of a specific chain (including the head). \ No newline at end of file diff --git a/documentation/proposals/Proposal - Vulkan Struct Chaining - #3 Managed Chaining.md b/documentation/proposals/Proposal - Vulkan Struct Chaining - #3 Managed Chaining.md new file mode 100644 index 0000000000..d055b133ee --- /dev/null +++ b/documentation/proposals/Proposal - Vulkan Struct Chaining - #3 Managed Chaining.md @@ -0,0 +1,1027 @@ +# Summary + +**_This proposal is dependent +on [Proposal - Vulkan Struct Chaining - #2 Unmanaged Chaining](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%232%20Unmanaged%20Chaining.md) +._** + +This proposal presents a _managed_ mechanism for safely building, and storing, Vulkan Structure Chains. You may wish to +start with the [previous proposal](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%232%20Unmanaged%20Chaining.md), +followed by the [Usage section below](#Usage) to aid understanding. There is also a fully working prototype +[in the labs](../../src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining). + +The [previous proposal](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%232%20Unmanaged%20Chaining.md) provided a +lightweight mechanism for building structure chains, but the responsibility for ensuring that the provided structures +did not move remained with the consumer. This provided a useful mechanism for reducing bugs (through compile time and +run time validation of `SType` and `PNext`) and making more readable and compact code, whilst not sacrificing +performance. + +However, many consumers are uncomfortable with pointers, and are especially prone to introducing bugs when placing +structs onto the heap. This proposal provides a convenient `ManagedChain` class, and multiple +descendent `ManagedChain` (similar to the `System.Tuple` classes) classes to safely fix the structures +in memory and prevent pointer bugs. + +Whenever a structure is loaded into the `ManagedChain` its `SType` and `PNext` are forced to be correct, preventing +errors. Structures can be replaced at any time, and will be inserted efficiently into the chain as an O(1) operation. + +# Contributors + +- [Craig Dean, DevDecoder](https://github.com/thargy) + +# Current Status + +- [x] Proposed +- [ ] Discussed with API Review Board (ARB) +- [ ] Approved +- [ ] Implemented + +# Design Decisions + +- There are no requirements to extend `BuildTools`, or add any additional information to the `IChainable` structures. +- Although the `ManagedChain` generic classes are auto-generated (for convenience) this is done using T4 + templating, an implementation of which is + provided [in the labs](../../src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/ManagedChain.gen.tt). +- For improved performance, the chain's structures are held in a single block of contiguous unmanaged memory, as the + memory is unmanaged, the position of the structures remains fixed, even though the containing object can be safely + moved around by the GC in the heap. Indeed a pointer to this block is the only data stored by an instance of any + `ManageChain` object, despite all the functionality provided! +- The structure accessors return a copy of the structures, and always correct the `SType` and `PNext` on input. Even + though the `PNext` values are exposed there is no way to modify them from outside the class, guaranteeing their + safety. +- The managed chains implement `IEquatable`, allowing two chains with identical content to be efficiently compared ( + ignoring the `PNext` pointers, but already being confident the `SType` and ordering is correct). They also implement + the equality operator overloads, and `GetHashCode`. + +Open questions: + +- Should we expose 8, 16 or 32 `ManagedChain` classes? +- Do we want to stick with `TChain chain, T1 item1`, or use `T1 item1, T2 item2` ala `Tuple`? +- Although the constructors used by `ManagedChain.Create` and `ManagedChain.Load` could be made `internal`, I don't + propose we do so. Primarily, the main benefit of the static methods is type inference, but, as chain building is + frequently done with defaults then direct constructor access does not have a disadvantage, and can take advantage of + implicit typing when assigning to an already typed field/property. Having both forms available is therefore + convenient. +- The current `Load` methods expect an unmanaged chain that matches the supplied type constraints, and is of the same + length. This is useful, as coders will normally expect a particular chain. We could additionally add more lax `Import` + methods that will import an unmanaged chain into a managed chain by populating any positions with structure types + found in the unmanaged chain, no matter at what position they are found. This is not entirely unreasonable as the + order of chains (after the start) is not fixed in Vulkan, and it will allow importing existing chains where the order + doesn't matter. +- `GetHasCode` current hashes the entire struct's data, except the `PNext` fields. However, a hashcode only needs to + create reasonable separation so a 'sampling' method could be used for increased performance. +- Similar to `Append` and `Truncate` we could also add `Insert` and `Remove` methods, though slightly more complex, as + we'd have to generate multiples of each, it is not difficult to do, for example: + +```csharp +pubilc class ManagedCache ... { + ... + + // There would be of these methods (not too bad to be fair, the worst case would be maxsize -1 as we + // wouldn't add these methods to the largest possible ManagedCache) + public ManagedCache InsertBeforeHead(TChain newHead) {...} + public ManagedCache InsertBeforeItem1(TNew newValue) {...} + public ManagedCache InsertBeforeItem2(TNew newValue) {...} + + // There would be size-2 of these methods (so wouldn't exist on `ManagedCache`) + public ManagedCache RemoveItem1(out T1 removedValue) {...} + + // This is pretty trivial to add (also wouldn't exist on `ManagedCache`) + public ManagedCache Truncate(out T2 removedValue) {...} +} +``` + +# Usage + +## The Any versions + +As with unmanaged chains, the managed chains system includes `Any` versions of all methods. In fact, +the `ManagedChain` constraints are 'loose', that is they only require types to be `IChainable` rather than +requiring the stricter constraints that prevent unrelated chain elements being added, or used as the start of a chain. + +With the exception of the setters on chain items, you cannot manipulate a chain save through the static methods, and the +preferred versions do include the tighter constraints. + +## Instance-Based Methods + +### Creation (Create/CreateAny) + +The following will create a chain starting with `PhysicalDeviceFeatures2`, pointing +to `PhysicalDeviceDescriptorIndexingFeatures` and finishing with a `PhysicalDeviceAccelerationStructureFeaturesKHR` +structure: + +```csharp +using var chain = ManagedChain.Create + ( + default(PhysicalDeviceFeatures2), + default(PhysicalDeviceDescriptorIndexingFeatures), + default(PhysicalDeviceAccelerationStructureFeaturesKhr) + ); + +// Ensure all STypes set correctly +Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); +Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); +Assert.Equal(StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, chain.Item2.SType); + +// Ensure pointers set correctly +Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); +Assert.Equal((nint) chain.Item2Ptr, (nint) chain.Item1.PNext); +Assert.Equal((nint) 0, (nint) chain.Item2.PNext); +``` + +The structures are held in unmanaged memory, preventing movement by the GC, and ensuring that the pointers remain fixed. + +You can also use specify the generic types directly, e.g.: + +```csharp +using var chain = ManagedChain.Create< + DeviceCreateInfo, + PhysicalDeviceFeatures2, + PhysicalDeviceDescriptorIndexingFeatures>(); +``` + +### Modifying values (Head/Item# properties) + +We can easily modify any value in the `ManagedChain`, and it will maintain the pointers automatically. You do this using +the `Head` property, or one of the `Item#` properties (e.g. `Item1`), for example: + +```csharp +using var chain = ManagedChain.Create< + DeviceCreateInfo, + PhysicalDeviceFeatures2, + PhysicalDeviceDescriptorIndexingFeatures>(); + +// Ensure all STypes set correctly +Assert.Equal(StructureType.DeviceCreateInfo, chain.Head.SType); +Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Item1.SType); +Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item2.SType); + +// Ensure pointers set correctly +Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); +Assert.Equal((nint) chain.Item2Ptr, (nint) chain.Item1.PNext); +Assert.Equal((nint) 0, (nint) chain.Item2.PNext); + +Assert.Equal(0U, chain.Head.Flags); + +var headPtr = chain.HeadPtr; + +// Get the current head (this is a copy) +var head = chain.Head; +// Update the flags +head.Flags = 1U; +// Update the chain +chain.Head = head; + +Assert.Equal(1U, chain.Head.Flags); + +// The head ptr should not change, as we overwrite the same memory location with the new value +Assert.Equal((nint) headPtr, (nint) chain.HeadPtr); +// But the next pointer should not change +Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); +``` + +**Note** When we update any item in the chain it overwrites the existing memory, so the pointers remain fixed. It also +ensures the `PNext` value pointing to it is maintained. + +## Extension Methods + +### Appending to a chain (Append/AppendAny) + +You can call `Append` on a `ManagedChain` (of length < 16) to efficiently create a new, larger, `ManagedChain` with a +new item appended to the end, e.g: + +```csharp +using var chain = ManagedChain.Create( + item1: new PhysicalDeviceDescriptorIndexingFeatures {ShaderInputAttachmentArrayDynamicIndexing = true}); + +// The new chain, will efficiently copy the old chain and append a new structure to the end +using var newChain = chain.Append(); +// You will usualy wish to dispose the old chain here, the two chains are now independent of each other. + +// Check the flag from the first chain is still set in the new chain. +Assert.True(newChain.Item1.ShaderInputAttachmentArrayDynamicIndexing); +``` + +**Note** As a `ManagedChain` holds a block of unmanaged memory, it must be [disposed manually](#disposal) when it is +finished with, when using the `Append` method you will produce a new `ManagedChain` and should not forget to dispose the +original if it is no longer needed. + +### Truncating (Truncate/TruncateAny) + +Similarly, you can `Truncate` a chain (of length > 1) to get an instance of a smaller chain: + +```csharp +using var chain = ManagedChain.Create(); +using var chain2 = chain.Append(); +// Remove the indexing features we just added (note the out parameter is optional) +using var chain3 = chain2.Truncate(out var indexingFeatures); + +Assert.Equal(1, chain.Count); +Assert.Equal(2, chain2.Count); +Assert.Equal(1, chain3.Count); +``` + +### Duplication (Duplicate/DuplicateAny) + +You can efficiently duplicate a managed chain by calling Duplicate on it: + +```csharp +using var chain = new ManagedChain.Create(); +using var copy = chain.Duplicate(); + +// Test equality +Assert.Equal(chain, copy); +Assert.True(chain == copy); +``` + +**Note** The `copy` is 'equal' to the `chain` until you modify it's contents. + +### Loading from an unmanaged chain (Load/LoadAny) + +If you have created an unmanaged chain and would like to load that into a `ManagedChain` you can use one of the +`ManagedChain.Load` methods: + +```csharp +// Load an unmanaged chain +var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures +{ + ShaderInputAttachmentArrayDynamicIndexing = true +}; +PhysicalDeviceFeatures2 +.Chain(out var unmanagedChain) +.SetNext(ref indexingFeatures) +.AddNext(out PhysicalDeviceAccelerationStructureFeaturesKHR accelerationStructureFeaturesKhr); + +// Loads a new managed chain from an unmanaged chain +using var managedChain = + ManagedChain.Load(out var errors, unmanagedChain); + +// Check we had no loading errors +Assert.Equal(string.Empty, errors); + +// Check the flag still set +Assert.True(managedChain.Item1.ShaderInputAttachmentArrayDynamicIndexing); +``` + +The full version of the `Load` method returns an output parameter `errors` as it's first parameter. The `errors` +parameter will be `string.Empty` if there are no errors, otherwise each line will contain a separate error for each +issue found during loading. There is also an overload that accepts a single argument `chain` for when you don't care if +there are any errors. Either method always succeeds, even if the unmanaged chain doesn't match exactly - for example it +is shorter or longer than the chain being loaded, or if the managed chain has different structure types in any of the +positions. Any structure type in the expected position will always be loaded into the new `ManagedChain`. + +```csharp +var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures +{ + ShaderInputAttachmentArrayDynamicIndexing = true +}; +// Load an unmanaged chain +DeviceCreateInfo + .Chain(out var unmanagedChain) + .AddNext(out PhysicalDeviceFeatures2 features2) + .SetNext(ref indexingFeatures) + .AddNext(out PhysicalDeviceAccelerationStructureFeaturesKHR accelerationStructureFeaturesKhr); + +// Loads a new managed chain from an unmanaged chain +using var managedChain = + new ManagedChain< + DeviceCreateInfo, + // Note we are supplied a PhysicalDeviceFeatures2 here from the unmanaged chain + PhysicalDeviceAccelerationStructureFeaturesKHR, + PhysicalDeviceDescriptorIndexingFeatures, + PhysicalDeviceAccelerationStructureFeaturesKHR, + // Note that the unmanaged chain did not supply a 5th entry + PhysicalDeviceFeatures2>(out var errors, unmanagedChain ); + +// Check for errors +Assert.Equal( +@"The unmanaged chain has a structure type PhysicalDeviceFeatures2Khr at position 2; expected PhysicalDeviceAccelerationStructureFeaturesKhr +The unmanaged chain was length 4, expected length 5", + errors); + +// Despite the errors indexing features was at the right location so was loaded +Assert.True(managedChain.Item2.ShaderInputAttachmentArrayDynamicIndexing); +``` + +Notice that the above form uses the equivalent constructor as an alternative to the `Load` method. There is no +equivalent constructor to `Load(TChain)` as that would be ambiguous. + +## Additional interfaces + +### IReadOnlyList + +All the fully generic `ManageChain` types extend `ManagedChain` which implements `IDisposable` +and `IReadOnlyList`. The latter allowing for easy consumption of any `ManagedChain`, e.g.: + +```csharp +using var chain = new ManagedChain(); + +Assert.Equal(3, chain.Count); + +// Ensure all STypes set correctly using indexer +Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain[0].StructureType()); +Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain[1].StructureType()); +Assert.Equal(StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, chain[2].StructureType()); + +Assert.Throws(() => chain[3]); + +// Get array using IEnumerable implementation +IChainable[] structures = chain.ToArray(); + +// Check concrete types +Assert.IsType(structures[0]); +Assert.IsType(structures[1]); +Assert.IsType(structures[2]); +``` + +### Equality (IEquatable<T>) + +ll the fully generic `ManageChain` types implement the corresponding `IEquatable>` +interface, and equality operators. As well as `GetHashCode`. + +### Deconstruction + +Each `ManageChain` has a corresponding deconstructor for convenience, e.g.: + +```csharp +using var chain = new ManagedChain(); + +var (physicalDeviceFeatures2, indexingFeatures, accelerationStructureFeaturesKhr) = chain; + +// Ensure all STypes set correctly +Assert.Equal(StructureType.PhysicalDeviceFeatures2, physicalDeviceFeatures2.SType); +Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, indexingFeatures.SType); +Assert.Equal(StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, accelerationStructureFeaturesKhr.SType); +``` + +### Disposal (IDisposable) + +As each `ManagedChain` holds the underlying structures in unmanaged memory (to prevent them being moved and their +pointers being invalidated), then it is critical you dispose them; either by calling `Dispose()` or by using a `using` +statement. + +# Proposed API + +## Abstract base class + +The `ManagedChain`, non-generic abstract base class provides an abstract implementation of `IReadOnlyList`, +and defines static `Create` and `Load` methods for each size of chain. + +```csharp + +/// +/// Base class for all Managed Chains. +/// +public abstract unsafe class ManagedChain : IReadOnlyList, IDisposable +{ + /// + /// Gets a pointer to the current head. + /// + public abstract BaseInStructure* HeadPtr { get; } + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public abstract int Size { get; } + + /// + public abstract IEnumerator GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// + public abstract int Count { get; } + + /// + public abstract IChainable this[int index] { get; } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool Equals(object obj) + { + return !ReferenceEquals(null, obj) && + (ReferenceEquals(this, obj) || obj.GetType() == this.GetType() && MemoryEquals((ManagedChain) obj)); + } + + /// + /// Compares the supplied memory block with this one. + /// + protected abstract bool MemoryEquals(ManagedChain other); + + /// + public abstract void Dispose(); + + /// + /// Combines a hashcode with the first part of a slice. + /// + /// + /// + /// + protected static void CombineHash(ref int hashCode, ReadOnlySpan slice) => + hashCode = slice.Length switch + { + < 2 => HashCode.Combine(hashCode, slice[0]), + < 4 => HashCode.Combine(hashCode, MemoryMarshal.Cast(slice)[0]), + < 8 => HashCode.Combine(hashCode, MemoryMarshal.Cast(slice)[0]), + _ => HashCode.Combine(hashCode, MemoryMarshal.Cast(slice)[0]) + }; + + // Skipping methods for `ManagedChain{TChain}` to show more completed example + ... + + /// + /// Creates a new with 2 items. + /// + /// The head of the chain. + /// Item 1. + /// The chain type + /// Type of Item 1. + /// A new with 2 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + => new(head, item1); + + /// + /// Creates a new with 2 items. + /// + /// The head of the chain. + /// Item 1. + /// The chain type + /// Type of Item 1. + /// A new with 2 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + => new(head, item1); + + /// + /// Loads a new with 2 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 2 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 2 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 2 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 2 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 2 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 2 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 2 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 2"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 2"); + existingPtr->PNext = null; + } + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + + // Only showing one example of Create/Load methods + ... +} +``` + +## Concrete generic classes + +A class is generated for each valid size of a chain, here is one example: + +```csharp +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item1Offset + Item1Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 2 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 2 items. + /// + /// The head of the chain. + /// Item 1. + internal ManagedChain(TChain head = default, T1 item1 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + Item1Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + } + + /// + public override int Count => 2; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + public void Deconstruct(out TChain head, out T1 item1) + { + head = Head; + item1 = Item1; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} +``` + +## Extension methods + +A static class is generated to hold the extension methods (showing one example set): + +```csharp + +/// +/// Static class providing extension methods for manipulating managed chains. +/// +/// The `Any` versions of chain methods do not validate that items belong in the chain, this is +/// useful for situations where the specification does not indicate required chain constraints. You should generally +/// try to use the none `Any` version in preference. +public static unsafe class ManagedChainExtensions +{ + ... + + /// + /// Creates a new with 2 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T1 item1 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + => chain.AddAny(item1); + + /// + /// Creates a new with 2 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T1 item1 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 0 + item1.StructureType(); + Marshal.StructureToPtr(item1, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 2 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 2 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 1 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 1 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 1 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T1 item1) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + => chain.TruncateAny(out item1); + + /// + /// Creates a new with 1 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T1 item1) + where TChain : struct, IChainable + where T1 : struct, IChainable + { + // Retrieve last item. + item1 = chain.Item1; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item1Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = null; + return new ManagedChain(newHeadPtr); + } + + ... +} +``` \ No newline at end of file diff --git a/documentation/proposals/Proposal - Vulkan Struct Chaining - #4 Chaining Metadata extensions.md b/documentation/proposals/Proposal - Vulkan Struct Chaining - #4 Chaining Metadata extensions.md new file mode 100644 index 0000000000..5a1153fcfb --- /dev/null +++ b/documentation/proposals/Proposal - Vulkan Struct Chaining - #4 Chaining Metadata extensions.md @@ -0,0 +1,393 @@ +# Summary + +**_This proposal is dependent +on [Proposal - Vulkan Struct Chaining - #2 Unmanaged Chaining](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%232%20Unmanaged%20Chaining.md) +._** + +Having extended `BuildTools` to make use of the `structextends` attribute, as part of +the [unmanaged chaining proposal](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%232%20Unmanaged%20Chaining.md) +it is possible to supply that metadata in a ready form for use by consumers of the library, without them needing to +resort to reflection. + +There are a number of potential use cases, most specifically validating that a supply `IChainable` structure is valid +for a given chain, at runtime. To facilitate the most common scenario 4 extension methods are also added. + +# Contributors + +- [Craig Dean, DevDecoder](https://github.com/thargy) + +# Current Status + +- [x] Proposed +- [ ] Discussed with API Review Board (ARB) +- [ ] Approved +- [ ] Implemented + +# Design Decisions + +- It is possible to get the same information presented statically by this proposal by creative use of reflection, + however, it is non-trivial and costly to do so. +- When combined with the + [Proposal - Vulkan Struct Chaining - #3 Managed Chaining](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%233%20Managed%20Chaining.md) + the above functionality makes handling of non-generic chains at runtime significantly easier, which is great for + library writers. +- Though 4 collections are proposed, they are grouped in pairs, providing two-way mapping. It is possible to only + provide one of each pair, and leave the reversal to the consumer, though that would make the extension methods + impractical. +- As .Net Standard 2.0 does not support `IReadOnlySet` we make use of the `IReadOnlyCollection` interface. + +# Proposed API + +## Auto-generated Metadata Structures + +The `Extensions` dictionary is added to the `Chain` extensions class from +the [unmanaged chaining proposal](Proposal%20-%20Vulkan%20Struct%20Chaining%20-%20%232%20Unmanaged%20Chaining.md) +for discoverability. It is a direct mapping of the `structextends` attribute, and is therefore trivial to generate. +Below is a cut down example to illustrate what will be generated: + +```csharp +public static class Chain : IChainable +{ + ... + /// + /// Provides a set of all the s that can be extended by a . + /// + public static readonly IReadOnlyDictionary> Extensions = + new Dictionary> + { + [StructureType.PhysicalDeviceFeatures2] = new HashSet + { + StructureType.DeviceCreateInfo + }, + [StructureType.PhysicalDeviceDescriptorIndexingFeatures] = new HashSet + { + StructureType.PhysicalDeviceFeatures2, + StructureType.DeviceCreateInfo + }, + [StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr] = new HashSet + { + StructureType.PhysicalDeviceFeatures2, + StructureType.DeviceCreateInfo + }, + ... + }; +} +``` + +## Extenders (Optional) + +By contrast the `Extenders` dictionary, it the reverse mapping of the `Extensions` dictionary, providing quick reverse +lookup. As this is slightly more complex to generate, it could be left to the consumer (who can generate it easily +from `Extensions` when needed). + +```csharp +public struct Chain : IChainable +{ + ... + /// + /// Provides a set of all the s that can extend a . + /// + public static readonly IReadOnlyDictionary> Extenders = + new Dictionary> + { + [StructureType.DeviceCreateInfo] = new HashSet + { + StructureType.PhysicalDeviceFeatures2, StructureType.PhysicalDeviceDescriptorIndexingFeatures, + StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr + }, + [StructureType.PhysicalDeviceFeatures2] = new HashSet + { + StructureType.PhysicalDeviceDescriptorIndexingFeatures, + StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr + }, + ... + }; +} +``` + +### ClrTypes + +The `ClrTypes` dictionary provides a `ClrType` for each `StructureType`, it is trivial to generate with existing +information: + +```csharp +public struct Chain : IChainable +{ + ... + /// + /// Provides a mapping from the to the corresponding . + /// + public static readonly IReadOnlyDictionary ClrTypes = + new Dictionary + { + [StructureType.DeviceCreateInfo] = typeof(DeviceCreateInfo), + [StructureType.PhysicalDeviceFeatures2] = typeof(PhysicalDeviceFeatures2), + [StructureType.PhysicalDeviceDescriptorIndexingFeatures]= typeof(PhysicalDeviceDescriptorIndexingFeatures), + [StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr] = typeof(PhysicalDeviceAccelerationStructureFeaturesKhr), + ... + }; +} +``` + +### StructureTypes (Optional) + +The `StructureTypes` is the reverse mapping of `ClrTypes` and is likewise trivial to generate. + +```csharp +public struct Chain : IChainable +{ + ... + /// + /// Provides a mapping from the to the corresponding . + /// + public static readonly IReadOnlyDictionary StructureTypes = + new Dictionary + { + [typeof(DeviceCreateInfo)] = StructureType.DeviceCreateInfo, + [typeof(PhysicalDeviceFeatures2)] = StructureType.PhysicalDeviceFeatures2, + [typeof(PhysicalDeviceDescriptorIndexingFeatures)]= StructureType.PhysicalDeviceDescriptorIndexingFeatures, + [typeof(PhysicalDeviceAccelerationStructureFeaturesKhr)] = StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr + ... + }; +} +``` + +## Extension Methods + +The following extension methods are not auto-generated and so can be added simply. + +### ClrType() + +Gets the corresponding `ClrType` for a `StructureTYpe`. + +```csharp +public static class Chain +{ + ... + /// + /// Gets the corresponding for a , if any. + /// + /// The structure type. + /// The corresponding for , if any; otherwise, + /// . + public static Type ClrType(this StructureType structureType) + { + return Chain.ClrTypes[structureType]; + } +} +``` + +Usage: + +```csharp +Assert.Equal(typeof(DeviceCreateInfo), StructureType.DeviceCreateInfo.ClrType()); +``` + +### StructureType() (Optional) + +Gets the corresponding `ClrType` for a `StructureTYpe`. + +```csharp +public static class Chain +{ + ... + /// + /// Gets the corresponding for a , if any. + /// + /// The CLR type. + /// The corresponding for , if any; otherwise, + /// . + public static StructureType? StructureType(this Type type) + { + return Chain.StructureTypes.TryGetValue(type, out var structureType) ? structureType : null; + } +} +``` + +Usage: + +```csharp +Assert.Equal(StructureType.DeviceCreateInfo, typeof(DeviceCreateInfo).StructureType()); +Assert.Null(typeof(PhysicalDeviceFeatures).StructureType()); +``` + +### IsChainStart() + +Tests whether the `StructureType` or `Type` can be used at the start of a chain: + +```csharp +public static class Chain +{ + ... + /// + /// Whether the can start a chain. + /// + /// The to test. + /// if the can start a chain; otherwise + /// . + public static bool IsChainStart(this StructureType type) + { + return Chain.Extenders.ContainsKey(type); + } + + /// + /// Whether the can start a chain. + /// + /// The to test. + /// if the can start a chain; otherwise + /// . + public static bool IsChainStart(this Type type) + { + return Chain.StructureTypes.TryGetValue(type, out var structureType) && + Chain.Extenders.ContainsKey(structureType); + } +} +``` + +Usage: + +```csharp +Assert.True(StructureType.DeviceCreateInfo.IsChainStart()); +Assert.True(typeof(DeviceCreateInfo).IsChainStart()); +Assert.False(StructureType.PhysicalDeviceDescriptorIndexingFeatures.IsChainStart()); +Assert.False(typeof(PhysicalDeviceDescriptorIndexingFeatures).IsChainStart()); +``` + +### IsChainable() + +Tests whether the `StructureType` or `Type` can be used in a chain: + +```csharp +public static class Chain +{ + ... + /// + /// Whether the is chainable. + /// + /// The to test. + /// if the can start a chain; otherwise + /// . + public static bool IsChainable(this StructureType type) + { + return Chain.Extenders.ContainsKey(type) || + Chain.Extensions.ContainsKey(type); + } + + /// + /// Whether the is chainable. + /// + /// The to test. + /// if the can start a chain; otherwise + /// . + public static bool IsChainable(this Type type) + { + return Chain.StructureTypes.TryGetValue(type, out var structureType) && + (Chain.Extenders.ContainsKey(structureType) || Chain.Extensions.ContainsKey(structureType)); + } +} +``` + +Usage: + +```csharp +Assert.True(StructureType.DeviceCreateInfo.IsChainable()); +Assert.True(typeof(DeviceCreateInfo).IsChainable()); +Assert.True(StructureType.PhysicalDeviceDescriptorIndexingFeatures.IsChainable()); +Assert.True(typeof(PhysicalDeviceDescriptorIndexingFeatures).IsChainable()); +``` + +### CanExtend() + +Tests whether the `StructureType` or `Type` can extend the corresponding type: + +```csharp +public static class Chain +{ + ... + + /// + /// Whether the current can extend the . + /// + /// The to test. + /// The of the chain. + /// if the can extend the ; otherwise, false. + /// + public static bool CanExtend(this StructureType next, StructureType chain) + { + return Chain.Extensions.TryGetValue(next, out var extensions) && extensions.Contains(chain); + } + + /// + /// Whether the current can extend the . + /// + /// The to test. + /// The of the chain. + /// if the can extend the ; otherwise, false. + /// + public static bool CanExtend(this Type next, Type chain) + { + return + Chain.StructureTypes.TryGetValue(next, out var nextType) && + Chain.StructureTypes.TryGetValue(chain, out var chainType) && + Chain.Extensions.TryGetValue(nextType, out var extensions) && + extensions.Contains(chainType); + } +} +``` + +Usage: + +```csharp +Assert.True(StructureType.PhysicalDeviceFeatures2.CanExtend(StructureType.DeviceCreateInfo)); +Assert.False(StructureType.DeviceCreateInfo.CanExtend(StructureType.PhysicalDeviceFeatures2)); +Assert.True(typeof(PhysicalDeviceFeatures2).CanExtend(typeof(DeviceCreateInfo))); +Assert.False(typeof(DeviceCreateInfo).CanExtend(typeof(PhysicalDeviceFeatures2))); +``` + +### CanBeExtendedBy() + +Tests whether the `StructureType` or `Type` can be extended by the corresponding type: + +```csharp +public static class Chain +{ + ... + + /// + /// Whether the current can be extended by the . + /// + /// The of the chain. + /// The to test. + /// if the can be extended the ; otherwise, false. + /// + public static bool CanBeExtendedBy(this StructureType chain, StructureType next) + { + return Chain.Extenders.TryGetValue(chain, out var extenders) && extenders.Contains(next); + } + + /// + /// Whether the current can be extended by the . + /// + /// The of the chain. + /// The to test. + /// if the can extend the ; otherwise, false. + /// + public static bool CanBeExtendedBy(this Type chain, Type next) + { + return + Chain.StructureTypes.TryGetValue(next, out var nextType) && + Chain.StructureTypes.TryGetValue(chain, out var chainType) && + Chain.Extenders.TryGetValue(chainType, out var extenders) && + extenders.Contains(nextType); + } +} +``` + +Usage: + +```csharp +Assert.False(StructureType.PhysicalDeviceFeatures2.CanBeExtendedBy(StructureType.DeviceCreateInfo)); +Assert.True(StructureType.DeviceCreateInfo.CanBeExtendedBy(StructureType.PhysicalDeviceFeatures2)); +Assert.False(typeof(PhysicalDeviceFeatures2).CanBeExtendedBy(typeof(DeviceCreateInfo))); +Assert.True(typeof(DeviceCreateInfo).CanBeExtendedBy(typeof(PhysicalDeviceFeatures2))); +``` \ No newline at end of file diff --git a/src/Core/Silk.NET.BuildTools/Bind/ProjectWriter.cs b/src/Core/Silk.NET.BuildTools/Bind/ProjectWriter.cs index 24932a3493..bb2f589938 100644 --- a/src/Core/Silk.NET.BuildTools/Bind/ProjectWriter.cs +++ b/src/Core/Silk.NET.BuildTools/Bind/ProjectWriter.cs @@ -1,6 +1,8 @@ // 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.Collections.Generic; using System.IO; using System.Linq; using Silk.NET.BuildTools.Common; @@ -9,6 +11,30 @@ namespace Silk.NET.BuildTools.Bind { public static class ProjectWriter { + /// + /// Creates a unique file name (that doesn't already exist), preventing clashes of names with different cases on + /// case insensitive filesystems. + /// + /// The name (goes before any disambiguator) + /// The extension (goes after any disambiguator) + /// Any number of directory segements + /// A unique filename. + private static string GetFileName(string name, string ext, params string[] directories) + { + var count = 1; + string filename; + Array.Resize(ref directories, directories.Length + 1); + var nameIndex = directories.Length - 1; + do + { + directories[nameIndex] = $"{name}{(count > 1 ? count.ToString() : "")}{ext}"; + filename = Path.Combine(directories); + count++; + } while (File.Exists(filename)); + + return filename; + } + /// /// Writes this project in the given folder, with the given settings and parent subsystem. /// @@ -38,14 +64,16 @@ public static void Write(this Project project, string folder, Profile profile, B ( x => x.WriteStruct ( - Path.Combine(folder, ProfileWriter.StructsSubfolder, $"{x.Name}.gen.cs"), profile, project, task + GetFileName(x.Name, ".gen.cs", folder, ProfileWriter.StructsSubfolder), profile, project, task ) ); project.Enums.ForEach ( x => x.WriteEnum - (Path.Combine(folder, ProfileWriter.EnumsSubfolder, $"{x.Name}.gen.cs"), profile, project, task) + ( + GetFileName(x.Name, ".gen.cs", folder, ProfileWriter.EnumsSubfolder), profile, project, task + ) ); project.WriteMixedModeClasses(profile, folder, task); diff --git a/src/Core/Silk.NET.BuildTools/Bind/StructWriter.cs b/src/Core/Silk.NET.BuildTools/Bind/StructWriter.cs index 4d5c5b8f1b..68b595d906 100644 --- a/src/Core/Silk.NET.BuildTools/Bind/StructWriter.cs +++ b/src/Core/Silk.NET.BuildTools/Bind/StructWriter.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; @@ -27,10 +27,11 @@ public static class StructWriter /// The file to write to. /// The subsystem containing this enum. /// The project containing this enum. + /// The bind state. public static void WriteStruct (this Struct @struct, string file, Profile profile, Project project, BindState task) { - if (@struct.Attributes.IsBuildToolsIntrinsic(out var args)) + if (@struct.Attributes.IsBuildToolsIntrinsic(out var args) && args.FirstOrDefault() == "$PFN") { WriteBuildToolsIntrinsic(@struct, file, profile, project, task, args); return; @@ -47,14 +48,53 @@ public static void WriteStruct sw.WriteLine($"namespace {ns}{project.Namespace}"); sw.WriteLine("{"); string guid = null; - + static bool IsChar(Type type) => type.Name == "char" || type.GenericTypes.Any(IsChar); var needsCharSetFixup = @struct.Fields.Any(x => IsChar(x.Type)); - + string structuredType = null; + var isChainable = false; + // Which chain this struct extends + IReadOnlyList chainExtensions = null; + // Which chain extend the current struct + IReadOnlyList chainExtenderss = null; + IReadOnlyList aliases = null; + string aliasOf = null; + foreach (var attr in @struct.Attributes) { if (attr.Name == "BuildToolsIntrinsic") { + if (attr.Arguments.Count > 0) + { + switch (attr.Arguments[0]) + { + case "$VKSTRUCTUREDTYPE": + structuredType = attr.Arguments.Count > 1 ? attr.Arguments[1] : null; + break; + case "$VKCHAINABLE": + isChainable = true; + break; + case "$VKEXTENDSCHAIN": + chainExtensions = attr.Arguments.Count > 1 ? attr.Arguments.Skip(1).ToArray() : null; + break; + case "$VKCHAINSTART": + chainExtenderss = attr.Arguments.Count > 1 ? attr.Arguments.Skip(1).ToArray() : null; + break; + case "$VKALIASOF": + aliasOf = attr.Arguments.Count > 1 ? attr.Arguments[1] : null; + break; + case "$VKALIASES": + aliases = attr.Arguments.Count > 1 ? attr.Arguments.Skip(1).ToArray() : null; + break; + default: + Console.WriteLine + ( + $"Unexpected build intrinsic attribute '{attr.Arguments[0]}' on '{@struct.Name}' struct!" + ); + break; + } + } + continue; } @@ -72,13 +112,51 @@ public static void WriteStruct sw.WriteLine($" {attr}"); } + // Build interface list + var interfaces = new List(); + if (chainExtenderss?.Any() == true) + { + interfaces.Add("IChainStart"); + } + + interfaces.AddRange + ( + chainExtensions?.Select(e => $"IExtendsChain<{e}>") ?? + Array.Empty() + ); + if (!interfaces.Any()) + { + // We only need to add these interfaces if a descendant not already added above. + if (isChainable) + { + interfaces.Add("IChainable"); + } + else if (structuredType is not null) + { + interfaces.Add("IStructuredType"); + } + } + if (needsCharSetFixup) { sw.WriteLine(" [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]"); } sw.WriteLine($" [NativeName(\"Name\", \"{@struct.NativeName}\")]"); - sw.WriteLine($" public unsafe partial struct {@struct.Name}"); + if (!string.IsNullOrWhiteSpace(aliasOf)) + { + sw.WriteLine($" [NativeName(\"AliasOf\", \"{aliasOf}\")]"); + } + + if (aliases is not null) + { + sw.WriteLine($" [NativeName(\"Aliases\", \"{string.Join(", ", aliases)}\")]"); + } + + sw.WriteLine + ( + $" public unsafe partial struct {@struct.Name}{(interfaces.Any() ? " : " + string.Join(", ", interfaces) : string.Empty)}" + ); sw.WriteLine(" {"); if (guid is not null) { @@ -214,7 +292,8 @@ public static void WriteStruct } else if (structField.NumBits is not null) { - WriteBitfield(structField, ref bitfieldIdx, ref bitfieldPsz, ref bitfieldRbs, ref bitfieldLbt, sw, profile); + WriteBitfield + (structField, ref bitfieldIdx, ref bitfieldPsz, ref bitfieldRbs, ref bitfieldLbt, sw, profile); } else if (!(structField.Count is null)) { @@ -347,7 +426,7 @@ public static void WriteStruct } foreach (var function in @struct.Functions.Concat - (ComVtblProcessor.GetHelperFunctions(@struct, profile.Projects["Core"]))) + (ComVtblProcessor.GetHelperFunctions(@struct, profile.Projects["Core"]))) { using (var sr = new StringReader(function.Signature.Doc)) { @@ -364,7 +443,7 @@ public static void WriteStruct } using (var sr = new StringReader - (function.Signature.ToString(null, accessibility: true, semicolon: false))) + (function.Signature.ToString(null, accessibility: true, semicolon: false))) { string line; while ((line = sr.ReadLine()) != null) @@ -383,6 +462,89 @@ public static void WriteStruct sw.WriteLine(); } + if (structuredType is not null) + { + sw.WriteLine + ( + @" + /// " + ); + if (structuredType.Length < 1) + { + sw.WriteLine(" /// Note, there is no fixed value for this type."); + } + + sw.Write + ( + @" StructureType IStructuredType.StructureType() + { + return SType" + ); + if (structuredType.Length > 0) + { + sw.Write(" = "); + sw.Write(structuredType); + } + + sw.WriteLine + ( + @"; + }" + ); + + + if (isChainable) + { + // Correct for none void* or BaseInStructure* PNext + var pNextType = @struct.Fields.FirstOrDefault(f => f.Name == "PNext")?.Type.Name ?? "void"; + string getCast, setCast; + switch (pNextType) + { + case "void": + getCast = "(BaseInStructure*) "; + setCast = ""; + break; + case "BaseInStructure": + getCast = setCast = ""; + break; + default: + getCast = "(BaseInStructure*) "; + setCast = $"({pNextType}*) "; + break; + + } + sw.WriteLine + ( + @$" + /// + unsafe BaseInStructure* IChainable.PNext + {{ + get => {getCast}PNext; + set => PNext = {setCast}value; + }}" + ); + } + + if (chainExtenderss?.Any() == true && structuredType.Length > 0) + { + sw.WriteLine + ( + @$" + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref {@struct.Name} Chain( + out {@struct.Name} capture) + {{ + capture = new {@struct.Name}({structuredType}); + return ref capture; + }}" + ); + } + } + sw.WriteLine(" }"); sw.WriteLine("}"); sw.Flush(); @@ -395,7 +557,9 @@ public static void WriteBuildToolsIntrinsic if (args[0] == "$PFN") { WriteFunctionPointerWrapper - (@struct, file, profile, project, task, args[1], args[2], Enum.Parse(args[3])); + ( + @struct, file, profile, project, task, args[1], args[2], Enum.Parse(args[3]) + ); } else { @@ -468,7 +632,8 @@ CallingConvention conv sw.WriteLine($" => SilkMarshal.PtrToDelegate<{delegateName}>(pfn);"); sw.WriteLine(); sw.WriteLine($" public static implicit operator {fnPtrSig}({pfnName} pfn) => pfn.Handle;"); - sw.WriteLine($" public static implicit operator {pfnName}({fnPtrSig} ptr) => new {pfnName}(ptr);"); + sw.WriteLine + ($" public static implicit operator {pfnName}({fnPtrSig} ptr) => new {pfnName}(ptr);"); sw.WriteLine(" }"); sw.WriteLine(); // type.FunctionPointerSignature.Name = delegateName; @@ -476,7 +641,10 @@ CallingConvention conv // type.Name = type.FunctionPointerSignature.NativeName; // type.IndirectionLevels--; using (var sr = new StringReader - (type.FunctionPointerSignature.ToString(null, @delegate: true, semicolon: true, accessibility: true))) + ( + type.FunctionPointerSignature.ToString + (null, @delegate: true, semicolon: true, accessibility: true) + )) { string line; while ((line = sr.ReadLine()) != null) @@ -490,7 +658,8 @@ CallingConvention conv sw.Flush(); } - public static void WriteFusedField(Struct @struct, Project p, Field field, List args, StreamWriter sw) + public static void WriteFusedField + (Struct @struct, Project p, Field field, List args, StreamWriter sw) { var temporaryValue = IsTemporaryValue(p, @struct, args); if (!temporaryValue) @@ -519,7 +688,8 @@ public static void WriteFusedField(Struct @struct, Project p, Field field, List< static bool IsTemporaryValue(Project p, Struct @struct, List args) { // ReSharper disable AccessToModifiedClosure - var fusingStruct = p.Structs.First(x => x.Name == @struct.Fields.First(y => y.Name == args[1]).Type.Name); + var fusingStruct = p.Structs.First + (x => x.Name == @struct.Fields.First(y => y.Name == args[1]).Type.Name); var fusingFieldInst = fusingStruct.Fields.First(x => x.Name == args[2]); if (fusingFieldInst.NumBits is not null) { @@ -609,7 +779,8 @@ Profile profile } var bitfieldOffset = currentSize * 8 - remainingBits; - var bitwidthHexStringBacking = ((1 << fieldDecl.NumBits.Value) - 1).ToString("X") + typeNameBacking switch + var bitwidthHexStringBacking = ((1 << fieldDecl.NumBits.Value) - 1).ToString + ("X") + typeNameBacking switch { "byte" => string.Empty, "sbyte" => string.Empty, diff --git a/src/Core/Silk.NET.BuildTools/Common/Attribute.cs b/src/Core/Silk.NET.BuildTools/Common/Attribute.cs index 377d89b047..aa78182f00 100644 --- a/src/Core/Silk.NET.BuildTools/Common/Attribute.cs +++ b/src/Core/Silk.NET.BuildTools/Common/Attribute.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Linq; using System.Text; namespace Silk.NET.BuildTools.Common @@ -39,5 +40,18 @@ public override string ToString() sb.Append(")]"); return sb.ToString(); } + + /// + /// Clones this attribute. + /// + /// A copy. + public Attribute Clone() + { + return new Attribute + { + Name = Name, + Arguments = Arguments.ToList() + }; + } } } diff --git a/src/Core/Silk.NET.BuildTools/Common/Struct.cs b/src/Core/Silk.NET.BuildTools/Common/Struct.cs index a9d643963c..6223bcf846 100644 --- a/src/Core/Silk.NET.BuildTools/Common/Struct.cs +++ b/src/Core/Silk.NET.BuildTools/Common/Struct.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Linq; using Newtonsoft.Json; using Silk.NET.BuildTools.Common.Functions; using Silk.NET.BuildTools.Common.Structs; @@ -18,30 +19,31 @@ public class Struct : IProfileConstituent /// The name of the struct. /// public string Name { get; set; } - + /// /// The name of the struct in the native library. /// public string NativeName { get; set; } - + /// /// The extension name. /// public string ExtensionName { get; set; } + [JsonIgnore] public string ProfileName { get; set; } [JsonIgnore] public Version ProfileVersion { get; set; } [JsonIgnore] public string[] ClangMetadata { get; set; } - + /// /// A list of fields this struct contains. /// public List Fields { get; set; } = new List(); - + /// /// A list of attributes this struct has. /// public List Attributes { get; set; } = new List(); - + /// /// A list of functions this struct has. /// @@ -51,7 +53,7 @@ public class Struct : IProfileConstituent /// A list of functions contained in the LpVtbl field. /// public List Vtbl { get; set; } = new List(); - + /// /// A list of interface names which this interface inherits. /// @@ -61,5 +63,34 @@ public class Struct : IProfileConstituent /// This struct's UUID attribute. /// public Guid? Uuid { get; set; } + + /// + /// Creates an alias of this structure, by cloning it. + /// + /// The alias name. + /// A copy of this instance. + public Struct Clone(string alias = null, string nativeAlias = null) + { + return new Struct + { + Name = alias ?? Name, + // These properties can simply be copied. + NativeName = nativeAlias ?? NativeName, + ExtensionName = ExtensionName, + ProfileName = ProfileName, + ProfileVersion = ProfileVersion, + Uuid = Uuid, + // WARNING these aren't deep clones so modifying any will modify the alias + // This is by design as an alias should not differ in any of these ways, and it means + // that modifying the source or the alias will affect both, which is desirable. + ClangMetadata = ClangMetadata, + Fields = Fields, + Functions = Functions, + Vtbl = Vtbl, + ComBases = ComBases, + // Deep clone, as we often want different attributes on an alias + Attributes = Attributes.Select(a => a.Clone()).ToList() + }; + } } -} \ No newline at end of file +} diff --git a/src/Core/Silk.NET.BuildTools/Converters/Khronos/StructureDefinition.cs b/src/Core/Silk.NET.BuildTools/Converters/Khronos/StructureDefinition.cs index 1de1946f5d..af3f9cae25 100644 --- a/src/Core/Silk.NET.BuildTools/Converters/Khronos/StructureDefinition.cs +++ b/src/Core/Silk.NET.BuildTools/Converters/Khronos/StructureDefinition.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Linq; using System.Xml.Linq; @@ -7,39 +8,57 @@ namespace Silk.NET.BuildTools.Converters.Khronos public class StructureDefinition { public string Name { get; } + + /// + /// The alias holds the concrete structure definition's name. + /// + public string Alias { get; } public MemberSpec[] Members { get; } + public IReadOnlyList Extends { get; } - public StructureDefinition(string name, MemberSpec[] members) + public StructureDefinition(string name, string alias, MemberSpec[] members, string extends) { Name = name; + Alias = alias; Members = members; + Extends = string.IsNullOrWhiteSpace(extends) + ? Array.Empty() + : extends.Split(',', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries); } public static StructureDefinition CreateFromXml(XElement xe) { Require.NotNull(xe); + var name = xe.GetNameAttribute(); - if (!(xe.Attribute("alias") is null)) + // Find original definition if this is an alias (this should usually be one step, but we handle gracefully) + var aliases = new HashSet { name }; + string alias = null; + string a; + while ((a = xe.Attribute("alias")?.Value) is not null) { - var ret = CreateFromXml - ( - xe.Document.Element("registry") - .Elements("types") - .Elements("type") - .Where(typex => typex.HasCategoryAttribute("struct")) - .FirstOrDefault(x => x.GetNameAttribute() == xe.Attribute("alias").Value) ?? throw new Exception("wat") - ); - - return new StructureDefinition(xe.GetNameAttribute(), ret.Members); + alias = a; + if (aliases.Contains(alias)) + { + throw new Exception($"A loop of aliases was found as we have seen the '{alias}' alias before."); + } + aliases.Add(alias); + + xe = xe.Document.Element("registry") + .Elements("types") + .Elements("type") + .Where(typex => typex.HasCategoryAttribute("struct")) + .FirstOrDefault(x => x.GetNameAttribute() == alias) ?? + throw new Exception($"Could not find the '{alias}' alias."); } - var name = xe.GetNameAttribute(); var members = xe.Elements ("member") .Where(x => !(x.Element("name") is null)) .Select(memberx => MemberSpec.CreateFromXml(memberx)) .ToArray(); - return new StructureDefinition(name, members); + var extends = xe.Attribute("structextends")?.Value; + return new StructureDefinition(name, alias, members, extends); } public override string ToString() diff --git a/src/Core/Silk.NET.BuildTools/Converters/Readers/VulkanReader.cs b/src/Core/Silk.NET.BuildTools/Converters/Readers/VulkanReader.cs index 923bdf914a..54198304d6 100644 --- a/src/Core/Silk.NET.BuildTools/Converters/Readers/VulkanReader.cs +++ b/src/Core/Silk.NET.BuildTools/Converters/Readers/VulkanReader.cs @@ -55,47 +55,246 @@ private Dictionary ConvertStructs(VulkanSpecification spec, Bind { var prefix = task.FunctionPrefix; var ret = new Dictionary(); + + // Gets all aliases of a struct, no matter where in an alias chain we start + // Note this could be simpler if we just assume we only need to check $VKALIASES, but this + // version is bombproof. + IReadOnlyList GetAllAliasesFromName(string structName) + { + var todo = new Queue(); + todo.Enqueue(structName); + var result = new Dictionary(); + + while (todo.Any()) + { + structName = todo.Dequeue(); + if (!ret.TryGetValue(structName, out var s)) + { + result[structName] = null; + continue; + } + + result[structName] = s; + + // Get any aliases + var aliasOf = s.Attributes + .FirstOrDefault + ( + a => a.Arguments.Count > 1 && a.Name == "BuildToolsIntrinsic" && + a.Arguments[0] == "$VKALIASOF" + ) + ?.Arguments[1]; + if (!string.IsNullOrWhiteSpace(aliasOf) && !result.ContainsKey(aliasOf)) + { + todo.Enqueue(aliasOf); + } + + // Check other way as well + foreach (var a in s.Attributes + .FirstOrDefault + ( + a => a.Arguments.Count > 1 && a.Name == "BuildToolsIntrinsic" && + a.Arguments[0] == "$VKALIASES" + ) + ?.Arguments + .Skip(1) + .Where(a => !string.IsNullOrWhiteSpace(a) && !result.ContainsKey(a)) + .ToArray() + ?? Array.Empty()) + { + todo.Enqueue(a); + } + } + + return result.Values.Where(s => s is not null).ToList(); + } + + // Opposite way round lookup of what aliases exist for this key-struct + // i.e. if VkB is an alias of VkA, and VkC is an alias of VkA, then aliases has [VkA]={VkB,VkC} + var aliases = new Dictionary>(); + // Holds any chain starts for chains we haven't seen yet (should rarely be needed). + var chainExtensions = new List<(Struct, IReadOnlyList)>(); foreach (var s in spec.Structures) { - ret.Add - ( - s.Name, new Struct + // Build aliases dictionary + if (!string.IsNullOrWhiteSpace(s.Alias)) + { + if (!aliases.TryGetValue(s.Alias, out var aList)) { - Fields = s.Members.Select - ( - x => new Field - { - Count = string.IsNullOrEmpty(x.ElementCountSymbolic) - ? x.ElementCount != 1 ? new Count(x.ElementCount) : null - : new Count(x.ElementCountSymbolic, false), - Name = Naming.Translate(TrimName(x.Name, task), prefix), - Doc = $"/// {x.Comment}", - NativeName = x.Name, - NativeType = x.Type.ToString(), - Type = ConvertType(x.Type), - DefaultAssignment = - (x.Type.Name == "VkStructureType" || x.Type.Name == "XrStructureType") - && !string.IsNullOrWhiteSpace(x.LegalValues) - ? "StructureType." + TryTrim + aList = new(); + aliases[s.Alias] = aList; + } + + aList.Add(s.Name); + continue; + } + + var @struct = new Struct + { + Fields = s.Members.Select + ( + x => new Field + { + Count = string.IsNullOrEmpty(x.ElementCountSymbolic) + ? x.ElementCount != 1 ? new Count(x.ElementCount) : null + : new Count(x.ElementCountSymbolic, false), + Name = Naming.Translate(TrimName(x.Name, task), prefix), + Doc = $"/// {x.Comment}", + NativeName = x.Name, + NativeType = x.Type.ToString(), + Type = ConvertType(x.Type), + DefaultAssignment = + (x.Type.Name == "VkStructureType" || x.Type.Name == "XrStructureType") + && !string.IsNullOrWhiteSpace(x.LegalValues) + ? "StructureType." + TryTrim + ( + Naming.Translate ( - Naming.Translate - ( - TrimName(x.LegalValues.Split(',').FirstOrDefault(), task), - task.FunctionPrefix - ), - Naming.TranslateLite(TrimName("VkStructureType", task), task.FunctionPrefix) - ) - : null, - NumBits = x.NumBits - }.WithFixedFieldFixup09072020() - ) - .ToList(), - Name = Naming.TranslateLite(TrimName(s.Name, task), prefix), - NativeName = s.Name + TrimName(x.LegalValues.Split(',').FirstOrDefault(), task), + task.FunctionPrefix + ), + Naming.TranslateLite(TrimName("VkStructureType", task), task.FunctionPrefix) + ) + : null, + NumBits = x.NumBits + }.WithFixedFieldFixup09072020() + ) + .ToList(), + Name = Naming.TranslateLite(TrimName(s.Name, task), prefix), + NativeName = s.Name + }; + + // Find the STYpe field (and it's position, which is required for IChainable + var (sTypeField, sTypeFieldIndex) = @struct.Fields.Select((f, i) => (Field: f, Index: i)) + .FirstOrDefault(f => f.Field.Name == "SType" && f.Field.Type.Name == "VkStructureType"); + if (sTypeField is not null) + { + @struct.Attributes.Add + ( + new() + { + Name = "BuildToolsIntrinsic", + Arguments = new() {"$VKSTRUCTUREDTYPE", sTypeField.DefaultAssignment ?? string.Empty} + } + ); + + // Ensure SType was in position 0, and we have a pointer called PNext in position 1. + Field pNextField; + if (sTypeFieldIndex == 0 && + @struct.Fields.Count > 1 && + (pNextField = @struct.Fields[1]).Name == "PNext" && + pNextField.Type.IsPointer) + { + // The type is at least chainable. + @struct.Attributes.Add + ( + new() + { + Name = "BuildToolsIntrinsic", + Arguments = new() {"$VKCHAINABLE"} + } + ); + + if (s.Extends.Any()) + { + chainExtensions.Add((@struct, s.Extends)); + } + } + } + + ret.Add(s.Name, @struct); + } + + // Create Aliases + foreach (var (structName, aList) in aliases) + { + if (!ret.TryGetValue(structName, out var @struct)) + { + continue; + } + + foreach (var alias in aList) + { + var aliasStruct = @struct.Clone(Naming.TranslateLite(TrimName(alias, task), prefix), alias); + aliasStruct.Attributes.Add + ( + new() + { + Name = "BuildToolsIntrinsic", + Arguments = new() {"$VKALIASOF", @struct.NativeName} + } + ); + // Create a clone for the alias + ret.Add(alias, aliasStruct); + } + + // Now that we've finished cloning we can add the build intrinsic to the root struct. + @struct.Attributes.Add + ( + new() + { + Name = "BuildToolsIntrinsic", + Arguments = new[] {"$VKALIASES"}.Concat(aList).ToList() } ); } - + + // Add chain extensions, we have to do this now to account for aliases, we + if (chainExtensions.Any()) + { + foreach (var (@struct, chainNames) in chainExtensions) + { + // Get all the aliases of this struct (including this one) + var allStructs = GetAllAliasesFromName(@struct.NativeName); + // Get all the chains this struct extends (including their aliases) + var chains = chainNames.SelectMany(n => GetAllAliasesFromName(n)).ToArray(); + + // Add $VKEXTENDSCHAIN build tools intrinsic attribute to all versions of this struct + Attribute attribute = null; + foreach (var s in allStructs) + { + if (attribute is null) + { + // Create $VKEXTENDSCHAIN build tools intrinsic attribute + attribute = new() + { + Name = "BuildToolsIntrinsic", + Arguments = new[] {"$VKEXTENDSCHAIN"}.Concat(chains.Select(c => c.Name)).ToList() + }; + } + else + { + // Clone existing attribute. + attribute = attribute.Clone(); + } + + s.Attributes.Add(attribute); + } + + // Add chain starts to all chains and their aliases + attribute = null; + foreach (var c in chains) + { + if (attribute is null) + { + // Create $VKEXTENDSCHAIN build tools intrinsic attribute + attribute = new() + { + Name = "BuildToolsIntrinsic", + Arguments = new[] {"$VKCHAINSTART"}.Concat(allStructs.Select(s => s.Name)).ToList() + }; + } + else + { + // Clone existing attribute. + attribute = attribute.Clone(); + } + + c.Attributes.Add(attribute); + } + } + } + foreach (var h in spec.Handles) { ret.Add @@ -103,7 +302,9 @@ private Dictionary ConvertStructs(VulkanSpecification spec, Bind h.Name, new Struct { Fields = new List - {new Field {Name = "Handle", Type = new Type {Name = h.CanBeDispatched ? "nint" : "ulong"}}}, + { + new Field {Name = "Handle", Type = new Type {Name = h.CanBeDispatched ? "nint" : "ulong"}} + }, Name = Naming.TranslateLite(TrimName(h.Name, task), prefix), NativeName = h.Name } @@ -112,13 +313,19 @@ private Dictionary ConvertStructs(VulkanSpecification spec, Bind foreach (var u in spec.Unions) { - ret.Add(u.Name, new Struct - { - Attributes = new List{new Attribute{Name = "StructLayout", Arguments = new List{"LayoutKind.Explicit"}}}, - Fields = GetFields(u, task).ToList(), - Name = Naming.TranslateLite(TrimName(u.Name, task), prefix), - NativeName = u.Name - }); + ret.Add + ( + u.Name, new Struct + { + Attributes = new List + { + new Attribute {Name = "StructLayout", Arguments = new List {"LayoutKind.Explicit"}} + }, + Fields = GetFields(u, task).ToList(), + Name = Naming.TranslateLite(TrimName(u.Name, task), prefix), + NativeName = u.Name + } + ); } return ret; @@ -138,7 +345,7 @@ private IEnumerable GetFields(StructureDefinition union, BindTask task) Name = $"{Naming.Translate(x.Name, task.FunctionPrefix)}_{i}", Attributes = new List { - new Attribute{Name = "FieldOffset", Arguments = new List {$"{i * fieldSize}"}} + new Attribute {Name = "FieldOffset", Arguments = new List {$"{i * fieldSize}"}} }, Doc = $"/// {x.Comment}", NativeName = x.Name, @@ -155,7 +362,7 @@ private IEnumerable GetFields(StructureDefinition union, BindTask task) Name = $"{Naming.Translate(x.Name, task.FunctionPrefix)}", Attributes = new List { - new Attribute{Name = "FieldOffset", Arguments = new List {"0"}} + new Attribute {Name = "FieldOffset", Arguments = new List {"0"}} }, Doc = $"/// {x.Comment}", NativeName = x.Name, @@ -165,7 +372,7 @@ private IEnumerable GetFields(StructureDefinition union, BindTask task) }; } } - } + } private int GetTypeSize(string type, IEnumerable> maps) { @@ -237,7 +444,7 @@ public IEnumerable ReadFunctions(object obj, BindTask task) } } } - + foreach (var extension in spec.Extensions) { foreach (var name in extension.CommandNames) @@ -273,14 +480,15 @@ private Dictionary ConvertFunctions(VulkanSpecification spec, ( function.Name, new Function { - Name = Naming.Translate(NameTrimmer.Trim(TrimName(function.Name, task), task.FunctionPrefix), task.FunctionPrefix), + Name = Naming.Translate + (NameTrimmer.Trim(TrimName(function.Name, task), task.FunctionPrefix), task.FunctionPrefix), Parameters = function.Parameters.Select ( x => new Parameter { Count = x.IsNullTerminated ? null : - x.ElementCountSymbolic != null ? - function.Parameters.Any(y => y.Name == x.ElementCountSymbolic) + x.ElementCountSymbolic != null ? function.Parameters.Any + (y => y.Name == x.ElementCountSymbolic) ? new(x.ElementCountSymbolic) : new(x.ElementCountSymbolic.Split(',')) : new(x.ElementCount), @@ -322,7 +530,7 @@ public IEnumerable ReadEnums(object obj, BindTask task) }; } } - + task.InjectTypeMap(tm); } @@ -342,7 +550,7 @@ public IEnumerable ReadConstants(object obj, BindTask task) ConstantType.Float32 => new Type {Name = "float"}, ConstantType.UInt32 => new Type {Name = "uint"}, ConstantType.UInt64 => new Type {Name = "ulong"}, - _ => new Type{Name = "ulong"} + _ => new Type {Name = "ulong"} }, ExtensionName = "Core" } @@ -363,21 +571,23 @@ public IEnumerable ReadConstants(object obj, BindTask task) } ) ) - ).Concat + ) + .Concat ( spec.Extensions.SelectMany ( - x => x.EnumExtensions.Where(y => y.ExtendedType is null).Select - ( - y => new Constant - { - Name = Naming.Translate(TrimName(y.Name, task), task.FunctionPrefix), - NativeName = y.Name, - Value = y.Value, - Type = new Type {Name = "uint"}, - ExtensionName = TrimName(x.Name, task) - } - ) + x => x.EnumExtensions.Where(y => y.ExtendedType is null) + .Select + ( + y => new Constant + { + Name = Naming.Translate(TrimName(y.Name, task), task.FunctionPrefix), + NativeName = y.Name, + Value = y.Value, + Type = new Type {Name = "uint"}, + ExtensionName = TrimName(x.Name, task) + } + ) ) ); } @@ -395,7 +605,9 @@ public string TrimName(string name, BindTask task) return name.Remove(0, task.FunctionPrefix.Length + 1); } - return name.ToLower().StartsWith(task.FunctionPrefix.ToLower()) ? name.Remove(0, task.FunctionPrefix.Length) : name; + return name.ToLower().StartsWith(task.FunctionPrefix.ToLower()) + ? name.Remove(0, task.FunctionPrefix.Length) + : name; } private static FlowDirection ConvertFlow(ParameterModifier mod) @@ -408,7 +620,7 @@ private static FlowDirection ConvertFlow(ParameterModifier mod) _ => FlowDirection.In }; } - + private Dictionary ConvertEnums(VulkanSpecification spec, BindTask task) { var ret = new Dictionary(); @@ -440,8 +652,8 @@ private Dictionary ConvertEnums(VulkanSpecification spec, BindTask : new List(), EnumBaseType = e.BitWidth switch { - 64 => new(){Name = "long"}, - _ => new(){Name = "int"} + 64 => new() {Name = "long"}, + _ => new() {Name = "int"} } } ); @@ -458,6 +670,7 @@ private Dictionary ConvertEnums(VulkanSpecification spec, BindTask } private static readonly char[] Digits = "1234567890".ToCharArray(); + private static string TryTrim(string token, string @enum) { var trimmed = token.StartsWith(@enum) ? token.Substring(@enum.Length) : token; diff --git a/src/Lab/Experiments/PrototypeStructChaining/.gitignore b/src/Lab/Experiments/PrototypeStructChaining/.gitignore new file mode 100644 index 0000000000..a83c78113b --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/.gitignore @@ -0,0 +1,341 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- Backup*.rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/**/workspace.xml +.idea/**/usage.statistics.xml +.idea/**/shelf/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb \ No newline at end of file diff --git a/src/Lab/Experiments/PrototypeStructChaining/.idea/.idea.PrototypeStructChaining/.idea/.gitignore b/src/Lab/Experiments/PrototypeStructChaining/.idea/.idea.PrototypeStructChaining/.idea/.gitignore new file mode 100644 index 0000000000..009550ae99 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/.idea/.idea.PrototypeStructChaining/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/modules.xml +/contentModel.xml +/.idea.PrototypeStructChaining.iml +/projectSettingsUpdater.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/src/Lab/Experiments/PrototypeStructChaining/.idea/.idea.PrototypeStructChaining/.idea/encodings.xml b/src/Lab/Experiments/PrototypeStructChaining/.idea/.idea.PrototypeStructChaining/.idea/encodings.xml new file mode 100644 index 0000000000..df87cf951f --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/.idea/.idea.PrototypeStructChaining/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/Lab/Experiments/PrototypeStructChaining/.idea/.idea.PrototypeStructChaining/.idea/indexLayout.xml b/src/Lab/Experiments/PrototypeStructChaining/.idea/.idea.PrototypeStructChaining/.idea/indexLayout.xml new file mode 100644 index 0000000000..7b08163ceb --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/.idea/.idea.PrototypeStructChaining/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/Lab/Experiments/PrototypeStructChaining/.idea/.idea.PrototypeStructChaining/.idea/vcs.xml b/src/Lab/Experiments/PrototypeStructChaining/.idea/.idea.PrototypeStructChaining/.idea/vcs.xml new file mode 100644 index 0000000000..029a1a823f --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/.idea/.idea.PrototypeStructChaining/.idea/vcs.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/PrototypeStructChaining.Test.csproj b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/PrototypeStructChaining.Test.csproj new file mode 100644 index 0000000000..c61c1205b8 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/PrototypeStructChaining.Test.csproj @@ -0,0 +1,34 @@ + + + + net6.0 + enable + + false + + true + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + + + + diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestChainMetadata.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestChainMetadata.cs new file mode 100644 index 0000000000..9e3c26a1f4 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestChainMetadata.cs @@ -0,0 +1,58 @@ +using System; +using System.Linq; +using Silk.NET.Vulkan; +using Xunit; + +namespace PrototypeStructChaining.Test; + +public class TestChainMetadata +{ + [Fact] + public void TestClrType() + { + Assert.Equal(typeof(DeviceCreateInfo), StructureType.DeviceCreateInfo.ClrType()); + } + + [Fact] + public void TestStructureType() + { + Assert.Equal(StructureType.DeviceCreateInfo, typeof(DeviceCreateInfo).StructureType()); + Assert.Null(typeof(PhysicalDeviceFeatures).StructureType()); + } + + [Fact] + public void TestIsChainStart() + { + Assert.True(StructureType.DeviceCreateInfo.IsChainStart()); + Assert.True(typeof(DeviceCreateInfo).IsChainStart()); + Assert.False(StructureType.PhysicalDeviceDescriptorIndexingFeatures.IsChainStart()); + Assert.False(typeof(PhysicalDeviceDescriptorIndexingFeatures).IsChainStart()); + } + + [Fact] + public void TestIsChainable() + { + Assert.True(StructureType.DeviceCreateInfo.IsChainable()); + Assert.True(typeof(DeviceCreateInfo).IsChainable()); + Assert.True(StructureType.PhysicalDeviceDescriptorIndexingFeatures.IsChainable()); + Assert.True(typeof(PhysicalDeviceDescriptorIndexingFeatures).IsChainable()); + } + + [Fact] + public void TestCanExtend() + { + Assert.True(StructureType.PhysicalDeviceFeatures2.CanExtend(StructureType.DeviceCreateInfo)); + Assert.False(StructureType.DeviceCreateInfo.CanExtend(StructureType.PhysicalDeviceFeatures2)); + Assert.True(typeof(PhysicalDeviceFeatures2).CanExtend(typeof(DeviceCreateInfo))); + Assert.False(typeof(DeviceCreateInfo).CanExtend(typeof(PhysicalDeviceFeatures2))); + } + + [Fact] + public void TestCanBeExtendedBy() + { + Assert.False(StructureType.PhysicalDeviceFeatures2.CanBeExtendedBy(StructureType.DeviceCreateInfo)); + Assert.True(StructureType.DeviceCreateInfo.CanBeExtendedBy(StructureType.PhysicalDeviceFeatures2)); + Assert.False(typeof(PhysicalDeviceFeatures2).CanBeExtendedBy(typeof(DeviceCreateInfo))); + Assert.True(typeof(DeviceCreateInfo).CanBeExtendedBy(typeof(PhysicalDeviceFeatures2))); + } +} diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestChains.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestChains.cs new file mode 100644 index 0000000000..40f1d40ce3 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestChains.cs @@ -0,0 +1,183 @@ +using Silk.NET.Vulkan; +using Xunit; + +namespace PrototypeStructChaining.Test; + +public class TestChains +{ + [Fact] + public unsafe void TestAddNext() + { + PhysicalDeviceFeatures2 + // The BaseInStructure method, is a convenient static, to provide a consistent syntax. + .Chain(out var features2) + // AddNext will create an empty struct, with the correct SType (as well as ensuring the + // chain's SType is coerced correctly. + .AddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures) + .AddNext(out PhysicalDeviceAccelerationStructureFeaturesKHR accelerationStructureFeaturesKhr); + + // Ensure all pointers set correctly + Assert.Equal((nint) (&indexingFeatures), (nint) features2.PNext); + Assert.Equal((nint) (&accelerationStructureFeaturesKhr), (nint) indexingFeatures.PNext); + Assert.Equal(0, (nint) accelerationStructureFeaturesKhr.PNext); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, features2.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, indexingFeatures.SType); + Assert.Equal + ( + StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, + accelerationStructureFeaturesKhr.SType + ); + + // Check indices + Assert.Equal(1, features2.IndexOf(ref indexingFeatures)); + Assert.Equal(2, features2.IndexOf(ref accelerationStructureFeaturesKhr)); + } + + [Fact] + public unsafe void TestTryAddNext() + { + PhysicalDeviceFeatures2 + // The BaseInStructure method, is a convenient static, to provide a consistent syntax. + .Chain(out var features2) + // AddNext will create an empty struct, with the correct SType (as well as ensuring the + // chain's SType is coerced correctly. + .AddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures); + + // Ensure all pointers set correctly + Assert.Equal((nint) (&indexingFeatures), (nint) features2.PNext); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, features2.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, indexingFeatures.SType); + + features2.TryAddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures2, out var added); + Assert.False(added); + } + + [Fact] + public unsafe void TestSetNext() + { + var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures + { + ShaderInputAttachmentArrayDynamicIndexing = true + }; + var accelerationStructureFeaturesKhr = new PhysicalDeviceAccelerationStructureFeaturesKHR + { + AccelerationStructure = true + }; + + PhysicalDeviceFeatures2 + .Chain(out var features2) + // SetNext accepts an existing struct, note, it will coerce the SType and blank the PNext + .SetNext(ref indexingFeatures) + .SetNext(ref accelerationStructureFeaturesKhr); + + Assert.Equal((nint) (&indexingFeatures), (nint) features2.PNext); + Assert.Equal((nint) (&accelerationStructureFeaturesKhr), (nint) indexingFeatures.PNext); + Assert.Equal(0, (nint) accelerationStructureFeaturesKhr.PNext); + + Assert.Equal(StructureType.PhysicalDeviceFeatures2, features2.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, indexingFeatures.SType); + Assert.Equal + ( + StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, + accelerationStructureFeaturesKhr.SType + ); + + Assert.True(indexingFeatures.ShaderInputAttachmentArrayDynamicIndexing); + Assert.True(accelerationStructureFeaturesKhr.AccelerationStructure); + } + + [Fact] + public unsafe void TestSetNextUpdates() + { + var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures + { + ShaderInputAttachmentArrayDynamicIndexing = true + }; + + PhysicalDeviceFeatures2 + .Chain(out var features2) + // SetNext accepts an existing struct, note, it will coerce the SType and blank the PNext + .SetNext(ref indexingFeatures); + + Assert.Equal((nint) (&indexingFeatures), (nint) features2.PNext); + Assert.Equal(0, (nint) indexingFeatures.PNext); + + Assert.Equal(StructureType.PhysicalDeviceFeatures2, features2.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, indexingFeatures.SType); + + // Update indexing features + var indexingFeatures2 = new PhysicalDeviceDescriptorIndexingFeatures + { + ShaderInputAttachmentArrayDynamicIndexing = false + }; + features2.SetNext(ref indexingFeatures2); + + Assert.Equal((nint) (&indexingFeatures2), (nint) features2.PNext); + Assert.Equal(0, (nint) indexingFeatures2.PNext); + + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, indexingFeatures2.SType); + + Assert.Equal(1, features2.IndexOf(ref indexingFeatures2)); + Assert.True(features2.IndexOf(ref indexingFeatures) < 0); + } + + [Fact] + public unsafe void TestSetNextAlwaysAdd() + { + var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures + { + ShaderInputAttachmentArrayDynamicIndexing = true + }; + + PhysicalDeviceFeatures2 + .Chain(out var features2) + // SetNext accepts an existing struct, note, it will coerce the SType and blank the PNext + .SetNext(ref indexingFeatures); + + Assert.Equal((nint) (&indexingFeatures), (nint) features2.PNext); + Assert.Equal(0, (nint) indexingFeatures.PNext); + + Assert.Equal(StructureType.PhysicalDeviceFeatures2, features2.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, indexingFeatures.SType); + + // Update indexing features + var indexingFeatures2 = new PhysicalDeviceDescriptorIndexingFeatures + { + ShaderInputAttachmentArrayDynamicIndexing = false + }; + features2.SetNext(ref indexingFeatures2, true); + + Assert.Equal((nint) (&indexingFeatures), (nint) features2.PNext); + Assert.Equal((nint) (&indexingFeatures2), (nint) indexingFeatures.PNext); + Assert.Equal(0, (nint) indexingFeatures2.PNext); + + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, indexingFeatures2.SType); + + Assert.Equal(1, features2.IndexOf(ref indexingFeatures)); + Assert.Equal(2, features2.IndexOf(ref indexingFeatures2)); + } + + [Fact] + public unsafe void TestWithoutChain() + { + // We don't have to use the BaseInStructure() pattern, as we can start with an existing struct + var createInfo = new DeviceCreateInfo + { + Flags = 1U + }; + // However, note that AddNext will still coerce the SType of createInfo. + createInfo.AddNext(out PhysicalDeviceFeatures2 features2); + Assert.Equal((nint) (&features2), (nint) createInfo.PNext); + Assert.Equal(0, (nint) features2.PNext); + + // Note, even though we didn't use chain, we have still coerced the SType + Assert.Equal(StructureType.DeviceCreateInfo, createInfo.SType); + Assert.Equal(StructureType.PhysicalDeviceFeatures2, features2.SType); + + Assert.Equal(1U, createInfo.Flags); + } +} diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestChainsAny.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestChainsAny.cs new file mode 100644 index 0000000000..f7e440dab8 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestChainsAny.cs @@ -0,0 +1,30 @@ +using Silk.NET.Vulkan; +using Xunit; + +namespace PrototypeStructChaining.Test; + +public class TestChainsAny +{ + [Fact] + public unsafe void TestAddNextUnchecked() + { + var accelerationStructureFeatures = new PhysicalDeviceAccelerationStructureFeaturesKHR(); + accelerationStructureFeatures + .AddNextAny(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures) + .AddNextAny(out DeviceCreateInfo deviceCreateInfo); + + // Ensure all pointers set correctly + Assert.Equal((nint) (&indexingFeatures), (nint) accelerationStructureFeatures.PNext); + Assert.Equal((nint) (&deviceCreateInfo), (nint) indexingFeatures.PNext); + Assert.Equal(0, (nint) deviceCreateInfo.PNext); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, accelerationStructureFeatures.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, indexingFeatures.SType); + Assert.Equal(StructureType.DeviceCreateInfo, deviceCreateInfo.SType); + + // Check indices + Assert.Equal(1, accelerationStructureFeatures.IndexOfAny(ref indexingFeatures)); + Assert.Equal(2, accelerationStructureFeatures.IndexOfAny(ref deviceCreateInfo)); + } +} diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestCompilation.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestCompilation.cs new file mode 100644 index 0000000000..5f27487a37 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestCompilation.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; +using Microsoft.CodeAnalysis.Emit; +using Silk.NET.Vulkan; +using Xunit; + +namespace PrototypeStructChaining.Test; + +public class TestCompilation +{ + private static readonly Lazy> References = new + ( + () => + ((string?) AppContext.GetData("TRUSTED_PLATFORM_ASSEMBLIES") ?? string.Empty) + .Split(Path.PathSeparator) + .Select(r => MetadataReference.CreateFromFile(r)) + .Concat(new[] {MetadataReference.CreateFromFile(typeof(StructureType).Assembly.Location)}) + .ToArray() + ); + + private static readonly string CodeTemplate = @" +using System; +using Silk.NET.Vulkan; + +public class Test +{{ + public void DoTest() + {{ + {0} + }} +}}"; + + private IReadOnlyList CheckCompile(string code) + { + var assemblyName = Path.GetRandomFileName(); + var compilation = CSharpCompilation.Create + ( + assemblyName, + new[] {CSharpSyntaxTree.ParseText(string.Format(CodeTemplate, code))}, + References.Value, + new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary) + ); + + using var ms = new MemoryStream(); + var result = compilation.Emit(ms); + + if (result.Success) + { + return Array.Empty(); + } + + return result.Diagnostics.Where + ( + diagnostic => + diagnostic.IsWarningAsError || + diagnostic.Severity == DiagnosticSeverity.Error + ) + .ToArray(); + } + + [Fact] + public void TestCantAddUnsupportedNext() + { + var diagnostics = CheckCompile + ( + @"PhysicalDeviceFeatures2 + .Chain(out var features2) + .AddNext(out DeviceCreateInfo createInfo);" + ); + + Assert.Single(diagnostics); + var error = diagnostics.First(); + // error CS0315: The type 'Silk.NET.Vulkan.PhysicalDeviceFeatures2' cannot be used as type parameter 'TChain' in the generic type or method 'Chain.AddNext(ref TChain, out TNext)'. There is no boxing conversion from 'Silk.NET.Vulkan.PhysicalDeviceFeatures2' to 'Silk.NET.Vulkan.IChainable'. + Assert.Equal("CS0315", error.Id); + } + + [Fact] + public void TestCanAddUnsupportedNextUsingAny() + { + var diagnostics = CheckCompile + ( + @"PhysicalDeviceFeatures2 + .Chain(out var features2) + .AddNextAny(out DeviceCreateInfo createInfo);" + ); + + Assert.Empty(diagnostics); + } + + [Fact] + public void TestCanAddSupportedNext() + { + var diagnostics = CheckCompile + ( + @"DeviceCreateInfo + .Chain(out var createInfo) + .AddNext(out PhysicalDeviceFeatures2 features2);" + ); + + Assert.Empty(diagnostics); + } +} diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestManagedChains.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestManagedChains.cs new file mode 100644 index 0000000000..df8663701a --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestManagedChains.cs @@ -0,0 +1,453 @@ +using System; +using System.Linq; +using Silk.NET.Vulkan; +using Xunit; + +namespace PrototypeStructChaining.Test; + +public class TestManagedChains +{ + [Fact] + public unsafe void TestManagedChain() + { + using var chain = ManagedChain.Create + ( + default(PhysicalDeviceFeatures2), + default(PhysicalDeviceDescriptorIndexingFeatures), + default(PhysicalDeviceAccelerationStructureFeaturesKHR) + ); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); + Assert.Equal(StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, chain.Item2.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + Assert.Equal((nint) chain.Item2Ptr, (nint) chain.Item1.PNext); + Assert.Equal(0, (nint) chain.Item2.PNext); + } + + [Fact] + public unsafe void TestManagedChainReplaceHead() + { + using var chain = + ManagedChain.Create + ( + default(DeviceCreateInfo), + default(PhysicalDeviceFeatures2), + default(PhysicalDeviceDescriptorIndexingFeatures) + ); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.DeviceCreateInfo, chain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Item1.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item2.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + Assert.Equal((nint) chain.Item2Ptr, (nint) chain.Item1.PNext); + Assert.Equal(0, (nint) chain.Item2.PNext); + + Assert.Equal(0U, chain.Head.Flags); + + var headPtr = chain.HeadPtr; + + // Get the current head + var head = chain.Head; + // Update the flags + head.Flags = 1U; + // Update the chain + chain.Head = head; + + Assert.Equal(1U, chain.Head.Flags); + + // The head ptr should not change, we overwrite it with the new value + Assert.Equal((nint) headPtr, (nint) chain.HeadPtr); + // But the next pointer should not change + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + } + + [Fact] + public unsafe void TestManagedChainReplaceMiddle() + { + using var chain = ManagedChain.Create + ( + item1: new PhysicalDeviceDescriptorIndexingFeatures + { + // We can set any non-default values, note we do not need to set SType or PNext + // indeed they will be overwritten. + ShaderInputAttachmentArrayDynamicIndexing = true + } + ); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); + Assert.Equal(StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, chain.Item2.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + Assert.Equal((nint) chain.Item2Ptr, (nint) chain.Item1.PNext); + Assert.Equal(0, (nint) chain.Item2.PNext); + + // Check our value was set + Assert.True(chain.Item1.ShaderInputAttachmentArrayDynamicIndexing); + + var item1Ptr = chain.Item1Ptr; + + // Overwrite Item1 + chain.Item1 = new PhysicalDeviceDescriptorIndexingFeatures + { + // Again we do not need to set SType or PNext, which will be set to the correct values + ShaderInputAttachmentArrayDynamicIndexing = false + }; + + // Check our value was cleared + Assert.False(chain.Item1.ShaderInputAttachmentArrayDynamicIndexing); + + // Note all the pointers are still correct (and have not changed) + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + Assert.Equal((nint) chain.Item2Ptr, (nint) chain.Item1.PNext); + Assert.Equal(0, (nint) chain.Item2.PNext); + + // As is the SType + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); + chain.Dispose(); + } + + [Fact] + public unsafe void TestManagedChainDuplicate() + { + using var chain = ManagedChain.Create + ( + item1: new PhysicalDeviceDescriptorIndexingFeatures {ShaderInputAttachmentArrayDynamicIndexing = true} + ); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + Assert.Equal(0, (nint) chain.Item1.PNext); + + // Check flag set + Assert.True(chain.Item1.ShaderInputAttachmentArrayDynamicIndexing); + + using var newChain = chain.Duplicate(); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + Assert.Equal(0, (nint) chain.Item1.PNext); + + // Check flag set + Assert.True(chain.Item1.ShaderInputAttachmentArrayDynamicIndexing); + + // Check we have new copies + Assert.NotEqual((nint) chain.HeadPtr, (nint) newChain.HeadPtr); + Assert.NotEqual((nint) chain.Item1Ptr, (nint) newChain.Item1Ptr); + + // Test equality + Assert.Equal(chain, newChain); + Assert.True(chain == newChain); + + // Modify second chain + newChain.Item1 = default; + + // Test equality + Assert.NotEqual(chain, newChain); + Assert.False(chain == newChain); + } + + [Fact] + public unsafe void TestManagedChainAdd() + { + using var chain = ManagedChain.Create + ( + item1: new PhysicalDeviceDescriptorIndexingFeatures {ShaderInputAttachmentArrayDynamicIndexing = true} + ); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + Assert.Equal(0, (nint) chain.Item1.PNext); + + // Check flag set + Assert.True(chain.Item1.ShaderInputAttachmentArrayDynamicIndexing); + + using var newChain = chain.Add(default(PhysicalDeviceAccelerationStructureFeaturesKHR)); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, newChain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, newChain.Item1.SType); + Assert.Equal(StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, newChain.Item2.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) newChain.Item1Ptr, (nint) newChain.Head.PNext); + Assert.Equal((nint) newChain.Item2Ptr, (nint) newChain.Item1.PNext); + Assert.Equal(0, (nint) newChain.Item2.PNext); + + // Check flag still set + Assert.True(newChain.Item1.ShaderInputAttachmentArrayDynamicIndexing); + + // Check we have new copies + Assert.NotEqual((nint) chain.HeadPtr, (nint) newChain.HeadPtr); + Assert.NotEqual((nint) chain.Item1Ptr, (nint) newChain.Item1Ptr); + } + + [Fact] + public unsafe void TestManagedChainTruncate() + { + using var chain = + ManagedChain.Create< + PhysicalDeviceFeatures2, + PhysicalDeviceDescriptorIndexingFeatures, + PhysicalDeviceAccelerationStructureFeaturesKHR> + ( + item2: new PhysicalDeviceAccelerationStructureFeaturesKHR + {AccelerationStructure = true} + ); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); + Assert.Equal(StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, chain.Item2.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + Assert.Equal((nint) chain.Item2Ptr, (nint) chain.Item1.PNext); + Assert.Equal(0, (nint) chain.Item2.PNext); + + // Check flag set + Assert.True(chain.Item2.AccelerationStructure); + + using var newChain = chain.Truncate(out var accelerationStructure); + + Assert.Equal(2, newChain.Count); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, newChain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, newChain.Item1.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) newChain.Item1Ptr, (nint) newChain.Head.PNext); + Assert.Equal(0, (nint) newChain.Item1.PNext); + + // Check removed type flag + Assert.True(accelerationStructure.AccelerationStructure); + + // Check we have new copies + Assert.NotEqual((nint) chain.HeadPtr, (nint) newChain.HeadPtr); + Assert.NotEqual((nint) chain.Item1Ptr, (nint) newChain.Item1Ptr); + } + + [Fact] + public unsafe void TestManagedChainLoad() + { + // Load an unmanaged chain + var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures + { + ShaderInputAttachmentArrayDynamicIndexing = true + }; + PhysicalDeviceFeatures2 + .Chain(out var unmanagedChain) + .SetNext(ref indexingFeatures) + .AddNext(out PhysicalDeviceAccelerationStructureFeaturesKHR accelerationStructureFeaturesKhr); + + // Loads a new managed chain from an unmanaged chain + using var managedChain = + ManagedChain.Load(out var errors, unmanagedChain); + + // Check we had no loading errors + Assert.Equal("", errors); + + // Check the flag still set + Assert.True(managedChain.Item1.ShaderInputAttachmentArrayDynamicIndexing); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, managedChain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, managedChain.Item1.SType); + Assert.Equal(StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, managedChain.Item2.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) managedChain.Item1Ptr, (nint) managedChain.Head.PNext); + Assert.Equal((nint) managedChain.Item2Ptr, (nint) managedChain.Item1.PNext); + Assert.Equal(0, (nint) managedChain.Item2.PNext); + } + + [Fact] + public void TestManagedChainLoadWithError() + { + var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures + { + ShaderInputAttachmentArrayDynamicIndexing = true + }; + // Load an unmanaged chain + DeviceCreateInfo + .Chain(out var unmanagedChain) + .AddNext(out PhysicalDeviceFeatures2 features2) + .SetNext(ref indexingFeatures) + .AddNext(out PhysicalDeviceAccelerationStructureFeaturesKHR accelerationStructureFeaturesKhr); + + // Loads a new managed chain from an unmanaged chain + using var managedChain = + ManagedChain.Load< + DeviceCreateInfo, + // Note we are supplied a PhysicalDeviceFeatures2 here from the unmanaged chain + PhysicalDeviceAccelerationStructureFeaturesKHR, + PhysicalDeviceDescriptorIndexingFeatures, + PhysicalDeviceAccelerationStructureFeaturesKHR, + // Note that the unmanaged chain did not supply a 5th entry + PhysicalDeviceFeatures2>(out var errors, unmanagedChain); + + // Check for errors + var errorsArray = errors.Split(new[] {'\r', '\n'}, StringSplitOptions.RemoveEmptyEntries); + Assert.Equal(2, errorsArray.Length); + Assert.Equal + ( + "The unmanaged chain has a structure type PhysicalDeviceFeatures2Khr at position 2; expected PhysicalDeviceAccelerationStructureFeaturesKhr", + errorsArray[0] + ); + Assert.Equal + ( + "The unmanaged chain was length 4, expected length 5", errorsArray[1] + ); + + // Despite the errors indexing features was at the right location so was loaded + Assert.True(managedChain.Item2.ShaderInputAttachmentArrayDynamicIndexing); + } + + [Fact] + public void TestManagedChainLoadWithErrorTooLong() + { + var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures + { + ShaderInputAttachmentArrayDynamicIndexing = true + }; + // Load an unmanaged chain + DeviceCreateInfo + .Chain(out var unmanagedChain) + .AddNext(out PhysicalDeviceFeatures2 features2) + .SetNext(ref indexingFeatures) + .AddNext(out PhysicalDeviceAccelerationStructureFeaturesKHR accelerationStructureFeaturesKhr); + + // Try loading a shorter managed chain + using var managedChain = + ManagedChain.Load< + DeviceCreateInfo, + PhysicalDeviceFeatures2, + PhysicalDeviceDescriptorIndexingFeatures>(out var errors, unmanagedChain); + + // Check for errors + Assert.Equal(@"The unmanaged chain was longer than the expected length 3", errors); + + // Despite the errors indexing features was at the right location so was loaded + Assert.True(managedChain.Item2.ShaderInputAttachmentArrayDynamicIndexing); + } + + [Fact] + public void TestReadOnlyList() + { + using var chain = ManagedChain.Create(); + + Assert.Equal(3, chain.Count); + + // Ensure all STypes set correctly using indexer + Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain[0].StructureType()); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain[1].StructureType()); + Assert.Equal(StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, chain[2].StructureType()); + + Assert.Throws(() => chain[3]); + + // Get array using IEnumerable implementation + var structures = chain.ToArray(); + + // Check concrete types + Assert.IsType(structures[0]); + Assert.IsType(structures[1]); + Assert.IsType(structures[2]); + } + + [Fact] + public void TestDeconstructor() + { + using var chain = ManagedChain.Create(); + + var (physicalDeviceFeatures2, indexingFeatures, accelerationStructureFeaturesKhr) = chain; + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, physicalDeviceFeatures2.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, indexingFeatures.SType); + Assert.Equal + (StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, accelerationStructureFeaturesKhr.SType); + } + + [Fact] + public unsafe void TestManagedChainGetHashCode() + { + using var chain = ManagedChain.Create + ( + item1: new PhysicalDeviceDescriptorIndexingFeatures {ShaderInputAttachmentArrayDynamicIndexing = true} + ); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + Assert.Equal(0, (nint) chain.Item1.PNext); + + // Check flag set + Assert.True(chain.Item1.ShaderInputAttachmentArrayDynamicIndexing); + + using var newChain = chain.Duplicate(); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); + + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1Ptr->SType); + + // Ensure pointers set correctly + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + Assert.Equal(0, (nint) chain.Item1.PNext); + + // Check flag set + Assert.True(chain.Item1.ShaderInputAttachmentArrayDynamicIndexing); + + // Check we have new copies + Assert.NotEqual((nint) chain.HeadPtr, (nint) newChain.HeadPtr); + Assert.NotEqual((nint) chain.Item1Ptr, (nint) newChain.Item1Ptr); + + // Test equality + Assert.Equal(chain, newChain); + Assert.True(chain == newChain); + var hashCode = chain.GetHashCode(); + var newHashCode = newChain.GetHashCode(); + Assert.Equal(hashCode, newHashCode); + + // Modify second chain + newChain.Item1 = default; + + // Test equality + Assert.NotEqual(chain, newChain); + Assert.False(chain == newChain); + Assert.Equal(hashCode, chain.GetHashCode()); + var newHashCode2 = newChain.GetHashCode(); + Assert.NotEqual(hashCode, newHashCode2); + Assert.NotEqual(newHashCode, newHashCode2); + } +} diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestManagedChainsAny.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestManagedChainsAny.cs new file mode 100644 index 0000000000..7b6c69018b --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.Test/TestManagedChainsAny.cs @@ -0,0 +1,193 @@ +using System; +using System.Linq; +using Silk.NET.Vulkan; +using Xunit; + +namespace PrototypeStructChaining.Test; + +public class TestManagedChainsAny +{ + [Fact] + public unsafe void TestManagedChainAny() + { + using var chain = ManagedChain.CreateAny + ( + default(PhysicalDeviceFeatures2), + default(PhysicalDeviceDescriptorIndexingFeatures), + default(DeviceCreateInfo) + ); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); + Assert.Equal(StructureType.DeviceCreateInfo, chain.Item2.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + Assert.Equal((nint) chain.Item2Ptr, (nint) chain.Item1.PNext); + Assert.Equal(0, (nint) chain.Item2.PNext); + } + + [Fact] + public unsafe void TestManagedChainDuplicateAny() + { + using var chain = ManagedChain.CreateAny + ( + item1: new DeviceCreateInfo {Flags = 1U} + ); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); + Assert.Equal(StructureType.DeviceCreateInfo, chain.Item1.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + Assert.Equal(0, (nint) chain.Item1.PNext); + + // Check flag set + Assert.Equal(1U, chain.Item1.Flags); + + using var newChain = chain.DuplicateAny(); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); + Assert.Equal(StructureType.DeviceCreateInfo, chain.Item1.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + Assert.Equal(0, (nint) chain.Item1.PNext); + + // Check flag set + Assert.Equal(1U, chain.Item1.Flags); + + // Check we have new copies + Assert.NotEqual((nint) chain.HeadPtr, (nint) newChain.HeadPtr); + Assert.NotEqual((nint) chain.Item1Ptr, (nint) newChain.Item1Ptr); + + // Test equality + Assert.Equal(chain, newChain); + Assert.True(chain == newChain); + } + + [Fact] + public unsafe void TestManagedChainAddAny() + { + using var chain = ManagedChain.Create + ( + item1: new PhysicalDeviceDescriptorIndexingFeatures {ShaderInputAttachmentArrayDynamicIndexing = true} + ); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + Assert.Equal(0, (nint) chain.Item1.PNext); + + // Check flag set + Assert.True(chain.Item1.ShaderInputAttachmentArrayDynamicIndexing); + + using var newChain = chain.AddAny(default(DeviceCreateInfo)); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, newChain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, newChain.Item1.SType); + Assert.Equal(StructureType.DeviceCreateInfo, newChain.Item2.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) newChain.Item1Ptr, (nint) newChain.Head.PNext); + Assert.Equal((nint) newChain.Item2Ptr, (nint) newChain.Item1.PNext); + Assert.Equal(0, (nint) newChain.Item2.PNext); + + // Check flag still set + Assert.True(newChain.Item1.ShaderInputAttachmentArrayDynamicIndexing); + + // Check we have new copies + Assert.NotEqual((nint) chain.HeadPtr, (nint) newChain.HeadPtr); + Assert.NotEqual((nint) chain.Item1Ptr, (nint) newChain.Item1Ptr); + } + + [Fact] + public unsafe void TestManagedChainTruncateAny() + { + using var chain = + ManagedChain.CreateAny< + PhysicalDeviceFeatures2, + PhysicalDeviceDescriptorIndexingFeatures, + DeviceCreateInfo> + ( + item2: new DeviceCreateInfo {Flags = 1U} + ); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); + Assert.Equal(StructureType.DeviceCreateInfo, chain.Item2.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); + Assert.Equal((nint) chain.Item2Ptr, (nint) chain.Item1.PNext); + Assert.Equal(0, (nint) chain.Item2.PNext); + + // Check flag set + Assert.Equal(1U, chain.Item2.Flags); + + using var newChain = chain.TruncateAny(out var deviceCreateInfo); + + Assert.Equal(2, newChain.Count); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, newChain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, newChain.Item1.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) newChain.Item1Ptr, (nint) newChain.Head.PNext); + Assert.Equal(0, (nint) newChain.Item1.PNext); + + // Check removed type flag + Assert.Equal(1U, deviceCreateInfo.Flags); + + // Check we have new copies + Assert.NotEqual((nint) chain.HeadPtr, (nint) newChain.HeadPtr); + Assert.NotEqual((nint) chain.Item1Ptr, (nint) newChain.Item1Ptr); + + // NOTE: As the new chain is valid, we can use Truncate on it + using var finalChain = newChain.Truncate(out var indexingFeatures); + } + + [Fact] + public unsafe void TestManagedChainLoadAny() + { + // Load an unmanaged chain + var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures + { + ShaderInputAttachmentArrayDynamicIndexing = true + }; + PhysicalDeviceFeatures2 + .Chain(out var unmanagedChain) + .SetNext(ref indexingFeatures) + .AddNextAny(out DeviceCreateInfo deviceCreateInfo); + + // Loads a new managed chain from an unmanaged chain + using var managedChain = + ManagedChain.LoadAny(out var errors, unmanagedChain); + + // Check we had no loading errors + Assert.Equal("", errors); + + // Check the flag still set + Assert.True(managedChain.Item1.ShaderInputAttachmentArrayDynamicIndexing); + + // Ensure all STypes set correctly + Assert.Equal(StructureType.PhysicalDeviceFeatures2, managedChain.Head.SType); + Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, managedChain.Item1.SType); + Assert.Equal(StructureType.DeviceCreateInfo, managedChain.Item2.SType); + + // Ensure pointers set correctly + Assert.Equal((nint) managedChain.Item1Ptr, (nint) managedChain.Head.PNext); + Assert.Equal((nint) managedChain.Item2Ptr, (nint) managedChain.Item1.PNext); + Assert.Equal(0, (nint) managedChain.Item2.PNext); + } +} diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/ChainExtensions.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/ChainExtensions.cs new file mode 100644 index 0000000000..604c4ae29f --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/ChainExtensions.cs @@ -0,0 +1,200 @@ +using System.Runtime.CompilerServices; + +namespace Silk.NET.Vulkan; + +public static class Chain +{ + /// + /// Provides a set of all the s that can be extended by a . + /// + public static readonly IReadOnlyDictionary> Extensions = + new Dictionary> + { + [Vulkan.StructureType.PhysicalDeviceFeatures2] = new HashSet + { + Vulkan.StructureType.DeviceCreateInfo + }, + [Vulkan.StructureType.PhysicalDeviceDescriptorIndexingFeatures] = new HashSet + { + Vulkan.StructureType.PhysicalDeviceFeatures2, + Vulkan.StructureType.DeviceCreateInfo + }, + [Vulkan.StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr] = new HashSet + { + Vulkan.StructureType.PhysicalDeviceFeatures2, + Vulkan.StructureType.DeviceCreateInfo + } + }; + + /// + /// Provides a set of all the s that can extend a . + /// + public static readonly IReadOnlyDictionary> Extenders = + new Dictionary> + { + [Vulkan.StructureType.DeviceCreateInfo] = new HashSet + { + Vulkan.StructureType.PhysicalDeviceFeatures2, + Vulkan.StructureType.PhysicalDeviceDescriptorIndexingFeatures, + Vulkan.StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr + }, + [Vulkan.StructureType.PhysicalDeviceFeatures2] = new HashSet + { + Vulkan.StructureType.PhysicalDeviceDescriptorIndexingFeatures, + Vulkan.StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr + } + }; + + /// + /// Provides a mapping from the to the corresponding . + /// + public static readonly IReadOnlyDictionary ClrTypes = + new Dictionary + { + [Vulkan.StructureType.DeviceCreateInfo] = typeof(DeviceCreateInfo), + [Vulkan.StructureType.PhysicalDeviceFeatures2] = typeof(PhysicalDeviceFeatures2), + [Vulkan.StructureType.PhysicalDeviceDescriptorIndexingFeatures] = + typeof(PhysicalDeviceDescriptorIndexingFeatures), + [Vulkan.StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr] = + typeof(PhysicalDeviceAccelerationStructureFeaturesKHR) + }; + + /// + /// Provides a mapping from the to the corresponding . + /// + public static readonly IReadOnlyDictionary StructureTypes = + new Dictionary + { + [typeof(DeviceCreateInfo)] = Vulkan.StructureType.DeviceCreateInfo, + [typeof(PhysicalDeviceFeatures2)] = Vulkan.StructureType.PhysicalDeviceFeatures2, + [typeof(PhysicalDeviceDescriptorIndexingFeatures)] = + Vulkan.StructureType.PhysicalDeviceDescriptorIndexingFeatures, + [typeof(PhysicalDeviceAccelerationStructureFeaturesKHR)] = + Vulkan.StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr + }; + + /// + /// Gets the corresponding for a , if any. + /// + /// The structure type. + /// The corresponding for , if any; otherwise, + /// . + public static Type ClrType(this StructureType structureType) + { + return ClrTypes[structureType]; + } + + /// + /// Gets the corresponding for a , if any. + /// + /// The CLR type. + /// The corresponding for , if any; otherwise, + /// . + public static StructureType? StructureType(this Type type) + { + return StructureTypes.TryGetValue(type, out var structureType) ? structureType : null; + } + + /// + /// Whether the can start a chain. + /// + /// The to test. + /// if the can start a chain; otherwise + /// . + public static bool IsChainStart(this StructureType type) + { + return Extenders.ContainsKey(type); + } + + /// + /// Whether the can start a chain. + /// + /// The to test. + /// if the can start a chain; otherwise + /// . + public static bool IsChainStart(this Type type) + { + return StructureTypes.TryGetValue(type, out var structureType) && + Extenders.ContainsKey(structureType); + } + + /// + /// Whether the is chainable. + /// + /// The to test. + /// if the can start a chain; otherwise + /// . + public static bool IsChainable(this StructureType type) + { + return Extenders.ContainsKey(type) || + Extensions.ContainsKey(type); + } + + /// + /// Whether the is chainable. + /// + /// The to test. + /// if the can start a chain; otherwise + /// . + public static bool IsChainable(this Type type) + { + return StructureTypes.TryGetValue(type, out var structureType) && + (Extenders.ContainsKey(structureType) || Extensions.ContainsKey(structureType)); + } + + /// + /// Whether the current can extend the . + /// + /// The to test. + /// The of the chain. + /// if the can extend the ; otherwise, false. + /// + public static bool CanExtend(this StructureType next, StructureType chain) + { + return Extensions.TryGetValue(next, out var extensions) && extensions.Contains(chain); + } + + /// + /// Whether the current can extend the . + /// + /// The to test. + /// The of the chain. + /// if the can extend the ; otherwise, false. + /// + public static bool CanExtend(this Type next, Type chain) + { + return + StructureTypes.TryGetValue(next, out var nextType) && + StructureTypes.TryGetValue(chain, out var chainType) && + Extensions.TryGetValue(nextType, out var extensions) && + extensions.Contains(chainType); + } + + /// + /// Whether the current can be extended by the . + /// + /// The of the chain. + /// The to test. + /// if the can be extended the ; otherwise, false. + /// + public static bool CanBeExtendedBy(this StructureType chain, StructureType next) + { + return Extenders.TryGetValue(chain, out var extenders) && extenders.Contains(next); + } + + /// + /// Whether the current can be extended by the . + /// + /// The of the chain. + /// The to test. + /// if the can extend the ; otherwise, false. + /// + public static bool CanBeExtendedBy(this Type chain, Type next) + { + return + StructureTypes.TryGetValue(next, out var nextType) && + StructureTypes.TryGetValue(chain, out var chainType) && + Extenders.TryGetValue(chainType, out var extenders) && + extenders.Contains(nextType); + } +} diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PrototypeStructChaining.csproj b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PrototypeStructChaining.csproj new file mode 100644 index 0000000000..b5f170722a --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PrototypeStructChaining.csproj @@ -0,0 +1,25 @@ + + + + netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0 + 10 + enable + true + Silk.NET.Vulkan + + + + + + + + + + + + + + + + + diff --git a/src/Lab/Experiments/PrototypeStructChaining/Readme.md b/src/Lab/Experiments/PrototypeStructChaining/Readme.md new file mode 100644 index 0000000000..2eb68080a7 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/Readme.md @@ -0,0 +1,393 @@ +# Prototype Struct Chaining + +This repository implements a prototype solution for Struct Chaining in [Silk.Net](https://github.com/dotnet/Silk.NET) + +## Design Goals + +* **Backward compatibility** - the chaining system should not change the existing structs, but add functionality. +* **Minimal bloat** - the minimum amount of new generated code was sought. +* **Discoverability** - it should be as easy as possible for a new user to discover +* **Compile-time Validation** - it should prevent chaining invalid structures (as much as possible) during compilation +* **Type coercion** - it should set the SType of chained structures. +* **Compact usage** - it should reduce copy-pasta code. +* **Avoid the heap** - boxing should be avoided +* **Well Tested** - tests were added to ensure pointers are correctly set, and compilation failures occur. + +All of these goals were met. + +## Usage + +The proposal provides for the following usage patterns: + +### Chain Building + +You can happily create the start of a chain as usual, and it's `SType` will be coerced when you start using it as a +chain: + +```csharp +var createInfo = new DeviceCreateInfo +{ + Flags = 1U +}; +// When you call any chaining method it will set the chain's SType automatically. +createinfo.AddNext... +``` + +-in many cases, we only want to create a default structure for population by the API. To do so, we use the +static `Chain` +method like so: + +```csharp +PhysicalDeviceFeatures2.Chain(out var features2) +``` + +This has several advantages: + +- The method is only available for structures that are valid at the start of a chain; providing compile-time validation. +- The structure's `SType` will be correctly set immediately. +- The syntax is fluent, and creates more readable code when used with the other chaining methods (see below). + +### AddNext + +The most common use case is to add an empty structure to the end of a chain for it to be populated by the Vulkan API, +this can now be done like so: + +```csharp +PhysicalDeviceFeatures2 + .Chain(out var features2) + // CreateNext will create an empty struct, with the correct SType (as well as ensuring the + // chain's SType is set correctly). + .AddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures) + .AddNext(out PhysicalDeviceAccelerationStructureFeaturesKHR accelerationStructureFeaturesKhr); +``` + +Each method `out` puts a struct into the local stackframe for querying once populated, and the pointers point to this +local variable. Despite generics and interfaces being used, the chain methods avoid the heap entirely. + +### TryAddNext + +You may only want to add a structure if it doesn't already exist in the chain, this can be done with `TryAddNext`, e.g.: + +```csharp +PhysicalDeviceFeatures2 + .Chain(out var features2) + .AddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures) + // As there is already a PhysicalDeviceDescriptorIndexingFeatures structure the following + // will not add anything to the chain and `added` will be `false`. + .TryAddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures2, out bool added); +``` + +### SetNext + +Sometimes we may wish to set the initial state of a structure, we can do this with `SetNext`: + +```csharp +var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures +{ + ShaderInputAttachmentArrayDynamicIndexing = true +}; +var accelerationStructureFeaturesKhr = new PhysicalDeviceAccelerationStructureFeaturesKHR +{ + AccelerationStructure = true +}; + +PhysicalDeviceFeatures2 + .Chain(out var features2) + // SetNext accepts an existing struct, note, it will coerce the SType and blank the PNext + .SetNext(ref indexingFeatures) + .SetNext(ref accelerationStructureFeaturesKhr); +``` + +*NOTE* you can mix and match `AddNext` and `SetNext` (and any chaining method) in the same method chain. + +By default, `SetNext` will replace any item in the chain with a matching `SType`, this behaviour can be changed by +setting the optional +`alwaysAdd` parameter to `true`; + +```csharp +var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures +{ + ShaderInputAttachmentArrayDynamicIndexing = true +}; +var indexingFeatures2 = new PhysicalDeviceDescriptorIndexingFeatures +{ + ShaderInputAttachmentArrayDynamicIndexing = false +}; +var accelerationStructureFeaturesKhr = new PhysicalDeviceAccelerationStructureFeaturesKHR +{ + AccelerationStructure = true +}; + +PhysicalDeviceFeatures2 + .Chain(out var features2) + .SetNext(ref indexingFeatures) + // This will add the second 'indexingFeatures' struct, even though one is already present in the chain. + .SetNext(ref indexingFeatures2, true); +``` + +### IndexOf + +Sometimes it's useful to know if a structure you previously supplied is still in a chain, this can be done +with `IndexOf`, which returns a non-negative index (zero-indexed) if the structure is found, eg.: + +```csharp +PhysicalDeviceFeatures2 + .Chain(out var features2) + .AddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures) + .AddNext(out PhysicalDeviceAccelerationStructureFeaturesKHR accelerationStructureFeaturesKhr); + +// Check indices +Assert.Equal(1, features2.IndexOf(ref indexingFeatures)); +Assert.Equal(2, features2.IndexOf(ref accelerationStructureFeaturesKhr)); +``` + +## Features + +* All the chaining methods are only available on the structures that implement `IChainStart`, i.e. the structures that + the Vulkan specification says can start a chain. +* All the chaining methods ensure the chain, and any supplied structures, have their `SType` correctly set. +* All the chaining methods will only accept a structure that is valid in the chain being extended, as per the Vulkan + specification. +* The chaining methods do not box structures, or add anything to the heap. + +## Changes required + +* Add the new `IStructureType`, `IChainable`, `IChainStart`, `IExtendChain` interfaces. +* Add the new `Chain` structure. +* Add the `ChainExtensions` extension methods `SetNext`, `AddNew`, `IndexOf`, `AddNext` and `TryAddNext`. +* Add the small instance `StructureType IStructuredType.StructureType()` method to `IChainable` structure. +* Add the `IChainStart` interface and the small static `Chain` method to any structure that can be used as the start of + a chain. +* Add `IExtendsChain` interfaces to any structures that can extend a chain. + +Note that the [Vulkan XML](https://raw.githubusercontent.com/KhronosGroup/Vulkan-Headers/master/registry/vk.xml) does +include the `structextends` attribute on each structure that directly maps to the `IExtendsChain` interfaces that +need to be added. However, to add the `IChainStart` interface (and it's associated method), these structures have to be +marked as a chain start whenever we see a structure extending them. + +Although it is possible to not use a design that does not make use of `IChainStart` the following functionality is lost: + +* The `Chain` method will appear on all chainable structures, even when they don't represent the start of a chain. +* All extension methods will appear on all chainable structures, even when they are not the start. +* Indexing, adding, etc. can't be guaranteed to be scanning from the start of the chain. + +As adding `IChainStart` requires relatively simple logic I believe it's worth including. + +# Extension + +## ManagedChain + +Sometimes it is desirable to keep the structures around on the heap. To facilitate that you can use +the `ManagedChain` types. Like `Tuple` et al, these support up to chain size 16. They must be +disposed when finished with. Whenever a structure is loaded into the `ManagedChain` it's `SType` and `PNext` are +forced to be correct, preventing errors. Structures can be replaced at any time, and we be inserted efficiently +into the chain as an O(1) operation. + +### Creation + +For example: + +```csharp +using var chain = new ManagedChain(); + +// Ensure all STypes set correctly +Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); +Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); +Assert.Equal(StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, chain.Item2.SType); + +// Ensure pointers set correctly +Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); +Assert.Equal((nint) chain.Item2Ptr, (nint) chain.Item1.PNext); +Assert.Equal((nint) 0, (nint) chain.Item2.PNext); +``` + +The structures are held in unmanaged memory, preventing movement by the GC, and ensuring that the ptrs remain fixed. + +You can also use the `ManagedChain.Create(...)` static methods to create `ManagedChain`s. + +### Modifying values + +We can easily modify any value in the `ManagedChain`, and it will maintain the ptrs automatically, e.g.: + +```csharp +using var chain = new ManagedChain(item1: new PhysicalDeviceDescriptorIndexingFeatures +{ + // We can set any non-default values, note we do not need to set SType or PNext + // indeed they will be overwritten. + ShaderInputAttachmentArrayDynamicIndexing = true +}); + +// Ensure all STypes set correctly +Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain.Head.SType); +Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); +Assert.Equal(StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, chain.Item2.SType); + +// Ensure pointers set correctly +Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); +Assert.Equal((nint) chain.Item2Ptr, (nint) chain.Item1.PNext); +Assert.Equal((nint) 0, (nint) chain.Item2.PNext); + +// Check our value was set +Assert.True(chain.Item1.ShaderInputAttachmentArrayDynamicIndexing); + +var item1Ptr = chain.Item1Ptr; + +// Overwrite Item1 +chain.Item1 = new PhysicalDeviceDescriptorIndexingFeatures +{ + // Again we do not need to set SType or PNext, which will be set to the correct values + ShaderInputAttachmentArrayDynamicIndexing = false +}; + +// Check our value was cleared +Assert.False(chain.Item1.ShaderInputAttachmentArrayDynamicIndexing); + +// Note all the pointers are still correct (and have not changed) +Assert.Equal((nint) chain.Item1Ptr, (nint) chain.Head.PNext); +Assert.Equal((nint) chain.Item2Ptr, (nint) chain.Item1.PNext); +Assert.Equal((nint) 0, (nint) chain.Item2.PNext); + +// As is the SType +Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain.Item1.SType); +``` + +**Note** When we update any item in the chain it overwrites the existing memory, so the ptrs remain fixed. It also +ensures the PNext value is maintained. + +### Appending to a chain + +You can call `Append` on a `ManagedChain` to efficiently create a new, larger, `ManagedChain` with a new item appended +to the end, e.g: + +```csharp +using var chain = new ManagedChain( + item1: new PhysicalDeviceDescriptorIndexingFeatures {ShaderInputAttachmentArrayDynamicIndexing = true}); + +// The new chain, will efficiently copy the old chain and append a new structure to the end +using var newChain = chain.Append(); +// You will usualy wish to dispose the old chain here, the two chains are now independent of each other. + +// Check the flag from the first chain is still set in the new chain. +Assert.True(newChain.Item1.ShaderInputAttachmentArrayDynamicIndexing); +``` + +### Loading from an unmanaged chain + +If you have created an unmanaged chain and would like to load that into a `ManagedChain` you can use one of the +`ManagedChain.Load` methods: + +```csharp +// Load an unmanaged chain +var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures +{ + ShaderInputAttachmentArrayDynamicIndexing = true +}; +PhysicalDeviceFeatures2 +.Chain(out var unmanagedChain) +.SetNext(ref indexingFeatures) +.AddNext(out PhysicalDeviceAccelerationStructureFeaturesKHR accelerationStructureFeaturesKhr); + +// Loads a new managed chain from an unmanaged chain +using var managedChain = + ManagedChain.Load(unmanagedChain, out var errors); + +// Check we had no loading errors +Assert.Equal("", errors); + +// Check the flag still set +Assert.True(managedChain.Item1.ShaderInputAttachmentArrayDynamicIndexing); +``` + +The full version of the `Load` method returns an output parameter `errors` as it's first parameter. The `errors` +parameter will be `string.Empty` if there are no errors, otherwise each line will contain a separate error for each +issue found during loading. There is also an overload that accepts a single argument `chain` for when you don't care if +there are any errors. Either method always succeeds, even if the unmanaged chain doesn't match exactly - for example it +is shorter or longer than the chain being loaded, or if the managed chain has different structure types in any of the +positions. Any structure type in the expected position will always be loaded into the new `ManagedChain`. + +```csharp +var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures +{ + ShaderInputAttachmentArrayDynamicIndexing = true +}; +// Load an unmanaged chain +DeviceCreateInfo + .Chain(out var unmanagedChain) + .AddNext(out PhysicalDeviceFeatures2 features2) + .SetNext(ref indexingFeatures) + .AddNext(out PhysicalDeviceAccelerationStructureFeaturesKHR accelerationStructureFeaturesKhr); + +// Loads a new managed chain from an unmanaged chain +using var managedChain = + new ManagedChain< + DeviceCreateInfo, + // Note we are supplied a PhysicalDeviceFeatures2 here from the unmanaged chain + PhysicalDeviceAccelerationStructureFeaturesKHR, + PhysicalDeviceDescriptorIndexingFeatures, + PhysicalDeviceAccelerationStructureFeaturesKHR, + // Note that the unmanaged chain did not supply a 5th entry + PhysicalDeviceFeatures2>(unmanagedChain, out var errors); + +// Check for errors +Assert.Equal( +@"The unmanaged chain has a structure type PhysicalDeviceFeatures2Khr at position 2; expected PhysicalDeviceAccelerationStructureFeaturesKhr +The unmanaged chain was length 4, expected length 5", + errors); + +// Despite the errors indexing features was at the right location so was loaded +Assert.True(managedChain.Item2.ShaderInputAttachmentArrayDynamicIndexing); +``` + +Notice that the above form use the constructor as an alternative. + +### IReadOnlyList + +All the fully generic `ManageChain` types extend `ManagedChain` which implements `IDisposable` +and `IReadOnlyList`. The latter allowing for easy consumption of any `ManagedChain`, e.g.: + +```csharp +using var chain = new ManagedChain(); + +Assert.Equal(3, chain.Count); + +// Ensure all STypes set correctly using indexer +Assert.Equal(StructureType.PhysicalDeviceFeatures2, chain[0].StructureType()); +Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, chain[1].StructureType()); +Assert.Equal(StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, chain[2].StructureType()); + +Assert.Throws(() => chain[3]); + +// Get array using IEnumerable implementation +IChainable[] structures = chain.ToArray(); + +// Check concrete types +Assert.IsType(structures[0]); +Assert.IsType(structures[1]); +Assert.IsType(structures[2]); +``` + +### Deconstruction + +Each `ManageChain` has a corresponding deconstructor for convenience, e.g.: + +```csharp +using var chain = new ManagedChain(); + +var (physicalDeviceFeatures2, indexingFeatures, accelerationStructureFeaturesKhr) = chain; + +// Ensure all STypes set correctly +Assert.Equal(StructureType.PhysicalDeviceFeatures2, physicalDeviceFeatures2.SType); +Assert.Equal(StructureType.PhysicalDeviceDescriptorIndexingFeatures, indexingFeatures.SType); +Assert.Equal(StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, accelerationStructureFeaturesKhr.SType); +``` + +### Disposal + +As each `ManagedChain` holds the underlying structures in unmanaged memory (to prevent them being moved and their +pointers being invalidated), then it is critical you dispose them; either by calling `Dispose()` or by using a `using` +statement. \ No newline at end of file diff --git a/src/Vulkan/Silk.NET.Vulkan/Chain.cs b/src/Vulkan/Silk.NET.Vulkan/Chain.cs new file mode 100644 index 0000000000..9aa49e2d30 --- /dev/null +++ b/src/Vulkan/Silk.NET.Vulkan/Chain.cs @@ -0,0 +1,380 @@ +using System.Runtime.CompilerServices; + +namespace Silk.NET.Vulkan; + +/// +/// Extension methods and utilities for building unmanaged structure chains. +/// +public static class Chain +{ + /// + /// Replaces a structure in the chain (if present, and is false), or adds it to the end. + /// + /// The current chain + /// A reference to the structure to update + /// Always adds to the end of the chain, even if an equivalent structure is present. + /// The type of the current chain + /// The type of the value + /// A reference to the value value in the chain + /// + /// Note that both the supplied chain, and the supplied value will have their `SType` correctly set. Further, + /// the supplied structure's will be overwritten. + /// To use + /// + /// var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures + /// { + /// ShaderInputAttachmentArrayDynamicIndexing = true + /// }; + /// var accelerationStructureFeaturesKhr = new PhysicalDeviceAccelerationStructureFeaturesKhr + /// { + /// AccelerationStructure = true + /// }; + /// + /// PhysicalDeviceFeatures2 + /// .BaseInStructure(out var features2) + /// .SetNext(ref indexingFeatures) + /// .SetNext(ref accelerationStructureFeaturesKhr); + /// + /// + /// + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ref TChain SetNext + ( + this ref TChain chain, + ref TNext value, + bool alwaysAdd = false + ) + where TChain : struct, IChainStart + where TNext : struct, IExtendsChain + => ref SetNextAny(ref chain, ref value, alwaysAdd); + + /// + /// Replaces a structure in the chain (if present, and is false), or adds it to the end. + /// + /// The current chain + /// A reference to the structure to update + /// Always adds to the end of the chain, even if an equivalent structure is present. + /// The type of the current chain + /// The type of the value + /// A reference to the value value in the chain + /// + /// Note that both the supplied chain, and the supplied value will have their `SType` correctly set. Further, + /// the supplied structure's will be overwritten. + /// To use + /// + /// var indexingFeatures = new PhysicalDeviceDescriptorIndexingFeatures + /// { + /// ShaderInputAttachmentArrayDynamicIndexing = true + /// }; + /// var accelerationStructureFeaturesKhr = new PhysicalDeviceAccelerationStructureFeaturesKhr + /// { + /// AccelerationStructure = true + /// }; + /// + /// PhysicalDeviceFeatures2 + /// .BaseInStructure(out var features2) + /// .SetNext(ref indexingFeatures) + /// .SetNext(ref accelerationStructureFeaturesKhr); + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public static unsafe ref TChain SetNextAny + ( + this ref TChain chain, + ref TNext value, + bool alwaysAdd = false + ) + where TChain : struct, IChainable + where TNext : struct, IChainable + { + // Ensure structure type of chain and value are set. + chain.StructureType(); + var structureType = value.StructureType(); + + // Find end of chain + var previousPtr = (BaseInStructure*) null; + var currentPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var valuePtr = (BaseInStructure*) Unsafe.AsPointer(ref value); + do + { + var nextPtr = currentPtr->PNext; + if (!alwaysAdd && currentPtr->SType == structureType) + { + // We have an existing structure, replace it. + if (previousPtr is not null) + { + previousPtr->PNext = valuePtr; + } + + valuePtr->PNext = nextPtr; + + return ref chain; + } + + previousPtr = currentPtr; + currentPtr = nextPtr; + } while (currentPtr is not null); + + // Add value to end of chain + previousPtr->PNext = valuePtr; + valuePtr->PNext = null; + + return ref chain; + } + + /// + /// Adds a structure to the end of the chain. + /// + /// The current chain + /// The structure added to the end of the chain + /// The type of the current chain + /// The type of the structure to add + /// The reference to the chain. + /// + /// Note that both the supplied chain, and the added structure will have their `SType` correctly set + /// To use specify the output type required, e.g.: + /// + /// PhysicalDeviceFeatures2 + /// .BaseInStructure(out var features2) + /// .AddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures) + /// .AddNext(out PhysicalDeviceAccelerationStructureFeaturesKhr accelerationStructureFeaturesKhr); + /// + /// Note, the value is always added, even if an equivalent value is added in the chain already. Use + /// to only add if not already present. + /// + /// + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ref TChain AddNext(this ref TChain chain, out TNext next) + where TChain : struct, IChainStart + where TNext : struct, IExtendsChain + => ref AddNextAny(ref chain, out next); + + /// + /// Adds a structure to the end of the chain. + /// + /// The current chain + /// The structure added to the end of the chain + /// The type of the current chain + /// The type of the structure to add + /// The reference to the chain. + /// + /// Note that both the supplied chain, and the added structure will have their `SType` correctly set + /// To use specify the output type required, e.g.: + /// + /// PhysicalDeviceFeatures2 + /// .BaseInStructure(out var features2) + /// .AddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures) + /// .AddNext(out PhysicalDeviceAccelerationStructureFeaturesKhr accelerationStructureFeaturesKhr); + /// + /// Note, the value is always added, even if an equivalent value is added in the chain already. Use + /// to only add if not already present. + /// + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + /// + /// + /// + public static unsafe ref TChain AddNextAny(this ref TChain chain, out TNext next) + where TChain : struct, IChainable + where TNext : struct, IChainable + { + // Ensure structure type of chain is set. + chain.StructureType(); + + // Find end of chain + var currentPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + while (currentPtr->PNext is not null) + { + currentPtr = currentPtr->PNext; + } + + // Create new entry and set it's structure type + next = default; + next.StructureType(); + currentPtr->PNext = (BaseInStructure*) Unsafe.AsPointer(ref next); + return ref chain; + } + + /// + /// Tries to add a structure to the end of the chain. + /// + /// The current chain + /// The structure added to the end of the chain + /// Whether the structure was actually added + /// The type of the current chain + /// The type of the structure to add + /// The reference to the chain. + /// + /// Note that both the supplied chain, and the added structure will have their `SType` correctly set + /// To use specify the output type required, e.g.: + /// + /// PhysicalDeviceFeatures2 + /// .BaseInStructure(out var features2) + /// .TryAddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures, out var added); + /// + /// + /// + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ref TChain TryAddNext(this ref TChain chain, out TNext next, out bool added) + where TChain : struct, IChainStart + where TNext : struct, IExtendsChain + => ref TryAddNextAny(ref chain, out next, out added); + + /// + /// Tries to add a structure to the end of the chain. + /// + /// The current chain + /// The structure added to the end of the chain + /// Whether the structure was actually added + /// The type of the current chain + /// The type of the structure to add + /// The reference to the chain. + /// + /// Note that both the supplied chain, and the added structure will have their `SType` correctly set + /// To use specify the output type required, e.g.: + /// + /// PhysicalDeviceFeatures2 + /// .BaseInStructure(out var features2) + /// .TryAddNext(out PhysicalDeviceDescriptorIndexingFeatures indexingFeatures, out var added); + /// + /// + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + /// + /// + /// + public static unsafe ref TChain TryAddNextAny(this ref TChain chain, out TNext next, out bool added) + where TChain : struct, IChainable + where TNext : struct, IChainable + { + // Ensure structure type of chain is set. + chain.StructureType(); + + // Create new entry and get it's structure type + next = default; + var structureType = next.StructureType(); + + // Follow chain + var currentPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + do + { + if (currentPtr->SType == structureType) + { + added = false; + return ref chain; + } + + var nextPtr = currentPtr->PNext; + if (nextPtr is null) + { + break; + } + + currentPtr = nextPtr; + } while (true); + + currentPtr->PNext = (BaseInStructure*) Unsafe.AsPointer(ref next); + added = true; + return ref chain; + } + + /// + /// Returns the index of the in the , if present. + /// + /// The chain + /// The structure value + /// The type of the current chain + /// The type of the value + /// The zero-indexed index if found; otherwise -1. + /// + /// + /// + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static int IndexOf(this ref TChain chain, ref TNext value) + where TChain : struct, IChainStart + where TNext : struct, IExtendsChain + => IndexOfAny(ref chain, ref value); + + /// + /// Returns the index of the in the , if present. + /// + /// The chain + /// The structure value + /// The type of the current chain + /// The type of the value + /// The zero-indexed index if found; otherwise -1. + /// + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + /// + /// + /// + public static unsafe int IndexOfAny(this ref TChain chain, ref TNext value) + where TChain : struct, IChainable + where TNext : struct, IChainable + { + // Ensure structure type of chain is set. + chain.StructureType(); + + var index = 0; + var currentPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var valuePtr = (BaseInStructure*) Unsafe.AsPointer(ref value); + // Follow chain + do + { + if (currentPtr == valuePtr) + { + return index; + } + + currentPtr = currentPtr->PNext; + index++; + } while (currentPtr is not null); + + return -1; + } +} diff --git a/src/Vulkan/Silk.NET.Vulkan/IChainStart.cs b/src/Vulkan/Silk.NET.Vulkan/IChainStart.cs new file mode 100644 index 0000000000..9ac897e448 --- /dev/null +++ b/src/Vulkan/Silk.NET.Vulkan/IChainStart.cs @@ -0,0 +1,10 @@ +namespace Silk.NET.Vulkan; + +/// +/// Marks a chainable struct as being allowed at the start of a chain. +/// +/// Any will have a corresponding static `BaseInStructure(out var chain)` +/// convenience method. +public interface IChainStart : IChainable +{ +} diff --git a/src/Vulkan/Silk.NET.Vulkan/IChainable.cs b/src/Vulkan/Silk.NET.Vulkan/IChainable.cs new file mode 100644 index 0000000000..1680728d74 --- /dev/null +++ b/src/Vulkan/Silk.NET.Vulkan/IChainable.cs @@ -0,0 +1,15 @@ +namespace Silk.NET.Vulkan; + +/// +/// Base interface for any struct that has can set the next value. +/// +/// Note that any structure marked must start with a +/// and a void* field, in that order. This is so that a pointer to it can be coerced +/// to a pointer to a . +public interface IChainable : IStructuredType +{ + /// + /// Points to the next in this chain, if any; otherwise . + /// + unsafe BaseInStructure* PNext { get; set; } +} diff --git a/src/Vulkan/Silk.NET.Vulkan/IExtendsChain.cs b/src/Vulkan/Silk.NET.Vulkan/IExtendsChain.cs new file mode 100644 index 0000000000..306e008327 --- /dev/null +++ b/src/Vulkan/Silk.NET.Vulkan/IExtendsChain.cs @@ -0,0 +1,11 @@ +namespace Silk.NET.Vulkan; + +/// +/// Marks a chainable struct indicating which chain this type +/// extends. +/// +/// A chain start structure. +public interface IExtendsChain : IChainable + where TChain : IChainable +{ +} diff --git a/src/Vulkan/Silk.NET.Vulkan/IStructuredType.cs b/src/Vulkan/Silk.NET.Vulkan/IStructuredType.cs new file mode 100644 index 0000000000..ed30531ea2 --- /dev/null +++ b/src/Vulkan/Silk.NET.Vulkan/IStructuredType.cs @@ -0,0 +1,19 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Vulkan; + +/// +/// Base interface for any struct that has a field called `SType`, that must be correctly +/// set when passing into the Vulkan API. +/// +public interface IStructuredType +{ + /// + /// Gets the structured type's enum value. + /// + /// + /// Retrieving the also ensures it is set to the correct value (if any). + /// + StructureType StructureType(); +} \ No newline at end of file diff --git a/src/Vulkan/Silk.NET.Vulkan/ManagedChain.gen.cs b/src/Vulkan/Silk.NET.Vulkan/ManagedChain.gen.cs new file mode 100644 index 0000000000..147681fdba --- /dev/null +++ b/src/Vulkan/Silk.NET.Vulkan/ManagedChain.gen.cs @@ -0,0 +1,20499 @@ +// ReSharper disable StaticMemberInGenericType +#pragma warning disable CS0659, CS0660 +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; + +namespace Silk.NET.Vulkan; + +/// +/// Base class for all Managed Chains. +/// +public abstract unsafe class ManagedChain : IReadOnlyList, IDisposable +{ + /// + /// Gets a pointer to the current head. + /// + public abstract BaseInStructure* HeadPtr { get; } + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public abstract int Size { get; } + + /// + public abstract IEnumerator GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// + public abstract int Count { get; } + + /// + public abstract IChainable this[int index] { get; } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool Equals(object obj) + { + return !ReferenceEquals(null, obj) && + (ReferenceEquals(this, obj) || obj.GetType() == this.GetType() && MemoryEquals((ManagedChain) obj)); + } + + /// + /// Compares the supplied memory block with this one. + /// + protected abstract bool MemoryEquals(ManagedChain other); + + /// + public abstract void Dispose(); + + /// + /// Combines a hashcode with the contents of a slice. + /// + /// + /// + /// + protected static void CombineHash(ref int hashCode, ReadOnlySpan slice) + { + if (slice.Length >= 8) + { + // Process slice in 8 byte chunks + var s8 = MemoryMarshal.Cast(slice); + foreach (var l in s8) + { + hashCode = HashCode.Combine(hashCode, l); + } + + slice = slice.Slice(s8.Length*8); + } + + // Process remainder of slice + if (slice.Length >= 4) + { + var s4 = MemoryMarshal.Cast(slice); + hashCode = HashCode.Combine(hashCode, s4[0]); + slice = slice.Slice(s4.Length*4); + } + + if (slice.Length >= 2) + { + var s2 = MemoryMarshal.Cast(slice); + hashCode = HashCode.Combine(hashCode, s2[0]); + slice = slice.Slice(s2.Length*2); + } + + if (slice.Length > 0) + { + hashCode = HashCode.Combine(hashCode, slice[0]); + } + } + + /// + /// Creates a new with 1 items. + /// + /// The head of the chain. + /// The chain type + /// A new with 1 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default) + where TChain : struct, IChainStart + => new(head); + + /// + /// Creates a new with 1 items. + /// + /// The head of the chain. + /// The chain type + /// A new with 1 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default) + where TChain : struct, IChainable + => new(head); + + /// + /// Loads a new with 1 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 1 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + => LoadAny(out var _, chain); + + /// + /// Loads a new with 1 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 1 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 1 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 1 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + => LoadAny(out errors, chain); + + /// + /// Loads a new with 1 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 1 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + errors = string.Empty; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 2 items. + /// + /// The head of the chain. + /// Item 1. + /// The chain type + /// Type of Item 1. + /// A new with 2 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + => new(head, item1); + + /// + /// Creates a new with 2 items. + /// + /// The head of the chain. + /// Item 1. + /// The chain type + /// Type of Item 1. + /// A new with 2 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + => new(head, item1); + + /// + /// Loads a new with 2 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 2 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 2 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 2 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 2 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 2 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 2 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 2 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 2"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 2"); + existingPtr->PNext = null; + } + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 3 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// A new with 3 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default, T2 item2 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + => new(head, item1, item2); + + /// + /// Creates a new with 3 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// A new with 3 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default, T2 item2 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + => new(head, item1, item2); + + /// + /// Loads a new with 3 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 3 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 3 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 3 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 3 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 3 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 3 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 3 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 3"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + newPtr = newPtr->PNext; + + T2 item2 = default; + expectedStructureType = item2.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 2, expected length 3"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 3; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 3"); + existingPtr->PNext = null; + } + item2 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item2, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 4 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// A new with 4 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + => new(head, item1, item2, item3); + + /// + /// Creates a new with 4 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// A new with 4 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + => new(head, item1, item2, item3); + + /// + /// Loads a new with 4 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 4 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 4 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 4 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 4 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 4 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 4 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 4 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 4"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + newPtr = newPtr->PNext; + + T2 item2 = default; + expectedStructureType = item2.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 2, expected length 4"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 3; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item2 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item2, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + newPtr = newPtr->PNext; + + T3 item3 = default; + expectedStructureType = item3.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 3, expected length 4"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 4; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 4"); + existingPtr->PNext = null; + } + item3 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item3, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 5 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// A new with 5 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + => new(head, item1, item2, item3, item4); + + /// + /// Creates a new with 5 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// A new with 5 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + => new(head, item1, item2, item3, item4); + + /// + /// Loads a new with 5 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 5 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 5 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 5 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 5 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 5 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 5 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 5 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 5"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + newPtr = newPtr->PNext; + + T2 item2 = default; + expectedStructureType = item2.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 2, expected length 5"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 3; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item2 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item2, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + newPtr = newPtr->PNext; + + T3 item3 = default; + expectedStructureType = item3.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 3, expected length 5"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 4; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item3 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item3, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + newPtr = newPtr->PNext; + + T4 item4 = default; + expectedStructureType = item4.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 4, expected length 5"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 5; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 5"); + existingPtr->PNext = null; + } + item4 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item4, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 6 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// A new with 6 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + => new(head, item1, item2, item3, item4, item5); + + /// + /// Creates a new with 6 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// A new with 6 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + => new(head, item1, item2, item3, item4, item5); + + /// + /// Loads a new with 6 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 6 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 6 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 6 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 6 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 6 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 6 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 6 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 6"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + newPtr = newPtr->PNext; + + T2 item2 = default; + expectedStructureType = item2.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 2, expected length 6"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 3; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item2 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item2, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + newPtr = newPtr->PNext; + + T3 item3 = default; + expectedStructureType = item3.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 3, expected length 6"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 4; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item3 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item3, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + newPtr = newPtr->PNext; + + T4 item4 = default; + expectedStructureType = item4.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 4, expected length 6"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 5; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item4 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item4, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + newPtr = newPtr->PNext; + + T5 item5 = default; + expectedStructureType = item5.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 5, expected length 6"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 6; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 6"); + existingPtr->PNext = null; + } + item5 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item5, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 7 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// A new with 7 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + => new(head, item1, item2, item3, item4, item5, item6); + + /// + /// Creates a new with 7 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// A new with 7 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + => new(head, item1, item2, item3, item4, item5, item6); + + /// + /// Loads a new with 7 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 7 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 7 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 7 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 7 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 7 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 7 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 7 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 7"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + newPtr = newPtr->PNext; + + T2 item2 = default; + expectedStructureType = item2.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 2, expected length 7"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 3; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item2 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item2, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + newPtr = newPtr->PNext; + + T3 item3 = default; + expectedStructureType = item3.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 3, expected length 7"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 4; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item3 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item3, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + newPtr = newPtr->PNext; + + T4 item4 = default; + expectedStructureType = item4.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 4, expected length 7"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 5; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item4 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item4, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + newPtr = newPtr->PNext; + + T5 item5 = default; + expectedStructureType = item5.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 5, expected length 7"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 6; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item5 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item5, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + newPtr = newPtr->PNext; + + T6 item6 = default; + expectedStructureType = item6.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 6, expected length 7"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 7; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 7"); + existingPtr->PNext = null; + } + item6 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item6, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 8 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// A new with 8 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + => new(head, item1, item2, item3, item4, item5, item6, item7); + + /// + /// Creates a new with 8 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// A new with 8 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + => new(head, item1, item2, item3, item4, item5, item6, item7); + + /// + /// Loads a new with 8 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 8 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 8 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 8 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 8 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 8 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 8 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 8 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 8"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + newPtr = newPtr->PNext; + + T2 item2 = default; + expectedStructureType = item2.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 2, expected length 8"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 3; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item2 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item2, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + newPtr = newPtr->PNext; + + T3 item3 = default; + expectedStructureType = item3.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 3, expected length 8"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 4; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item3 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item3, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + newPtr = newPtr->PNext; + + T4 item4 = default; + expectedStructureType = item4.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 4, expected length 8"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 5; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item4 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item4, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + newPtr = newPtr->PNext; + + T5 item5 = default; + expectedStructureType = item5.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 5, expected length 8"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 6; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item5 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item5, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + newPtr = newPtr->PNext; + + T6 item6 = default; + expectedStructureType = item6.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 6, expected length 8"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 7; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item6 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item6, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + newPtr = newPtr->PNext; + + T7 item7 = default; + expectedStructureType = item7.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 7, expected length 8"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 8; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 8"); + existingPtr->PNext = null; + } + item7 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item7, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 9 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// A new with 9 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + => new(head, item1, item2, item3, item4, item5, item6, item7, item8); + + /// + /// Creates a new with 9 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// A new with 9 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + => new(head, item1, item2, item3, item4, item5, item6, item7, item8); + + /// + /// Loads a new with 9 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 9 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 9 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 9 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 9 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 9 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 9 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 9 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 9"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + newPtr = newPtr->PNext; + + T2 item2 = default; + expectedStructureType = item2.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 2, expected length 9"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 3; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item2 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item2, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + newPtr = newPtr->PNext; + + T3 item3 = default; + expectedStructureType = item3.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 3, expected length 9"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 4; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item3 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item3, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + newPtr = newPtr->PNext; + + T4 item4 = default; + expectedStructureType = item4.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 4, expected length 9"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 5; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item4 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item4, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + newPtr = newPtr->PNext; + + T5 item5 = default; + expectedStructureType = item5.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 5, expected length 9"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 6; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item5 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item5, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + newPtr = newPtr->PNext; + + T6 item6 = default; + expectedStructureType = item6.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 6, expected length 9"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 7; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item6 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item6, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + newPtr = newPtr->PNext; + + T7 item7 = default; + expectedStructureType = item7.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 7, expected length 9"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 8; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item7 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item7, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + newPtr = newPtr->PNext; + + T8 item8 = default; + expectedStructureType = item8.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 8, expected length 9"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 9; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 9"); + existingPtr->PNext = null; + } + item8 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item8, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 10 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// A new with 10 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + => new(head, item1, item2, item3, item4, item5, item6, item7, item8, item9); + + /// + /// Creates a new with 10 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// A new with 10 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + => new(head, item1, item2, item3, item4, item5, item6, item7, item8, item9); + + /// + /// Loads a new with 10 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 10 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 10 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 10 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 10 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 10 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 10 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 10 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 10"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + newPtr = newPtr->PNext; + + T2 item2 = default; + expectedStructureType = item2.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 2, expected length 10"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 3; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item2 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item2, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + newPtr = newPtr->PNext; + + T3 item3 = default; + expectedStructureType = item3.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 3, expected length 10"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 4; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item3 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item3, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + newPtr = newPtr->PNext; + + T4 item4 = default; + expectedStructureType = item4.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 4, expected length 10"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 5; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item4 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item4, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + newPtr = newPtr->PNext; + + T5 item5 = default; + expectedStructureType = item5.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 5, expected length 10"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 6; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item5 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item5, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + newPtr = newPtr->PNext; + + T6 item6 = default; + expectedStructureType = item6.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 6, expected length 10"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 7; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item6 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item6, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + newPtr = newPtr->PNext; + + T7 item7 = default; + expectedStructureType = item7.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 7, expected length 10"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 8; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item7 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item7, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + newPtr = newPtr->PNext; + + T8 item8 = default; + expectedStructureType = item8.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 8, expected length 10"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 9; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item8 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item8, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + newPtr = newPtr->PNext; + + T9 item9 = default; + expectedStructureType = item9.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 9, expected length 10"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 10; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 10"); + existingPtr->PNext = null; + } + item9 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item9, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 11 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// A new with 11 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + => new(head, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10); + + /// + /// Creates a new with 11 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// A new with 11 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + => new(head, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10); + + /// + /// Loads a new with 11 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 11 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 11 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 11 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 11 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 11 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 11 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 11 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 11"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + newPtr = newPtr->PNext; + + T2 item2 = default; + expectedStructureType = item2.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 2, expected length 11"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 3; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item2 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item2, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + newPtr = newPtr->PNext; + + T3 item3 = default; + expectedStructureType = item3.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 3, expected length 11"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 4; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item3 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item3, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + newPtr = newPtr->PNext; + + T4 item4 = default; + expectedStructureType = item4.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 4, expected length 11"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 5; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item4 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item4, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + newPtr = newPtr->PNext; + + T5 item5 = default; + expectedStructureType = item5.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 5, expected length 11"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 6; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item5 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item5, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + newPtr = newPtr->PNext; + + T6 item6 = default; + expectedStructureType = item6.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 6, expected length 11"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 7; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item6 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item6, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + newPtr = newPtr->PNext; + + T7 item7 = default; + expectedStructureType = item7.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 7, expected length 11"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 8; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item7 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item7, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + newPtr = newPtr->PNext; + + T8 item8 = default; + expectedStructureType = item8.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 8, expected length 11"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 9; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item8 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item8, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + newPtr = newPtr->PNext; + + T9 item9 = default; + expectedStructureType = item9.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 9, expected length 11"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 10; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item9 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item9, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + newPtr = newPtr->PNext; + + T10 item10 = default; + expectedStructureType = item10.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 10, expected length 11"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 11; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 11"); + existingPtr->PNext = null; + } + item10 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item10, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 12 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// A new with 12 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default, T11 item11 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + => new(head, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11); + + /// + /// Creates a new with 12 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// A new with 12 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default, T11 item11 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + => new(head, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11); + + /// + /// Loads a new with 12 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 12 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 12 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 12 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 12 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 12 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 12 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 12 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 12"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + newPtr = newPtr->PNext; + + T2 item2 = default; + expectedStructureType = item2.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 2, expected length 12"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 3; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item2 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item2, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + newPtr = newPtr->PNext; + + T3 item3 = default; + expectedStructureType = item3.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 3, expected length 12"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 4; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item3 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item3, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + newPtr = newPtr->PNext; + + T4 item4 = default; + expectedStructureType = item4.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 4, expected length 12"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 5; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item4 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item4, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + newPtr = newPtr->PNext; + + T5 item5 = default; + expectedStructureType = item5.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 5, expected length 12"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 6; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item5 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item5, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + newPtr = newPtr->PNext; + + T6 item6 = default; + expectedStructureType = item6.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 6, expected length 12"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 7; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item6 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item6, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + newPtr = newPtr->PNext; + + T7 item7 = default; + expectedStructureType = item7.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 7, expected length 12"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 8; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item7 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item7, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + newPtr = newPtr->PNext; + + T8 item8 = default; + expectedStructureType = item8.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 8, expected length 12"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 9; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item8 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item8, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + newPtr = newPtr->PNext; + + T9 item9 = default; + expectedStructureType = item9.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 9, expected length 12"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 10; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item9 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item9, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + newPtr = newPtr->PNext; + + T10 item10 = default; + expectedStructureType = item10.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 10, expected length 12"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 11; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item10 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item10, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + newPtr = newPtr->PNext; + + T11 item11 = default; + expectedStructureType = item11.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 11, expected length 12"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 12; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 12"); + existingPtr->PNext = null; + } + item11 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item11, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 13 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// A new with 13 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default, T11 item11 = default, T12 item12 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + => new(head, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12); + + /// + /// Creates a new with 13 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// A new with 13 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default, T11 item11 = default, T12 item12 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + => new(head, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12); + + /// + /// Loads a new with 13 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 13 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 13 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 13 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 13 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 13 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 13 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 13 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 13"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + newPtr = newPtr->PNext; + + T2 item2 = default; + expectedStructureType = item2.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 2, expected length 13"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 3; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item2 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item2, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + newPtr = newPtr->PNext; + + T3 item3 = default; + expectedStructureType = item3.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 3, expected length 13"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 4; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item3 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item3, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + newPtr = newPtr->PNext; + + T4 item4 = default; + expectedStructureType = item4.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 4, expected length 13"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 5; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item4 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item4, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + newPtr = newPtr->PNext; + + T5 item5 = default; + expectedStructureType = item5.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 5, expected length 13"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 6; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item5 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item5, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + newPtr = newPtr->PNext; + + T6 item6 = default; + expectedStructureType = item6.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 6, expected length 13"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 7; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item6 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item6, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + newPtr = newPtr->PNext; + + T7 item7 = default; + expectedStructureType = item7.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 7, expected length 13"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 8; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item7 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item7, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + newPtr = newPtr->PNext; + + T8 item8 = default; + expectedStructureType = item8.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 8, expected length 13"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 9; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item8 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item8, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + newPtr = newPtr->PNext; + + T9 item9 = default; + expectedStructureType = item9.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 9, expected length 13"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 10; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item9 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item9, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + newPtr = newPtr->PNext; + + T10 item10 = default; + expectedStructureType = item10.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 10, expected length 13"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 11; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item10 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item10, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + newPtr = newPtr->PNext; + + T11 item11 = default; + expectedStructureType = item11.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 11, expected length 13"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 12; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item11 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item11, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item12Offset); + newPtr = newPtr->PNext; + + T12 item12 = default; + expectedStructureType = item12.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 12, expected length 13"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 13; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 13"); + existingPtr->PNext = null; + } + item12 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item12, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 14 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + /// Item 13. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// A new with 14 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default, T11 item11 = default, T12 item12 = default, T13 item13 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + => new(head, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13); + + /// + /// Creates a new with 14 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + /// Item 13. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// A new with 14 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default, T11 item11 = default, T12 item12 = default, T13 item13 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + => new(head, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13); + + /// + /// Loads a new with 14 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 14 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 14 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 14 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 14 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 14 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 14 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 14 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 14"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + newPtr = newPtr->PNext; + + T2 item2 = default; + expectedStructureType = item2.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 2, expected length 14"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 3; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item2 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item2, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + newPtr = newPtr->PNext; + + T3 item3 = default; + expectedStructureType = item3.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 3, expected length 14"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 4; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item3 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item3, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + newPtr = newPtr->PNext; + + T4 item4 = default; + expectedStructureType = item4.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 4, expected length 14"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 5; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item4 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item4, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + newPtr = newPtr->PNext; + + T5 item5 = default; + expectedStructureType = item5.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 5, expected length 14"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 6; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item5 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item5, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + newPtr = newPtr->PNext; + + T6 item6 = default; + expectedStructureType = item6.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 6, expected length 14"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 7; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item6 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item6, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + newPtr = newPtr->PNext; + + T7 item7 = default; + expectedStructureType = item7.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 7, expected length 14"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 8; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item7 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item7, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + newPtr = newPtr->PNext; + + T8 item8 = default; + expectedStructureType = item8.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 8, expected length 14"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 9; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item8 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item8, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + newPtr = newPtr->PNext; + + T9 item9 = default; + expectedStructureType = item9.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 9, expected length 14"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 10; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item9 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item9, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + newPtr = newPtr->PNext; + + T10 item10 = default; + expectedStructureType = item10.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 10, expected length 14"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 11; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item10 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item10, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + newPtr = newPtr->PNext; + + T11 item11 = default; + expectedStructureType = item11.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 11, expected length 14"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 12; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item11 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item11, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item12Offset); + newPtr = newPtr->PNext; + + T12 item12 = default; + expectedStructureType = item12.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 12, expected length 14"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 13; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item12 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item12, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item13Offset); + newPtr = newPtr->PNext; + + T13 item13 = default; + expectedStructureType = item13.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 13, expected length 14"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 14; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 14"); + existingPtr->PNext = null; + } + item13 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item13, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 15 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + /// Item 13. + /// Item 14. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// A new with 15 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default, T11 item11 = default, T12 item12 = default, T13 item13 = default, T14 item14 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + where T14 : struct, IExtendsChain + => new(head, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14); + + /// + /// Creates a new with 15 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + /// Item 13. + /// Item 14. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// A new with 15 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default, T11 item11 = default, T12 item12 = default, T13 item13 = default, T14 item14 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable + => new(head, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14); + + /// + /// Loads a new with 15 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 15 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + where T14 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 15 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 15 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 15 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 15 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + where T14 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 15 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 15 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 15"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + newPtr = newPtr->PNext; + + T2 item2 = default; + expectedStructureType = item2.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 2, expected length 15"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 3; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item2 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item2, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + newPtr = newPtr->PNext; + + T3 item3 = default; + expectedStructureType = item3.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 3, expected length 15"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 4; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item3 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item3, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + newPtr = newPtr->PNext; + + T4 item4 = default; + expectedStructureType = item4.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 4, expected length 15"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 5; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item4 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item4, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + newPtr = newPtr->PNext; + + T5 item5 = default; + expectedStructureType = item5.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 5, expected length 15"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 6; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item5 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item5, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + newPtr = newPtr->PNext; + + T6 item6 = default; + expectedStructureType = item6.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 6, expected length 15"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 7; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item6 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item6, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + newPtr = newPtr->PNext; + + T7 item7 = default; + expectedStructureType = item7.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 7, expected length 15"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 8; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item7 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item7, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + newPtr = newPtr->PNext; + + T8 item8 = default; + expectedStructureType = item8.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 8, expected length 15"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 9; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item8 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item8, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + newPtr = newPtr->PNext; + + T9 item9 = default; + expectedStructureType = item9.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 9, expected length 15"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 10; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item9 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item9, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + newPtr = newPtr->PNext; + + T10 item10 = default; + expectedStructureType = item10.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 10, expected length 15"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 11; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item10 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item10, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + newPtr = newPtr->PNext; + + T11 item11 = default; + expectedStructureType = item11.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 11, expected length 15"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 12; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item11 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item11, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item12Offset); + newPtr = newPtr->PNext; + + T12 item12 = default; + expectedStructureType = item12.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 12, expected length 15"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 13; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item12 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item12, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item13Offset); + newPtr = newPtr->PNext; + + T13 item13 = default; + expectedStructureType = item13.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 13, expected length 15"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 14; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item13 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item13, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item14Offset); + newPtr = newPtr->PNext; + + T14 item14 = default; + expectedStructureType = item14.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 14, expected length 15"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 15; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 15"); + existingPtr->PNext = null; + } + item14 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item14, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 16 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + /// Item 13. + /// Item 14. + /// Item 15. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// Type of Item 15. + /// A new with 16 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Create(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default, T11 item11 = default, T12 item12 = default, T13 item13 = default, T14 item14 = default, T15 item15 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + where T14 : struct, IExtendsChain + where T15 : struct, IExtendsChain + => new(head, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15); + + /// + /// Creates a new with 16 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + /// Item 13. + /// Item 14. + /// Item 15. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// Type of Item 15. + /// A new with 16 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain CreateAny(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default, T11 item11 = default, T12 item12 = default, T13 item13 = default, T14 item14 = default, T15 item15 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable + where T15 : struct, IChainable + => new(head, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11, item12, item13, item14, item15); + + /// + /// Loads a new with 16 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 16 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + where T14 : struct, IExtendsChain + where T15 : struct, IExtendsChain + => LoadAny(out var _, chain); + + /// + /// Loads a new with 16 items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with 16 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable + where T15 : struct, IChainable + => LoadAny(out var _, chain); + + /// + /// Loads a new with 16 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 16 items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Load(out string errors, TChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + where T14 : struct, IExtendsChain + where T15 : struct, IExtendsChain + => LoadAny(out errors, chain); + + /// + /// Loads a new with 16 items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with 16 items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain LoadAny(out string errors, TChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable + where T15 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + newPtr = newPtr->PNext; + + T1 item1 = default; + var expectedStructureType = item1.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 1, expected length 16"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 2; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item1 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item1, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + newPtr = newPtr->PNext; + + T2 item2 = default; + expectedStructureType = item2.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 2, expected length 16"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 3; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item2 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item2, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + newPtr = newPtr->PNext; + + T3 item3 = default; + expectedStructureType = item3.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 3, expected length 16"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 4; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item3 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item3, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + newPtr = newPtr->PNext; + + T4 item4 = default; + expectedStructureType = item4.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 4, expected length 16"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 5; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item4 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item4, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + newPtr = newPtr->PNext; + + T5 item5 = default; + expectedStructureType = item5.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 5, expected length 16"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 6; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item5 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item5, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + newPtr = newPtr->PNext; + + T6 item6 = default; + expectedStructureType = item6.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 6, expected length 16"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 7; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item6 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item6, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + newPtr = newPtr->PNext; + + T7 item7 = default; + expectedStructureType = item7.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 7, expected length 16"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 8; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item7 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item7, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + newPtr = newPtr->PNext; + + T8 item8 = default; + expectedStructureType = item8.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 8, expected length 16"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 9; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item8 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item8, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + newPtr = newPtr->PNext; + + T9 item9 = default; + expectedStructureType = item9.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 9, expected length 16"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 10; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item9 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item9, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + newPtr = newPtr->PNext; + + T10 item10 = default; + expectedStructureType = item10.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 10, expected length 16"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 11; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item10 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item10, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + newPtr = newPtr->PNext; + + T11 item11 = default; + expectedStructureType = item11.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 11, expected length 16"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 12; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item11 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item11, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item12Offset); + newPtr = newPtr->PNext; + + T12 item12 = default; + expectedStructureType = item12.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 12, expected length 16"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 13; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item12 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item12, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item13Offset); + newPtr = newPtr->PNext; + + T13 item13 = default; + expectedStructureType = item13.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 13, expected length 16"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 14; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item13 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item13, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item14Offset); + newPtr = newPtr->PNext; + + T14 item14 = default; + expectedStructureType = item14.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 14, expected length 16"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 15; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + item14 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item14, (nint) newPtr, false); + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item15Offset); + newPtr = newPtr->PNext; + + T15 item15 = default; + expectedStructureType = item15.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length 15, expected length 16"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position 16; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length 16"); + existingPtr->PNext = null; + } + item15 = Unsafe.AsRef(existingPtr); + } + } + Marshal.StructureToPtr(item15, (nint) newPtr, false); + + // Create string of errors + errors = errorBuilder.ToString().Trim(); + return new ManagedChain(newHeadPtr); + } + +} + +/// +/// Static class providing extension methods for manipulating managed chains. +/// +/// The `Any` versions of chain methods do not validate that items belong in the chain, this is +/// useful for situations where the specification does not indicate required chain constraints. You should generally +/// try to use the none `Any` version in preference. +public static unsafe class ManagedChainExtensions +{ + /// + /// Creates a new with 1 by copying the . + /// + /// The chain. + /// The chain type + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + => chain.DuplicateAny(); + + /// + /// Creates a new with 1 by copying the . + /// + /// The chain. + /// The chain type + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 2 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T1 item1 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + => chain.AddAny(item1); + + /// + /// Creates a new with 2 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T1 item1 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 0 + item1.StructureType(); + Marshal.StructureToPtr(item1, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 2 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 2 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 1 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 1 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 1 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T1 item1) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + => chain.TruncateAny(out item1); + + /// + /// Creates a new with 1 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T1 item1) + where TChain : struct, IChainable + where T1 : struct, IChainable + { + // Retrieve last item. + item1 = chain.Item1; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item1Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 3 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T2 item2 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + => chain.AddAny(item2); + + /// + /// Creates a new with 3 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T2 item2 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 1 + item2.StructureType(); + Marshal.StructureToPtr(item2, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 3 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 3 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 2 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 2 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 2 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T2 item2) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + => chain.TruncateAny(out item2); + + /// + /// Creates a new with 2 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T2 item2) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + { + // Retrieve last item. + item2 = chain.Item2; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item2Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 4 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T3 item3 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + => chain.AddAny(item3); + + /// + /// Creates a new with 4 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T3 item3 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 2 + item3.StructureType(); + Marshal.StructureToPtr(item3, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 4 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 4 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 3 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 3 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 3 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T3 item3) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + => chain.TruncateAny(out item3); + + /// + /// Creates a new with 3 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T3 item3) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + { + // Retrieve last item. + item3 = chain.Item3; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item3Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 5 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T4 item4 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + => chain.AddAny(item4); + + /// + /// Creates a new with 5 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T4 item4 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 3 + item4.StructureType(); + Marshal.StructureToPtr(item4, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 5 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 5 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 4 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 4 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 4 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T4 item4) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + => chain.TruncateAny(out item4); + + /// + /// Creates a new with 4 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T4 item4) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + { + // Retrieve last item. + item4 = chain.Item4; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item4Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 6 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T5 item5 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + => chain.AddAny(item5); + + /// + /// Creates a new with 6 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T5 item5 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 4 + item5.StructureType(); + Marshal.StructureToPtr(item5, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 6 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 6 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 5 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 5 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 5 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T5 item5) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + => chain.TruncateAny(out item5); + + /// + /// Creates a new with 5 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T5 item5) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + { + // Retrieve last item. + item5 = chain.Item5; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item5Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 7 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T6 item6 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + => chain.AddAny(item6); + + /// + /// Creates a new with 7 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T6 item6 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 5 + item6.StructureType(); + Marshal.StructureToPtr(item6, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 7 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 7 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 6 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 6 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 6 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T6 item6) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + => chain.TruncateAny(out item6); + + /// + /// Creates a new with 6 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T6 item6) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + { + // Retrieve last item. + item6 = chain.Item6; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item6Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 8 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T7 item7 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + => chain.AddAny(item7); + + /// + /// Creates a new with 8 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T7 item7 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 6 + item7.StructureType(); + Marshal.StructureToPtr(item7, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 8 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 8 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 7 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 7 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 7 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T7 item7) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + => chain.TruncateAny(out item7); + + /// + /// Creates a new with 7 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T7 item7) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + { + // Retrieve last item. + item7 = chain.Item7; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item7Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 9 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T8 item8 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + => chain.AddAny(item8); + + /// + /// Creates a new with 9 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T8 item8 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 7 + item8.StructureType(); + Marshal.StructureToPtr(item8, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 9 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 9 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 8 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 8 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 8 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T8 item8) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + => chain.TruncateAny(out item8); + + /// + /// Creates a new with 8 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T8 item8) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + { + // Retrieve last item. + item8 = chain.Item8; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item8Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 10 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T9 item9 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + => chain.AddAny(item9); + + /// + /// Creates a new with 10 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T9 item9 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 8 + item9.StructureType(); + Marshal.StructureToPtr(item9, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 10 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 10 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 9 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 9 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 9 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T9 item9) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + => chain.TruncateAny(out item9); + + /// + /// Creates a new with 9 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T9 item9) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + { + // Retrieve last item. + item9 = chain.Item9; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item9Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 11 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T10 item10 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + => chain.AddAny(item10); + + /// + /// Creates a new with 11 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T10 item10 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 9 + item10.StructureType(); + Marshal.StructureToPtr(item10, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 11 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 11 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 10 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 10 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 10 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T10 item10) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + => chain.TruncateAny(out item10); + + /// + /// Creates a new with 10 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T10 item10) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + { + // Retrieve last item. + item10 = chain.Item10; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item10Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 12 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T11 item11 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + => chain.AddAny(item11); + + /// + /// Creates a new with 12 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T11 item11 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 10 + item11.StructureType(); + Marshal.StructureToPtr(item11, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item10Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 12 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 12 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item10Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 11 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 11 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 11 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T11 item11) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + => chain.TruncateAny(out item11); + + /// + /// Creates a new with 11 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T11 item11) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + { + // Retrieve last item. + item11 = chain.Item11; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item11Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item10Offset))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 13 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T12 item12 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + => chain.AddAny(item12); + + /// + /// Creates a new with 13 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T12 item12 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 11 + item12.StructureType(); + Marshal.StructureToPtr(item12, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item10Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item11Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item12Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 13 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 13 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item10Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item11Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item12Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 12 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 12 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 12 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T12 item12) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + => chain.TruncateAny(out item12); + + /// + /// Creates a new with 12 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T12 item12) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + { + // Retrieve last item. + item12 = chain.Item12; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item12Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item10Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item11Offset))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 14 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T13 item13 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + => chain.AddAny(item13); + + /// + /// Creates a new with 14 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T13 item13 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 12 + item13.StructureType(); + Marshal.StructureToPtr(item13, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item10Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item11Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item12Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item12Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item13Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 14 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 14 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item10Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item11Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item12Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item12Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item13Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 13 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 13 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 13 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T13 item13) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + => chain.TruncateAny(out item13); + + /// + /// Creates a new with 13 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T13 item13) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + { + // Retrieve last item. + item13 = chain.Item13; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item13Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item10Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item11Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item12Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item12Offset))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 15 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T14 item14 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + where T14 : struct, IExtendsChain + => chain.AddAny(item14); + + /// + /// Creates a new with 15 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T14 item14 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 13 + item14.StructureType(); + Marshal.StructureToPtr(item14, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item10Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item11Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item12Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item12Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item13Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item13Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item14Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 15 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + where T14 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 15 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item10Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item11Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item12Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item12Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item13Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item13Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item14Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 14 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + where T14 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 14 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 14 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T14 item14) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + where T14 : struct, IExtendsChain + => chain.TruncateAny(out item14); + + /// + /// Creates a new with 14 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T14 item14) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable + { + // Retrieve last item. + item14 = chain.Item14; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item14Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item10Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item11Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item12Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item12Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item13Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item13Offset))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 16 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// Type of Item 15. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain Add(this ManagedChain chain, T15 item15 = default) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + where T14 : struct, IExtendsChain + where T15 : struct, IExtendsChain + => chain.AddAny(item15); + + /// + /// Creates a new with 16 items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// Type of Item 15. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain AddAny(this ManagedChain chain, T15 item15 = default) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable + where T15 : struct, IChainable + { + var previousSize = ManagedChain.MemorySize; + var newSize = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item 14 + item15.StructureType(); + Marshal.StructureToPtr(item15, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item10Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item11Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item12Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item12Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item13Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item13Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item14Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item14Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item15Offset); + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 16 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// Type of Item 15. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Duplicate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + where T14 : struct, IExtendsChain + where T15 : struct, IExtendsChain + => chain.DuplicateAny(); + + /// + /// Creates a new with 16 by copying the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// Type of Item 15. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain DuplicateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable + where T15 : struct, IChainable + { + var size = ManagedChain.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item10Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item11Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item12Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item12Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item13Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item13Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item14Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item14Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item15Offset); + return new ManagedChain(newHeadPtr); + } + + /// + /// Creates a new with 15 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// Type of Item 15. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + where T14 : struct, IExtendsChain + where T15 : struct, IExtendsChain + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 15 items, by removing the last item + /// from the . + /// + /// The chain. + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// Type of Item 15. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain TruncateAny(this ManagedChain chain) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable + where T15 : struct, IChainable + => chain.TruncateAny(out var _); + + /// + /// Creates a new with 15 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// Type of Item 15. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain Truncate(this ManagedChain chain, out T15 item15) + where TChain : struct, IChainStart + where T1 : struct, IExtendsChain + where T2 : struct, IExtendsChain + where T3 : struct, IExtendsChain + where T4 : struct, IExtendsChain + where T5 : struct, IExtendsChain + where T6 : struct, IExtendsChain + where T7 : struct, IExtendsChain + where T8 : struct, IExtendsChain + where T9 : struct, IExtendsChain + where T10 : struct, IExtendsChain + where T11 : struct, IExtendsChain + where T12 : struct, IExtendsChain + where T13 : struct, IExtendsChain + where T14 : struct, IExtendsChain + where T15 : struct, IExtendsChain + => chain.TruncateAny(out item15); + + /// + /// Creates a new with 15 items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . + /// The chain type + /// Type of Item 1. + /// Type of Item 2. + /// Type of Item 3. + /// Type of Item 4. + /// Type of Item 5. + /// Type of Item 6. + /// Type of Item 7. + /// Type of Item 8. + /// Type of Item 9. + /// Type of Item 10. + /// Type of Item 11. + /// Type of Item 12. + /// Type of Item 13. + /// Type of Item 14. + /// Type of Item 15. + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain TruncateAny(this ManagedChain chain, out T15 item15) + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable + where T15 : struct, IChainable + { + // Retrieve last item. + item15 = chain.Item15; + + var newSize = ManagedChain.MemorySize - ManagedChain.Item15Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item1Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item1Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item2Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item2Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item3Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item3Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item4Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item4Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item5Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item5Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item6Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item6Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item7Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item7Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item8Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item8Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item9Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item9Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item10Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item10Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item11Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item11Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item12Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item12Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item13Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item13Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain.Item14Offset); + ((BaseInStructure*)(newHeadPtr + ManagedChain.Item14Offset))->PNext = null; + return new ManagedChain(newHeadPtr); + } + +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = HeadSize; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 1 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 1 items. + /// + /// The head of the chain. + internal ManagedChain(TChain head = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + HeadPtr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + } + + /// + public override int Count => 1; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + public void Deconstruct(out TChain head) + { + head = Head; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item1Offset + Item1Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 2 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 2 items. + /// + /// The head of the chain. + /// Item 1. + internal ManagedChain(TChain head = default, T1 item1 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + Item1Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + } + + /// + public override int Count => 2; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + public void Deconstruct(out TChain head, out T1 item1) + { + head = Head; + item1 = Item1; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +/// Type of Item 2. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item2Offset = Item1Offset + Item1Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item2Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item2Offset + Item2Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item2Ptr => (BaseInStructure*) (_headPtr + Item2Offset); + + /// + /// Gets or sets item #2 in the chain. + /// + public T2 Item2 + { + get => Unsafe.AsRef(Item2Ptr); + set + { + value.StructureType(); + var ptr = Item2Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 3 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 3 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + internal ManagedChain(TChain head = default, T1 item1 = default, T2 item2 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + itemPtr = Item2Ptr; + item2.StructureType(); + Marshal.StructureToPtr(item2, (nint)itemPtr, false); + Item1Ptr->PNext = itemPtr; + Item2Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + yield return Item2; + } + + /// + public override int Count => 3; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + 2 => Item2, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(", "); + sb.Append((object) Item2); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + public void Deconstruct(out TChain head, out T1 item1, out T2 item2) + { + head = Head; + item1 = Item1; + item2 = Item2; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + Marshal.DestroyStructure(headPtr + Item2Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +/// Type of Item 2. +/// Type of Item 3. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item2Offset = Item1Offset + Item1Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item2Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item3Offset = Item2Offset + Item2Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item3Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item3Offset + Item3Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item2Ptr => (BaseInStructure*) (_headPtr + Item2Offset); + + /// + /// Gets or sets item #2 in the chain. + /// + public T2 Item2 + { + get => Unsafe.AsRef(Item2Ptr); + set + { + value.StructureType(); + var ptr = Item2Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item3Ptr => (BaseInStructure*) (_headPtr + Item3Offset); + + /// + /// Gets or sets item #3 in the chain. + /// + public T3 Item3 + { + get => Unsafe.AsRef(Item3Ptr); + set + { + value.StructureType(); + var ptr = Item3Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 4 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 4 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + internal ManagedChain(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + itemPtr = Item2Ptr; + item2.StructureType(); + Marshal.StructureToPtr(item2, (nint)itemPtr, false); + Item1Ptr->PNext = itemPtr; + itemPtr = Item3Ptr; + item3.StructureType(); + Marshal.StructureToPtr(item3, (nint)itemPtr, false); + Item2Ptr->PNext = itemPtr; + Item3Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + yield return Item2; + yield return Item3; + } + + /// + public override int Count => 4; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + 2 => Item2, + 3 => Item3, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(", "); + sb.Append((object) Item2); + sb.Append(", "); + sb.Append((object) Item3); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + public void Deconstruct(out TChain head, out T1 item1, out T2 item2, out T3 item3) + { + head = Head; + item1 = Item1; + item2 = Item2; + item3 = Item3; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + Marshal.DestroyStructure(headPtr + Item2Offset); + Marshal.DestroyStructure(headPtr + Item3Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +/// Type of Item 2. +/// Type of Item 3. +/// Type of Item 4. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item2Offset = Item1Offset + Item1Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item2Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item3Offset = Item2Offset + Item2Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item3Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item4Offset = Item3Offset + Item3Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item4Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item4Offset + Item4Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item2Ptr => (BaseInStructure*) (_headPtr + Item2Offset); + + /// + /// Gets or sets item #2 in the chain. + /// + public T2 Item2 + { + get => Unsafe.AsRef(Item2Ptr); + set + { + value.StructureType(); + var ptr = Item2Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item3Ptr => (BaseInStructure*) (_headPtr + Item3Offset); + + /// + /// Gets or sets item #3 in the chain. + /// + public T3 Item3 + { + get => Unsafe.AsRef(Item3Ptr); + set + { + value.StructureType(); + var ptr = Item3Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item4Ptr => (BaseInStructure*) (_headPtr + Item4Offset); + + /// + /// Gets or sets item #4 in the chain. + /// + public T4 Item4 + { + get => Unsafe.AsRef(Item4Ptr); + set + { + value.StructureType(); + var ptr = Item4Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 5 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 5 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + internal ManagedChain(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + itemPtr = Item2Ptr; + item2.StructureType(); + Marshal.StructureToPtr(item2, (nint)itemPtr, false); + Item1Ptr->PNext = itemPtr; + itemPtr = Item3Ptr; + item3.StructureType(); + Marshal.StructureToPtr(item3, (nint)itemPtr, false); + Item2Ptr->PNext = itemPtr; + itemPtr = Item4Ptr; + item4.StructureType(); + Marshal.StructureToPtr(item4, (nint)itemPtr, false); + Item3Ptr->PNext = itemPtr; + Item4Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + yield return Item2; + yield return Item3; + yield return Item4; + } + + /// + public override int Count => 5; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + 2 => Item2, + 3 => Item3, + 4 => Item4, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(", "); + sb.Append((object) Item2); + sb.Append(", "); + sb.Append((object) Item3); + sb.Append(", "); + sb.Append((object) Item4); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + public void Deconstruct(out TChain head, out T1 item1, out T2 item2, out T3 item3, out T4 item4) + { + head = Head; + item1 = Item1; + item2 = Item2; + item3 = Item3; + item4 = Item4; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + Marshal.DestroyStructure(headPtr + Item2Offset); + Marshal.DestroyStructure(headPtr + Item3Offset); + Marshal.DestroyStructure(headPtr + Item4Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +/// Type of Item 2. +/// Type of Item 3. +/// Type of Item 4. +/// Type of Item 5. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item2Offset = Item1Offset + Item1Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item2Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item3Offset = Item2Offset + Item2Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item3Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item4Offset = Item3Offset + Item3Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item4Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item5Offset = Item4Offset + Item4Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item5Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item5Offset + Item5Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item2Ptr => (BaseInStructure*) (_headPtr + Item2Offset); + + /// + /// Gets or sets item #2 in the chain. + /// + public T2 Item2 + { + get => Unsafe.AsRef(Item2Ptr); + set + { + value.StructureType(); + var ptr = Item2Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item3Ptr => (BaseInStructure*) (_headPtr + Item3Offset); + + /// + /// Gets or sets item #3 in the chain. + /// + public T3 Item3 + { + get => Unsafe.AsRef(Item3Ptr); + set + { + value.StructureType(); + var ptr = Item3Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item4Ptr => (BaseInStructure*) (_headPtr + Item4Offset); + + /// + /// Gets or sets item #4 in the chain. + /// + public T4 Item4 + { + get => Unsafe.AsRef(Item4Ptr); + set + { + value.StructureType(); + var ptr = Item4Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item5Ptr => (BaseInStructure*) (_headPtr + Item5Offset); + + /// + /// Gets or sets item #5 in the chain. + /// + public T5 Item5 + { + get => Unsafe.AsRef(Item5Ptr); + set + { + value.StructureType(); + var ptr = Item5Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 6 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 6 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + internal ManagedChain(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + itemPtr = Item2Ptr; + item2.StructureType(); + Marshal.StructureToPtr(item2, (nint)itemPtr, false); + Item1Ptr->PNext = itemPtr; + itemPtr = Item3Ptr; + item3.StructureType(); + Marshal.StructureToPtr(item3, (nint)itemPtr, false); + Item2Ptr->PNext = itemPtr; + itemPtr = Item4Ptr; + item4.StructureType(); + Marshal.StructureToPtr(item4, (nint)itemPtr, false); + Item3Ptr->PNext = itemPtr; + itemPtr = Item5Ptr; + item5.StructureType(); + Marshal.StructureToPtr(item5, (nint)itemPtr, false); + Item4Ptr->PNext = itemPtr; + Item5Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + yield return Item2; + yield return Item3; + yield return Item4; + yield return Item5; + } + + /// + public override int Count => 6; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + 2 => Item2, + 3 => Item3, + 4 => Item4, + 5 => Item5, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(", "); + sb.Append((object) Item2); + sb.Append(", "); + sb.Append((object) Item3); + sb.Append(", "); + sb.Append((object) Item4); + sb.Append(", "); + sb.Append((object) Item5); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + public void Deconstruct(out TChain head, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5) + { + head = Head; + item1 = Item1; + item2 = Item2; + item3 = Item3; + item4 = Item4; + item5 = Item5; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + Marshal.DestroyStructure(headPtr + Item2Offset); + Marshal.DestroyStructure(headPtr + Item3Offset); + Marshal.DestroyStructure(headPtr + Item4Offset); + Marshal.DestroyStructure(headPtr + Item5Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +/// Type of Item 2. +/// Type of Item 3. +/// Type of Item 4. +/// Type of Item 5. +/// Type of Item 6. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item2Offset = Item1Offset + Item1Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item2Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item3Offset = Item2Offset + Item2Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item3Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item4Offset = Item3Offset + Item3Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item4Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item5Offset = Item4Offset + Item4Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item5Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item6Offset = Item5Offset + Item5Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item6Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item6Offset + Item6Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item2Ptr => (BaseInStructure*) (_headPtr + Item2Offset); + + /// + /// Gets or sets item #2 in the chain. + /// + public T2 Item2 + { + get => Unsafe.AsRef(Item2Ptr); + set + { + value.StructureType(); + var ptr = Item2Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item3Ptr => (BaseInStructure*) (_headPtr + Item3Offset); + + /// + /// Gets or sets item #3 in the chain. + /// + public T3 Item3 + { + get => Unsafe.AsRef(Item3Ptr); + set + { + value.StructureType(); + var ptr = Item3Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item4Ptr => (BaseInStructure*) (_headPtr + Item4Offset); + + /// + /// Gets or sets item #4 in the chain. + /// + public T4 Item4 + { + get => Unsafe.AsRef(Item4Ptr); + set + { + value.StructureType(); + var ptr = Item4Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item5Ptr => (BaseInStructure*) (_headPtr + Item5Offset); + + /// + /// Gets or sets item #5 in the chain. + /// + public T5 Item5 + { + get => Unsafe.AsRef(Item5Ptr); + set + { + value.StructureType(); + var ptr = Item5Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item6Ptr => (BaseInStructure*) (_headPtr + Item6Offset); + + /// + /// Gets or sets item #6 in the chain. + /// + public T6 Item6 + { + get => Unsafe.AsRef(Item6Ptr); + set + { + value.StructureType(); + var ptr = Item6Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 7 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 7 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + internal ManagedChain(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + itemPtr = Item2Ptr; + item2.StructureType(); + Marshal.StructureToPtr(item2, (nint)itemPtr, false); + Item1Ptr->PNext = itemPtr; + itemPtr = Item3Ptr; + item3.StructureType(); + Marshal.StructureToPtr(item3, (nint)itemPtr, false); + Item2Ptr->PNext = itemPtr; + itemPtr = Item4Ptr; + item4.StructureType(); + Marshal.StructureToPtr(item4, (nint)itemPtr, false); + Item3Ptr->PNext = itemPtr; + itemPtr = Item5Ptr; + item5.StructureType(); + Marshal.StructureToPtr(item5, (nint)itemPtr, false); + Item4Ptr->PNext = itemPtr; + itemPtr = Item6Ptr; + item6.StructureType(); + Marshal.StructureToPtr(item6, (nint)itemPtr, false); + Item5Ptr->PNext = itemPtr; + Item6Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + yield return Item2; + yield return Item3; + yield return Item4; + yield return Item5; + yield return Item6; + } + + /// + public override int Count => 7; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + 2 => Item2, + 3 => Item3, + 4 => Item4, + 5 => Item5, + 6 => Item6, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(", "); + sb.Append((object) Item2); + sb.Append(", "); + sb.Append((object) Item3); + sb.Append(", "); + sb.Append((object) Item4); + sb.Append(", "); + sb.Append((object) Item5); + sb.Append(", "); + sb.Append((object) Item6); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + public void Deconstruct(out TChain head, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6) + { + head = Head; + item1 = Item1; + item2 = Item2; + item3 = Item3; + item4 = Item4; + item5 = Item5; + item6 = Item6; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + Marshal.DestroyStructure(headPtr + Item2Offset); + Marshal.DestroyStructure(headPtr + Item3Offset); + Marshal.DestroyStructure(headPtr + Item4Offset); + Marshal.DestroyStructure(headPtr + Item5Offset); + Marshal.DestroyStructure(headPtr + Item6Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +/// Type of Item 2. +/// Type of Item 3. +/// Type of Item 4. +/// Type of Item 5. +/// Type of Item 6. +/// Type of Item 7. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item2Offset = Item1Offset + Item1Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item2Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item3Offset = Item2Offset + Item2Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item3Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item4Offset = Item3Offset + Item3Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item4Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item5Offset = Item4Offset + Item4Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item5Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item6Offset = Item5Offset + Item5Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item6Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item7Offset = Item6Offset + Item6Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item7Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item7Offset + Item7Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item2Ptr => (BaseInStructure*) (_headPtr + Item2Offset); + + /// + /// Gets or sets item #2 in the chain. + /// + public T2 Item2 + { + get => Unsafe.AsRef(Item2Ptr); + set + { + value.StructureType(); + var ptr = Item2Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item3Ptr => (BaseInStructure*) (_headPtr + Item3Offset); + + /// + /// Gets or sets item #3 in the chain. + /// + public T3 Item3 + { + get => Unsafe.AsRef(Item3Ptr); + set + { + value.StructureType(); + var ptr = Item3Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item4Ptr => (BaseInStructure*) (_headPtr + Item4Offset); + + /// + /// Gets or sets item #4 in the chain. + /// + public T4 Item4 + { + get => Unsafe.AsRef(Item4Ptr); + set + { + value.StructureType(); + var ptr = Item4Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item5Ptr => (BaseInStructure*) (_headPtr + Item5Offset); + + /// + /// Gets or sets item #5 in the chain. + /// + public T5 Item5 + { + get => Unsafe.AsRef(Item5Ptr); + set + { + value.StructureType(); + var ptr = Item5Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item6Ptr => (BaseInStructure*) (_headPtr + Item6Offset); + + /// + /// Gets or sets item #6 in the chain. + /// + public T6 Item6 + { + get => Unsafe.AsRef(Item6Ptr); + set + { + value.StructureType(); + var ptr = Item6Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item7Ptr => (BaseInStructure*) (_headPtr + Item7Offset); + + /// + /// Gets or sets item #7 in the chain. + /// + public T7 Item7 + { + get => Unsafe.AsRef(Item7Ptr); + set + { + value.StructureType(); + var ptr = Item7Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 8 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 8 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + internal ManagedChain(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + itemPtr = Item2Ptr; + item2.StructureType(); + Marshal.StructureToPtr(item2, (nint)itemPtr, false); + Item1Ptr->PNext = itemPtr; + itemPtr = Item3Ptr; + item3.StructureType(); + Marshal.StructureToPtr(item3, (nint)itemPtr, false); + Item2Ptr->PNext = itemPtr; + itemPtr = Item4Ptr; + item4.StructureType(); + Marshal.StructureToPtr(item4, (nint)itemPtr, false); + Item3Ptr->PNext = itemPtr; + itemPtr = Item5Ptr; + item5.StructureType(); + Marshal.StructureToPtr(item5, (nint)itemPtr, false); + Item4Ptr->PNext = itemPtr; + itemPtr = Item6Ptr; + item6.StructureType(); + Marshal.StructureToPtr(item6, (nint)itemPtr, false); + Item5Ptr->PNext = itemPtr; + itemPtr = Item7Ptr; + item7.StructureType(); + Marshal.StructureToPtr(item7, (nint)itemPtr, false); + Item6Ptr->PNext = itemPtr; + Item7Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + yield return Item2; + yield return Item3; + yield return Item4; + yield return Item5; + yield return Item6; + yield return Item7; + } + + /// + public override int Count => 8; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + 2 => Item2, + 3 => Item3, + 4 => Item4, + 5 => Item5, + 6 => Item6, + 7 => Item7, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(", "); + sb.Append((object) Item2); + sb.Append(", "); + sb.Append((object) Item3); + sb.Append(", "); + sb.Append((object) Item4); + sb.Append(", "); + sb.Append((object) Item5); + sb.Append(", "); + sb.Append((object) Item6); + sb.Append(", "); + sb.Append((object) Item7); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + public void Deconstruct(out TChain head, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7) + { + head = Head; + item1 = Item1; + item2 = Item2; + item3 = Item3; + item4 = Item4; + item5 = Item5; + item6 = Item6; + item7 = Item7; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + Marshal.DestroyStructure(headPtr + Item2Offset); + Marshal.DestroyStructure(headPtr + Item3Offset); + Marshal.DestroyStructure(headPtr + Item4Offset); + Marshal.DestroyStructure(headPtr + Item5Offset); + Marshal.DestroyStructure(headPtr + Item6Offset); + Marshal.DestroyStructure(headPtr + Item7Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +/// Type of Item 2. +/// Type of Item 3. +/// Type of Item 4. +/// Type of Item 5. +/// Type of Item 6. +/// Type of Item 7. +/// Type of Item 8. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item2Offset = Item1Offset + Item1Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item2Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item3Offset = Item2Offset + Item2Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item3Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item4Offset = Item3Offset + Item3Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item4Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item5Offset = Item4Offset + Item4Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item5Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item6Offset = Item5Offset + Item5Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item6Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item7Offset = Item6Offset + Item6Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item7Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item8Offset = Item7Offset + Item7Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item8Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item8Offset + Item8Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item2Ptr => (BaseInStructure*) (_headPtr + Item2Offset); + + /// + /// Gets or sets item #2 in the chain. + /// + public T2 Item2 + { + get => Unsafe.AsRef(Item2Ptr); + set + { + value.StructureType(); + var ptr = Item2Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item3Ptr => (BaseInStructure*) (_headPtr + Item3Offset); + + /// + /// Gets or sets item #3 in the chain. + /// + public T3 Item3 + { + get => Unsafe.AsRef(Item3Ptr); + set + { + value.StructureType(); + var ptr = Item3Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item4Ptr => (BaseInStructure*) (_headPtr + Item4Offset); + + /// + /// Gets or sets item #4 in the chain. + /// + public T4 Item4 + { + get => Unsafe.AsRef(Item4Ptr); + set + { + value.StructureType(); + var ptr = Item4Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item5Ptr => (BaseInStructure*) (_headPtr + Item5Offset); + + /// + /// Gets or sets item #5 in the chain. + /// + public T5 Item5 + { + get => Unsafe.AsRef(Item5Ptr); + set + { + value.StructureType(); + var ptr = Item5Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item6Ptr => (BaseInStructure*) (_headPtr + Item6Offset); + + /// + /// Gets or sets item #6 in the chain. + /// + public T6 Item6 + { + get => Unsafe.AsRef(Item6Ptr); + set + { + value.StructureType(); + var ptr = Item6Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item7Ptr => (BaseInStructure*) (_headPtr + Item7Offset); + + /// + /// Gets or sets item #7 in the chain. + /// + public T7 Item7 + { + get => Unsafe.AsRef(Item7Ptr); + set + { + value.StructureType(); + var ptr = Item7Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item8Ptr => (BaseInStructure*) (_headPtr + Item8Offset); + + /// + /// Gets or sets item #8 in the chain. + /// + public T8 Item8 + { + get => Unsafe.AsRef(Item8Ptr); + set + { + value.StructureType(); + var ptr = Item8Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 9 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 9 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + internal ManagedChain(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + itemPtr = Item2Ptr; + item2.StructureType(); + Marshal.StructureToPtr(item2, (nint)itemPtr, false); + Item1Ptr->PNext = itemPtr; + itemPtr = Item3Ptr; + item3.StructureType(); + Marshal.StructureToPtr(item3, (nint)itemPtr, false); + Item2Ptr->PNext = itemPtr; + itemPtr = Item4Ptr; + item4.StructureType(); + Marshal.StructureToPtr(item4, (nint)itemPtr, false); + Item3Ptr->PNext = itemPtr; + itemPtr = Item5Ptr; + item5.StructureType(); + Marshal.StructureToPtr(item5, (nint)itemPtr, false); + Item4Ptr->PNext = itemPtr; + itemPtr = Item6Ptr; + item6.StructureType(); + Marshal.StructureToPtr(item6, (nint)itemPtr, false); + Item5Ptr->PNext = itemPtr; + itemPtr = Item7Ptr; + item7.StructureType(); + Marshal.StructureToPtr(item7, (nint)itemPtr, false); + Item6Ptr->PNext = itemPtr; + itemPtr = Item8Ptr; + item8.StructureType(); + Marshal.StructureToPtr(item8, (nint)itemPtr, false); + Item7Ptr->PNext = itemPtr; + Item8Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + yield return Item2; + yield return Item3; + yield return Item4; + yield return Item5; + yield return Item6; + yield return Item7; + yield return Item8; + } + + /// + public override int Count => 9; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + 2 => Item2, + 3 => Item3, + 4 => Item4, + 5 => Item5, + 6 => Item6, + 7 => Item7, + 8 => Item8, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(", "); + sb.Append((object) Item2); + sb.Append(", "); + sb.Append((object) Item3); + sb.Append(", "); + sb.Append((object) Item4); + sb.Append(", "); + sb.Append((object) Item5); + sb.Append(", "); + sb.Append((object) Item6); + sb.Append(", "); + sb.Append((object) Item7); + sb.Append(", "); + sb.Append((object) Item8); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + public void Deconstruct(out TChain head, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8) + { + head = Head; + item1 = Item1; + item2 = Item2; + item3 = Item3; + item4 = Item4; + item5 = Item5; + item6 = Item6; + item7 = Item7; + item8 = Item8; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + Marshal.DestroyStructure(headPtr + Item2Offset); + Marshal.DestroyStructure(headPtr + Item3Offset); + Marshal.DestroyStructure(headPtr + Item4Offset); + Marshal.DestroyStructure(headPtr + Item5Offset); + Marshal.DestroyStructure(headPtr + Item6Offset); + Marshal.DestroyStructure(headPtr + Item7Offset); + Marshal.DestroyStructure(headPtr + Item8Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +/// Type of Item 2. +/// Type of Item 3. +/// Type of Item 4. +/// Type of Item 5. +/// Type of Item 6. +/// Type of Item 7. +/// Type of Item 8. +/// Type of Item 9. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item2Offset = Item1Offset + Item1Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item2Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item3Offset = Item2Offset + Item2Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item3Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item4Offset = Item3Offset + Item3Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item4Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item5Offset = Item4Offset + Item4Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item5Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item6Offset = Item5Offset + Item5Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item6Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item7Offset = Item6Offset + Item6Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item7Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item8Offset = Item7Offset + Item7Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item8Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item9Offset = Item8Offset + Item8Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item9Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item9Offset + Item9Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item2Ptr => (BaseInStructure*) (_headPtr + Item2Offset); + + /// + /// Gets or sets item #2 in the chain. + /// + public T2 Item2 + { + get => Unsafe.AsRef(Item2Ptr); + set + { + value.StructureType(); + var ptr = Item2Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item3Ptr => (BaseInStructure*) (_headPtr + Item3Offset); + + /// + /// Gets or sets item #3 in the chain. + /// + public T3 Item3 + { + get => Unsafe.AsRef(Item3Ptr); + set + { + value.StructureType(); + var ptr = Item3Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item4Ptr => (BaseInStructure*) (_headPtr + Item4Offset); + + /// + /// Gets or sets item #4 in the chain. + /// + public T4 Item4 + { + get => Unsafe.AsRef(Item4Ptr); + set + { + value.StructureType(); + var ptr = Item4Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item5Ptr => (BaseInStructure*) (_headPtr + Item5Offset); + + /// + /// Gets or sets item #5 in the chain. + /// + public T5 Item5 + { + get => Unsafe.AsRef(Item5Ptr); + set + { + value.StructureType(); + var ptr = Item5Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item6Ptr => (BaseInStructure*) (_headPtr + Item6Offset); + + /// + /// Gets or sets item #6 in the chain. + /// + public T6 Item6 + { + get => Unsafe.AsRef(Item6Ptr); + set + { + value.StructureType(); + var ptr = Item6Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item7Ptr => (BaseInStructure*) (_headPtr + Item7Offset); + + /// + /// Gets or sets item #7 in the chain. + /// + public T7 Item7 + { + get => Unsafe.AsRef(Item7Ptr); + set + { + value.StructureType(); + var ptr = Item7Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item8Ptr => (BaseInStructure*) (_headPtr + Item8Offset); + + /// + /// Gets or sets item #8 in the chain. + /// + public T8 Item8 + { + get => Unsafe.AsRef(Item8Ptr); + set + { + value.StructureType(); + var ptr = Item8Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item9Ptr => (BaseInStructure*) (_headPtr + Item9Offset); + + /// + /// Gets or sets item #9 in the chain. + /// + public T9 Item9 + { + get => Unsafe.AsRef(Item9Ptr); + set + { + value.StructureType(); + var ptr = Item9Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 10 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 10 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + internal ManagedChain(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + itemPtr = Item2Ptr; + item2.StructureType(); + Marshal.StructureToPtr(item2, (nint)itemPtr, false); + Item1Ptr->PNext = itemPtr; + itemPtr = Item3Ptr; + item3.StructureType(); + Marshal.StructureToPtr(item3, (nint)itemPtr, false); + Item2Ptr->PNext = itemPtr; + itemPtr = Item4Ptr; + item4.StructureType(); + Marshal.StructureToPtr(item4, (nint)itemPtr, false); + Item3Ptr->PNext = itemPtr; + itemPtr = Item5Ptr; + item5.StructureType(); + Marshal.StructureToPtr(item5, (nint)itemPtr, false); + Item4Ptr->PNext = itemPtr; + itemPtr = Item6Ptr; + item6.StructureType(); + Marshal.StructureToPtr(item6, (nint)itemPtr, false); + Item5Ptr->PNext = itemPtr; + itemPtr = Item7Ptr; + item7.StructureType(); + Marshal.StructureToPtr(item7, (nint)itemPtr, false); + Item6Ptr->PNext = itemPtr; + itemPtr = Item8Ptr; + item8.StructureType(); + Marshal.StructureToPtr(item8, (nint)itemPtr, false); + Item7Ptr->PNext = itemPtr; + itemPtr = Item9Ptr; + item9.StructureType(); + Marshal.StructureToPtr(item9, (nint)itemPtr, false); + Item8Ptr->PNext = itemPtr; + Item9Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + yield return Item2; + yield return Item3; + yield return Item4; + yield return Item5; + yield return Item6; + yield return Item7; + yield return Item8; + yield return Item9; + } + + /// + public override int Count => 10; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + 2 => Item2, + 3 => Item3, + 4 => Item4, + 5 => Item5, + 6 => Item6, + 7 => Item7, + 8 => Item8, + 9 => Item9, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item9Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item9Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(", "); + sb.Append((object) Item2); + sb.Append(", "); + sb.Append((object) Item3); + sb.Append(", "); + sb.Append((object) Item4); + sb.Append(", "); + sb.Append((object) Item5); + sb.Append(", "); + sb.Append((object) Item6); + sb.Append(", "); + sb.Append((object) Item7); + sb.Append(", "); + sb.Append((object) Item8); + sb.Append(", "); + sb.Append((object) Item9); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + public void Deconstruct(out TChain head, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9) + { + head = Head; + item1 = Item1; + item2 = Item2; + item3 = Item3; + item4 = Item4; + item5 = Item5; + item6 = Item6; + item7 = Item7; + item8 = Item8; + item9 = Item9; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + Marshal.DestroyStructure(headPtr + Item2Offset); + Marshal.DestroyStructure(headPtr + Item3Offset); + Marshal.DestroyStructure(headPtr + Item4Offset); + Marshal.DestroyStructure(headPtr + Item5Offset); + Marshal.DestroyStructure(headPtr + Item6Offset); + Marshal.DestroyStructure(headPtr + Item7Offset); + Marshal.DestroyStructure(headPtr + Item8Offset); + Marshal.DestroyStructure(headPtr + Item9Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +/// Type of Item 2. +/// Type of Item 3. +/// Type of Item 4. +/// Type of Item 5. +/// Type of Item 6. +/// Type of Item 7. +/// Type of Item 8. +/// Type of Item 9. +/// Type of Item 10. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item2Offset = Item1Offset + Item1Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item2Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item3Offset = Item2Offset + Item2Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item3Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item4Offset = Item3Offset + Item3Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item4Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item5Offset = Item4Offset + Item4Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item5Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item6Offset = Item5Offset + Item5Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item6Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item7Offset = Item6Offset + Item6Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item7Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item8Offset = Item7Offset + Item7Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item8Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item9Offset = Item8Offset + Item8Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item9Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item10Offset = Item9Offset + Item9Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item10Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item10Offset + Item10Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item2Ptr => (BaseInStructure*) (_headPtr + Item2Offset); + + /// + /// Gets or sets item #2 in the chain. + /// + public T2 Item2 + { + get => Unsafe.AsRef(Item2Ptr); + set + { + value.StructureType(); + var ptr = Item2Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item3Ptr => (BaseInStructure*) (_headPtr + Item3Offset); + + /// + /// Gets or sets item #3 in the chain. + /// + public T3 Item3 + { + get => Unsafe.AsRef(Item3Ptr); + set + { + value.StructureType(); + var ptr = Item3Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item4Ptr => (BaseInStructure*) (_headPtr + Item4Offset); + + /// + /// Gets or sets item #4 in the chain. + /// + public T4 Item4 + { + get => Unsafe.AsRef(Item4Ptr); + set + { + value.StructureType(); + var ptr = Item4Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item5Ptr => (BaseInStructure*) (_headPtr + Item5Offset); + + /// + /// Gets or sets item #5 in the chain. + /// + public T5 Item5 + { + get => Unsafe.AsRef(Item5Ptr); + set + { + value.StructureType(); + var ptr = Item5Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item6Ptr => (BaseInStructure*) (_headPtr + Item6Offset); + + /// + /// Gets or sets item #6 in the chain. + /// + public T6 Item6 + { + get => Unsafe.AsRef(Item6Ptr); + set + { + value.StructureType(); + var ptr = Item6Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item7Ptr => (BaseInStructure*) (_headPtr + Item7Offset); + + /// + /// Gets or sets item #7 in the chain. + /// + public T7 Item7 + { + get => Unsafe.AsRef(Item7Ptr); + set + { + value.StructureType(); + var ptr = Item7Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item8Ptr => (BaseInStructure*) (_headPtr + Item8Offset); + + /// + /// Gets or sets item #8 in the chain. + /// + public T8 Item8 + { + get => Unsafe.AsRef(Item8Ptr); + set + { + value.StructureType(); + var ptr = Item8Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item9Ptr => (BaseInStructure*) (_headPtr + Item9Offset); + + /// + /// Gets or sets item #9 in the chain. + /// + public T9 Item9 + { + get => Unsafe.AsRef(Item9Ptr); + set + { + value.StructureType(); + var ptr = Item9Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item10Ptr => (BaseInStructure*) (_headPtr + Item10Offset); + + /// + /// Gets or sets item #10 in the chain. + /// + public T10 Item10 + { + get => Unsafe.AsRef(Item10Ptr); + set + { + value.StructureType(); + var ptr = Item10Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 11 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 11 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + internal ManagedChain(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + itemPtr = Item2Ptr; + item2.StructureType(); + Marshal.StructureToPtr(item2, (nint)itemPtr, false); + Item1Ptr->PNext = itemPtr; + itemPtr = Item3Ptr; + item3.StructureType(); + Marshal.StructureToPtr(item3, (nint)itemPtr, false); + Item2Ptr->PNext = itemPtr; + itemPtr = Item4Ptr; + item4.StructureType(); + Marshal.StructureToPtr(item4, (nint)itemPtr, false); + Item3Ptr->PNext = itemPtr; + itemPtr = Item5Ptr; + item5.StructureType(); + Marshal.StructureToPtr(item5, (nint)itemPtr, false); + Item4Ptr->PNext = itemPtr; + itemPtr = Item6Ptr; + item6.StructureType(); + Marshal.StructureToPtr(item6, (nint)itemPtr, false); + Item5Ptr->PNext = itemPtr; + itemPtr = Item7Ptr; + item7.StructureType(); + Marshal.StructureToPtr(item7, (nint)itemPtr, false); + Item6Ptr->PNext = itemPtr; + itemPtr = Item8Ptr; + item8.StructureType(); + Marshal.StructureToPtr(item8, (nint)itemPtr, false); + Item7Ptr->PNext = itemPtr; + itemPtr = Item9Ptr; + item9.StructureType(); + Marshal.StructureToPtr(item9, (nint)itemPtr, false); + Item8Ptr->PNext = itemPtr; + itemPtr = Item10Ptr; + item10.StructureType(); + Marshal.StructureToPtr(item10, (nint)itemPtr, false); + Item9Ptr->PNext = itemPtr; + Item10Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + yield return Item2; + yield return Item3; + yield return Item4; + yield return Item5; + yield return Item6; + yield return Item7; + yield return Item8; + yield return Item9; + yield return Item10; + } + + /// + public override int Count => 11; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + 2 => Item2, + 3 => Item3, + 4 => Item4, + 5 => Item5, + 6 => Item6, + 7 => Item7, + 8 => Item8, + 9 => Item9, + 10 => Item10, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item9Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item10Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item9Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item10Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(", "); + sb.Append((object) Item2); + sb.Append(", "); + sb.Append((object) Item3); + sb.Append(", "); + sb.Append((object) Item4); + sb.Append(", "); + sb.Append((object) Item5); + sb.Append(", "); + sb.Append((object) Item6); + sb.Append(", "); + sb.Append((object) Item7); + sb.Append(", "); + sb.Append((object) Item8); + sb.Append(", "); + sb.Append((object) Item9); + sb.Append(", "); + sb.Append((object) Item10); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + public void Deconstruct(out TChain head, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10) + { + head = Head; + item1 = Item1; + item2 = Item2; + item3 = Item3; + item4 = Item4; + item5 = Item5; + item6 = Item6; + item7 = Item7; + item8 = Item8; + item9 = Item9; + item10 = Item10; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + Marshal.DestroyStructure(headPtr + Item2Offset); + Marshal.DestroyStructure(headPtr + Item3Offset); + Marshal.DestroyStructure(headPtr + Item4Offset); + Marshal.DestroyStructure(headPtr + Item5Offset); + Marshal.DestroyStructure(headPtr + Item6Offset); + Marshal.DestroyStructure(headPtr + Item7Offset); + Marshal.DestroyStructure(headPtr + Item8Offset); + Marshal.DestroyStructure(headPtr + Item9Offset); + Marshal.DestroyStructure(headPtr + Item10Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +/// Type of Item 2. +/// Type of Item 3. +/// Type of Item 4. +/// Type of Item 5. +/// Type of Item 6. +/// Type of Item 7. +/// Type of Item 8. +/// Type of Item 9. +/// Type of Item 10. +/// Type of Item 11. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item2Offset = Item1Offset + Item1Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item2Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item3Offset = Item2Offset + Item2Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item3Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item4Offset = Item3Offset + Item3Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item4Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item5Offset = Item4Offset + Item4Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item5Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item6Offset = Item5Offset + Item5Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item6Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item7Offset = Item6Offset + Item6Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item7Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item8Offset = Item7Offset + Item7Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item8Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item9Offset = Item8Offset + Item8Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item9Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item10Offset = Item9Offset + Item9Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item10Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item11Offset = Item10Offset + Item10Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item11Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item11Offset + Item11Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item2Ptr => (BaseInStructure*) (_headPtr + Item2Offset); + + /// + /// Gets or sets item #2 in the chain. + /// + public T2 Item2 + { + get => Unsafe.AsRef(Item2Ptr); + set + { + value.StructureType(); + var ptr = Item2Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item3Ptr => (BaseInStructure*) (_headPtr + Item3Offset); + + /// + /// Gets or sets item #3 in the chain. + /// + public T3 Item3 + { + get => Unsafe.AsRef(Item3Ptr); + set + { + value.StructureType(); + var ptr = Item3Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item4Ptr => (BaseInStructure*) (_headPtr + Item4Offset); + + /// + /// Gets or sets item #4 in the chain. + /// + public T4 Item4 + { + get => Unsafe.AsRef(Item4Ptr); + set + { + value.StructureType(); + var ptr = Item4Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item5Ptr => (BaseInStructure*) (_headPtr + Item5Offset); + + /// + /// Gets or sets item #5 in the chain. + /// + public T5 Item5 + { + get => Unsafe.AsRef(Item5Ptr); + set + { + value.StructureType(); + var ptr = Item5Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item6Ptr => (BaseInStructure*) (_headPtr + Item6Offset); + + /// + /// Gets or sets item #6 in the chain. + /// + public T6 Item6 + { + get => Unsafe.AsRef(Item6Ptr); + set + { + value.StructureType(); + var ptr = Item6Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item7Ptr => (BaseInStructure*) (_headPtr + Item7Offset); + + /// + /// Gets or sets item #7 in the chain. + /// + public T7 Item7 + { + get => Unsafe.AsRef(Item7Ptr); + set + { + value.StructureType(); + var ptr = Item7Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item8Ptr => (BaseInStructure*) (_headPtr + Item8Offset); + + /// + /// Gets or sets item #8 in the chain. + /// + public T8 Item8 + { + get => Unsafe.AsRef(Item8Ptr); + set + { + value.StructureType(); + var ptr = Item8Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item9Ptr => (BaseInStructure*) (_headPtr + Item9Offset); + + /// + /// Gets or sets item #9 in the chain. + /// + public T9 Item9 + { + get => Unsafe.AsRef(Item9Ptr); + set + { + value.StructureType(); + var ptr = Item9Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item10Ptr => (BaseInStructure*) (_headPtr + Item10Offset); + + /// + /// Gets or sets item #10 in the chain. + /// + public T10 Item10 + { + get => Unsafe.AsRef(Item10Ptr); + set + { + value.StructureType(); + var ptr = Item10Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item11Ptr => (BaseInStructure*) (_headPtr + Item11Offset); + + /// + /// Gets or sets item #11 in the chain. + /// + public T11 Item11 + { + get => Unsafe.AsRef(Item11Ptr); + set + { + value.StructureType(); + var ptr = Item11Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 12 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 12 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + internal ManagedChain(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default, T11 item11 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + itemPtr = Item2Ptr; + item2.StructureType(); + Marshal.StructureToPtr(item2, (nint)itemPtr, false); + Item1Ptr->PNext = itemPtr; + itemPtr = Item3Ptr; + item3.StructureType(); + Marshal.StructureToPtr(item3, (nint)itemPtr, false); + Item2Ptr->PNext = itemPtr; + itemPtr = Item4Ptr; + item4.StructureType(); + Marshal.StructureToPtr(item4, (nint)itemPtr, false); + Item3Ptr->PNext = itemPtr; + itemPtr = Item5Ptr; + item5.StructureType(); + Marshal.StructureToPtr(item5, (nint)itemPtr, false); + Item4Ptr->PNext = itemPtr; + itemPtr = Item6Ptr; + item6.StructureType(); + Marshal.StructureToPtr(item6, (nint)itemPtr, false); + Item5Ptr->PNext = itemPtr; + itemPtr = Item7Ptr; + item7.StructureType(); + Marshal.StructureToPtr(item7, (nint)itemPtr, false); + Item6Ptr->PNext = itemPtr; + itemPtr = Item8Ptr; + item8.StructureType(); + Marshal.StructureToPtr(item8, (nint)itemPtr, false); + Item7Ptr->PNext = itemPtr; + itemPtr = Item9Ptr; + item9.StructureType(); + Marshal.StructureToPtr(item9, (nint)itemPtr, false); + Item8Ptr->PNext = itemPtr; + itemPtr = Item10Ptr; + item10.StructureType(); + Marshal.StructureToPtr(item10, (nint)itemPtr, false); + Item9Ptr->PNext = itemPtr; + itemPtr = Item11Ptr; + item11.StructureType(); + Marshal.StructureToPtr(item11, (nint)itemPtr, false); + Item10Ptr->PNext = itemPtr; + Item11Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + yield return Item2; + yield return Item3; + yield return Item4; + yield return Item5; + yield return Item6; + yield return Item7; + yield return Item8; + yield return Item9; + yield return Item10; + yield return Item11; + } + + /// + public override int Count => 12; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + 2 => Item2, + 3 => Item3, + 4 => Item4, + 5 => Item5, + 6 => Item6, + 7 => Item7, + 8 => Item8, + 9 => Item9, + 10 => Item10, + 11 => Item11, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item9Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item10Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item11Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item9Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item10Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item11Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(", "); + sb.Append((object) Item2); + sb.Append(", "); + sb.Append((object) Item3); + sb.Append(", "); + sb.Append((object) Item4); + sb.Append(", "); + sb.Append((object) Item5); + sb.Append(", "); + sb.Append((object) Item6); + sb.Append(", "); + sb.Append((object) Item7); + sb.Append(", "); + sb.Append((object) Item8); + sb.Append(", "); + sb.Append((object) Item9); + sb.Append(", "); + sb.Append((object) Item10); + sb.Append(", "); + sb.Append((object) Item11); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + public void Deconstruct(out TChain head, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11) + { + head = Head; + item1 = Item1; + item2 = Item2; + item3 = Item3; + item4 = Item4; + item5 = Item5; + item6 = Item6; + item7 = Item7; + item8 = Item8; + item9 = Item9; + item10 = Item10; + item11 = Item11; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + Marshal.DestroyStructure(headPtr + Item2Offset); + Marshal.DestroyStructure(headPtr + Item3Offset); + Marshal.DestroyStructure(headPtr + Item4Offset); + Marshal.DestroyStructure(headPtr + Item5Offset); + Marshal.DestroyStructure(headPtr + Item6Offset); + Marshal.DestroyStructure(headPtr + Item7Offset); + Marshal.DestroyStructure(headPtr + Item8Offset); + Marshal.DestroyStructure(headPtr + Item9Offset); + Marshal.DestroyStructure(headPtr + Item10Offset); + Marshal.DestroyStructure(headPtr + Item11Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +/// Type of Item 2. +/// Type of Item 3. +/// Type of Item 4. +/// Type of Item 5. +/// Type of Item 6. +/// Type of Item 7. +/// Type of Item 8. +/// Type of Item 9. +/// Type of Item 10. +/// Type of Item 11. +/// Type of Item 12. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item2Offset = Item1Offset + Item1Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item2Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item3Offset = Item2Offset + Item2Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item3Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item4Offset = Item3Offset + Item3Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item4Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item5Offset = Item4Offset + Item4Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item5Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item6Offset = Item5Offset + Item5Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item6Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item7Offset = Item6Offset + Item6Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item7Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item8Offset = Item7Offset + Item7Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item8Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item9Offset = Item8Offset + Item8Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item9Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item10Offset = Item9Offset + Item9Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item10Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item11Offset = Item10Offset + Item10Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item11Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item12Offset = Item11Offset + Item11Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item12Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item12Offset + Item12Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item2Ptr => (BaseInStructure*) (_headPtr + Item2Offset); + + /// + /// Gets or sets item #2 in the chain. + /// + public T2 Item2 + { + get => Unsafe.AsRef(Item2Ptr); + set + { + value.StructureType(); + var ptr = Item2Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item3Ptr => (BaseInStructure*) (_headPtr + Item3Offset); + + /// + /// Gets or sets item #3 in the chain. + /// + public T3 Item3 + { + get => Unsafe.AsRef(Item3Ptr); + set + { + value.StructureType(); + var ptr = Item3Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item4Ptr => (BaseInStructure*) (_headPtr + Item4Offset); + + /// + /// Gets or sets item #4 in the chain. + /// + public T4 Item4 + { + get => Unsafe.AsRef(Item4Ptr); + set + { + value.StructureType(); + var ptr = Item4Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item5Ptr => (BaseInStructure*) (_headPtr + Item5Offset); + + /// + /// Gets or sets item #5 in the chain. + /// + public T5 Item5 + { + get => Unsafe.AsRef(Item5Ptr); + set + { + value.StructureType(); + var ptr = Item5Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item6Ptr => (BaseInStructure*) (_headPtr + Item6Offset); + + /// + /// Gets or sets item #6 in the chain. + /// + public T6 Item6 + { + get => Unsafe.AsRef(Item6Ptr); + set + { + value.StructureType(); + var ptr = Item6Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item7Ptr => (BaseInStructure*) (_headPtr + Item7Offset); + + /// + /// Gets or sets item #7 in the chain. + /// + public T7 Item7 + { + get => Unsafe.AsRef(Item7Ptr); + set + { + value.StructureType(); + var ptr = Item7Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item8Ptr => (BaseInStructure*) (_headPtr + Item8Offset); + + /// + /// Gets or sets item #8 in the chain. + /// + public T8 Item8 + { + get => Unsafe.AsRef(Item8Ptr); + set + { + value.StructureType(); + var ptr = Item8Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item9Ptr => (BaseInStructure*) (_headPtr + Item9Offset); + + /// + /// Gets or sets item #9 in the chain. + /// + public T9 Item9 + { + get => Unsafe.AsRef(Item9Ptr); + set + { + value.StructureType(); + var ptr = Item9Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item10Ptr => (BaseInStructure*) (_headPtr + Item10Offset); + + /// + /// Gets or sets item #10 in the chain. + /// + public T10 Item10 + { + get => Unsafe.AsRef(Item10Ptr); + set + { + value.StructureType(); + var ptr = Item10Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item11Ptr => (BaseInStructure*) (_headPtr + Item11Offset); + + /// + /// Gets or sets item #11 in the chain. + /// + public T11 Item11 + { + get => Unsafe.AsRef(Item11Ptr); + set + { + value.StructureType(); + var ptr = Item11Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item12Ptr => (BaseInStructure*) (_headPtr + Item12Offset); + + /// + /// Gets or sets item #12 in the chain. + /// + public T12 Item12 + { + get => Unsafe.AsRef(Item12Ptr); + set + { + value.StructureType(); + var ptr = Item12Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 13 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 13 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + internal ManagedChain(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default, T11 item11 = default, T12 item12 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + itemPtr = Item2Ptr; + item2.StructureType(); + Marshal.StructureToPtr(item2, (nint)itemPtr, false); + Item1Ptr->PNext = itemPtr; + itemPtr = Item3Ptr; + item3.StructureType(); + Marshal.StructureToPtr(item3, (nint)itemPtr, false); + Item2Ptr->PNext = itemPtr; + itemPtr = Item4Ptr; + item4.StructureType(); + Marshal.StructureToPtr(item4, (nint)itemPtr, false); + Item3Ptr->PNext = itemPtr; + itemPtr = Item5Ptr; + item5.StructureType(); + Marshal.StructureToPtr(item5, (nint)itemPtr, false); + Item4Ptr->PNext = itemPtr; + itemPtr = Item6Ptr; + item6.StructureType(); + Marshal.StructureToPtr(item6, (nint)itemPtr, false); + Item5Ptr->PNext = itemPtr; + itemPtr = Item7Ptr; + item7.StructureType(); + Marshal.StructureToPtr(item7, (nint)itemPtr, false); + Item6Ptr->PNext = itemPtr; + itemPtr = Item8Ptr; + item8.StructureType(); + Marshal.StructureToPtr(item8, (nint)itemPtr, false); + Item7Ptr->PNext = itemPtr; + itemPtr = Item9Ptr; + item9.StructureType(); + Marshal.StructureToPtr(item9, (nint)itemPtr, false); + Item8Ptr->PNext = itemPtr; + itemPtr = Item10Ptr; + item10.StructureType(); + Marshal.StructureToPtr(item10, (nint)itemPtr, false); + Item9Ptr->PNext = itemPtr; + itemPtr = Item11Ptr; + item11.StructureType(); + Marshal.StructureToPtr(item11, (nint)itemPtr, false); + Item10Ptr->PNext = itemPtr; + itemPtr = Item12Ptr; + item12.StructureType(); + Marshal.StructureToPtr(item12, (nint)itemPtr, false); + Item11Ptr->PNext = itemPtr; + Item12Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + yield return Item2; + yield return Item3; + yield return Item4; + yield return Item5; + yield return Item6; + yield return Item7; + yield return Item8; + yield return Item9; + yield return Item10; + yield return Item11; + yield return Item12; + } + + /// + public override int Count => 13; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + 2 => Item2, + 3 => Item3, + 4 => Item4, + 5 => Item5, + 6 => Item6, + 7 => Item7, + 8 => Item8, + 9 => Item9, + 10 => Item10, + 11 => Item11, + 12 => Item12, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item9Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item10Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item11Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item12Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item9Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item10Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item11Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item12Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(", "); + sb.Append((object) Item2); + sb.Append(", "); + sb.Append((object) Item3); + sb.Append(", "); + sb.Append((object) Item4); + sb.Append(", "); + sb.Append((object) Item5); + sb.Append(", "); + sb.Append((object) Item6); + sb.Append(", "); + sb.Append((object) Item7); + sb.Append(", "); + sb.Append((object) Item8); + sb.Append(", "); + sb.Append((object) Item9); + sb.Append(", "); + sb.Append((object) Item10); + sb.Append(", "); + sb.Append((object) Item11); + sb.Append(", "); + sb.Append((object) Item12); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + public void Deconstruct(out TChain head, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12) + { + head = Head; + item1 = Item1; + item2 = Item2; + item3 = Item3; + item4 = Item4; + item5 = Item5; + item6 = Item6; + item7 = Item7; + item8 = Item8; + item9 = Item9; + item10 = Item10; + item11 = Item11; + item12 = Item12; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + Marshal.DestroyStructure(headPtr + Item2Offset); + Marshal.DestroyStructure(headPtr + Item3Offset); + Marshal.DestroyStructure(headPtr + Item4Offset); + Marshal.DestroyStructure(headPtr + Item5Offset); + Marshal.DestroyStructure(headPtr + Item6Offset); + Marshal.DestroyStructure(headPtr + Item7Offset); + Marshal.DestroyStructure(headPtr + Item8Offset); + Marshal.DestroyStructure(headPtr + Item9Offset); + Marshal.DestroyStructure(headPtr + Item10Offset); + Marshal.DestroyStructure(headPtr + Item11Offset); + Marshal.DestroyStructure(headPtr + Item12Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +/// Type of Item 2. +/// Type of Item 3. +/// Type of Item 4. +/// Type of Item 5. +/// Type of Item 6. +/// Type of Item 7. +/// Type of Item 8. +/// Type of Item 9. +/// Type of Item 10. +/// Type of Item 11. +/// Type of Item 12. +/// Type of Item 13. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item2Offset = Item1Offset + Item1Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item2Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item3Offset = Item2Offset + Item2Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item3Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item4Offset = Item3Offset + Item3Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item4Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item5Offset = Item4Offset + Item4Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item5Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item6Offset = Item5Offset + Item5Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item6Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item7Offset = Item6Offset + Item6Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item7Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item8Offset = Item7Offset + Item7Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item8Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item9Offset = Item8Offset + Item8Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item9Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item10Offset = Item9Offset + Item9Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item10Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item11Offset = Item10Offset + Item10Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item11Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item12Offset = Item11Offset + Item11Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item12Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item13Offset = Item12Offset + Item12Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item13Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item13Offset + Item13Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item2Ptr => (BaseInStructure*) (_headPtr + Item2Offset); + + /// + /// Gets or sets item #2 in the chain. + /// + public T2 Item2 + { + get => Unsafe.AsRef(Item2Ptr); + set + { + value.StructureType(); + var ptr = Item2Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item3Ptr => (BaseInStructure*) (_headPtr + Item3Offset); + + /// + /// Gets or sets item #3 in the chain. + /// + public T3 Item3 + { + get => Unsafe.AsRef(Item3Ptr); + set + { + value.StructureType(); + var ptr = Item3Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item4Ptr => (BaseInStructure*) (_headPtr + Item4Offset); + + /// + /// Gets or sets item #4 in the chain. + /// + public T4 Item4 + { + get => Unsafe.AsRef(Item4Ptr); + set + { + value.StructureType(); + var ptr = Item4Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item5Ptr => (BaseInStructure*) (_headPtr + Item5Offset); + + /// + /// Gets or sets item #5 in the chain. + /// + public T5 Item5 + { + get => Unsafe.AsRef(Item5Ptr); + set + { + value.StructureType(); + var ptr = Item5Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item6Ptr => (BaseInStructure*) (_headPtr + Item6Offset); + + /// + /// Gets or sets item #6 in the chain. + /// + public T6 Item6 + { + get => Unsafe.AsRef(Item6Ptr); + set + { + value.StructureType(); + var ptr = Item6Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item7Ptr => (BaseInStructure*) (_headPtr + Item7Offset); + + /// + /// Gets or sets item #7 in the chain. + /// + public T7 Item7 + { + get => Unsafe.AsRef(Item7Ptr); + set + { + value.StructureType(); + var ptr = Item7Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item8Ptr => (BaseInStructure*) (_headPtr + Item8Offset); + + /// + /// Gets or sets item #8 in the chain. + /// + public T8 Item8 + { + get => Unsafe.AsRef(Item8Ptr); + set + { + value.StructureType(); + var ptr = Item8Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item9Ptr => (BaseInStructure*) (_headPtr + Item9Offset); + + /// + /// Gets or sets item #9 in the chain. + /// + public T9 Item9 + { + get => Unsafe.AsRef(Item9Ptr); + set + { + value.StructureType(); + var ptr = Item9Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item10Ptr => (BaseInStructure*) (_headPtr + Item10Offset); + + /// + /// Gets or sets item #10 in the chain. + /// + public T10 Item10 + { + get => Unsafe.AsRef(Item10Ptr); + set + { + value.StructureType(); + var ptr = Item10Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item11Ptr => (BaseInStructure*) (_headPtr + Item11Offset); + + /// + /// Gets or sets item #11 in the chain. + /// + public T11 Item11 + { + get => Unsafe.AsRef(Item11Ptr); + set + { + value.StructureType(); + var ptr = Item11Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item12Ptr => (BaseInStructure*) (_headPtr + Item12Offset); + + /// + /// Gets or sets item #12 in the chain. + /// + public T12 Item12 + { + get => Unsafe.AsRef(Item12Ptr); + set + { + value.StructureType(); + var ptr = Item12Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item13Ptr => (BaseInStructure*) (_headPtr + Item13Offset); + + /// + /// Gets or sets item #13 in the chain. + /// + public T13 Item13 + { + get => Unsafe.AsRef(Item13Ptr); + set + { + value.StructureType(); + var ptr = Item13Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 14 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 14 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + /// Item 13. + internal ManagedChain(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default, T11 item11 = default, T12 item12 = default, T13 item13 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + itemPtr = Item2Ptr; + item2.StructureType(); + Marshal.StructureToPtr(item2, (nint)itemPtr, false); + Item1Ptr->PNext = itemPtr; + itemPtr = Item3Ptr; + item3.StructureType(); + Marshal.StructureToPtr(item3, (nint)itemPtr, false); + Item2Ptr->PNext = itemPtr; + itemPtr = Item4Ptr; + item4.StructureType(); + Marshal.StructureToPtr(item4, (nint)itemPtr, false); + Item3Ptr->PNext = itemPtr; + itemPtr = Item5Ptr; + item5.StructureType(); + Marshal.StructureToPtr(item5, (nint)itemPtr, false); + Item4Ptr->PNext = itemPtr; + itemPtr = Item6Ptr; + item6.StructureType(); + Marshal.StructureToPtr(item6, (nint)itemPtr, false); + Item5Ptr->PNext = itemPtr; + itemPtr = Item7Ptr; + item7.StructureType(); + Marshal.StructureToPtr(item7, (nint)itemPtr, false); + Item6Ptr->PNext = itemPtr; + itemPtr = Item8Ptr; + item8.StructureType(); + Marshal.StructureToPtr(item8, (nint)itemPtr, false); + Item7Ptr->PNext = itemPtr; + itemPtr = Item9Ptr; + item9.StructureType(); + Marshal.StructureToPtr(item9, (nint)itemPtr, false); + Item8Ptr->PNext = itemPtr; + itemPtr = Item10Ptr; + item10.StructureType(); + Marshal.StructureToPtr(item10, (nint)itemPtr, false); + Item9Ptr->PNext = itemPtr; + itemPtr = Item11Ptr; + item11.StructureType(); + Marshal.StructureToPtr(item11, (nint)itemPtr, false); + Item10Ptr->PNext = itemPtr; + itemPtr = Item12Ptr; + item12.StructureType(); + Marshal.StructureToPtr(item12, (nint)itemPtr, false); + Item11Ptr->PNext = itemPtr; + itemPtr = Item13Ptr; + item13.StructureType(); + Marshal.StructureToPtr(item13, (nint)itemPtr, false); + Item12Ptr->PNext = itemPtr; + Item13Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + yield return Item2; + yield return Item3; + yield return Item4; + yield return Item5; + yield return Item6; + yield return Item7; + yield return Item8; + yield return Item9; + yield return Item10; + yield return Item11; + yield return Item12; + yield return Item13; + } + + /// + public override int Count => 14; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + 2 => Item2, + 3 => Item3, + 4 => Item4, + 5 => Item5, + 6 => Item6, + 7 => Item7, + 8 => Item8, + 9 => Item9, + 10 => Item10, + 11 => Item11, + 12 => Item12, + 13 => Item13, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item9Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item10Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item11Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item12Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item13Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item9Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item10Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item11Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item12Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item13Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(", "); + sb.Append((object) Item2); + sb.Append(", "); + sb.Append((object) Item3); + sb.Append(", "); + sb.Append((object) Item4); + sb.Append(", "); + sb.Append((object) Item5); + sb.Append(", "); + sb.Append((object) Item6); + sb.Append(", "); + sb.Append((object) Item7); + sb.Append(", "); + sb.Append((object) Item8); + sb.Append(", "); + sb.Append((object) Item9); + sb.Append(", "); + sb.Append((object) Item10); + sb.Append(", "); + sb.Append((object) Item11); + sb.Append(", "); + sb.Append((object) Item12); + sb.Append(", "); + sb.Append((object) Item13); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + /// Item 13. + public void Deconstruct(out TChain head, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13) + { + head = Head; + item1 = Item1; + item2 = Item2; + item3 = Item3; + item4 = Item4; + item5 = Item5; + item6 = Item6; + item7 = Item7; + item8 = Item8; + item9 = Item9; + item10 = Item10; + item11 = Item11; + item12 = Item12; + item13 = Item13; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + Marshal.DestroyStructure(headPtr + Item2Offset); + Marshal.DestroyStructure(headPtr + Item3Offset); + Marshal.DestroyStructure(headPtr + Item4Offset); + Marshal.DestroyStructure(headPtr + Item5Offset); + Marshal.DestroyStructure(headPtr + Item6Offset); + Marshal.DestroyStructure(headPtr + Item7Offset); + Marshal.DestroyStructure(headPtr + Item8Offset); + Marshal.DestroyStructure(headPtr + Item9Offset); + Marshal.DestroyStructure(headPtr + Item10Offset); + Marshal.DestroyStructure(headPtr + Item11Offset); + Marshal.DestroyStructure(headPtr + Item12Offset); + Marshal.DestroyStructure(headPtr + Item13Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +/// Type of Item 2. +/// Type of Item 3. +/// Type of Item 4. +/// Type of Item 5. +/// Type of Item 6. +/// Type of Item 7. +/// Type of Item 8. +/// Type of Item 9. +/// Type of Item 10. +/// Type of Item 11. +/// Type of Item 12. +/// Type of Item 13. +/// Type of Item 14. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item2Offset = Item1Offset + Item1Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item2Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item3Offset = Item2Offset + Item2Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item3Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item4Offset = Item3Offset + Item3Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item4Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item5Offset = Item4Offset + Item4Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item5Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item6Offset = Item5Offset + Item5Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item6Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item7Offset = Item6Offset + Item6Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item7Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item8Offset = Item7Offset + Item7Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item8Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item9Offset = Item8Offset + Item8Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item9Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item10Offset = Item9Offset + Item9Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item10Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item11Offset = Item10Offset + Item10Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item11Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item12Offset = Item11Offset + Item11Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item12Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item13Offset = Item12Offset + Item12Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item13Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item14Offset = Item13Offset + Item13Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item14Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item14Offset + Item14Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item2Ptr => (BaseInStructure*) (_headPtr + Item2Offset); + + /// + /// Gets or sets item #2 in the chain. + /// + public T2 Item2 + { + get => Unsafe.AsRef(Item2Ptr); + set + { + value.StructureType(); + var ptr = Item2Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item3Ptr => (BaseInStructure*) (_headPtr + Item3Offset); + + /// + /// Gets or sets item #3 in the chain. + /// + public T3 Item3 + { + get => Unsafe.AsRef(Item3Ptr); + set + { + value.StructureType(); + var ptr = Item3Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item4Ptr => (BaseInStructure*) (_headPtr + Item4Offset); + + /// + /// Gets or sets item #4 in the chain. + /// + public T4 Item4 + { + get => Unsafe.AsRef(Item4Ptr); + set + { + value.StructureType(); + var ptr = Item4Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item5Ptr => (BaseInStructure*) (_headPtr + Item5Offset); + + /// + /// Gets or sets item #5 in the chain. + /// + public T5 Item5 + { + get => Unsafe.AsRef(Item5Ptr); + set + { + value.StructureType(); + var ptr = Item5Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item6Ptr => (BaseInStructure*) (_headPtr + Item6Offset); + + /// + /// Gets or sets item #6 in the chain. + /// + public T6 Item6 + { + get => Unsafe.AsRef(Item6Ptr); + set + { + value.StructureType(); + var ptr = Item6Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item7Ptr => (BaseInStructure*) (_headPtr + Item7Offset); + + /// + /// Gets or sets item #7 in the chain. + /// + public T7 Item7 + { + get => Unsafe.AsRef(Item7Ptr); + set + { + value.StructureType(); + var ptr = Item7Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item8Ptr => (BaseInStructure*) (_headPtr + Item8Offset); + + /// + /// Gets or sets item #8 in the chain. + /// + public T8 Item8 + { + get => Unsafe.AsRef(Item8Ptr); + set + { + value.StructureType(); + var ptr = Item8Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item9Ptr => (BaseInStructure*) (_headPtr + Item9Offset); + + /// + /// Gets or sets item #9 in the chain. + /// + public T9 Item9 + { + get => Unsafe.AsRef(Item9Ptr); + set + { + value.StructureType(); + var ptr = Item9Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item10Ptr => (BaseInStructure*) (_headPtr + Item10Offset); + + /// + /// Gets or sets item #10 in the chain. + /// + public T10 Item10 + { + get => Unsafe.AsRef(Item10Ptr); + set + { + value.StructureType(); + var ptr = Item10Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item11Ptr => (BaseInStructure*) (_headPtr + Item11Offset); + + /// + /// Gets or sets item #11 in the chain. + /// + public T11 Item11 + { + get => Unsafe.AsRef(Item11Ptr); + set + { + value.StructureType(); + var ptr = Item11Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item12Ptr => (BaseInStructure*) (_headPtr + Item12Offset); + + /// + /// Gets or sets item #12 in the chain. + /// + public T12 Item12 + { + get => Unsafe.AsRef(Item12Ptr); + set + { + value.StructureType(); + var ptr = Item12Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item13Ptr => (BaseInStructure*) (_headPtr + Item13Offset); + + /// + /// Gets or sets item #13 in the chain. + /// + public T13 Item13 + { + get => Unsafe.AsRef(Item13Ptr); + set + { + value.StructureType(); + var ptr = Item13Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item14Ptr => (BaseInStructure*) (_headPtr + Item14Offset); + + /// + /// Gets or sets item #14 in the chain. + /// + public T14 Item14 + { + get => Unsafe.AsRef(Item14Ptr); + set + { + value.StructureType(); + var ptr = Item14Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 15 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 15 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + /// Item 13. + /// Item 14. + internal ManagedChain(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default, T11 item11 = default, T12 item12 = default, T13 item13 = default, T14 item14 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + itemPtr = Item2Ptr; + item2.StructureType(); + Marshal.StructureToPtr(item2, (nint)itemPtr, false); + Item1Ptr->PNext = itemPtr; + itemPtr = Item3Ptr; + item3.StructureType(); + Marshal.StructureToPtr(item3, (nint)itemPtr, false); + Item2Ptr->PNext = itemPtr; + itemPtr = Item4Ptr; + item4.StructureType(); + Marshal.StructureToPtr(item4, (nint)itemPtr, false); + Item3Ptr->PNext = itemPtr; + itemPtr = Item5Ptr; + item5.StructureType(); + Marshal.StructureToPtr(item5, (nint)itemPtr, false); + Item4Ptr->PNext = itemPtr; + itemPtr = Item6Ptr; + item6.StructureType(); + Marshal.StructureToPtr(item6, (nint)itemPtr, false); + Item5Ptr->PNext = itemPtr; + itemPtr = Item7Ptr; + item7.StructureType(); + Marshal.StructureToPtr(item7, (nint)itemPtr, false); + Item6Ptr->PNext = itemPtr; + itemPtr = Item8Ptr; + item8.StructureType(); + Marshal.StructureToPtr(item8, (nint)itemPtr, false); + Item7Ptr->PNext = itemPtr; + itemPtr = Item9Ptr; + item9.StructureType(); + Marshal.StructureToPtr(item9, (nint)itemPtr, false); + Item8Ptr->PNext = itemPtr; + itemPtr = Item10Ptr; + item10.StructureType(); + Marshal.StructureToPtr(item10, (nint)itemPtr, false); + Item9Ptr->PNext = itemPtr; + itemPtr = Item11Ptr; + item11.StructureType(); + Marshal.StructureToPtr(item11, (nint)itemPtr, false); + Item10Ptr->PNext = itemPtr; + itemPtr = Item12Ptr; + item12.StructureType(); + Marshal.StructureToPtr(item12, (nint)itemPtr, false); + Item11Ptr->PNext = itemPtr; + itemPtr = Item13Ptr; + item13.StructureType(); + Marshal.StructureToPtr(item13, (nint)itemPtr, false); + Item12Ptr->PNext = itemPtr; + itemPtr = Item14Ptr; + item14.StructureType(); + Marshal.StructureToPtr(item14, (nint)itemPtr, false); + Item13Ptr->PNext = itemPtr; + Item14Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + yield return Item2; + yield return Item3; + yield return Item4; + yield return Item5; + yield return Item6; + yield return Item7; + yield return Item8; + yield return Item9; + yield return Item10; + yield return Item11; + yield return Item12; + yield return Item13; + yield return Item14; + } + + /// + public override int Count => 15; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + 2 => Item2, + 3 => Item3, + 4 => Item4, + 5 => Item5, + 6 => Item6, + 7 => Item7, + 8 => Item8, + 9 => Item9, + 10 => Item10, + 11 => Item11, + 12 => Item12, + 13 => Item13, + 14 => Item14, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item9Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item10Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item11Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item12Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item13Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item14Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item9Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item10Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item11Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item12Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item13Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item14Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(", "); + sb.Append((object) Item2); + sb.Append(", "); + sb.Append((object) Item3); + sb.Append(", "); + sb.Append((object) Item4); + sb.Append(", "); + sb.Append((object) Item5); + sb.Append(", "); + sb.Append((object) Item6); + sb.Append(", "); + sb.Append((object) Item7); + sb.Append(", "); + sb.Append((object) Item8); + sb.Append(", "); + sb.Append((object) Item9); + sb.Append(", "); + sb.Append((object) Item10); + sb.Append(", "); + sb.Append((object) Item11); + sb.Append(", "); + sb.Append((object) Item12); + sb.Append(", "); + sb.Append((object) Item13); + sb.Append(", "); + sb.Append((object) Item14); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + /// Item 13. + /// Item 14. + public void Deconstruct(out TChain head, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14) + { + head = Head; + item1 = Item1; + item2 = Item2; + item3 = Item3; + item4 = Item4; + item5 = Item5; + item6 = Item6; + item7 = Item7; + item8 = Item8; + item9 = Item9; + item10 = Item10; + item11 = Item11; + item12 = Item12; + item13 = Item13; + item14 = Item14; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + Marshal.DestroyStructure(headPtr + Item2Offset); + Marshal.DestroyStructure(headPtr + Item3Offset); + Marshal.DestroyStructure(headPtr + Item4Offset); + Marshal.DestroyStructure(headPtr + Item5Offset); + Marshal.DestroyStructure(headPtr + Item6Offset); + Marshal.DestroyStructure(headPtr + Item7Offset); + Marshal.DestroyStructure(headPtr + Item8Offset); + Marshal.DestroyStructure(headPtr + Item9Offset); + Marshal.DestroyStructure(headPtr + Item10Offset); + Marshal.DestroyStructure(headPtr + Item11Offset); + Marshal.DestroyStructure(headPtr + Item12Offset); + Marshal.DestroyStructure(headPtr + Item13Offset); + Marshal.DestroyStructure(headPtr + Item14Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} + +/// +/// A safely manages the pointers of a managed structure chain. +/// +/// The chain type +/// Type of Item 1. +/// Type of Item 2. +/// Type of Item 3. +/// Type of Item 4. +/// Type of Item 5. +/// Type of Item 6. +/// Type of Item 7. +/// Type of Item 8. +/// Type of Item 9. +/// Type of Item 10. +/// Type of Item 11. +/// Type of Item 12. +/// Type of Item 13. +/// Type of Item 14. +/// Type of Item 15. +public unsafe sealed class ManagedChain : ManagedChain, IEquatable> + where TChain : struct, IChainable + where T1 : struct, IChainable + where T2 : struct, IChainable + where T3 : struct, IChainable + where T4 : struct, IChainable + where T5 : struct, IChainable + where T6 : struct, IChainable + where T7 : struct, IChainable + where T8 : struct, IChainable + where T9 : struct, IChainable + where T10 : struct, IChainable + where T11 : struct, IChainable + where T12 : struct, IChainable + where T13 : struct, IChainable + where T14 : struct, IChainable + where T15 : struct, IChainable +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item1Offset = HeadSize; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item1Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item2Offset = Item1Offset + Item1Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item2Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item3Offset = Item2Offset + Item2Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item3Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item4Offset = Item3Offset + Item3Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item4Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item5Offset = Item4Offset + Item4Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item5Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item6Offset = Item5Offset + Item5Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item6Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item7Offset = Item6Offset + Item6Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item7Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item8Offset = Item7Offset + Item7Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item8Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item9Offset = Item8Offset + Item8Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item9Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item10Offset = Item9Offset + Item9Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item10Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item11Offset = Item10Offset + Item10Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item11Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item12Offset = Item11Offset + Item11Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item12Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item13Offset = Item12Offset + Item12Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item13Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item14Offset = Item13Offset + Item13Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item14Size = Marshal.SizeOf(); + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item15Offset = Item14Offset + Item14Size; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item15Size = Marshal.SizeOf(); + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = Item15Offset + Item15Size; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item1Ptr => (BaseInStructure*) (_headPtr + Item1Offset); + + /// + /// Gets or sets item #1 in the chain. + /// + public T1 Item1 + { + get => Unsafe.AsRef(Item1Ptr); + set + { + value.StructureType(); + var ptr = Item1Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item2Ptr => (BaseInStructure*) (_headPtr + Item2Offset); + + /// + /// Gets or sets item #2 in the chain. + /// + public T2 Item2 + { + get => Unsafe.AsRef(Item2Ptr); + set + { + value.StructureType(); + var ptr = Item2Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item3Ptr => (BaseInStructure*) (_headPtr + Item3Offset); + + /// + /// Gets or sets item #3 in the chain. + /// + public T3 Item3 + { + get => Unsafe.AsRef(Item3Ptr); + set + { + value.StructureType(); + var ptr = Item3Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item4Ptr => (BaseInStructure*) (_headPtr + Item4Offset); + + /// + /// Gets or sets item #4 in the chain. + /// + public T4 Item4 + { + get => Unsafe.AsRef(Item4Ptr); + set + { + value.StructureType(); + var ptr = Item4Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item5Ptr => (BaseInStructure*) (_headPtr + Item5Offset); + + /// + /// Gets or sets item #5 in the chain. + /// + public T5 Item5 + { + get => Unsafe.AsRef(Item5Ptr); + set + { + value.StructureType(); + var ptr = Item5Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item6Ptr => (BaseInStructure*) (_headPtr + Item6Offset); + + /// + /// Gets or sets item #6 in the chain. + /// + public T6 Item6 + { + get => Unsafe.AsRef(Item6Ptr); + set + { + value.StructureType(); + var ptr = Item6Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item7Ptr => (BaseInStructure*) (_headPtr + Item7Offset); + + /// + /// Gets or sets item #7 in the chain. + /// + public T7 Item7 + { + get => Unsafe.AsRef(Item7Ptr); + set + { + value.StructureType(); + var ptr = Item7Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item8Ptr => (BaseInStructure*) (_headPtr + Item8Offset); + + /// + /// Gets or sets item #8 in the chain. + /// + public T8 Item8 + { + get => Unsafe.AsRef(Item8Ptr); + set + { + value.StructureType(); + var ptr = Item8Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item9Ptr => (BaseInStructure*) (_headPtr + Item9Offset); + + /// + /// Gets or sets item #9 in the chain. + /// + public T9 Item9 + { + get => Unsafe.AsRef(Item9Ptr); + set + { + value.StructureType(); + var ptr = Item9Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item10Ptr => (BaseInStructure*) (_headPtr + Item10Offset); + + /// + /// Gets or sets item #10 in the chain. + /// + public T10 Item10 + { + get => Unsafe.AsRef(Item10Ptr); + set + { + value.StructureType(); + var ptr = Item10Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item11Ptr => (BaseInStructure*) (_headPtr + Item11Offset); + + /// + /// Gets or sets item #11 in the chain. + /// + public T11 Item11 + { + get => Unsafe.AsRef(Item11Ptr); + set + { + value.StructureType(); + var ptr = Item11Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item12Ptr => (BaseInStructure*) (_headPtr + Item12Offset); + + /// + /// Gets or sets item #12 in the chain. + /// + public T12 Item12 + { + get => Unsafe.AsRef(Item12Ptr); + set + { + value.StructureType(); + var ptr = Item12Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item13Ptr => (BaseInStructure*) (_headPtr + Item13Offset); + + /// + /// Gets or sets item #13 in the chain. + /// + public T13 Item13 + { + get => Unsafe.AsRef(Item13Ptr); + set + { + value.StructureType(); + var ptr = Item13Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item14Ptr => (BaseInStructure*) (_headPtr + Item14Offset); + + /// + /// Gets or sets item #14 in the chain. + /// + public T14 Item14 + { + get => Unsafe.AsRef(Item14Ptr); + set + { + value.StructureType(); + var ptr = Item14Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item15Ptr => (BaseInStructure*) (_headPtr + Item15Offset); + + /// + /// Gets or sets item #15 in the chain. + /// + public T15 Item15 + { + get => Unsafe.AsRef(Item15Ptr); + set + { + value.StructureType(); + var ptr = Item15Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } + + /// + /// Creates a new with 16 items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with 16 items. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + /// Item 13. + /// Item 14. + /// Item 15. + internal ManagedChain(TChain head = default, T1 item1 = default, T2 item2 = default, T3 item3 = default, T4 item4 = default, T5 item5 = default, T6 item6 = default, T7 item7 = default, T8 item8 = default, T9 item9 = default, T10 item10 = default, T11 item11 = default, T12 item12 = default, T13 item13 = default, T14 item14 = default, T15 item15 = default) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); + var itemPtr = Item1Ptr; + item1.StructureType(); + Marshal.StructureToPtr(item1, (nint)itemPtr, false); + HeadPtr->PNext = itemPtr; + itemPtr = Item2Ptr; + item2.StructureType(); + Marshal.StructureToPtr(item2, (nint)itemPtr, false); + Item1Ptr->PNext = itemPtr; + itemPtr = Item3Ptr; + item3.StructureType(); + Marshal.StructureToPtr(item3, (nint)itemPtr, false); + Item2Ptr->PNext = itemPtr; + itemPtr = Item4Ptr; + item4.StructureType(); + Marshal.StructureToPtr(item4, (nint)itemPtr, false); + Item3Ptr->PNext = itemPtr; + itemPtr = Item5Ptr; + item5.StructureType(); + Marshal.StructureToPtr(item5, (nint)itemPtr, false); + Item4Ptr->PNext = itemPtr; + itemPtr = Item6Ptr; + item6.StructureType(); + Marshal.StructureToPtr(item6, (nint)itemPtr, false); + Item5Ptr->PNext = itemPtr; + itemPtr = Item7Ptr; + item7.StructureType(); + Marshal.StructureToPtr(item7, (nint)itemPtr, false); + Item6Ptr->PNext = itemPtr; + itemPtr = Item8Ptr; + item8.StructureType(); + Marshal.StructureToPtr(item8, (nint)itemPtr, false); + Item7Ptr->PNext = itemPtr; + itemPtr = Item9Ptr; + item9.StructureType(); + Marshal.StructureToPtr(item9, (nint)itemPtr, false); + Item8Ptr->PNext = itemPtr; + itemPtr = Item10Ptr; + item10.StructureType(); + Marshal.StructureToPtr(item10, (nint)itemPtr, false); + Item9Ptr->PNext = itemPtr; + itemPtr = Item11Ptr; + item11.StructureType(); + Marshal.StructureToPtr(item11, (nint)itemPtr, false); + Item10Ptr->PNext = itemPtr; + itemPtr = Item12Ptr; + item12.StructureType(); + Marshal.StructureToPtr(item12, (nint)itemPtr, false); + Item11Ptr->PNext = itemPtr; + itemPtr = Item13Ptr; + item13.StructureType(); + Marshal.StructureToPtr(item13, (nint)itemPtr, false); + Item12Ptr->PNext = itemPtr; + itemPtr = Item14Ptr; + item14.StructureType(); + Marshal.StructureToPtr(item14, (nint)itemPtr, false); + Item13Ptr->PNext = itemPtr; + itemPtr = Item15Ptr; + item15.StructureType(); + Marshal.StructureToPtr(item15, (nint)itemPtr, false); + Item14Ptr->PNext = itemPtr; + Item15Ptr->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; + yield return Item1; + yield return Item2; + yield return Item3; + yield return Item4; + yield return Item5; + yield return Item6; + yield return Item7; + yield return Item8; + yield return Item9; + yield return Item10; + yield return Item11; + yield return Item12; + yield return Item13; + yield return Item14; + yield return Item15; + } + + /// + public override int Count => 16; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, + 1 => Item1, + 2 => Item2, + 3 => Item3, + 4 => Item4, + 5 => Item5, + 6 => Item6, + 7 => Item7, + 8 => Item8, + 9 => Item9, + 10 => Item10, + 11 => Item11, + 12 => Item12, + 13 => Item13, + 14 => Item14, + 15 => Item15, + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item9Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item10Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item11Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item12Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item13Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item14Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + + start += length; + length = Item15Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item1Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item2Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item3Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item4Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item5Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item6Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item7Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item8Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item9Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item10Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item11Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item12Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item13Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item14Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + + start += length; + length = Item15Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain left, ManagedChain right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head); sb.Append(", "); + sb.Append((object) Item1); + sb.Append(", "); + sb.Append((object) Item2); + sb.Append(", "); + sb.Append((object) Item3); + sb.Append(", "); + sb.Append((object) Item4); + sb.Append(", "); + sb.Append((object) Item5); + sb.Append(", "); + sb.Append((object) Item6); + sb.Append(", "); + sb.Append((object) Item7); + sb.Append(", "); + sb.Append((object) Item8); + sb.Append(", "); + sb.Append((object) Item9); + sb.Append(", "); + sb.Append((object) Item10); + sb.Append(", "); + sb.Append((object) Item11); + sb.Append(", "); + sb.Append((object) Item12); + sb.Append(", "); + sb.Append((object) Item13); + sb.Append(", "); + sb.Append((object) Item14); + sb.Append(", "); + sb.Append((object) Item15); + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// + /// The head of the chain. + /// Item 1. + /// Item 2. + /// Item 3. + /// Item 4. + /// Item 5. + /// Item 6. + /// Item 7. + /// Item 8. + /// Item 9. + /// Item 10. + /// Item 11. + /// Item 12. + /// Item 13. + /// Item 14. + /// Item 15. + public void Deconstruct(out TChain head, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15) + { + head = Head; + item1 = Item1; + item2 = Item2; + item3 = Item3; + item4 = Item4; + item5 = Item5; + item6 = Item6; + item7 = Item7; + item8 = Item8; + item9 = Item9; + item10 = Item10; + item11 = Item11; + item12 = Item12; + item13 = Item13; + item14 = Item14; + item15 = Item15; + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); + Marshal.DestroyStructure(headPtr + Item1Offset); + Marshal.DestroyStructure(headPtr + Item2Offset); + Marshal.DestroyStructure(headPtr + Item3Offset); + Marshal.DestroyStructure(headPtr + Item4Offset); + Marshal.DestroyStructure(headPtr + Item5Offset); + Marshal.DestroyStructure(headPtr + Item6Offset); + Marshal.DestroyStructure(headPtr + Item7Offset); + Marshal.DestroyStructure(headPtr + Item8Offset); + Marshal.DestroyStructure(headPtr + Item9Offset); + Marshal.DestroyStructure(headPtr + Item10Offset); + Marshal.DestroyStructure(headPtr + Item11Offset); + Marshal.DestroyStructure(headPtr + Item12Offset); + Marshal.DestroyStructure(headPtr + Item13Offset); + Marshal.DestroyStructure(headPtr + Item14Offset); + Marshal.DestroyStructure(headPtr + Item15Offset); + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} diff --git a/src/Vulkan/Silk.NET.Vulkan/ManagedChain.gen.tt b/src/Vulkan/Silk.NET.Vulkan/ManagedChain.gen.tt new file mode 100644 index 0000000000..59477e4e7c --- /dev/null +++ b/src/Vulkan/Silk.NET.Vulkan/ManagedChain.gen.tt @@ -0,0 +1,947 @@ +<#@ template language="C#" #> +<#@ import namespace="System.Text" #> +<# + var maximumItems = 16; + + string ParameterDocs(int index, string prefix) + { + var builder = new StringBuilder(prefix); + builder.Append("The head of the chain."); + for (var i = 1; i < index; i++) + { + builder + .AppendLine() + .Append(prefix) + .Append("Item ") + .Append(i) + .Append("."); + } + return builder.ToString(); + } + + string ParameterTypeDocs(int index, string prefix) + { + var builder = new StringBuilder(prefix); + builder.Append("The chain type"); + for (var i = 1; i < index; i++) + { + builder + .AppendLine() + .Append(prefix) + .Append("Type of Item ") + .Append(i) + .Append("."); + } + return builder.ToString(); + } + + string TypeList(int index) + { + var builder = new StringBuilder("TChain"); + for (var i = 1; i < index; i++) + { + builder + .Append(", T") + .Append(i); + } + return builder.ToString(); + } + + string ParamList(int index) + { + var builder = new StringBuilder("TChain head = default"); + for (var i = 1; i < index; i++) + { + builder + .Append(", T") + .Append(i) + .Append(" item") + .Append(i) + .Append(" = default"); + } + return builder.ToString(); + } + + string ArgList(int index) + { + var builder = new StringBuilder("head"); + for (var i = 1; i < index; i++) + { + builder + .Append(", item") + .Append(i); + } + return builder.ToString(); + } + + string ConstraintList(int index, string prefix) + { + var builder = new StringBuilder(prefix); + builder.Append("where TChain : struct, IChainStart"); + for (var i = 1; i < index; i++) + { + builder + .AppendLine() + .Append(prefix) + .Append("where T") + .Append(i) + .Append(" : struct, IExtendsChain"); + } + return builder.ToString(); + } + + string ConstraintListLoose(int index, string prefix) + { + var builder = new StringBuilder(prefix); + builder.Append("where TChain : struct, IChainable"); + for (var i = 1; i < index; i++) + { + builder + .AppendLine() + .Append(prefix) + .Append("where T") + .Append(i) + .Append(" : struct, IChainable"); + } + return builder.ToString(); + } +#> +// ReSharper disable StaticMemberInGenericType +#pragma warning disable CS0659, CS0660 +using System; +using System.Collections; +using System.Collections.Generic; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading; + +namespace Silk.NET.Vulkan; + +/// +/// Base class for all Managed Chains. +/// +public abstract unsafe class ManagedChain : IReadOnlyList, IDisposable +{ + /// + /// Gets a pointer to the current head. + /// + public abstract BaseInStructure* HeadPtr { get; } + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public abstract int Size { get; } + + /// + public abstract IEnumerator GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + /// + public abstract int Count { get; } + + /// + public abstract IChainable this[int index] { get; } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool Equals(object obj) + { + return !ReferenceEquals(null, obj) && + (ReferenceEquals(this, obj) || obj.GetType() == this.GetType() && MemoryEquals((ManagedChain) obj)); + } + + /// + /// Compares the supplied memory block with this one. + /// + protected abstract bool MemoryEquals(ManagedChain other); + + /// + public abstract void Dispose(); + + /// + /// Combines a hashcode with the contents of a slice. + /// + /// + /// + /// + protected static void CombineHash(ref int hashCode, ReadOnlySpan slice) + { + if (slice.Length >= 8) + { + // Process slice in 8 byte chunks + var s8 = MemoryMarshal.Cast(slice); + foreach (var l in s8) + { + hashCode = HashCode.Combine(hashCode, l); + } + + slice = slice.Slice(s8.Length*8); + } + + // Process remainder of slice + if (slice.Length >= 4) + { + var s4 = MemoryMarshal.Cast(slice); + hashCode = HashCode.Combine(hashCode, s4[0]); + slice = slice.Slice(s4.Length*4); + } + + if (slice.Length >= 2) + { + var s2 = MemoryMarshal.Cast(slice); + hashCode = HashCode.Combine(hashCode, s2[0]); + slice = slice.Slice(s2.Length*2); + } + + if (slice.Length > 0) + { + hashCode = HashCode.Combine(hashCode, slice[0]); + } + } + +<# + for (var i = 1; i <= maximumItems; i++) + { + var tList = TypeList(i); + var pDocs = ParameterDocs(i, " /// "); + var pTypeDocs = ParameterTypeDocs(i, " /// "); + var constraints = ConstraintList(i, " "); + var constraintsLoose = ConstraintListLoose(i, " "); +#> + /// + /// Creates a new with <#= i #> items. + /// +<#= pDocs #> +<#= pTypeDocs #> + /// A new with <#= i #> items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain<<#= tList #>> Create<<#= tList #>>(<#= ParamList(i) #>) +<#= constraints #> + => new(<#= ArgList(i) #>); + + /// + /// Creates a new with <#= i #> items. + /// +<#= pDocs #> +<#= pTypeDocs #> + /// A new with <#= i #> items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain<<#= tList #>> CreateAny<<#= tList #>>(<#= ParamList(i) #>) +<#= constraintsLoose #> + => new(<#= ArgList(i) #>); + + /// + /// Loads a new with <#= i #> items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with <#= i #> items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain<<#= tList #>> Load<<#= tList #>>(TChain chain) +<#= constraints #> + => LoadAny<<#= tList #>>(out var _, chain); + + /// + /// Loads a new with <#= i #> items from an existing unmanaged chain, + /// ignoring any errors. + /// + /// The unmanaged chain to use as the basis of this chain. + /// A new with <#= i #> items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain<<#= tList #>> LoadAny<<#= tList #>>(TChain chain) +<#= constraintsLoose #> + => LoadAny<<#= tList #>>(out var _, chain); + + /// + /// Loads a new with <#= i #> items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with <#= i #> items. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain<<#= tList #>> Load<<#= tList #>>(out string errors, TChain chain) +<#= constraints #> + => LoadAny<<#= tList #>>(out errors, chain); + + /// + /// Loads a new with <#= i #> items from an existing unmanaged chain. + /// + /// Any errors loading the chain. + /// The unmanaged chain to use as the basis of this chain. + /// A new with <#= i #> items. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain<<#= tList #>> LoadAny<<#= tList #>>(out string errors, TChain chain) +<#= constraintsLoose #> + { + var size = ManagedChain<<#= tList #>>.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + chain.StructureType(); + Marshal.StructureToPtr(chain, newHeadPtr, false); +<# + if (i == 1) + { +#> + errors = string.Empty; +<# + } + else + { +#> + var errorBuilder = new StringBuilder(); + var existingPtr = (BaseInStructure*) Unsafe.AsPointer(ref chain); + var newPtr = (BaseInStructure*) newHeadPtr; +<# + for (var j = 1; j < i; j++) + { +#> + + existingPtr = existingPtr->PNext; + newPtr->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain<<#= tList #>>.Item<#= j #>Offset); + newPtr = newPtr->PNext; + + T<#= j #> item<#= j #> = default; + <#= j == 1 ? "var " : "" #>expectedStructureType = item<#= j #>.StructureType(); + if (existingPtr is null) { + errorBuilder.AppendLine("The unmanaged chain was length <#= j #>, expected length <#= i #>"); + } else { + if (existingPtr->SType != expectedStructureType) { + errorBuilder.Append("The unmanaged chain has a structure type ") + .Append(existingPtr->SType) + .Append(" at position <#= j + 1 #>; expected ") + .Append(expectedStructureType) + .AppendLine(); + } else { +<# + if (j == i - 1) + { +#> + if (existingPtr->PNext is not null) { + errorBuilder.AppendLine("The unmanaged chain was longer than the expected length <#= i #>"); + existingPtr->PNext = null; + } +<# + } // if (j == i -1) +#> + item<#= j #> = Unsafe.AsRef>(existingPtr); + } + } + Marshal.StructureToPtr(item<#= j #>, (nint) newPtr, false); +<# + } // for (int j = 1; j < i; j++) { +#> + + // Create string of errors + errors = errorBuilder.ToString().Trim(); +<# + } // if (i == 1) {} else {... +#> + return new ManagedChain<<#= tList #>>(newHeadPtr); + } + +<# + } // for (var i = 1; i <= maximumItems; i++) +#> +} + +/// +/// Static class providing extension methods for manipulating managed chains. +/// +/// The `Any` versions of chain methods do not validate that items belong in the chain, this is +/// useful for situations where the specification does not indicate required chain constraints. You should generally +/// try to use the none `Any` version in preference. +public static unsafe class ManagedChainExtensions +{ +<# + for (var i = 1; i <= maximumItems; i++) + { + var tList = TypeList(i); + var pTypeDocs = ParameterTypeDocs(i, " /// "); + var constraints = ConstraintList(i, " "); + var constraintsLoose = ConstraintListLoose(i, " "); +#> + /// + /// Creates a new with <#= i #> by copying the . + /// + /// The chain. +<#= pTypeDocs #> + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain<<#= tList #>> Duplicate<<#= tList #>>(this ManagedChain<<#= tList #>> chain) +<#= constraints #> + => chain.DuplicateAny(); + + /// + /// Creates a new with <#= i #> by copying the . + /// + /// The chain. +<#= pTypeDocs #> + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain<<#= tList #>> DuplicateAny<<#= tList #>>(this ManagedChain<<#= tList #>> chain) +<#= constraintsLoose #> + { + var size = ManagedChain<<#= tList #>>.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(size); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, size, size); +<# + if (i > 1) + { +#> + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain<<#= tList #>>.Item1Offset); +<# + } // if (i > 1) +#> +<# + for (var j = 2; j < i; j++) + { +#> + ((BaseInStructure*)(newHeadPtr + ManagedChain<<#= tList #>>.Item<#= j - 1 #>Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain<<#= tList #>>.Item<#= j #>Offset); +<# + } // for (int j = 1; j < i; j++) { +#> + return new ManagedChain<<#= tList #>>(newHeadPtr); + } + +<# + if (i > 1) + { + var shortTList = TypeList(i - 1); +#> + /// + /// Creates a new with <#= i - 1 #> items, by removing the last item + /// from the . + /// + /// The chain. +<#= pTypeDocs #> + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain<<#= shortTList #>> Truncate<<#= tList #>>(this ManagedChain<<#= tList #>> chain) +<#= constraints #> + => chain.TruncateAny(out var _); + + /// + /// Creates a new with <#= i - 1 #> items, by removing the last item + /// from the . + /// + /// The chain. +<#= pTypeDocs #> + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain<<#= shortTList #>> TruncateAny<<#= tList #>>(this ManagedChain<<#= tList #>> chain) +<#= constraintsLoose #> + => chain.TruncateAny(out var _); + + /// + /// Creates a new with <#= i - 1 #> items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . +<#= pTypeDocs #> + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// + /// + /// + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static ManagedChain<<#= shortTList #>> Truncate<<#= tList #>>(this ManagedChain<<#= tList #>> chain, out T<#= i - 1 #> item<#= i - 1 #>) +<#= constraints #> + => chain.TruncateAny(out item<#= i - 1 #>); + + /// + /// Creates a new with <#= i - 1 #> items, by removing + /// from the end of the . + /// + /// The chain. + /// The item removed from the . +<#= pTypeDocs #> + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + /// + /// + public static ManagedChain<<#= shortTList #>> TruncateAny<<#= tList #>>(this ManagedChain<<#= tList #>> chain, out T<#= i - 1 #> item<#= i - 1 #>) +<#= constraintsLoose #> + { + // Retrieve last item. + item<#= i - 1 #> = chain.Item<#= i - 1 #>; + + var newSize = ManagedChain<<#= tList #>>.MemorySize - ManagedChain<<#= tList #>>.Item<#= i - 1 #>Size; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, newSize, newSize); + // Update all pointers +<# + if (i > 2) + { +#> + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain<<#= tList #>>.Item1Offset); +<# + for (var j = 2; j < i; j++) + { +#> + ((BaseInStructure*)(newHeadPtr + ManagedChain<<#= tList #>>.Item<#= j - 1 #>Offset))->PNext = <#= + j == i - 1 + ? "null" + : $"(BaseInStructure*) (newHeadPtr + ManagedChain<{tList}>.Item{j}Offset)" #>; +<# + } // for (int j = 1; j < i - 1; j++) + } + else // if (i > 1) + { +#> + ((BaseInStructure*)newHeadPtr)->PNext = null; +<# + } +#> + return new ManagedChain<<#= shortTList #>>(newHeadPtr); + } + +<# + } // (i > 1) + + if (i < maximumItems) + { + var bigTList = TypeList(i + 1); + var bigPTypeDocs = ParameterTypeDocs(i + 1, " /// "); + var bigConstraints = ConstraintList(i + 1, " "); + var bigConstraintsLoose = ConstraintListLoose(i + 1, " "); +#> + /// + /// Creates a new with <#= i + 1 #> items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. +<#= bigPTypeDocs #> + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain<<#= bigTList #>> Add<<#= bigTList #>>(this ManagedChain<<#= tList #>> chain, T<#= i #> item<#= i #> = default) +<#= bigConstraints #> + => chain.AddAny(item<#= i #>); + + /// + /// Creates a new with <#= i + 1 #> items, by appending to + /// the end of the . + /// + /// The chain. + /// The item to append. +<#= bigPTypeDocs #> + /// + /// Do not forget to dispose this chain if you are no longer using it. + /// The `Any` versions of chain methods do not validate that items belong in the chain, this is + /// useful for situations where the specification does not indicate required chain constraints. You should generally + /// try to use the none `Any` version in preference. + /// + /// + public static ManagedChain<<#= bigTList #>> AddAny<<#= bigTList #>>(this ManagedChain<<#= tList #>> chain, T<#= i #> item<#= i #> = default) +<#= bigConstraintsLoose #> + { + var previousSize = ManagedChain<<#= tList #>>.MemorySize; + var newSize = ManagedChain<<#= bigTList #>>.MemorySize; + var newHeadPtr = Marshal.AllocHGlobal(newSize); + // Block copy original struct data for speed + System.Buffer.MemoryCopy(chain.HeadPtr, (void*)newHeadPtr, previousSize, previousSize); + + // Append item <#= i - 1 #> + item<#= i #>.StructureType(); + Marshal.StructureToPtr(item<#= i #>, newHeadPtr + previousSize, false); + + // Update all pointers + ((BaseInStructure*)newHeadPtr)->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain<<#= bigTList #>>.Item1Offset); +<# + for (var j = 1; j < i; j++) + { +#> + ((BaseInStructure*)(newHeadPtr + ManagedChain<<#= bigTList #>>.Item<#= j #>Offset))->PNext = (BaseInStructure*) (newHeadPtr + ManagedChain<<#= bigTList #>>.Item<#= j + 1 #>Offset); +<# + } // for (int j = 1; j < i; j++) { +#> + ((BaseInStructure*)(newHeadPtr + previousSize))->PNext = null; + return new ManagedChain<<#= bigTList #>>(newHeadPtr); + } + +<# + } // if (i < maximumItems) + } // for (var i = 1; i <= maximumItems; i++) +#> +} +<# + for (var i = 1; i <= maximumItems; i++) + { + var tList = TypeList(i); + var pDocs = ParameterDocs(i, " /// "); +#> + +/// +/// A safely manages the pointers of a managed structure chain. +/// +<#= ParameterTypeDocs(i, "/// ") #> +public unsafe sealed class ManagedChain<<#= tList #>> : ManagedChain, IEquatable>> +<#= ConstraintListLoose(i, " ") #> +{ + /// + /// Gets the size (in bytes) of the default structure header. + /// + public static readonly int HeaderSize = Marshal.SizeOf(); + + /// + /// Gets the size (in bytes) of the head structure. + /// + public static readonly int HeadSize = Marshal.SizeOf(); +<# + for (var j = 1; j < i; j++) + { +#> + + /// + /// Gets the offset to the start of . + /// + public static readonly int Item<#= j #>Offset = <#= j == 1 ? "HeadSize" : $"Item{j - 1}Offset + Item{j - 1}Size" #>; + + /// + /// Gets the size (in bytes) of the Item 1. + /// + public static readonly int Item<#= j #>Size = Marshal.SizeOf>(); +<# + } // for (int j = 1; j < i; j++) { +#> + + /// + /// Gets the total size (in bytes) of the unmanaged memory, managed by this chain. + /// + public static readonly int MemorySize = <#= i == 1 ? "HeadSize" : $"Item{i - 1}Offset + Item{i - 1}Size" #>; + + /// + public override int Size => MemorySize; + + private nint _headPtr; + + /// + public override BaseInStructure* HeadPtr => (BaseInStructure*) _headPtr; + + /// + /// Gets or sets the head of the chain. + /// + public TChain Head + { + get => Unsafe.AsRef((BaseInStructure*) _headPtr); + set + { + value.StructureType(); + var ptr = (BaseInStructure*) _headPtr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, _headPtr, true); + ptr->PNext = nextPtr; + } + } +<# + for (var j = 1; j < i; j++) + { +#> + + /// + /// Gets a pointer to the second item in the chain. + /// + public BaseInStructure* Item<#= j #>Ptr => (BaseInStructure*) (_headPtr + Item<#= j #>Offset); + + /// + /// Gets or sets item #<#= j #> in the chain. + /// + public T<#= j #> Item<#= j #> + { + get => Unsafe.AsRef>(Item<#= j #>Ptr); + set + { + value.StructureType(); + var ptr = Item<#= j #>Ptr; + var nextPtr = ptr->PNext; + Marshal.StructureToPtr(value, (nint)ptr, true); + ptr->PNext = nextPtr; + } + } +<# + } // for (int j = 1; j < i; j++) { +#> + + /// + /// Creates a new with <#= i #> items from an existing memory block. + /// + /// The pointer to the head of the chain. + /// + /// Callers are responsible for ensuring the size of the memory is correct. + /// + internal ManagedChain(nint headPtr) + { + _headPtr = headPtr; + } + + /// + /// Creates a new with <#= i #> items. + /// +<#= pDocs #> + internal ManagedChain(<#= ParamList(i) #>) + : this(Marshal.AllocHGlobal(MemorySize)) + { + head.StructureType(); + Marshal.StructureToPtr(head, _headPtr, false); +<# + for (var j = 1; j < i; j++) + { +#> + <#= j == 1 ? "var " : "" #>itemPtr = Item<#= j #>Ptr; + item<#= j #>.StructureType(); + Marshal.StructureToPtr(item<#= j #>, (nint)itemPtr, false); + <#= j == 1 ? "HeadPtr" : $"Item{j - 1}Ptr" #>->PNext = itemPtr; +<# + } // for (int j = 1; j < i; j++) { +#> + <#= i == 1 ? "HeadPtr" : $"Item{i - 1}Ptr" #>->PNext = null; + } + + /// + public override IEnumerator GetEnumerator() + { + yield return Head; +<# + for (var j = 1; j < i; j++) + { +#> + yield return Item<#= j #>; +<# + } // for (int j = 1; j < i; j++) { +#> + } + + /// + public override int Count => <#= i #>; + + /// + public override IChainable this[int index] + => index switch + { + 0 => Head, +<# + for (var j = 1; j < i; j++) + { +#> + <#= j #> => Item<#= j #>, +<# + } // for (int j = 1; j < i; j++) { +#> + _ => throw new IndexOutOfRangeException() + }; + + /// + /// Compares the supplied memory block with this one, ignoring the structure headers. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected override bool MemoryEquals(ManagedChain other) + { + var ptr = HeadPtr; + var otherPtr = other.HeadPtr; + if (ptr == otherPtr) { + return true; + } + var span = new ReadOnlySpan((void*) ptr, MemorySize); + var otherSpan = new ReadOnlySpan((void*) otherPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; +<# + for (var j = 1; j < i; j++) + { +#> + + start += length; + length = Item<#=j#>Size; + sliceLength = length - HeaderSize; + if (sliceLength > 0 && + !span.Slice(start + HeaderSize, sliceLength) + .SequenceEqual(otherSpan.Slice(start + HeaderSize, sliceLength))) + return false; +<# + } // for (int j = 1; j < i; j++) { +#> + return true; + } + + /// + public override int GetHashCode() + { + var span = new ReadOnlySpan((void*)_headPtr, MemorySize); + var start = 0; + var length = HeadSize; + var sliceLength = length - HeaderSize; + var hashCode = 0; + // Hash the structure type + var sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + + // Hash any payload + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); +<# + for (var j = 1; j < i; j++) + { +#> + + start += length; + length = Item<#=j#>Size; + sliceLength = length - HeaderSize; + sTYpe = ((BaseInStructure*) (_headPtr + start))->SType; + hashCode = HashCode.Combine(hashCode, sTYpe); + if (sliceLength >= 0) + CombineHash(ref hashCode, span.Slice(start + HeaderSize, sliceLength)); +<# + } // for (int j = 1; j < i; j++) { +#> + return hashCode; + } + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ManagedChain<<#=tList#>> other) + => !ReferenceEquals(null, other) && (ReferenceEquals(this, other) || MemoryEquals(other)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ManagedChain<<#=tList#>> left, ManagedChain<<#=tList#>> right) => + ReferenceEquals(null, left) + ? ReferenceEquals(null, right) + : !ReferenceEquals(null, right) && (ReferenceEquals(left, right) || left.MemoryEquals(right)); + + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ManagedChain<<#=tList#>> left, ManagedChain<<#=tList#>> right) => + ReferenceEquals(null, left) + ? !ReferenceEquals(null, right) + : ReferenceEquals(null, right) || (!ReferenceEquals(left, right) && !left.MemoryEquals(right)); + + /// + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("("); + sb.Append((object) Head);<# + for (var j = 1; j < i; j++) + { +#> + sb.Append(", "); + sb.Append((object) Item<#= j #>); +<# +} // for (int j = 1; j < i; j++) { +#> + sb.Append(")"); + return sb.ToString(); + } + + /// + /// Deconstructs this chain. + /// +<#= pDocs #> + public void Deconstruct(out TChain head<# + for (var j = 1; j < i; j++) + { +#>, out T<#= j #> item<#= j #><# + } // for (int j = 1; j < i; j++) { +#>) + { + head = Head; +<# + for (var j = 1; j < i; j++) + { +#> + item<#= j #> = Item<#= j #>; +<# + } // for (int j = 1; j < i; j++) { +#> + } + + /// + public override void Dispose() + { + var headPtr = Interlocked.Exchange(ref _headPtr, (nint)0); + if (headPtr == (nint)0) { + return; + } + + // Destroy all structures + Marshal.DestroyStructure(headPtr); +<# + for (var j = 1; j < i; j++) + { +#> + Marshal.DestroyStructure>(headPtr + Item<#= j #>Offset); +<# + } // for (int j = 1; j < i; j++) { +#> + + // Free memory block + Marshal.FreeHGlobal(headPtr); + } +} +<# + } // for (var i = 1; i <= maximumItems; i++) +#> \ No newline at end of file diff --git a/src/Vulkan/Silk.NET.Vulkan/Silk.NET.Vulkan.csproj b/src/Vulkan/Silk.NET.Vulkan/Silk.NET.Vulkan.csproj index 9825eaefd3..00f8ca3283 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Silk.NET.Vulkan.csproj +++ b/src/Vulkan/Silk.NET.Vulkan/Silk.NET.Vulkan.csproj @@ -9,5 +9,20 @@ + + + TextTemplatingFileGenerator + ManagedChain.gen.cs + + + + + + True + True + ManagedChain.gen.tt + + + diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureBuildGeometryInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureBuildGeometryInfoKHR.gen.cs index 12b90a78bf..9748cd4fec 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureBuildGeometryInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureBuildGeometryInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureBuildGeometryInfoKHR")] - public unsafe partial struct AccelerationStructureBuildGeometryInfoKHR + public unsafe partial struct AccelerationStructureBuildGeometryInfoKHR : IChainable { public AccelerationStructureBuildGeometryInfoKHR ( @@ -145,5 +145,18 @@ public AccelerationStructureBuildGeometryInfoKHR [NativeName("Type.Name", "VkDeviceOrHostAddressKHR")] [NativeName("Name", "scratchData")] public DeviceOrHostAddressKHR ScratchData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureBuildGeometryInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureBuildSizesInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureBuildSizesInfoKHR.gen.cs index 95a13831f2..9efc522c44 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureBuildSizesInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureBuildSizesInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureBuildSizesInfoKHR")] - public unsafe partial struct AccelerationStructureBuildSizesInfoKHR + public unsafe partial struct AccelerationStructureBuildSizesInfoKHR : IChainable { public AccelerationStructureBuildSizesInfoKHR ( @@ -79,5 +79,18 @@ public AccelerationStructureBuildSizesInfoKHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "buildScratchSize")] public ulong BuildScratchSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureBuildSizesInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureCreateInfoKHR.gen.cs index f7e7016001..76959b03a5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureCreateInfoKHR")] - public unsafe partial struct AccelerationStructureCreateInfoKHR + public unsafe partial struct AccelerationStructureCreateInfoKHR : IChainStart { public AccelerationStructureCreateInfoKHR ( @@ -112,5 +112,30 @@ public AccelerationStructureCreateInfoKHR [NativeName("Type.Name", "VkDeviceAddress")] [NativeName("Name", "deviceAddress")] public ulong DeviceAddress; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref AccelerationStructureCreateInfoKHR Chain( + out AccelerationStructureCreateInfoKHR capture) + { + capture = new AccelerationStructureCreateInfoKHR(StructureType.AccelerationStructureCreateInfoKhr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureCreateInfoNV.gen.cs index 8835e4deea..dfaa45f954 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureCreateInfoNV")] - public unsafe partial struct AccelerationStructureCreateInfoNV + public unsafe partial struct AccelerationStructureCreateInfoNV : IChainable { public AccelerationStructureCreateInfoNV ( @@ -68,5 +68,18 @@ public AccelerationStructureCreateInfoNV [NativeName("Type.Name", "VkAccelerationStructureInfoNV")] [NativeName("Name", "info")] public AccelerationStructureInfoNV Info; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureDeviceAddressInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureDeviceAddressInfoKHR.gen.cs index ac00ff95de..bae174f9dd 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureDeviceAddressInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureDeviceAddressInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureDeviceAddressInfoKHR")] - public unsafe partial struct AccelerationStructureDeviceAddressInfoKHR + public unsafe partial struct AccelerationStructureDeviceAddressInfoKHR : IChainable { public AccelerationStructureDeviceAddressInfoKHR ( @@ -57,5 +57,18 @@ public AccelerationStructureDeviceAddressInfoKHR [NativeName("Type.Name", "VkAccelerationStructureKHR")] [NativeName("Name", "accelerationStructure")] public AccelerationStructureKHR AccelerationStructure; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureDeviceAddressInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryAabbsDataKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryAabbsDataKHR.gen.cs index 9e967adae5..b3a73b0fd9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryAabbsDataKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryAabbsDataKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureGeometryAabbsDataKHR")] - public unsafe partial struct AccelerationStructureGeometryAabbsDataKHR + public unsafe partial struct AccelerationStructureGeometryAabbsDataKHR : IChainable { public AccelerationStructureGeometryAabbsDataKHR ( @@ -68,5 +68,18 @@ public AccelerationStructureGeometryAabbsDataKHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "stride")] public ulong Stride; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureGeometryAabbsDataKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryInstancesDataKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryInstancesDataKHR.gen.cs index bf35b61fab..e066c011d0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryInstancesDataKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryInstancesDataKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureGeometryInstancesDataKHR")] - public unsafe partial struct AccelerationStructureGeometryInstancesDataKHR + public unsafe partial struct AccelerationStructureGeometryInstancesDataKHR : IChainable { public AccelerationStructureGeometryInstancesDataKHR ( @@ -68,5 +68,18 @@ public AccelerationStructureGeometryInstancesDataKHR [NativeName("Type.Name", "VkDeviceOrHostAddressConstKHR")] [NativeName("Name", "data")] public DeviceOrHostAddressConstKHR Data; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureGeometryInstancesDataKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryKHR.gen.cs index 7aaf6f8bab..9916a92110 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureGeometryKHR")] - public unsafe partial struct AccelerationStructureGeometryKHR + public unsafe partial struct AccelerationStructureGeometryKHR : IChainable { public AccelerationStructureGeometryKHR ( @@ -79,5 +79,18 @@ public AccelerationStructureGeometryKHR [NativeName("Type.Name", "VkGeometryFlagsKHR")] [NativeName("Name", "flags")] public GeometryFlagsKHR Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureGeometryKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryMotionTrianglesDataNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryMotionTrianglesDataNV.gen.cs index 2845abd7d2..05312ac34e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryMotionTrianglesDataNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryMotionTrianglesDataNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureGeometryMotionTrianglesDataNV")] - public unsafe partial struct AccelerationStructureGeometryMotionTrianglesDataNV + public unsafe partial struct AccelerationStructureGeometryMotionTrianglesDataNV : IExtendsChain { public AccelerationStructureGeometryMotionTrianglesDataNV ( @@ -57,5 +57,18 @@ public AccelerationStructureGeometryMotionTrianglesDataNV [NativeName("Type.Name", "VkDeviceOrHostAddressConstKHR")] [NativeName("Name", "vertexData")] public DeviceOrHostAddressConstKHR VertexData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureGeometryMotionTrianglesDataNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryTrianglesDataKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryTrianglesDataKHR.gen.cs index d4372cca71..23d7d25d35 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryTrianglesDataKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryTrianglesDataKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureGeometryTrianglesDataKHR")] - public unsafe partial struct AccelerationStructureGeometryTrianglesDataKHR + public unsafe partial struct AccelerationStructureGeometryTrianglesDataKHR : IChainStart { public AccelerationStructureGeometryTrianglesDataKHR ( @@ -123,5 +123,30 @@ public AccelerationStructureGeometryTrianglesDataKHR [NativeName("Type.Name", "VkDeviceOrHostAddressConstKHR")] [NativeName("Name", "transformData")] public DeviceOrHostAddressConstKHR TransformData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureGeometryTrianglesDataKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref AccelerationStructureGeometryTrianglesDataKHR Chain( + out AccelerationStructureGeometryTrianglesDataKHR capture) + { + capture = new AccelerationStructureGeometryTrianglesDataKHR(StructureType.AccelerationStructureGeometryTrianglesDataKhr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureInfoNV.gen.cs index 2ad4f001ba..9c688242c5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureInfoNV")] - public unsafe partial struct AccelerationStructureInfoNV + public unsafe partial struct AccelerationStructureInfoNV : IChainable { public AccelerationStructureInfoNV ( @@ -101,5 +101,18 @@ public AccelerationStructureInfoNV [NativeName("Type.Name", "VkGeometryNV")] [NativeName("Name", "pGeometries")] public GeometryNV* PGeometries; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureInstanceKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureInstanceKHR.gen.cs index 8be3285c85..b32568108e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureInstanceKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureInstanceKHR.gen.cs @@ -17,6 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureInstanceKHR")] + [NativeName("Aliases", "VkAccelerationStructureInstanceNV")] public unsafe partial struct AccelerationStructureInstanceKHR { public AccelerationStructureInstanceKHR diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureInstanceNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureInstanceNV.gen.cs index 1816b8afd4..685e76d9ec 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureInstanceNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureInstanceNV.gen.cs @@ -17,6 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureInstanceNV")] + [NativeName("AliasOf", "VkAccelerationStructureInstanceKHR")] public unsafe partial struct AccelerationStructureInstanceNV { public AccelerationStructureInstanceNV diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureMemoryRequirementsInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureMemoryRequirementsInfoNV.gen.cs index 3b597c4d5f..0e4cac38c1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureMemoryRequirementsInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureMemoryRequirementsInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureMemoryRequirementsInfoNV")] - public unsafe partial struct AccelerationStructureMemoryRequirementsInfoNV + public unsafe partial struct AccelerationStructureMemoryRequirementsInfoNV : IChainable { public AccelerationStructureMemoryRequirementsInfoNV ( @@ -68,5 +68,18 @@ public AccelerationStructureMemoryRequirementsInfoNV [NativeName("Type.Name", "VkAccelerationStructureNV")] [NativeName("Name", "accelerationStructure")] public AccelerationStructureNV AccelerationStructure; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureMemoryRequirementsInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureMotionInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureMotionInfoNV.gen.cs index cea6cc8378..9c11e36cd9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureMotionInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureMotionInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureMotionInfoNV")] - public unsafe partial struct AccelerationStructureMotionInfoNV + public unsafe partial struct AccelerationStructureMotionInfoNV : IExtendsChain { public AccelerationStructureMotionInfoNV ( @@ -68,5 +68,18 @@ public AccelerationStructureMotionInfoNV [NativeName("Type.Name", "VkAccelerationStructureMotionInfoFlagsNV")] [NativeName("Name", "flags")] public uint Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureMotionInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureVersionInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureVersionInfoKHR.gen.cs index c8d44f0f9b..875122ec67 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureVersionInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureVersionInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAccelerationStructureVersionInfoKHR")] - public unsafe partial struct AccelerationStructureVersionInfoKHR + public unsafe partial struct AccelerationStructureVersionInfoKHR : IChainable { public AccelerationStructureVersionInfoKHR ( @@ -57,5 +57,18 @@ public AccelerationStructureVersionInfoKHR [NativeName("Type.Name", "uint8_t")] [NativeName("Name", "pVersionData")] public byte* PVersionData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureVersionInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AcquireNextImageInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AcquireNextImageInfoKHR.gen.cs index b34ad6b20b..3bee4435a3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AcquireNextImageInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AcquireNextImageInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAcquireNextImageInfoKHR")] - public unsafe partial struct AcquireNextImageInfoKHR + public unsafe partial struct AcquireNextImageInfoKHR : IChainable { public AcquireNextImageInfoKHR ( @@ -101,5 +101,18 @@ public AcquireNextImageInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "deviceMask")] public uint DeviceMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AcquireNextImageInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AcquireProfilingLockInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AcquireProfilingLockInfoKHR.gen.cs index 87c7e03350..aabbd31384 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AcquireProfilingLockInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AcquireProfilingLockInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAcquireProfilingLockInfoKHR")] - public unsafe partial struct AcquireProfilingLockInfoKHR + public unsafe partial struct AcquireProfilingLockInfoKHR : IChainable { public AcquireProfilingLockInfoKHR ( @@ -68,5 +68,18 @@ public AcquireProfilingLockInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "timeout")] public ulong Timeout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AcquireProfilingLockInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferFormatProperties2ANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferFormatProperties2ANDROID.gen.cs index 31ca7380b5..9d82ddd841 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferFormatProperties2ANDROID.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferFormatProperties2ANDROID.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAndroidHardwareBufferFormatProperties2ANDROID")] - public unsafe partial struct AndroidHardwareBufferFormatProperties2ANDROID + public unsafe partial struct AndroidHardwareBufferFormatProperties2ANDROID : IExtendsChain { public AndroidHardwareBufferFormatProperties2ANDROID ( @@ -134,5 +134,18 @@ public AndroidHardwareBufferFormatProperties2ANDROID [NativeName("Type.Name", "VkChromaLocation")] [NativeName("Name", "suggestedYChromaOffset")] public ChromaLocation SuggestedYChromaOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AndroidHardwareBufferFormatProperties2Android; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferFormatPropertiesANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferFormatPropertiesANDROID.gen.cs index 9eb6649d87..bd7f99d388 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferFormatPropertiesANDROID.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferFormatPropertiesANDROID.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAndroidHardwareBufferFormatPropertiesANDROID")] - public unsafe partial struct AndroidHardwareBufferFormatPropertiesANDROID + public unsafe partial struct AndroidHardwareBufferFormatPropertiesANDROID : IExtendsChain { public AndroidHardwareBufferFormatPropertiesANDROID ( @@ -134,5 +134,18 @@ public AndroidHardwareBufferFormatPropertiesANDROID [NativeName("Type.Name", "VkChromaLocation")] [NativeName("Name", "suggestedYChromaOffset")] public ChromaLocation SuggestedYChromaOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AndroidHardwareBufferFormatPropertiesAndroid; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferPropertiesANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferPropertiesANDROID.gen.cs index 3b1ba26afd..6d7a2e7838 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferPropertiesANDROID.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferPropertiesANDROID.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAndroidHardwareBufferPropertiesANDROID")] - public unsafe partial struct AndroidHardwareBufferPropertiesANDROID + public unsafe partial struct AndroidHardwareBufferPropertiesANDROID : IChainStart { public AndroidHardwareBufferPropertiesANDROID ( @@ -68,5 +68,30 @@ public AndroidHardwareBufferPropertiesANDROID [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryTypeBits")] public uint MemoryTypeBits; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AndroidHardwareBufferPropertiesAndroid; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref AndroidHardwareBufferPropertiesANDROID Chain( + out AndroidHardwareBufferPropertiesANDROID capture) + { + capture = new AndroidHardwareBufferPropertiesANDROID(StructureType.AndroidHardwareBufferPropertiesAndroid); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferUsageANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferUsageANDROID.gen.cs index aba41e04b1..9663aad63a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferUsageANDROID.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferUsageANDROID.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAndroidHardwareBufferUsageANDROID")] - public unsafe partial struct AndroidHardwareBufferUsageANDROID + public unsafe partial struct AndroidHardwareBufferUsageANDROID : IExtendsChain, IExtendsChain { public AndroidHardwareBufferUsageANDROID ( @@ -57,5 +57,18 @@ public AndroidHardwareBufferUsageANDROID [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "androidHardwareBufferUsage")] public ulong AndroidHardwareBufferUsage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AndroidHardwareBufferUsageAndroid; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidSurfaceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidSurfaceCreateInfoKHR.gen.cs index df24ec9705..546ba8a4d1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidSurfaceCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidSurfaceCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAndroidSurfaceCreateInfoKHR")] - public unsafe partial struct AndroidSurfaceCreateInfoKHR + public unsafe partial struct AndroidSurfaceCreateInfoKHR : IChainable { public AndroidSurfaceCreateInfoKHR ( @@ -68,5 +68,18 @@ public AndroidSurfaceCreateInfoKHR [NativeName("Type.Name", "ANativeWindow")] [NativeName("Name", "window")] public nint* Window; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AndroidSurfaceCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ApplicationInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ApplicationInfo.gen.cs index 239cda566e..cc4a1f3b56 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ApplicationInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ApplicationInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkApplicationInfo")] - public unsafe partial struct ApplicationInfo + public unsafe partial struct ApplicationInfo : IChainable { public ApplicationInfo ( @@ -101,5 +101,18 @@ public ApplicationInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "apiVersion")] public uint ApiVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ApplicationInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2.gen.cs index 6ea1723170..4583f76ce4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentDescription2")] - public unsafe partial struct AttachmentDescription2 + [NativeName("Aliases", "VkAttachmentDescription2KHR")] + public unsafe partial struct AttachmentDescription2 : IChainStart { public AttachmentDescription2 ( @@ -145,5 +146,30 @@ public AttachmentDescription2 [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "finalLayout")] public ImageLayout FinalLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentDescription2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref AttachmentDescription2 Chain( + out AttachmentDescription2 capture) + { + capture = new AttachmentDescription2(StructureType.AttachmentDescription2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2KHR.gen.cs index a07f77a9e1..b6915748ad 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentDescription2KHR")] - public unsafe partial struct AttachmentDescription2KHR + [NativeName("AliasOf", "VkAttachmentDescription2")] + public unsafe partial struct AttachmentDescription2KHR : IChainStart { public AttachmentDescription2KHR ( @@ -145,5 +146,30 @@ public AttachmentDescription2KHR [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "finalLayout")] public ImageLayout FinalLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentDescription2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref AttachmentDescription2KHR Chain( + out AttachmentDescription2KHR capture) + { + capture = new AttachmentDescription2KHR(StructureType.AttachmentDescription2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayout.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayout.gen.cs index b0b93cff9f..9d34559490 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayout.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayout.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentDescriptionStencilLayout")] - public unsafe partial struct AttachmentDescriptionStencilLayout + [NativeName("Aliases", "VkAttachmentDescriptionStencilLayoutKHR")] + public unsafe partial struct AttachmentDescriptionStencilLayout : IExtendsChain, IExtendsChain { public AttachmentDescriptionStencilLayout ( @@ -68,5 +69,18 @@ public AttachmentDescriptionStencilLayout [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "stencilFinalLayout")] public ImageLayout StencilFinalLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentDescriptionStencilLayout; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayoutKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayoutKHR.gen.cs index 70bf2e2c11..9aa7b60fa7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayoutKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayoutKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentDescriptionStencilLayoutKHR")] - public unsafe partial struct AttachmentDescriptionStencilLayoutKHR + [NativeName("AliasOf", "VkAttachmentDescriptionStencilLayout")] + public unsafe partial struct AttachmentDescriptionStencilLayoutKHR : IExtendsChain, IExtendsChain { public AttachmentDescriptionStencilLayoutKHR ( @@ -68,5 +69,18 @@ public AttachmentDescriptionStencilLayoutKHR [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "stencilFinalLayout")] public ImageLayout StencilFinalLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentDescriptionStencilLayout; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2.gen.cs index c2ef53327c..3cc0871f7b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentReference2")] - public unsafe partial struct AttachmentReference2 + [NativeName("Aliases", "VkAttachmentReference2KHR")] + public unsafe partial struct AttachmentReference2 : IChainStart { public AttachmentReference2 ( @@ -79,5 +80,30 @@ public AttachmentReference2 [NativeName("Type.Name", "VkImageAspectFlags")] [NativeName("Name", "aspectMask")] public ImageAspectFlags AspectMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentReference2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref AttachmentReference2 Chain( + out AttachmentReference2 capture) + { + capture = new AttachmentReference2(StructureType.AttachmentReference2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2KHR.gen.cs index 3b6bffe7cd..576609efc5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentReference2KHR")] - public unsafe partial struct AttachmentReference2KHR + [NativeName("AliasOf", "VkAttachmentReference2")] + public unsafe partial struct AttachmentReference2KHR : IChainStart { public AttachmentReference2KHR ( @@ -79,5 +80,30 @@ public AttachmentReference2KHR [NativeName("Type.Name", "VkImageAspectFlags")] [NativeName("Name", "aspectMask")] public ImageAspectFlags AspectMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentReference2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref AttachmentReference2KHR Chain( + out AttachmentReference2KHR capture) + { + capture = new AttachmentReference2KHR(StructureType.AttachmentReference2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayout.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayout.gen.cs index 81f1952c68..989232bd9c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayout.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayout.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentReferenceStencilLayout")] - public unsafe partial struct AttachmentReferenceStencilLayout + [NativeName("Aliases", "VkAttachmentReferenceStencilLayoutKHR")] + public unsafe partial struct AttachmentReferenceStencilLayout : IExtendsChain, IExtendsChain { public AttachmentReferenceStencilLayout ( @@ -57,5 +58,18 @@ public AttachmentReferenceStencilLayout [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "stencilLayout")] public ImageLayout StencilLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentReferenceStencilLayout; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayoutKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayoutKHR.gen.cs index 903f6b72ec..84ab7f722b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayoutKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayoutKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentReferenceStencilLayoutKHR")] - public unsafe partial struct AttachmentReferenceStencilLayoutKHR + [NativeName("AliasOf", "VkAttachmentReferenceStencilLayout")] + public unsafe partial struct AttachmentReferenceStencilLayoutKHR : IExtendsChain, IExtendsChain { public AttachmentReferenceStencilLayoutKHR ( @@ -57,5 +58,18 @@ public AttachmentReferenceStencilLayoutKHR [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "stencilLayout")] public ImageLayout StencilLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentReferenceStencilLayout; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoAMD.gen.cs index 8d83eda8f7..edb6523d19 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoAMD.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoAMD.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentSampleCountInfoAMD")] - public unsafe partial struct AttachmentSampleCountInfoAMD + [NativeName("Aliases", "VkAttachmentSampleCountInfoNV")] + public unsafe partial struct AttachmentSampleCountInfoAMD : IExtendsChain, IExtendsChain { public AttachmentSampleCountInfoAMD ( @@ -79,5 +80,18 @@ public AttachmentSampleCountInfoAMD [NativeName("Type.Name", "VkSampleCountFlagBits")] [NativeName("Name", "depthStencilAttachmentSamples")] public SampleCountFlags DepthStencilAttachmentSamples; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentSampleCountInfoAmd; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoNV.gen.cs index b39f193fe5..afd20e57c1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoNV.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentSampleCountInfoNV")] - public unsafe partial struct AttachmentSampleCountInfoNV + [NativeName("AliasOf", "VkAttachmentSampleCountInfoAMD")] + public unsafe partial struct AttachmentSampleCountInfoNV : IExtendsChain, IExtendsChain { public AttachmentSampleCountInfoNV ( @@ -79,5 +80,18 @@ public AttachmentSampleCountInfoNV [NativeName("Type.Name", "VkSampleCountFlagBits")] [NativeName("Name", "depthStencilAttachmentSamples")] public SampleCountFlags DepthStencilAttachmentSamples; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentSampleCountInfoAmd; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BaseInStructure.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BaseInStructure.gen.cs index 3081af1381..a48ab10a0a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BaseInStructure.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BaseInStructure.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBaseInStructure")] - public unsafe partial struct BaseInStructure + public unsafe partial struct BaseInStructure : IChainable { public BaseInStructure ( @@ -46,5 +46,19 @@ public BaseInStructure [NativeName("Type.Name", "VkBaseInStructure")] [NativeName("Name", "pNext")] public BaseInStructure* PNext; + + /// + /// Note, there is no fixed value for this type. + StructureType IStructuredType.StructureType() + { + return SType; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BaseOutStructure.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BaseOutStructure.gen.cs index 1280c81c6c..73c20482bb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BaseOutStructure.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BaseOutStructure.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBaseOutStructure")] - public unsafe partial struct BaseOutStructure + public unsafe partial struct BaseOutStructure : IChainable { public BaseOutStructure ( @@ -46,5 +46,19 @@ public BaseOutStructure [NativeName("Type.Name", "VkBaseOutStructure")] [NativeName("Name", "pNext")] public BaseOutStructure* PNext; + + /// + /// Note, there is no fixed value for this type. + StructureType IStructuredType.StructureType() + { + return SType; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = (BaseOutStructure*) value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindAccelerationStructureMemoryInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindAccelerationStructureMemoryInfoNV.gen.cs index dbf7bff946..9e5087c759 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindAccelerationStructureMemoryInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindAccelerationStructureMemoryInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindAccelerationStructureMemoryInfoNV")] - public unsafe partial struct BindAccelerationStructureMemoryInfoNV + public unsafe partial struct BindAccelerationStructureMemoryInfoNV : IChainable { public BindAccelerationStructureMemoryInfoNV ( @@ -101,5 +101,18 @@ public BindAccelerationStructureMemoryInfoNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pDeviceIndices")] public uint* PDeviceIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindAccelerationStructureMemoryInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfo.gen.cs index 92bd72aa56..cd183166a8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindBufferMemoryDeviceGroupInfo")] - public unsafe partial struct BindBufferMemoryDeviceGroupInfo + [NativeName("Aliases", "VkBindBufferMemoryDeviceGroupInfoKHR")] + public unsafe partial struct BindBufferMemoryDeviceGroupInfo : IExtendsChain, IExtendsChain { public BindBufferMemoryDeviceGroupInfo ( @@ -68,5 +69,18 @@ public BindBufferMemoryDeviceGroupInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pDeviceIndices")] public uint* PDeviceIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindBufferMemoryDeviceGroupInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfoKHR.gen.cs index 50d996847a..81640c917d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindBufferMemoryDeviceGroupInfoKHR")] - public unsafe partial struct BindBufferMemoryDeviceGroupInfoKHR + [NativeName("AliasOf", "VkBindBufferMemoryDeviceGroupInfo")] + public unsafe partial struct BindBufferMemoryDeviceGroupInfoKHR : IExtendsChain, IExtendsChain { public BindBufferMemoryDeviceGroupInfoKHR ( @@ -68,5 +69,18 @@ public BindBufferMemoryDeviceGroupInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pDeviceIndices")] public uint* PDeviceIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindBufferMemoryDeviceGroupInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfo.gen.cs index f495a0b5e3..3b2080b9d6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindBufferMemoryInfo")] - public unsafe partial struct BindBufferMemoryInfo + [NativeName("Aliases", "VkBindBufferMemoryInfoKHR")] + public unsafe partial struct BindBufferMemoryInfo : IChainStart { public BindBufferMemoryInfo ( @@ -79,5 +80,30 @@ public BindBufferMemoryInfo [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "memoryOffset")] public ulong MemoryOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindBufferMemoryInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref BindBufferMemoryInfo Chain( + out BindBufferMemoryInfo capture) + { + capture = new BindBufferMemoryInfo(StructureType.BindBufferMemoryInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfoKHR.gen.cs index 3b2d32aaf7..d402c824e1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindBufferMemoryInfoKHR")] - public unsafe partial struct BindBufferMemoryInfoKHR + [NativeName("AliasOf", "VkBindBufferMemoryInfo")] + public unsafe partial struct BindBufferMemoryInfoKHR : IChainStart { public BindBufferMemoryInfoKHR ( @@ -79,5 +80,30 @@ public BindBufferMemoryInfoKHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "memoryOffset")] public ulong MemoryOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindBufferMemoryInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref BindBufferMemoryInfoKHR Chain( + out BindBufferMemoryInfoKHR capture) + { + capture = new BindBufferMemoryInfoKHR(StructureType.BindBufferMemoryInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfo.gen.cs index 050b4df12e..0f7a75568a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindImageMemoryDeviceGroupInfo")] - public unsafe partial struct BindImageMemoryDeviceGroupInfo + [NativeName("Aliases", "VkBindImageMemoryDeviceGroupInfoKHR")] + public unsafe partial struct BindImageMemoryDeviceGroupInfo : IExtendsChain, IExtendsChain { public BindImageMemoryDeviceGroupInfo ( @@ -90,5 +91,18 @@ public BindImageMemoryDeviceGroupInfo [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "pSplitInstanceBindRegions")] public Rect2D* PSplitInstanceBindRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindImageMemoryDeviceGroupInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfoKHR.gen.cs index 60c8f7f09c..d1e20b7837 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindImageMemoryDeviceGroupInfoKHR")] - public unsafe partial struct BindImageMemoryDeviceGroupInfoKHR + [NativeName("AliasOf", "VkBindImageMemoryDeviceGroupInfo")] + public unsafe partial struct BindImageMemoryDeviceGroupInfoKHR : IExtendsChain, IExtendsChain { public BindImageMemoryDeviceGroupInfoKHR ( @@ -90,5 +91,18 @@ public BindImageMemoryDeviceGroupInfoKHR [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "pSplitInstanceBindRegions")] public Rect2D* PSplitInstanceBindRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindImageMemoryDeviceGroupInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfo.gen.cs index 16ffbab1e8..59c451dfe8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindImageMemoryInfo")] - public unsafe partial struct BindImageMemoryInfo + [NativeName("Aliases", "VkBindImageMemoryInfoKHR")] + public unsafe partial struct BindImageMemoryInfo : IChainStart { public BindImageMemoryInfo ( @@ -79,5 +80,30 @@ public BindImageMemoryInfo [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "memoryOffset")] public ulong MemoryOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindImageMemoryInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref BindImageMemoryInfo Chain( + out BindImageMemoryInfo capture) + { + capture = new BindImageMemoryInfo(StructureType.BindImageMemoryInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfoKHR.gen.cs index 717f544584..fe65822e01 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindImageMemoryInfoKHR")] - public unsafe partial struct BindImageMemoryInfoKHR + [NativeName("AliasOf", "VkBindImageMemoryInfo")] + public unsafe partial struct BindImageMemoryInfoKHR : IChainStart { public BindImageMemoryInfoKHR ( @@ -79,5 +80,30 @@ public BindImageMemoryInfoKHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "memoryOffset")] public ulong MemoryOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindImageMemoryInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref BindImageMemoryInfoKHR Chain( + out BindImageMemoryInfoKHR capture) + { + capture = new BindImageMemoryInfoKHR(StructureType.BindImageMemoryInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemorySwapchainInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemorySwapchainInfoKHR.gen.cs index 7177548469..54254924bc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemorySwapchainInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemorySwapchainInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindImageMemorySwapchainInfoKHR")] - public unsafe partial struct BindImageMemorySwapchainInfoKHR + public unsafe partial struct BindImageMemorySwapchainInfoKHR : IExtendsChain, IExtendsChain { public BindImageMemorySwapchainInfoKHR ( @@ -68,5 +68,18 @@ public BindImageMemorySwapchainInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "imageIndex")] public uint ImageIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindImageMemorySwapchainInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfo.gen.cs index 8a49eb4d3e..5a65d42138 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindImagePlaneMemoryInfo")] - public unsafe partial struct BindImagePlaneMemoryInfo + [NativeName("Aliases", "VkBindImagePlaneMemoryInfoKHR")] + public unsafe partial struct BindImagePlaneMemoryInfo : IExtendsChain, IExtendsChain { public BindImagePlaneMemoryInfo ( @@ -57,5 +58,18 @@ public BindImagePlaneMemoryInfo [NativeName("Type.Name", "VkImageAspectFlagBits")] [NativeName("Name", "planeAspect")] public ImageAspectFlags PlaneAspect; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindImagePlaneMemoryInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfoKHR.gen.cs index 22a7f29c0e..de7e36bb73 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindImagePlaneMemoryInfoKHR")] - public unsafe partial struct BindImagePlaneMemoryInfoKHR + [NativeName("AliasOf", "VkBindImagePlaneMemoryInfo")] + public unsafe partial struct BindImagePlaneMemoryInfoKHR : IExtendsChain, IExtendsChain { public BindImagePlaneMemoryInfoKHR ( @@ -57,5 +58,18 @@ public BindImagePlaneMemoryInfoKHR [NativeName("Type.Name", "VkImageAspectFlagBits")] [NativeName("Name", "planeAspect")] public ImageAspectFlags PlaneAspect; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindImagePlaneMemoryInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindSparseInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindSparseInfo.gen.cs index 96182b369e..d7f4decf79 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindSparseInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindSparseInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindSparseInfo")] - public unsafe partial struct BindSparseInfo + public unsafe partial struct BindSparseInfo : IChainStart { public BindSparseInfo ( @@ -156,5 +156,30 @@ public BindSparseInfo [NativeName("Type.Name", "VkSemaphore")] [NativeName("Name", "pSignalSemaphores")] public Semaphore* PSignalSemaphores; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindSparseInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref BindSparseInfo Chain( + out BindSparseInfo capture) + { + capture = new BindSparseInfo(StructureType.BindSparseInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BlitImageInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BlitImageInfo2KHR.gen.cs index 58693d0f62..c2da810faf 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BlitImageInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BlitImageInfo2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBlitImageInfo2KHR")] - public unsafe partial struct BlitImageInfo2KHR + public unsafe partial struct BlitImageInfo2KHR : IChainable { public BlitImageInfo2KHR ( @@ -123,5 +123,18 @@ public BlitImageInfo2KHR [NativeName("Type.Name", "VkFilter")] [NativeName("Name", "filter")] public Filter Filter; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BlitImageInfo2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionBufferCreateInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionBufferCreateInfoFUCHSIA.gen.cs index a471940476..ef05b43626 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionBufferCreateInfoFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionBufferCreateInfoFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferCollectionBufferCreateInfoFUCHSIA")] - public unsafe partial struct BufferCollectionBufferCreateInfoFUCHSIA + public unsafe partial struct BufferCollectionBufferCreateInfoFUCHSIA : IExtendsChain { public BufferCollectionBufferCreateInfoFUCHSIA ( @@ -68,5 +68,18 @@ public BufferCollectionBufferCreateInfoFUCHSIA [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "index")] public uint Index; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferCollectionBufferCreateInfoFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionConstraintsInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionConstraintsInfoFUCHSIA.gen.cs index 3548b1b20d..fa3b8ebdee 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionConstraintsInfoFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionConstraintsInfoFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferCollectionConstraintsInfoFUCHSIA")] - public unsafe partial struct BufferCollectionConstraintsInfoFUCHSIA + public unsafe partial struct BufferCollectionConstraintsInfoFUCHSIA : IChainable { public BufferCollectionConstraintsInfoFUCHSIA ( @@ -101,5 +101,18 @@ public BufferCollectionConstraintsInfoFUCHSIA [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "minBufferCountForSharedSlack")] public uint MinBufferCountForSharedSlack; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferCollectionConstraintsInfoFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionCreateInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionCreateInfoFUCHSIA.gen.cs index e6b133d299..3d56d25659 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionCreateInfoFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionCreateInfoFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferCollectionCreateInfoFUCHSIA")] - public unsafe partial struct BufferCollectionCreateInfoFUCHSIA + public unsafe partial struct BufferCollectionCreateInfoFUCHSIA : IChainable { public BufferCollectionCreateInfoFUCHSIA ( @@ -57,5 +57,18 @@ public BufferCollectionCreateInfoFUCHSIA [NativeName("Type.Name", "zx_handle_t")] [NativeName("Name", "collectionToken")] public nint CollectionToken; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferCollectionCreateInfoFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionImageCreateInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionImageCreateInfoFUCHSIA.gen.cs index bb0662871c..fbc4de818f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionImageCreateInfoFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionImageCreateInfoFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferCollectionImageCreateInfoFUCHSIA")] - public unsafe partial struct BufferCollectionImageCreateInfoFUCHSIA + public unsafe partial struct BufferCollectionImageCreateInfoFUCHSIA : IExtendsChain { public BufferCollectionImageCreateInfoFUCHSIA ( @@ -68,5 +68,18 @@ public BufferCollectionImageCreateInfoFUCHSIA [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "index")] public uint Index; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferCollectionImageCreateInfoFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionPropertiesFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionPropertiesFUCHSIA.gen.cs index 39f694dce6..536f8594b3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionPropertiesFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionPropertiesFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferCollectionPropertiesFUCHSIA")] - public unsafe partial struct BufferCollectionPropertiesFUCHSIA + public unsafe partial struct BufferCollectionPropertiesFUCHSIA : IChainable { public BufferCollectionPropertiesFUCHSIA ( @@ -167,5 +167,18 @@ public BufferCollectionPropertiesFUCHSIA [NativeName("Type.Name", "VkChromaLocation")] [NativeName("Name", "suggestedYChromaOffset")] public ChromaLocation SuggestedYChromaOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferCollectionPropertiesFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferConstraintsInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferConstraintsInfoFUCHSIA.gen.cs index 45b53c3441..768c039b44 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferConstraintsInfoFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferConstraintsInfoFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferConstraintsInfoFUCHSIA")] - public unsafe partial struct BufferConstraintsInfoFUCHSIA + public unsafe partial struct BufferConstraintsInfoFUCHSIA : IChainable { public BufferConstraintsInfoFUCHSIA ( @@ -79,5 +79,18 @@ public BufferConstraintsInfoFUCHSIA [NativeName("Type.Name", "VkBufferCollectionConstraintsInfoFUCHSIA")] [NativeName("Name", "bufferCollectionConstraints")] public BufferCollectionConstraintsInfoFUCHSIA BufferCollectionConstraints; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferConstraintsInfoFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCopy2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCopy2KHR.gen.cs index 7f9d443110..d73b9c88c4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCopy2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCopy2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferCopy2KHR")] - public unsafe partial struct BufferCopy2KHR + public unsafe partial struct BufferCopy2KHR : IChainable { public BufferCopy2KHR ( @@ -79,5 +79,18 @@ public BufferCopy2KHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "size")] public ulong Size; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferCopy2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCreateInfo.gen.cs index b47963e280..072d88a1a7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferCreateInfo")] - public unsafe partial struct BufferCreateInfo + public unsafe partial struct BufferCreateInfo : IChainStart { public BufferCreateInfo ( @@ -112,5 +112,30 @@ public BufferCreateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pQueueFamilyIndices")] public uint* PQueueFamilyIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref BufferCreateInfo Chain( + out BufferCreateInfo capture) + { + capture = new BufferCreateInfo(StructureType.BufferCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressCreateInfoEXT.gen.cs index 74e8486479..590b6564e0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferDeviceAddressCreateInfoEXT")] - public unsafe partial struct BufferDeviceAddressCreateInfoEXT + public unsafe partial struct BufferDeviceAddressCreateInfoEXT : IExtendsChain { public BufferDeviceAddressCreateInfoEXT ( @@ -57,5 +57,18 @@ public BufferDeviceAddressCreateInfoEXT [NativeName("Type.Name", "VkDeviceAddress")] [NativeName("Name", "deviceAddress")] public ulong DeviceAddress; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferDeviceAddressCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfo.gen.cs index 30d8c1dd29..d14f31b206 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferDeviceAddressInfo")] - public unsafe partial struct BufferDeviceAddressInfo + [NativeName("Aliases", "VkBufferDeviceAddressInfoKHR, VkBufferDeviceAddressInfoEXT")] + public unsafe partial struct BufferDeviceAddressInfo : IChainable { public BufferDeviceAddressInfo ( @@ -57,5 +58,18 @@ public BufferDeviceAddressInfo [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferDeviceAddressInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoEXT.gen.cs index 4d45c89428..9d2a6bec9a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoEXT.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferDeviceAddressInfoEXT")] - public unsafe partial struct BufferDeviceAddressInfoEXT + [NativeName("AliasOf", "VkBufferDeviceAddressInfo")] + public unsafe partial struct BufferDeviceAddressInfoEXT : IChainable { public BufferDeviceAddressInfoEXT ( @@ -57,5 +58,18 @@ public BufferDeviceAddressInfoEXT [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferDeviceAddressInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoKHR.gen.cs index f0b2bb0446..1631e88202 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferDeviceAddressInfoKHR")] - public unsafe partial struct BufferDeviceAddressInfoKHR + [NativeName("AliasOf", "VkBufferDeviceAddressInfo")] + public unsafe partial struct BufferDeviceAddressInfoKHR : IChainable { public BufferDeviceAddressInfoKHR ( @@ -57,5 +58,18 @@ public BufferDeviceAddressInfoKHR [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferDeviceAddressInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferImageCopy2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferImageCopy2KHR.gen.cs index 748c5cd857..37fb9eec75 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferImageCopy2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferImageCopy2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferImageCopy2KHR")] - public unsafe partial struct BufferImageCopy2KHR + public unsafe partial struct BufferImageCopy2KHR : IChainStart { public BufferImageCopy2KHR ( @@ -112,5 +112,30 @@ public BufferImageCopy2KHR [NativeName("Type.Name", "VkExtent3D")] [NativeName("Name", "imageExtent")] public Extent3D ImageExtent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferImageCopy2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref BufferImageCopy2KHR Chain( + out BufferImageCopy2KHR capture) + { + capture = new BufferImageCopy2KHR(StructureType.BufferImageCopy2Khr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryBarrier.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryBarrier.gen.cs index 1f35d5b86a..b5913ba316 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryBarrier.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryBarrier.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferMemoryBarrier")] - public unsafe partial struct BufferMemoryBarrier + public unsafe partial struct BufferMemoryBarrier : IChainable { public BufferMemoryBarrier ( @@ -123,5 +123,18 @@ public BufferMemoryBarrier [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "size")] public ulong Size; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferMemoryBarrier; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryBarrier2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryBarrier2KHR.gen.cs index 14a46390d8..8c9e20f586 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryBarrier2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryBarrier2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferMemoryBarrier2KHR")] - public unsafe partial struct BufferMemoryBarrier2KHR + public unsafe partial struct BufferMemoryBarrier2KHR : IChainable { public BufferMemoryBarrier2KHR ( @@ -145,5 +145,18 @@ public BufferMemoryBarrier2KHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "size")] public ulong Size; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferMemoryBarrier2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2.gen.cs index f9d70a6876..20599243ba 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferMemoryRequirementsInfo2")] - public unsafe partial struct BufferMemoryRequirementsInfo2 + [NativeName("Aliases", "VkBufferMemoryRequirementsInfo2KHR")] + public unsafe partial struct BufferMemoryRequirementsInfo2 : IChainable { public BufferMemoryRequirementsInfo2 ( @@ -57,5 +58,18 @@ public BufferMemoryRequirementsInfo2 [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferMemoryRequirementsInfo2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2KHR.gen.cs index aa20d10541..1affae1b2d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferMemoryRequirementsInfo2KHR")] - public unsafe partial struct BufferMemoryRequirementsInfo2KHR + [NativeName("AliasOf", "VkBufferMemoryRequirementsInfo2")] + public unsafe partial struct BufferMemoryRequirementsInfo2KHR : IChainable { public BufferMemoryRequirementsInfo2KHR ( @@ -57,5 +58,18 @@ public BufferMemoryRequirementsInfo2KHR [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferMemoryRequirementsInfo2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfo.gen.cs index ee44d8b400..25485751a8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferOpaqueCaptureAddressCreateInfo")] - public unsafe partial struct BufferOpaqueCaptureAddressCreateInfo + [NativeName("Aliases", "VkBufferOpaqueCaptureAddressCreateInfoKHR")] + public unsafe partial struct BufferOpaqueCaptureAddressCreateInfo : IExtendsChain { public BufferOpaqueCaptureAddressCreateInfo ( @@ -57,5 +58,18 @@ public BufferOpaqueCaptureAddressCreateInfo [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "opaqueCaptureAddress")] public ulong OpaqueCaptureAddress; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferOpaqueCaptureAddressCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfoKHR.gen.cs index 1c90079609..6ba3218614 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferOpaqueCaptureAddressCreateInfoKHR")] - public unsafe partial struct BufferOpaqueCaptureAddressCreateInfoKHR + [NativeName("AliasOf", "VkBufferOpaqueCaptureAddressCreateInfo")] + public unsafe partial struct BufferOpaqueCaptureAddressCreateInfoKHR : IExtendsChain { public BufferOpaqueCaptureAddressCreateInfoKHR ( @@ -57,5 +58,18 @@ public BufferOpaqueCaptureAddressCreateInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "opaqueCaptureAddress")] public ulong OpaqueCaptureAddress; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferOpaqueCaptureAddressCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferViewCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferViewCreateInfo.gen.cs index 6ca904b2fb..fa3c12a533 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferViewCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferViewCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferViewCreateInfo")] - public unsafe partial struct BufferViewCreateInfo + public unsafe partial struct BufferViewCreateInfo : IChainable { public BufferViewCreateInfo ( @@ -101,5 +101,18 @@ public BufferViewCreateInfo [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "range")] public ulong Range; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferViewCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CalibratedTimestampInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CalibratedTimestampInfoEXT.gen.cs index 766a08d04c..5e6c2acb41 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CalibratedTimestampInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CalibratedTimestampInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCalibratedTimestampInfoEXT")] - public unsafe partial struct CalibratedTimestampInfoEXT + public unsafe partial struct CalibratedTimestampInfoEXT : IChainable { public CalibratedTimestampInfoEXT ( @@ -57,5 +57,18 @@ public CalibratedTimestampInfoEXT [NativeName("Type.Name", "VkTimeDomainEXT")] [NativeName("Name", "timeDomain")] public TimeDomainEXT TimeDomain; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CalibratedTimestampInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CheckpointData2NV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CheckpointData2NV.gen.cs index a4341792c5..6e191a01bb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CheckpointData2NV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CheckpointData2NV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCheckpointData2NV")] - public unsafe partial struct CheckpointData2NV + public unsafe partial struct CheckpointData2NV : IChainable { public CheckpointData2NV ( @@ -68,5 +68,18 @@ public CheckpointData2NV [NativeName("Type.Name", "void")] [NativeName("Name", "pCheckpointMarker")] public void* PCheckpointMarker; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CheckpointData2NV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CheckpointDataNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CheckpointDataNV.gen.cs index fcedd9d29e..53ef1eecdf 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CheckpointDataNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CheckpointDataNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCheckpointDataNV")] - public unsafe partial struct CheckpointDataNV + public unsafe partial struct CheckpointDataNV : IChainable { public CheckpointDataNV ( @@ -68,5 +68,18 @@ public CheckpointDataNV [NativeName("Type.Name", "void")] [NativeName("Name", "pCheckpointMarker")] public void* PCheckpointMarker; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CheckpointDataNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferAllocateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferAllocateInfo.gen.cs index 8b6aedc1e3..5554e02dd0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferAllocateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferAllocateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCommandBufferAllocateInfo")] - public unsafe partial struct CommandBufferAllocateInfo + public unsafe partial struct CommandBufferAllocateInfo : IChainable { public CommandBufferAllocateInfo ( @@ -79,5 +79,18 @@ public CommandBufferAllocateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "commandBufferCount")] public uint CommandBufferCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferAllocateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferBeginInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferBeginInfo.gen.cs index 42ba975c6f..298221368e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferBeginInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferBeginInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCommandBufferBeginInfo")] - public unsafe partial struct CommandBufferBeginInfo + public unsafe partial struct CommandBufferBeginInfo : IChainStart { public CommandBufferBeginInfo ( @@ -68,5 +68,30 @@ public CommandBufferBeginInfo [NativeName("Type.Name", "VkCommandBufferInheritanceInfo")] [NativeName("Name", "pInheritanceInfo")] public CommandBufferInheritanceInfo* PInheritanceInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferBeginInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref CommandBufferBeginInfo Chain( + out CommandBufferBeginInfo capture) + { + capture = new CommandBufferBeginInfo(StructureType.CommandBufferBeginInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceConditionalRenderingInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceConditionalRenderingInfoEXT.gen.cs index 8b4da9d925..4bd91f83ca 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceConditionalRenderingInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceConditionalRenderingInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCommandBufferInheritanceConditionalRenderingInfoEXT")] - public unsafe partial struct CommandBufferInheritanceConditionalRenderingInfoEXT + public unsafe partial struct CommandBufferInheritanceConditionalRenderingInfoEXT : IExtendsChain { public CommandBufferInheritanceConditionalRenderingInfoEXT ( @@ -57,5 +57,18 @@ public CommandBufferInheritanceConditionalRenderingInfoEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "conditionalRenderingEnable")] public Bool32 ConditionalRenderingEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferInheritanceConditionalRenderingInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceInfo.gen.cs index 683489a159..ba365fc0a3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCommandBufferInheritanceInfo")] - public unsafe partial struct CommandBufferInheritanceInfo + public unsafe partial struct CommandBufferInheritanceInfo : IChainStart { public CommandBufferInheritanceInfo ( @@ -112,5 +112,30 @@ public CommandBufferInheritanceInfo [NativeName("Type.Name", "VkQueryPipelineStatisticFlags")] [NativeName("Name", "pipelineStatistics")] public QueryPipelineStatisticFlags PipelineStatistics; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferInheritanceInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref CommandBufferInheritanceInfo Chain( + out CommandBufferInheritanceInfo capture) + { + capture = new CommandBufferInheritanceInfo(StructureType.CommandBufferInheritanceInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceRenderPassTransformInfoQCOM.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceRenderPassTransformInfoQCOM.gen.cs index 38403fc2a6..821c594f26 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceRenderPassTransformInfoQCOM.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceRenderPassTransformInfoQCOM.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCommandBufferInheritanceRenderPassTransformInfoQCOM")] - public unsafe partial struct CommandBufferInheritanceRenderPassTransformInfoQCOM + public unsafe partial struct CommandBufferInheritanceRenderPassTransformInfoQCOM : IExtendsChain { public CommandBufferInheritanceRenderPassTransformInfoQCOM ( @@ -68,5 +68,18 @@ public CommandBufferInheritanceRenderPassTransformInfoQCOM [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "renderArea")] public Rect2D RenderArea; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferInheritanceRenderPassTransformInfoQCom; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceRenderingInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceRenderingInfoKHR.gen.cs index e7ded3878e..b72176b4ca 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceRenderingInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceRenderingInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCommandBufferInheritanceRenderingInfoKHR")] - public unsafe partial struct CommandBufferInheritanceRenderingInfoKHR + public unsafe partial struct CommandBufferInheritanceRenderingInfoKHR : IExtendsChain { public CommandBufferInheritanceRenderingInfoKHR ( @@ -123,5 +123,18 @@ public CommandBufferInheritanceRenderingInfoKHR [NativeName("Type.Name", "VkSampleCountFlagBits")] [NativeName("Name", "rasterizationSamples")] public SampleCountFlags RasterizationSamples; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferInheritanceRenderingInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceViewportScissorInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceViewportScissorInfoNV.gen.cs index 0682b2ab07..c4fe64929d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceViewportScissorInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceViewportScissorInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCommandBufferInheritanceViewportScissorInfoNV")] - public unsafe partial struct CommandBufferInheritanceViewportScissorInfoNV + public unsafe partial struct CommandBufferInheritanceViewportScissorInfoNV : IExtendsChain { public CommandBufferInheritanceViewportScissorInfoNV ( @@ -79,5 +79,18 @@ public CommandBufferInheritanceViewportScissorInfoNV [NativeName("Type.Name", "VkViewport")] [NativeName("Name", "pViewportDepths")] public Viewport* PViewportDepths; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferInheritanceViewportScissorInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferSubmitInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferSubmitInfoKHR.gen.cs index fbc518f865..74a3b2f2b5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferSubmitInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferSubmitInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCommandBufferSubmitInfoKHR")] - public unsafe partial struct CommandBufferSubmitInfoKHR + public unsafe partial struct CommandBufferSubmitInfoKHR : IChainable { public CommandBufferSubmitInfoKHR ( @@ -68,5 +68,18 @@ public CommandBufferSubmitInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "deviceMask")] public uint DeviceMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferSubmitInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandPoolCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandPoolCreateInfo.gen.cs index a4c690828b..27bfe416a5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandPoolCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandPoolCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCommandPoolCreateInfo")] - public unsafe partial struct CommandPoolCreateInfo + public unsafe partial struct CommandPoolCreateInfo : IChainable { public CommandPoolCreateInfo ( @@ -68,5 +68,18 @@ public CommandPoolCreateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "queueFamilyIndex")] public uint QueueFamilyIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandPoolCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ComputePipelineCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ComputePipelineCreateInfo.gen.cs index abe21d16ca..37f7f8f51c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ComputePipelineCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ComputePipelineCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkComputePipelineCreateInfo")] - public unsafe partial struct ComputePipelineCreateInfo + public unsafe partial struct ComputePipelineCreateInfo : IChainStart { public ComputePipelineCreateInfo ( @@ -101,5 +101,30 @@ public ComputePipelineCreateInfo [NativeName("Type.Name", "int32_t")] [NativeName("Name", "basePipelineIndex")] public int BasePipelineIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ComputePipelineCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref ComputePipelineCreateInfo Chain( + out ComputePipelineCreateInfo capture) + { + capture = new ComputePipelineCreateInfo(StructureType.ComputePipelineCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ConditionalRenderingBeginInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ConditionalRenderingBeginInfoEXT.gen.cs index 32140f05b0..013d699a72 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ConditionalRenderingBeginInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ConditionalRenderingBeginInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkConditionalRenderingBeginInfoEXT")] - public unsafe partial struct ConditionalRenderingBeginInfoEXT + public unsafe partial struct ConditionalRenderingBeginInfoEXT : IChainable { public ConditionalRenderingBeginInfoEXT ( @@ -79,5 +79,18 @@ public ConditionalRenderingBeginInfoEXT [NativeName("Type.Name", "VkConditionalRenderingFlagsEXT")] [NativeName("Name", "flags")] public ConditionalRenderingFlagsEXT Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ConditionalRenderingBeginInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ConformanceVersion.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ConformanceVersion.gen.cs index e22008845c..30995ef0d2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ConformanceVersion.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ConformanceVersion.gen.cs @@ -17,6 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkConformanceVersion")] + [NativeName("Aliases", "VkConformanceVersionKHR")] public unsafe partial struct ConformanceVersion { public ConformanceVersion diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ConformanceVersionKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ConformanceVersionKHR.gen.cs index 162dedddb0..932b00aaf5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ConformanceVersionKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ConformanceVersionKHR.gen.cs @@ -17,6 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkConformanceVersionKHR")] + [NativeName("AliasOf", "VkConformanceVersion")] public unsafe partial struct ConformanceVersionKHR { public ConformanceVersionKHR diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CooperativeMatrixPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CooperativeMatrixPropertiesNV.gen.cs index a7cd5adbfe..564b4f0fe0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CooperativeMatrixPropertiesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CooperativeMatrixPropertiesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCooperativeMatrixPropertiesNV")] - public unsafe partial struct CooperativeMatrixPropertiesNV + public unsafe partial struct CooperativeMatrixPropertiesNV : IChainable { public CooperativeMatrixPropertiesNV ( @@ -134,5 +134,18 @@ public CooperativeMatrixPropertiesNV [NativeName("Type.Name", "VkScopeNV")] [NativeName("Name", "scope")] public ScopeNV Scope; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CooperativeMatrixPropertiesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyAccelerationStructureInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyAccelerationStructureInfoKHR.gen.cs index 9bf4e42f4e..f6b403eb79 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyAccelerationStructureInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyAccelerationStructureInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCopyAccelerationStructureInfoKHR")] - public unsafe partial struct CopyAccelerationStructureInfoKHR + public unsafe partial struct CopyAccelerationStructureInfoKHR : IChainable { public CopyAccelerationStructureInfoKHR ( @@ -79,5 +79,18 @@ public CopyAccelerationStructureInfoKHR [NativeName("Type.Name", "VkCopyAccelerationStructureModeKHR")] [NativeName("Name", "mode")] public CopyAccelerationStructureModeKHR Mode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyAccelerationStructureInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyAccelerationStructureToMemoryInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyAccelerationStructureToMemoryInfoKHR.gen.cs index 8dbae43af0..97368db731 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyAccelerationStructureToMemoryInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyAccelerationStructureToMemoryInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCopyAccelerationStructureToMemoryInfoKHR")] - public unsafe partial struct CopyAccelerationStructureToMemoryInfoKHR + public unsafe partial struct CopyAccelerationStructureToMemoryInfoKHR : IChainable { public CopyAccelerationStructureToMemoryInfoKHR ( @@ -79,5 +79,18 @@ public CopyAccelerationStructureToMemoryInfoKHR [NativeName("Type.Name", "VkCopyAccelerationStructureModeKHR")] [NativeName("Name", "mode")] public CopyAccelerationStructureModeKHR Mode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyAccelerationStructureToMemoryInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyBufferInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyBufferInfo2KHR.gen.cs index 6250679329..9808153651 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyBufferInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyBufferInfo2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCopyBufferInfo2KHR")] - public unsafe partial struct CopyBufferInfo2KHR + public unsafe partial struct CopyBufferInfo2KHR : IChainable { public CopyBufferInfo2KHR ( @@ -90,5 +90,18 @@ public CopyBufferInfo2KHR [NativeName("Type.Name", "VkBufferCopy2KHR")] [NativeName("Name", "pRegions")] public BufferCopy2KHR* PRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyBufferInfo2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyBufferToImageInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyBufferToImageInfo2KHR.gen.cs index cb5b82a858..a3aa6452eb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyBufferToImageInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyBufferToImageInfo2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCopyBufferToImageInfo2KHR")] - public unsafe partial struct CopyBufferToImageInfo2KHR + public unsafe partial struct CopyBufferToImageInfo2KHR : IChainable { public CopyBufferToImageInfo2KHR ( @@ -101,5 +101,18 @@ public CopyBufferToImageInfo2KHR [NativeName("Type.Name", "VkBufferImageCopy2KHR")] [NativeName("Name", "pRegions")] public BufferImageCopy2KHR* PRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyBufferToImageInfo2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyCommandTransformInfoQCOM.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyCommandTransformInfoQCOM.gen.cs index f6f7e3fcc7..d348a3d5ca 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyCommandTransformInfoQCOM.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyCommandTransformInfoQCOM.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCopyCommandTransformInfoQCOM")] - public unsafe partial struct CopyCommandTransformInfoQCOM + public unsafe partial struct CopyCommandTransformInfoQCOM : IExtendsChain, IExtendsChain { public CopyCommandTransformInfoQCOM ( @@ -57,5 +57,18 @@ public CopyCommandTransformInfoQCOM [NativeName("Type.Name", "VkSurfaceTransformFlagBitsKHR")] [NativeName("Name", "transform")] public SurfaceTransformFlagsKHR Transform; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyCommandTransformInfoQCom; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyDescriptorSet.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyDescriptorSet.gen.cs index 864a3d55fe..a61c47a1d9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyDescriptorSet.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyDescriptorSet.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCopyDescriptorSet")] - public unsafe partial struct CopyDescriptorSet + public unsafe partial struct CopyDescriptorSet : IChainable { public CopyDescriptorSet ( @@ -123,5 +123,18 @@ public CopyDescriptorSet [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "descriptorCount")] public uint DescriptorCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyDescriptorSet; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyImageInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyImageInfo2KHR.gen.cs index 81f492848f..2efa19a9b2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyImageInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyImageInfo2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCopyImageInfo2KHR")] - public unsafe partial struct CopyImageInfo2KHR + public unsafe partial struct CopyImageInfo2KHR : IChainable { public CopyImageInfo2KHR ( @@ -112,5 +112,18 @@ public CopyImageInfo2KHR [NativeName("Type.Name", "VkImageCopy2KHR")] [NativeName("Name", "pRegions")] public ImageCopy2KHR* PRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyImageInfo2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyImageToBufferInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyImageToBufferInfo2KHR.gen.cs index 82ef762892..f11912d644 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyImageToBufferInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyImageToBufferInfo2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCopyImageToBufferInfo2KHR")] - public unsafe partial struct CopyImageToBufferInfo2KHR + public unsafe partial struct CopyImageToBufferInfo2KHR : IChainable { public CopyImageToBufferInfo2KHR ( @@ -101,5 +101,18 @@ public CopyImageToBufferInfo2KHR [NativeName("Type.Name", "VkBufferImageCopy2KHR")] [NativeName("Name", "pRegions")] public BufferImageCopy2KHR* PRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyImageToBufferInfo2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyMemoryToAccelerationStructureInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyMemoryToAccelerationStructureInfoKHR.gen.cs index 0d585a5313..1d8595eff1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyMemoryToAccelerationStructureInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyMemoryToAccelerationStructureInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCopyMemoryToAccelerationStructureInfoKHR")] - public unsafe partial struct CopyMemoryToAccelerationStructureInfoKHR + public unsafe partial struct CopyMemoryToAccelerationStructureInfoKHR : IChainable { public CopyMemoryToAccelerationStructureInfoKHR ( @@ -79,5 +79,18 @@ public CopyMemoryToAccelerationStructureInfoKHR [NativeName("Type.Name", "VkCopyAccelerationStructureModeKHR")] [NativeName("Name", "mode")] public CopyAccelerationStructureModeKHR Mode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyMemoryToAccelerationStructureInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CuFunctionCreateInfoNVX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CuFunctionCreateInfoNVX.gen.cs index 8e56e46f55..8f4ddc824f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CuFunctionCreateInfoNVX.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CuFunctionCreateInfoNVX.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCuFunctionCreateInfoNVX")] - public unsafe partial struct CuFunctionCreateInfoNVX + public unsafe partial struct CuFunctionCreateInfoNVX : IChainable { public CuFunctionCreateInfoNVX ( @@ -68,5 +68,18 @@ public CuFunctionCreateInfoNVX [NativeName("Type.Name", "char")] [NativeName("Name", "pName")] public byte* PName; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CUFunctionCreateInfoNvx; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CuLaunchInfoNVX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CuLaunchInfoNVX.gen.cs index c62828123e..c1fe8838a2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CuLaunchInfoNVX.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CuLaunchInfoNVX.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCuLaunchInfoNVX")] - public unsafe partial struct CuLaunchInfoNVX + public unsafe partial struct CuLaunchInfoNVX : IChainable { public CuLaunchInfoNVX ( @@ -178,5 +178,18 @@ public CuLaunchInfoNVX [NativeName("Type.Name", "void")] [NativeName("Name", "pExtras")] public void* PExtras; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CULaunchInfoNvx; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CuModuleCreateInfoNVX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CuModuleCreateInfoNVX.gen.cs index 8fced1ee39..ab6fba734c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/CuModuleCreateInfoNVX.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/CuModuleCreateInfoNVX.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkCuModuleCreateInfoNVX")] - public unsafe partial struct CuModuleCreateInfoNVX + public unsafe partial struct CuModuleCreateInfoNVX : IChainable { public CuModuleCreateInfoNVX ( @@ -68,5 +68,18 @@ public CuModuleCreateInfoNVX [NativeName("Type.Name", "void")] [NativeName("Name", "pData")] public void* PData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CUModuleCreateInfoNvx; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/D3D12FenceSubmitInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/D3D12FenceSubmitInfoKHR.gen.cs index 866e1edc91..660cd6f37f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/D3D12FenceSubmitInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/D3D12FenceSubmitInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkD3D12FenceSubmitInfoKHR")] - public unsafe partial struct D3D12FenceSubmitInfoKHR + public unsafe partial struct D3D12FenceSubmitInfoKHR : IExtendsChain { public D3D12FenceSubmitInfoKHR ( @@ -90,5 +90,18 @@ public D3D12FenceSubmitInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pSignalSemaphoreValues")] public ulong* PSignalSemaphoreValues; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.D3D12FenceSubmitInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerMarkerInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerMarkerInfoEXT.gen.cs index 4cb107a54c..ab10b34b9f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerMarkerInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerMarkerInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDebugMarkerMarkerInfoEXT")] - public unsafe partial struct DebugMarkerMarkerInfoEXT + public unsafe partial struct DebugMarkerMarkerInfoEXT : IChainable { public DebugMarkerMarkerInfoEXT ( @@ -62,5 +62,18 @@ public DebugMarkerMarkerInfoEXT [NativeName("Type.Name", "float")] [NativeName("Name", "color")] public fixed float Color[4]; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugMarkerMarkerInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerObjectNameInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerObjectNameInfoEXT.gen.cs index 52c002d723..17734109fe 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerObjectNameInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerObjectNameInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDebugMarkerObjectNameInfoEXT")] - public unsafe partial struct DebugMarkerObjectNameInfoEXT + public unsafe partial struct DebugMarkerObjectNameInfoEXT : IChainable { public DebugMarkerObjectNameInfoEXT ( @@ -79,5 +79,18 @@ public DebugMarkerObjectNameInfoEXT [NativeName("Type.Name", "char")] [NativeName("Name", "pObjectName")] public byte* PObjectName; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugMarkerObjectNameInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerObjectTagInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerObjectTagInfoEXT.gen.cs index 081505dee9..01633e8a8a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerObjectTagInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerObjectTagInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDebugMarkerObjectTagInfoEXT")] - public unsafe partial struct DebugMarkerObjectTagInfoEXT + public unsafe partial struct DebugMarkerObjectTagInfoEXT : IChainable { public DebugMarkerObjectTagInfoEXT ( @@ -101,5 +101,18 @@ public DebugMarkerObjectTagInfoEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pTag")] public void* PTag; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugMarkerObjectTagInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugReportCallbackCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugReportCallbackCreateInfoEXT.gen.cs index 04c99582b1..107598258b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugReportCallbackCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugReportCallbackCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDebugReportCallbackCreateInfoEXT")] - public unsafe partial struct DebugReportCallbackCreateInfoEXT + public unsafe partial struct DebugReportCallbackCreateInfoEXT : IExtendsChain { public DebugReportCallbackCreateInfoEXT ( @@ -79,5 +79,18 @@ public DebugReportCallbackCreateInfoEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pUserData")] public void* PUserData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugReportCallbackCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsLabelEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsLabelEXT.gen.cs index ebb4ad1328..648b8a1efd 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsLabelEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsLabelEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDebugUtilsLabelEXT")] - public unsafe partial struct DebugUtilsLabelEXT + public unsafe partial struct DebugUtilsLabelEXT : IChainable { public DebugUtilsLabelEXT ( @@ -62,5 +62,18 @@ public DebugUtilsLabelEXT [NativeName("Type.Name", "float")] [NativeName("Name", "color")] public fixed float Color[4]; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugUtilsLabelExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsMessengerCallbackDataEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsMessengerCallbackDataEXT.gen.cs index f4f5e0e756..ecb88892b7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsMessengerCallbackDataEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsMessengerCallbackDataEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDebugUtilsMessengerCallbackDataEXT")] - public unsafe partial struct DebugUtilsMessengerCallbackDataEXT + public unsafe partial struct DebugUtilsMessengerCallbackDataEXT : IChainable { public DebugUtilsMessengerCallbackDataEXT ( @@ -156,5 +156,18 @@ public DebugUtilsMessengerCallbackDataEXT [NativeName("Type.Name", "VkDebugUtilsObjectNameInfoEXT")] [NativeName("Name", "pObjects")] public DebugUtilsObjectNameInfoEXT* PObjects; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugUtilsMessengerCallbackDataExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsMessengerCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsMessengerCreateInfoEXT.gen.cs index 63c7244638..4393beb677 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsMessengerCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsMessengerCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDebugUtilsMessengerCreateInfoEXT")] - public unsafe partial struct DebugUtilsMessengerCreateInfoEXT + public unsafe partial struct DebugUtilsMessengerCreateInfoEXT : IExtendsChain { public DebugUtilsMessengerCreateInfoEXT ( @@ -101,5 +101,18 @@ public DebugUtilsMessengerCreateInfoEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pUserData")] public void* PUserData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugUtilsMessengerCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsObjectNameInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsObjectNameInfoEXT.gen.cs index c0faf9595a..f051151fdf 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsObjectNameInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsObjectNameInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDebugUtilsObjectNameInfoEXT")] - public unsafe partial struct DebugUtilsObjectNameInfoEXT + public unsafe partial struct DebugUtilsObjectNameInfoEXT : IChainable { public DebugUtilsObjectNameInfoEXT ( @@ -79,5 +79,18 @@ public DebugUtilsObjectNameInfoEXT [NativeName("Type.Name", "char")] [NativeName("Name", "pObjectName")] public byte* PObjectName; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugUtilsObjectNameInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsObjectTagInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsObjectTagInfoEXT.gen.cs index 3144818f6f..43269adf89 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsObjectTagInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsObjectTagInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDebugUtilsObjectTagInfoEXT")] - public unsafe partial struct DebugUtilsObjectTagInfoEXT + public unsafe partial struct DebugUtilsObjectTagInfoEXT : IChainable { public DebugUtilsObjectTagInfoEXT ( @@ -101,5 +101,18 @@ public DebugUtilsObjectTagInfoEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pTag")] public void* PTag; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugUtilsObjectTagInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationBufferCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationBufferCreateInfoNV.gen.cs index b18583d711..03fbf55dff 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationBufferCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationBufferCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDedicatedAllocationBufferCreateInfoNV")] - public unsafe partial struct DedicatedAllocationBufferCreateInfoNV + public unsafe partial struct DedicatedAllocationBufferCreateInfoNV : IExtendsChain { public DedicatedAllocationBufferCreateInfoNV ( @@ -57,5 +57,18 @@ public DedicatedAllocationBufferCreateInfoNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "dedicatedAllocation")] public Bool32 DedicatedAllocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DedicatedAllocationBufferCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationImageCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationImageCreateInfoNV.gen.cs index f3c70dd674..42f8f44177 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationImageCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationImageCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDedicatedAllocationImageCreateInfoNV")] - public unsafe partial struct DedicatedAllocationImageCreateInfoNV + public unsafe partial struct DedicatedAllocationImageCreateInfoNV : IExtendsChain { public DedicatedAllocationImageCreateInfoNV ( @@ -57,5 +57,18 @@ public DedicatedAllocationImageCreateInfoNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "dedicatedAllocation")] public Bool32 DedicatedAllocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DedicatedAllocationImageCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationMemoryAllocateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationMemoryAllocateInfoNV.gen.cs index c5d2855dc7..b3408e50d4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationMemoryAllocateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationMemoryAllocateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDedicatedAllocationMemoryAllocateInfoNV")] - public unsafe partial struct DedicatedAllocationMemoryAllocateInfoNV + public unsafe partial struct DedicatedAllocationMemoryAllocateInfoNV : IExtendsChain { public DedicatedAllocationMemoryAllocateInfoNV ( @@ -68,5 +68,18 @@ public DedicatedAllocationMemoryAllocateInfoNV [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DedicatedAllocationMemoryAllocateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DependencyInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DependencyInfoKHR.gen.cs index 6ef7eae1e0..0bc35c5911 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DependencyInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DependencyInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDependencyInfoKHR")] - public unsafe partial struct DependencyInfoKHR + public unsafe partial struct DependencyInfoKHR : IChainable { public DependencyInfoKHR ( @@ -123,5 +123,18 @@ public DependencyInfoKHR [NativeName("Type.Name", "VkImageMemoryBarrier2KHR")] [NativeName("Name", "pImageMemoryBarriers")] public ImageMemoryBarrier2KHR* PImageMemoryBarriers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DependencyInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorPoolCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorPoolCreateInfo.gen.cs index b7ac59b9bb..7f6a61f0be 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorPoolCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorPoolCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorPoolCreateInfo")] - public unsafe partial struct DescriptorPoolCreateInfo + public unsafe partial struct DescriptorPoolCreateInfo : IChainStart { public DescriptorPoolCreateInfo ( @@ -90,5 +90,30 @@ public DescriptorPoolCreateInfo [NativeName("Type.Name", "VkDescriptorPoolSize")] [NativeName("Name", "pPoolSizes")] public DescriptorPoolSize* PPoolSizes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorPoolCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref DescriptorPoolCreateInfo Chain( + out DescriptorPoolCreateInfo capture) + { + capture = new DescriptorPoolCreateInfo(StructureType.DescriptorPoolCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorPoolInlineUniformBlockCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorPoolInlineUniformBlockCreateInfoEXT.gen.cs index a42a2f277e..4b8362f429 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorPoolInlineUniformBlockCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorPoolInlineUniformBlockCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorPoolInlineUniformBlockCreateInfoEXT")] - public unsafe partial struct DescriptorPoolInlineUniformBlockCreateInfoEXT + public unsafe partial struct DescriptorPoolInlineUniformBlockCreateInfoEXT : IExtendsChain { public DescriptorPoolInlineUniformBlockCreateInfoEXT ( @@ -57,5 +57,18 @@ public DescriptorPoolInlineUniformBlockCreateInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxInlineUniformBlockBindings")] public uint MaxInlineUniformBlockBindings; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorPoolInlineUniformBlockCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetAllocateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetAllocateInfo.gen.cs index e56c39db3e..4aca83f350 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetAllocateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetAllocateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetAllocateInfo")] - public unsafe partial struct DescriptorSetAllocateInfo + public unsafe partial struct DescriptorSetAllocateInfo : IChainStart { public DescriptorSetAllocateInfo ( @@ -79,5 +79,30 @@ public DescriptorSetAllocateInfo [NativeName("Type.Name", "VkDescriptorSetLayout")] [NativeName("Name", "pSetLayouts")] public DescriptorSetLayout* PSetLayouts; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetAllocateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref DescriptorSetAllocateInfo Chain( + out DescriptorSetAllocateInfo capture) + { + capture = new DescriptorSetAllocateInfo(StructureType.DescriptorSetAllocateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfo.gen.cs index c1a973580f..558c869f27 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetLayoutBindingFlagsCreateInfo")] - public unsafe partial struct DescriptorSetLayoutBindingFlagsCreateInfo + [NativeName("Aliases", "VkDescriptorSetLayoutBindingFlagsCreateInfoEXT")] + public unsafe partial struct DescriptorSetLayoutBindingFlagsCreateInfo : IExtendsChain { public DescriptorSetLayoutBindingFlagsCreateInfo ( @@ -68,5 +69,18 @@ public DescriptorSetLayoutBindingFlagsCreateInfo [NativeName("Type.Name", "VkDescriptorBindingFlags")] [NativeName("Name", "pBindingFlags")] public DescriptorBindingFlags* PBindingFlags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetLayoutBindingFlagsCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfoEXT.gen.cs index 8785c01ffd..d408a524f9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfoEXT.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetLayoutBindingFlagsCreateInfoEXT")] - public unsafe partial struct DescriptorSetLayoutBindingFlagsCreateInfoEXT + [NativeName("AliasOf", "VkDescriptorSetLayoutBindingFlagsCreateInfo")] + public unsafe partial struct DescriptorSetLayoutBindingFlagsCreateInfoEXT : IExtendsChain { public DescriptorSetLayoutBindingFlagsCreateInfoEXT ( @@ -68,5 +69,18 @@ public DescriptorSetLayoutBindingFlagsCreateInfoEXT [NativeName("Type.Name", "VkDescriptorBindingFlags")] [NativeName("Name", "pBindingFlags")] public DescriptorBindingFlags* PBindingFlags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetLayoutBindingFlagsCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutCreateInfo.gen.cs index 44c2c25343..6d3291fb2a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetLayoutCreateInfo")] - public unsafe partial struct DescriptorSetLayoutCreateInfo + public unsafe partial struct DescriptorSetLayoutCreateInfo : IChainStart { public DescriptorSetLayoutCreateInfo ( @@ -79,5 +79,30 @@ public DescriptorSetLayoutCreateInfo [NativeName("Type.Name", "VkDescriptorSetLayoutBinding")] [NativeName("Name", "pBindings")] public DescriptorSetLayoutBinding* PBindings; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetLayoutCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref DescriptorSetLayoutCreateInfo Chain( + out DescriptorSetLayoutCreateInfo capture) + { + capture = new DescriptorSetLayoutCreateInfo(StructureType.DescriptorSetLayoutCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupport.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupport.gen.cs index aff486ce38..9642324580 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupport.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupport.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetLayoutSupport")] - public unsafe partial struct DescriptorSetLayoutSupport + [NativeName("Aliases", "VkDescriptorSetLayoutSupportKHR")] + public unsafe partial struct DescriptorSetLayoutSupport : IChainStart { public DescriptorSetLayoutSupport ( @@ -57,5 +58,30 @@ public DescriptorSetLayoutSupport [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "supported")] public Bool32 Supported; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetLayoutSupport; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref DescriptorSetLayoutSupport Chain( + out DescriptorSetLayoutSupport capture) + { + capture = new DescriptorSetLayoutSupport(StructureType.DescriptorSetLayoutSupport); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupportKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupportKHR.gen.cs index f2078864cb..85c6916e7b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupportKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupportKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetLayoutSupportKHR")] - public unsafe partial struct DescriptorSetLayoutSupportKHR + [NativeName("AliasOf", "VkDescriptorSetLayoutSupport")] + public unsafe partial struct DescriptorSetLayoutSupportKHR : IChainStart { public DescriptorSetLayoutSupportKHR ( @@ -57,5 +58,30 @@ public DescriptorSetLayoutSupportKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "supported")] public Bool32 Supported; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetLayoutSupport; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref DescriptorSetLayoutSupportKHR Chain( + out DescriptorSetLayoutSupportKHR capture) + { + capture = new DescriptorSetLayoutSupportKHR(StructureType.DescriptorSetLayoutSupport); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfo.gen.cs index c6d04b5760..296e80b1d1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetVariableDescriptorCountAllocateInfo")] - public unsafe partial struct DescriptorSetVariableDescriptorCountAllocateInfo + [NativeName("Aliases", "VkDescriptorSetVariableDescriptorCountAllocateInfoEXT")] + public unsafe partial struct DescriptorSetVariableDescriptorCountAllocateInfo : IExtendsChain { public DescriptorSetVariableDescriptorCountAllocateInfo ( @@ -68,5 +69,18 @@ public DescriptorSetVariableDescriptorCountAllocateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pDescriptorCounts")] public uint* PDescriptorCounts; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetVariableDescriptorCountAllocateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfoEXT.gen.cs index f40c87ed2e..f435e61120 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfoEXT.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetVariableDescriptorCountAllocateInfoEXT")] - public unsafe partial struct DescriptorSetVariableDescriptorCountAllocateInfoEXT + [NativeName("AliasOf", "VkDescriptorSetVariableDescriptorCountAllocateInfo")] + public unsafe partial struct DescriptorSetVariableDescriptorCountAllocateInfoEXT : IExtendsChain { public DescriptorSetVariableDescriptorCountAllocateInfoEXT ( @@ -68,5 +69,18 @@ public DescriptorSetVariableDescriptorCountAllocateInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pDescriptorCounts")] public uint* PDescriptorCounts; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetVariableDescriptorCountAllocateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupport.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupport.gen.cs index bd4d204d04..9f676a42a8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupport.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupport.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetVariableDescriptorCountLayoutSupport")] - public unsafe partial struct DescriptorSetVariableDescriptorCountLayoutSupport + [NativeName("Aliases", "VkDescriptorSetVariableDescriptorCountLayoutSupportEXT")] + public unsafe partial struct DescriptorSetVariableDescriptorCountLayoutSupport : IExtendsChain, IExtendsChain { public DescriptorSetVariableDescriptorCountLayoutSupport ( @@ -57,5 +58,18 @@ public DescriptorSetVariableDescriptorCountLayoutSupport [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxVariableDescriptorCount")] public uint MaxVariableDescriptorCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetVariableDescriptorCountLayoutSupport; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupportEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupportEXT.gen.cs index e0fd5f9ae6..c13ac8afd5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupportEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupportEXT.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetVariableDescriptorCountLayoutSupportEXT")] - public unsafe partial struct DescriptorSetVariableDescriptorCountLayoutSupportEXT + [NativeName("AliasOf", "VkDescriptorSetVariableDescriptorCountLayoutSupport")] + public unsafe partial struct DescriptorSetVariableDescriptorCountLayoutSupportEXT : IExtendsChain, IExtendsChain { public DescriptorSetVariableDescriptorCountLayoutSupportEXT ( @@ -57,5 +58,18 @@ public DescriptorSetVariableDescriptorCountLayoutSupportEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxVariableDescriptorCount")] public uint MaxVariableDescriptorCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetVariableDescriptorCountLayoutSupport; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfo.gen.cs index 514657ae97..f7340a9b70 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorUpdateTemplateCreateInfo")] - public unsafe partial struct DescriptorUpdateTemplateCreateInfo + [NativeName("Aliases", "VkDescriptorUpdateTemplateCreateInfoKHR")] + public unsafe partial struct DescriptorUpdateTemplateCreateInfo : IChainable { public DescriptorUpdateTemplateCreateInfo ( @@ -134,5 +135,18 @@ public DescriptorUpdateTemplateCreateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "set")] public uint Set; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorUpdateTemplateCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfoKHR.gen.cs index 416fbea6d4..6e2ae087e4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorUpdateTemplateCreateInfoKHR")] - public unsafe partial struct DescriptorUpdateTemplateCreateInfoKHR + [NativeName("AliasOf", "VkDescriptorUpdateTemplateCreateInfo")] + public unsafe partial struct DescriptorUpdateTemplateCreateInfoKHR : IChainable { public DescriptorUpdateTemplateCreateInfoKHR ( @@ -134,5 +135,18 @@ public DescriptorUpdateTemplateCreateInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "set")] public uint Set; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorUpdateTemplateCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateEntry.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateEntry.gen.cs index 95fc39a566..29325d645e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateEntry.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateEntry.gen.cs @@ -17,6 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorUpdateTemplateEntry")] + [NativeName("Aliases", "VkDescriptorUpdateTemplateEntryKHR")] public unsafe partial struct DescriptorUpdateTemplateEntry { public DescriptorUpdateTemplateEntry diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateEntryKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateEntryKHR.gen.cs index 4cdfce864e..a43a910b1c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateEntryKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateEntryKHR.gen.cs @@ -17,6 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorUpdateTemplateEntryKHR")] + [NativeName("AliasOf", "VkDescriptorUpdateTemplateEntry")] public unsafe partial struct DescriptorUpdateTemplateEntryKHR { public DescriptorUpdateTemplateEntryKHR diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceBufferMemoryRequirementsKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceBufferMemoryRequirementsKHR.gen.cs index 9cb47ba0f0..8d50a42b9d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceBufferMemoryRequirementsKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceBufferMemoryRequirementsKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceBufferMemoryRequirementsKHR")] - public unsafe partial struct DeviceBufferMemoryRequirementsKHR + public unsafe partial struct DeviceBufferMemoryRequirementsKHR : IChainable { public DeviceBufferMemoryRequirementsKHR ( @@ -57,5 +57,18 @@ public DeviceBufferMemoryRequirementsKHR [NativeName("Type.Name", "VkBufferCreateInfo")] [NativeName("Name", "pCreateInfo")] public BufferCreateInfo* PCreateInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceBufferMemoryRequirementsKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceCreateInfo.gen.cs index 3310a31fb4..1c3fcbdc3f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceCreateInfo")] - public unsafe partial struct DeviceCreateInfo + public unsafe partial struct DeviceCreateInfo : IChainStart { public DeviceCreateInfo ( @@ -134,5 +134,30 @@ public DeviceCreateInfo [NativeName("Type.Name", "VkPhysicalDeviceFeatures")] [NativeName("Name", "pEnabledFeatures")] public PhysicalDeviceFeatures* PEnabledFeatures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref DeviceCreateInfo Chain( + out DeviceCreateInfo capture) + { + capture = new DeviceCreateInfo(StructureType.DeviceCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceDeviceMemoryReportCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceDeviceMemoryReportCreateInfoEXT.gen.cs index 00eb7571b9..eb4652fdb7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceDeviceMemoryReportCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceDeviceMemoryReportCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceDeviceMemoryReportCreateInfoEXT")] - public unsafe partial struct DeviceDeviceMemoryReportCreateInfoEXT + public unsafe partial struct DeviceDeviceMemoryReportCreateInfoEXT : IExtendsChain { public DeviceDeviceMemoryReportCreateInfoEXT ( @@ -79,5 +79,18 @@ public DeviceDeviceMemoryReportCreateInfoEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pUserData")] public void* PUserData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceDeviceMemoryReportCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceDiagnosticsConfigCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceDiagnosticsConfigCreateInfoNV.gen.cs index 0c1045b866..bd08f5cbfb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceDiagnosticsConfigCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceDiagnosticsConfigCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceDiagnosticsConfigCreateInfoNV")] - public unsafe partial struct DeviceDiagnosticsConfigCreateInfoNV + public unsafe partial struct DeviceDiagnosticsConfigCreateInfoNV : IExtendsChain { public DeviceDiagnosticsConfigCreateInfoNV ( @@ -57,5 +57,18 @@ public DeviceDiagnosticsConfigCreateInfoNV [NativeName("Type.Name", "VkDeviceDiagnosticsConfigFlagsNV")] [NativeName("Name", "flags")] public DeviceDiagnosticsConfigFlagsNV Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceDiagnosticsConfigCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceEventInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceEventInfoEXT.gen.cs index 9b999ca658..24af9a9a9f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceEventInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceEventInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceEventInfoEXT")] - public unsafe partial struct DeviceEventInfoEXT + public unsafe partial struct DeviceEventInfoEXT : IChainable { public DeviceEventInfoEXT ( @@ -57,5 +57,18 @@ public DeviceEventInfoEXT [NativeName("Type.Name", "VkDeviceEventTypeEXT")] [NativeName("Name", "deviceEvent")] public DeviceEventTypeEXT DeviceEvent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceEventInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfo.gen.cs index ff4daa66a2..c89cf01ec0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupBindSparseInfo")] - public unsafe partial struct DeviceGroupBindSparseInfo + [NativeName("Aliases", "VkDeviceGroupBindSparseInfoKHR")] + public unsafe partial struct DeviceGroupBindSparseInfo : IExtendsChain { public DeviceGroupBindSparseInfo ( @@ -68,5 +69,18 @@ public DeviceGroupBindSparseInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryDeviceIndex")] public uint MemoryDeviceIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupBindSparseInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfoKHR.gen.cs index 05c3f46006..7615abdb05 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupBindSparseInfoKHR")] - public unsafe partial struct DeviceGroupBindSparseInfoKHR + [NativeName("AliasOf", "VkDeviceGroupBindSparseInfo")] + public unsafe partial struct DeviceGroupBindSparseInfoKHR : IExtendsChain { public DeviceGroupBindSparseInfoKHR ( @@ -68,5 +69,18 @@ public DeviceGroupBindSparseInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryDeviceIndex")] public uint MemoryDeviceIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupBindSparseInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfo.gen.cs index 5a705b8847..4fbbb74978 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupCommandBufferBeginInfo")] - public unsafe partial struct DeviceGroupCommandBufferBeginInfo + [NativeName("Aliases", "VkDeviceGroupCommandBufferBeginInfoKHR")] + public unsafe partial struct DeviceGroupCommandBufferBeginInfo : IExtendsChain { public DeviceGroupCommandBufferBeginInfo ( @@ -57,5 +58,18 @@ public DeviceGroupCommandBufferBeginInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "deviceMask")] public uint DeviceMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupCommandBufferBeginInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfoKHR.gen.cs index 919187368b..b3a4f715d6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupCommandBufferBeginInfoKHR")] - public unsafe partial struct DeviceGroupCommandBufferBeginInfoKHR + [NativeName("AliasOf", "VkDeviceGroupCommandBufferBeginInfo")] + public unsafe partial struct DeviceGroupCommandBufferBeginInfoKHR : IExtendsChain { public DeviceGroupCommandBufferBeginInfoKHR ( @@ -57,5 +58,18 @@ public DeviceGroupCommandBufferBeginInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "deviceMask")] public uint DeviceMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupCommandBufferBeginInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfo.gen.cs index d678acf328..f3ddda990a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupDeviceCreateInfo")] - public unsafe partial struct DeviceGroupDeviceCreateInfo + [NativeName("Aliases", "VkDeviceGroupDeviceCreateInfoKHR")] + public unsafe partial struct DeviceGroupDeviceCreateInfo : IExtendsChain { public DeviceGroupDeviceCreateInfo ( @@ -68,5 +69,18 @@ public DeviceGroupDeviceCreateInfo [NativeName("Type.Name", "VkPhysicalDevice")] [NativeName("Name", "pPhysicalDevices")] public PhysicalDevice* PPhysicalDevices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupDeviceCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfoKHR.gen.cs index 52103ac0e2..3e40f3eab9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupDeviceCreateInfoKHR")] - public unsafe partial struct DeviceGroupDeviceCreateInfoKHR + [NativeName("AliasOf", "VkDeviceGroupDeviceCreateInfo")] + public unsafe partial struct DeviceGroupDeviceCreateInfoKHR : IExtendsChain { public DeviceGroupDeviceCreateInfoKHR ( @@ -68,5 +69,18 @@ public DeviceGroupDeviceCreateInfoKHR [NativeName("Type.Name", "VkPhysicalDevice")] [NativeName("Name", "pPhysicalDevices")] public PhysicalDevice* PPhysicalDevices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupDeviceCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupPresentCapabilitiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupPresentCapabilitiesKHR.gen.cs index 609ea5d256..1abeafaea8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupPresentCapabilitiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupPresentCapabilitiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupPresentCapabilitiesKHR")] - public unsafe partial struct DeviceGroupPresentCapabilitiesKHR + public unsafe partial struct DeviceGroupPresentCapabilitiesKHR : IChainable { public DeviceGroupPresentCapabilitiesKHR ( @@ -62,5 +62,18 @@ public DeviceGroupPresentCapabilitiesKHR [NativeName("Type.Name", "VkDeviceGroupPresentModeFlagsKHR")] [NativeName("Name", "modes")] public DeviceGroupPresentModeFlagsKHR Modes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupPresentCapabilitiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupPresentInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupPresentInfoKHR.gen.cs index 7dcf359914..f769c4af18 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupPresentInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupPresentInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupPresentInfoKHR")] - public unsafe partial struct DeviceGroupPresentInfoKHR + public unsafe partial struct DeviceGroupPresentInfoKHR : IExtendsChain { public DeviceGroupPresentInfoKHR ( @@ -79,5 +79,18 @@ public DeviceGroupPresentInfoKHR [NativeName("Type.Name", "VkDeviceGroupPresentModeFlagBitsKHR")] [NativeName("Name", "mode")] public DeviceGroupPresentModeFlagsKHR Mode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupPresentInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfo.gen.cs index 739866371d..8ff8a48f9a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupRenderPassBeginInfo")] - public unsafe partial struct DeviceGroupRenderPassBeginInfo + [NativeName("Aliases", "VkDeviceGroupRenderPassBeginInfoKHR")] + public unsafe partial struct DeviceGroupRenderPassBeginInfo : IExtendsChain, IExtendsChain { public DeviceGroupRenderPassBeginInfo ( @@ -79,5 +80,18 @@ public DeviceGroupRenderPassBeginInfo [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "pDeviceRenderAreas")] public Rect2D* PDeviceRenderAreas; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupRenderPassBeginInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfoKHR.gen.cs index e23ce7ff95..d68b5c57cb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupRenderPassBeginInfoKHR")] - public unsafe partial struct DeviceGroupRenderPassBeginInfoKHR + [NativeName("AliasOf", "VkDeviceGroupRenderPassBeginInfo")] + public unsafe partial struct DeviceGroupRenderPassBeginInfoKHR : IExtendsChain, IExtendsChain { public DeviceGroupRenderPassBeginInfoKHR ( @@ -79,5 +80,18 @@ public DeviceGroupRenderPassBeginInfoKHR [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "pDeviceRenderAreas")] public Rect2D* PDeviceRenderAreas; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupRenderPassBeginInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfo.gen.cs index 713c3bda01..58a1f9d298 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupSubmitInfo")] - public unsafe partial struct DeviceGroupSubmitInfo + [NativeName("Aliases", "VkDeviceGroupSubmitInfoKHR")] + public unsafe partial struct DeviceGroupSubmitInfo : IExtendsChain { public DeviceGroupSubmitInfo ( @@ -112,5 +113,18 @@ public DeviceGroupSubmitInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pSignalSemaphoreDeviceIndices")] public uint* PSignalSemaphoreDeviceIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupSubmitInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfoKHR.gen.cs index 44bbc3e4d8..a71131ee18 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupSubmitInfoKHR")] - public unsafe partial struct DeviceGroupSubmitInfoKHR + [NativeName("AliasOf", "VkDeviceGroupSubmitInfo")] + public unsafe partial struct DeviceGroupSubmitInfoKHR : IExtendsChain { public DeviceGroupSubmitInfoKHR ( @@ -112,5 +113,18 @@ public DeviceGroupSubmitInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pSignalSemaphoreDeviceIndices")] public uint* PSignalSemaphoreDeviceIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupSubmitInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSwapchainCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSwapchainCreateInfoKHR.gen.cs index 06e676a452..17ec5246c3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSwapchainCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSwapchainCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupSwapchainCreateInfoKHR")] - public unsafe partial struct DeviceGroupSwapchainCreateInfoKHR + public unsafe partial struct DeviceGroupSwapchainCreateInfoKHR : IExtendsChain { public DeviceGroupSwapchainCreateInfoKHR ( @@ -57,5 +57,18 @@ public DeviceGroupSwapchainCreateInfoKHR [NativeName("Type.Name", "VkDeviceGroupPresentModeFlagsKHR")] [NativeName("Name", "modes")] public DeviceGroupPresentModeFlagsKHR Modes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupSwapchainCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceImageMemoryRequirementsKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceImageMemoryRequirementsKHR.gen.cs index 13965ead42..bd92cd9e5e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceImageMemoryRequirementsKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceImageMemoryRequirementsKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceImageMemoryRequirementsKHR")] - public unsafe partial struct DeviceImageMemoryRequirementsKHR + public unsafe partial struct DeviceImageMemoryRequirementsKHR : IChainable { public DeviceImageMemoryRequirementsKHR ( @@ -68,5 +68,18 @@ public DeviceImageMemoryRequirementsKHR [NativeName("Type.Name", "VkImageAspectFlagBits")] [NativeName("Name", "planeAspect")] public ImageAspectFlags PlaneAspect; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceImageMemoryRequirementsKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfo.gen.cs index 1b191c29fa..56fb284f96 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceMemoryOpaqueCaptureAddressInfo")] - public unsafe partial struct DeviceMemoryOpaqueCaptureAddressInfo + [NativeName("Aliases", "VkDeviceMemoryOpaqueCaptureAddressInfoKHR")] + public unsafe partial struct DeviceMemoryOpaqueCaptureAddressInfo : IChainable { public DeviceMemoryOpaqueCaptureAddressInfo ( @@ -57,5 +58,18 @@ public DeviceMemoryOpaqueCaptureAddressInfo [NativeName("Type.Name", "VkDeviceMemory")] [NativeName("Name", "memory")] public DeviceMemory Memory; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceMemoryOpaqueCaptureAddressInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfoKHR.gen.cs index 9c031ab7c9..9212b20738 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceMemoryOpaqueCaptureAddressInfoKHR")] - public unsafe partial struct DeviceMemoryOpaqueCaptureAddressInfoKHR + [NativeName("AliasOf", "VkDeviceMemoryOpaqueCaptureAddressInfo")] + public unsafe partial struct DeviceMemoryOpaqueCaptureAddressInfoKHR : IChainable { public DeviceMemoryOpaqueCaptureAddressInfoKHR ( @@ -57,5 +58,18 @@ public DeviceMemoryOpaqueCaptureAddressInfoKHR [NativeName("Type.Name", "VkDeviceMemory")] [NativeName("Name", "memory")] public DeviceMemory Memory; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceMemoryOpaqueCaptureAddressInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOverallocationCreateInfoAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOverallocationCreateInfoAMD.gen.cs index 3b1cb07ead..9fbfde43de 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOverallocationCreateInfoAMD.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOverallocationCreateInfoAMD.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceMemoryOverallocationCreateInfoAMD")] - public unsafe partial struct DeviceMemoryOverallocationCreateInfoAMD + public unsafe partial struct DeviceMemoryOverallocationCreateInfoAMD : IExtendsChain { public DeviceMemoryOverallocationCreateInfoAMD ( @@ -57,5 +57,18 @@ public DeviceMemoryOverallocationCreateInfoAMD [NativeName("Type.Name", "VkMemoryOverallocationBehaviorAMD")] [NativeName("Name", "overallocationBehavior")] public MemoryOverallocationBehaviorAMD OverallocationBehavior; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceMemoryOverallocationCreateInfoAmd; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryReportCallbackDataEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryReportCallbackDataEXT.gen.cs index 3a5c7318ce..b9f4aa0d0d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryReportCallbackDataEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryReportCallbackDataEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceMemoryReportCallbackDataEXT")] - public unsafe partial struct DeviceMemoryReportCallbackDataEXT + public unsafe partial struct DeviceMemoryReportCallbackDataEXT : IChainable { public DeviceMemoryReportCallbackDataEXT ( @@ -123,5 +123,18 @@ public DeviceMemoryReportCallbackDataEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "heapIndex")] public uint HeapIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceMemoryReportCallbackDataExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DevicePrivateDataCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DevicePrivateDataCreateInfoEXT.gen.cs index 88e3416cbc..ddfed90599 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DevicePrivateDataCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DevicePrivateDataCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDevicePrivateDataCreateInfoEXT")] - public unsafe partial struct DevicePrivateDataCreateInfoEXT + public unsafe partial struct DevicePrivateDataCreateInfoEXT : IExtendsChain { public DevicePrivateDataCreateInfoEXT ( @@ -57,5 +57,18 @@ public DevicePrivateDataCreateInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "privateDataSlotRequestCount")] public uint PrivateDataSlotRequestCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DevicePrivateDataCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueCreateInfo.gen.cs index b4cdf43bf8..39f8507dfb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceQueueCreateInfo")] - public unsafe partial struct DeviceQueueCreateInfo + public unsafe partial struct DeviceQueueCreateInfo : IChainStart { public DeviceQueueCreateInfo ( @@ -90,5 +90,30 @@ public DeviceQueueCreateInfo [NativeName("Type.Name", "float")] [NativeName("Name", "pQueuePriorities")] public float* PQueuePriorities; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceQueueCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref DeviceQueueCreateInfo Chain( + out DeviceQueueCreateInfo capture) + { + capture = new DeviceQueueCreateInfo(StructureType.DeviceQueueCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueGlobalPriorityCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueGlobalPriorityCreateInfoEXT.gen.cs index ed5a83b240..7086c388d6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueGlobalPriorityCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueGlobalPriorityCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceQueueGlobalPriorityCreateInfoEXT")] - public unsafe partial struct DeviceQueueGlobalPriorityCreateInfoEXT + public unsafe partial struct DeviceQueueGlobalPriorityCreateInfoEXT : IExtendsChain { public DeviceQueueGlobalPriorityCreateInfoEXT ( @@ -57,5 +57,18 @@ public DeviceQueueGlobalPriorityCreateInfoEXT [NativeName("Type.Name", "VkQueueGlobalPriorityEXT")] [NativeName("Name", "globalPriority")] public QueueGlobalPriorityEXT GlobalPriority; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceQueueGlobalPriorityCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueInfo2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueInfo2.gen.cs index 830f6cf6f6..b1b82554b4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueInfo2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueInfo2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceQueueInfo2")] - public unsafe partial struct DeviceQueueInfo2 + public unsafe partial struct DeviceQueueInfo2 : IChainable { public DeviceQueueInfo2 ( @@ -79,5 +79,18 @@ public DeviceQueueInfo2 [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "queueIndex")] public uint QueueIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceQueueInfo2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DirectFBSurfaceCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DirectFBSurfaceCreateInfoEXT.gen.cs index 687cc0f0e7..fe51cd1f6a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DirectFBSurfaceCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DirectFBSurfaceCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDirectFBSurfaceCreateInfoEXT")] - public unsafe partial struct DirectFBSurfaceCreateInfoEXT + public unsafe partial struct DirectFBSurfaceCreateInfoEXT : IChainable { public DirectFBSurfaceCreateInfoEXT ( @@ -79,5 +79,18 @@ public DirectFBSurfaceCreateInfoEXT [NativeName("Type.Name", "IDirectFBSurface")] [NativeName("Name", "surface")] public nint Surface; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DirectfbSurfaceCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayEventInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayEventInfoEXT.gen.cs index ce61acafa7..36f40cb5e9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayEventInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayEventInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDisplayEventInfoEXT")] - public unsafe partial struct DisplayEventInfoEXT + public unsafe partial struct DisplayEventInfoEXT : IChainable { public DisplayEventInfoEXT ( @@ -57,5 +57,18 @@ public DisplayEventInfoEXT [NativeName("Type.Name", "VkDisplayEventTypeEXT")] [NativeName("Name", "displayEvent")] public DisplayEventTypeEXT DisplayEvent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayEventInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayModeCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayModeCreateInfoKHR.gen.cs index 987e6c38be..5e319bfa78 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayModeCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayModeCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDisplayModeCreateInfoKHR")] - public unsafe partial struct DisplayModeCreateInfoKHR + public unsafe partial struct DisplayModeCreateInfoKHR : IChainable { public DisplayModeCreateInfoKHR ( @@ -68,5 +68,18 @@ public DisplayModeCreateInfoKHR [NativeName("Type.Name", "VkDisplayModeParametersKHR")] [NativeName("Name", "parameters")] public DisplayModeParametersKHR Parameters; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayModeCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayModeProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayModeProperties2KHR.gen.cs index 6a618c1eef..ac3bce58d4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayModeProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayModeProperties2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDisplayModeProperties2KHR")] - public unsafe partial struct DisplayModeProperties2KHR + public unsafe partial struct DisplayModeProperties2KHR : IChainable { public DisplayModeProperties2KHR ( @@ -57,5 +57,18 @@ public DisplayModeProperties2KHR [NativeName("Type.Name", "VkDisplayModePropertiesKHR")] [NativeName("Name", "displayModeProperties")] public DisplayModePropertiesKHR DisplayModeProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayModeProperties2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayNativeHdrSurfaceCapabilitiesAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayNativeHdrSurfaceCapabilitiesAMD.gen.cs index e9add12380..f39766f857 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayNativeHdrSurfaceCapabilitiesAMD.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayNativeHdrSurfaceCapabilitiesAMD.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDisplayNativeHdrSurfaceCapabilitiesAMD")] - public unsafe partial struct DisplayNativeHdrSurfaceCapabilitiesAMD + public unsafe partial struct DisplayNativeHdrSurfaceCapabilitiesAMD : IExtendsChain { public DisplayNativeHdrSurfaceCapabilitiesAMD ( @@ -57,5 +57,18 @@ public DisplayNativeHdrSurfaceCapabilitiesAMD [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "localDimmingSupport")] public Bool32 LocalDimmingSupport; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayNativeHdrSurfaceCapabilitiesAmd; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneCapabilities2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneCapabilities2KHR.gen.cs index 52c24fec5d..f4655bf2d3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneCapabilities2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneCapabilities2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDisplayPlaneCapabilities2KHR")] - public unsafe partial struct DisplayPlaneCapabilities2KHR + public unsafe partial struct DisplayPlaneCapabilities2KHR : IChainable { public DisplayPlaneCapabilities2KHR ( @@ -57,5 +57,18 @@ public DisplayPlaneCapabilities2KHR [NativeName("Type.Name", "VkDisplayPlaneCapabilitiesKHR")] [NativeName("Name", "capabilities")] public DisplayPlaneCapabilitiesKHR Capabilities; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayPlaneCapabilities2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneInfo2KHR.gen.cs index dba6c81d82..b08cc5611e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneInfo2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDisplayPlaneInfo2KHR")] - public unsafe partial struct DisplayPlaneInfo2KHR + public unsafe partial struct DisplayPlaneInfo2KHR : IChainable { public DisplayPlaneInfo2KHR ( @@ -68,5 +68,18 @@ public DisplayPlaneInfo2KHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "planeIndex")] public uint PlaneIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayPlaneInfo2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneProperties2KHR.gen.cs index e227b32d89..c28aab5719 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneProperties2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDisplayPlaneProperties2KHR")] - public unsafe partial struct DisplayPlaneProperties2KHR + public unsafe partial struct DisplayPlaneProperties2KHR : IChainable { public DisplayPlaneProperties2KHR ( @@ -57,5 +57,18 @@ public DisplayPlaneProperties2KHR [NativeName("Type.Name", "VkDisplayPlanePropertiesKHR")] [NativeName("Name", "displayPlaneProperties")] public DisplayPlanePropertiesKHR DisplayPlaneProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayPlaneProperties2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPowerInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPowerInfoEXT.gen.cs index 18faa54b1d..d0d4dce048 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPowerInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPowerInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDisplayPowerInfoEXT")] - public unsafe partial struct DisplayPowerInfoEXT + public unsafe partial struct DisplayPowerInfoEXT : IChainable { public DisplayPowerInfoEXT ( @@ -57,5 +57,18 @@ public DisplayPowerInfoEXT [NativeName("Type.Name", "VkDisplayPowerStateEXT")] [NativeName("Name", "powerState")] public DisplayPowerStateEXT PowerState; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayPowerInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPresentInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPresentInfoKHR.gen.cs index 1419fd0b27..aa1e11b8d8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPresentInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPresentInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDisplayPresentInfoKHR")] - public unsafe partial struct DisplayPresentInfoKHR + public unsafe partial struct DisplayPresentInfoKHR : IExtendsChain { public DisplayPresentInfoKHR ( @@ -79,5 +79,18 @@ public DisplayPresentInfoKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "persistent")] public Bool32 Persistent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayPresentInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayProperties2KHR.gen.cs index 8ab2def3e0..946e5711d2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayProperties2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDisplayProperties2KHR")] - public unsafe partial struct DisplayProperties2KHR + public unsafe partial struct DisplayProperties2KHR : IChainable { public DisplayProperties2KHR ( @@ -57,5 +57,18 @@ public DisplayProperties2KHR [NativeName("Type.Name", "VkDisplayPropertiesKHR")] [NativeName("Name", "displayProperties")] public DisplayPropertiesKHR DisplayProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayProperties2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplaySurfaceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplaySurfaceCreateInfoKHR.gen.cs index 180a0878c1..764f4c7178 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplaySurfaceCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplaySurfaceCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDisplaySurfaceCreateInfoKHR")] - public unsafe partial struct DisplaySurfaceCreateInfoKHR + public unsafe partial struct DisplaySurfaceCreateInfoKHR : IChainable { public DisplaySurfaceCreateInfoKHR ( @@ -134,5 +134,18 @@ public DisplaySurfaceCreateInfoKHR [NativeName("Type.Name", "VkExtent2D")] [NativeName("Name", "imageExtent")] public Extent2D ImageExtent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplaySurfaceCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DrmFormatModifierPropertiesList2EXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DrmFormatModifierPropertiesList2EXT.gen.cs index a03ec09869..779e5bdfeb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DrmFormatModifierPropertiesList2EXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DrmFormatModifierPropertiesList2EXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDrmFormatModifierPropertiesList2EXT")] - public unsafe partial struct DrmFormatModifierPropertiesList2EXT + public unsafe partial struct DrmFormatModifierPropertiesList2EXT : IExtendsChain, IExtendsChain { public DrmFormatModifierPropertiesList2EXT ( @@ -68,5 +68,18 @@ public DrmFormatModifierPropertiesList2EXT [NativeName("Type.Name", "VkDrmFormatModifierProperties2EXT")] [NativeName("Name", "pDrmFormatModifierProperties")] public DrmFormatModifierProperties2EXT* PDrmFormatModifierProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DrmFormatModifierPropertiesList2Ext; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DrmFormatModifierPropertiesListEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DrmFormatModifierPropertiesListEXT.gen.cs index d78370a026..512073fdb2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DrmFormatModifierPropertiesListEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DrmFormatModifierPropertiesListEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDrmFormatModifierPropertiesListEXT")] - public unsafe partial struct DrmFormatModifierPropertiesListEXT + public unsafe partial struct DrmFormatModifierPropertiesListEXT : IExtendsChain, IExtendsChain { public DrmFormatModifierPropertiesListEXT ( @@ -68,5 +68,18 @@ public DrmFormatModifierPropertiesListEXT [NativeName("Type.Name", "VkDrmFormatModifierPropertiesEXT")] [NativeName("Name", "pDrmFormatModifierProperties")] public DrmFormatModifierPropertiesEXT* PDrmFormatModifierProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DrmFormatModifierPropertiesListExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/EventCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/EventCreateInfo.gen.cs index 577afba1eb..bcff06c209 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/EventCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/EventCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkEventCreateInfo")] - public unsafe partial struct EventCreateInfo + public unsafe partial struct EventCreateInfo : IChainable { public EventCreateInfo ( @@ -57,5 +57,18 @@ public EventCreateInfo [NativeName("Type.Name", "VkEventCreateFlags")] [NativeName("Name", "flags")] public EventCreateFlags Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.EventCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfo.gen.cs index 71b8504487..4b2997d733 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportFenceCreateInfo")] - public unsafe partial struct ExportFenceCreateInfo + [NativeName("Aliases", "VkExportFenceCreateInfoKHR")] + public unsafe partial struct ExportFenceCreateInfo : IExtendsChain { public ExportFenceCreateInfo ( @@ -57,5 +58,18 @@ public ExportFenceCreateInfo [NativeName("Type.Name", "VkExternalFenceHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalFenceHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportFenceCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfoKHR.gen.cs index 85e4e86682..29fa8895d4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportFenceCreateInfoKHR")] - public unsafe partial struct ExportFenceCreateInfoKHR + [NativeName("AliasOf", "VkExportFenceCreateInfo")] + public unsafe partial struct ExportFenceCreateInfoKHR : IExtendsChain { public ExportFenceCreateInfoKHR ( @@ -57,5 +58,18 @@ public ExportFenceCreateInfoKHR [NativeName("Type.Name", "VkExternalFenceHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalFenceHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportFenceCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceWin32HandleInfoKHR.gen.cs index d3c475a240..195dd649d8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceWin32HandleInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceWin32HandleInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportFenceWin32HandleInfoKHR")] - public unsafe partial struct ExportFenceWin32HandleInfoKHR + public unsafe partial struct ExportFenceWin32HandleInfoKHR : IExtendsChain { public ExportFenceWin32HandleInfoKHR ( @@ -79,5 +79,18 @@ public ExportFenceWin32HandleInfoKHR [NativeName("Type.Name", "LPCWSTR")] [NativeName("Name", "name")] public nint Name; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportFenceWin32HandleInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfo.gen.cs index 02c46dd224..2d361571c4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportMemoryAllocateInfo")] - public unsafe partial struct ExportMemoryAllocateInfo + [NativeName("Aliases", "VkExportMemoryAllocateInfoKHR")] + public unsafe partial struct ExportMemoryAllocateInfo : IExtendsChain { public ExportMemoryAllocateInfo ( @@ -57,5 +58,18 @@ public ExportMemoryAllocateInfo [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportMemoryAllocateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfoKHR.gen.cs index 846acfd3fd..dee5f82944 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportMemoryAllocateInfoKHR")] - public unsafe partial struct ExportMemoryAllocateInfoKHR + [NativeName("AliasOf", "VkExportMemoryAllocateInfo")] + public unsafe partial struct ExportMemoryAllocateInfoKHR : IExtendsChain { public ExportMemoryAllocateInfoKHR ( @@ -57,5 +58,18 @@ public ExportMemoryAllocateInfoKHR [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportMemoryAllocateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfoNV.gen.cs index 742af2b449..ad1f737d35 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportMemoryAllocateInfoNV")] - public unsafe partial struct ExportMemoryAllocateInfoNV + public unsafe partial struct ExportMemoryAllocateInfoNV : IExtendsChain { public ExportMemoryAllocateInfoNV ( @@ -57,5 +57,18 @@ public ExportMemoryAllocateInfoNV [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagsNV")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlagsNV HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportMemoryAllocateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryWin32HandleInfoKHR.gen.cs index 4fb153ddc3..056ad8f3c3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryWin32HandleInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryWin32HandleInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportMemoryWin32HandleInfoKHR")] - public unsafe partial struct ExportMemoryWin32HandleInfoKHR + public unsafe partial struct ExportMemoryWin32HandleInfoKHR : IExtendsChain { public ExportMemoryWin32HandleInfoKHR ( @@ -79,5 +79,18 @@ public ExportMemoryWin32HandleInfoKHR [NativeName("Type.Name", "LPCWSTR")] [NativeName("Name", "name")] public nint Name; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportMemoryWin32HandleInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryWin32HandleInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryWin32HandleInfoNV.gen.cs index e9db8326b1..d4e63c5daf 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryWin32HandleInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryWin32HandleInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportMemoryWin32HandleInfoNV")] - public unsafe partial struct ExportMemoryWin32HandleInfoNV + public unsafe partial struct ExportMemoryWin32HandleInfoNV : IExtendsChain { public ExportMemoryWin32HandleInfoNV ( @@ -68,5 +68,18 @@ public ExportMemoryWin32HandleInfoNV [NativeName("Type.Name", "DWORD")] [NativeName("Name", "dwAccess")] public int DwAccess; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportMemoryWin32HandleInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfo.gen.cs index d7300de420..d58a3cf6c5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportSemaphoreCreateInfo")] - public unsafe partial struct ExportSemaphoreCreateInfo + [NativeName("Aliases", "VkExportSemaphoreCreateInfoKHR")] + public unsafe partial struct ExportSemaphoreCreateInfo : IExtendsChain { public ExportSemaphoreCreateInfo ( @@ -57,5 +58,18 @@ public ExportSemaphoreCreateInfo [NativeName("Type.Name", "VkExternalSemaphoreHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalSemaphoreHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportSemaphoreCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfoKHR.gen.cs index 5d7a958bdf..76bcc960c3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportSemaphoreCreateInfoKHR")] - public unsafe partial struct ExportSemaphoreCreateInfoKHR + [NativeName("AliasOf", "VkExportSemaphoreCreateInfo")] + public unsafe partial struct ExportSemaphoreCreateInfoKHR : IExtendsChain { public ExportSemaphoreCreateInfoKHR ( @@ -57,5 +58,18 @@ public ExportSemaphoreCreateInfoKHR [NativeName("Type.Name", "VkExternalSemaphoreHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalSemaphoreHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportSemaphoreCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreWin32HandleInfoKHR.gen.cs index 1d22e118b3..b8760d74bf 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreWin32HandleInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreWin32HandleInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportSemaphoreWin32HandleInfoKHR")] - public unsafe partial struct ExportSemaphoreWin32HandleInfoKHR + public unsafe partial struct ExportSemaphoreWin32HandleInfoKHR : IExtendsChain { public ExportSemaphoreWin32HandleInfoKHR ( @@ -79,5 +79,18 @@ public ExportSemaphoreWin32HandleInfoKHR [NativeName("Type.Name", "LPCWSTR")] [NativeName("Name", "name")] public nint Name; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportSemaphoreWin32HandleInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferProperties.gen.cs index 08f408a93b..b783fd727e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferProperties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalBufferProperties")] - public unsafe partial struct ExternalBufferProperties + [NativeName("Aliases", "VkExternalBufferPropertiesKHR")] + public unsafe partial struct ExternalBufferProperties : IChainable { public ExternalBufferProperties ( @@ -57,5 +58,18 @@ public ExternalBufferProperties [NativeName("Type.Name", "VkExternalMemoryProperties")] [NativeName("Name", "externalMemoryProperties")] public ExternalMemoryProperties ExternalMemoryProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalBufferProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferPropertiesKHR.gen.cs index 6f2bc53f27..823296ebf9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferPropertiesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalBufferPropertiesKHR")] - public unsafe partial struct ExternalBufferPropertiesKHR + [NativeName("AliasOf", "VkExternalBufferProperties")] + public unsafe partial struct ExternalBufferPropertiesKHR : IChainable { public ExternalBufferPropertiesKHR ( @@ -57,5 +58,18 @@ public ExternalBufferPropertiesKHR [NativeName("Type.Name", "VkExternalMemoryProperties")] [NativeName("Name", "externalMemoryProperties")] public ExternalMemoryProperties ExternalMemoryProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalBufferProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFenceProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFenceProperties.gen.cs index 30630ea319..e21e048474 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFenceProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFenceProperties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalFenceProperties")] - public unsafe partial struct ExternalFenceProperties + [NativeName("Aliases", "VkExternalFencePropertiesKHR")] + public unsafe partial struct ExternalFenceProperties : IChainable { public ExternalFenceProperties ( @@ -79,5 +80,18 @@ public ExternalFenceProperties [NativeName("Type.Name", "VkExternalFenceFeatureFlags")] [NativeName("Name", "externalFenceFeatures")] public ExternalFenceFeatureFlags ExternalFenceFeatures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalFenceProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFencePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFencePropertiesKHR.gen.cs index a280f62c33..9e0e2871f9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFencePropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFencePropertiesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalFencePropertiesKHR")] - public unsafe partial struct ExternalFencePropertiesKHR + [NativeName("AliasOf", "VkExternalFenceProperties")] + public unsafe partial struct ExternalFencePropertiesKHR : IChainable { public ExternalFencePropertiesKHR ( @@ -79,5 +80,18 @@ public ExternalFencePropertiesKHR [NativeName("Type.Name", "VkExternalFenceFeatureFlags")] [NativeName("Name", "externalFenceFeatures")] public ExternalFenceFeatureFlags ExternalFenceFeatures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalFenceProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFormatANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFormatANDROID.gen.cs index 6d9233b1ce..cfddebbe55 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFormatANDROID.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFormatANDROID.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalFormatANDROID")] - public unsafe partial struct ExternalFormatANDROID + public unsafe partial struct ExternalFormatANDROID : IExtendsChain, IExtendsChain, IExtendsChain { public ExternalFormatANDROID ( @@ -57,5 +57,18 @@ public ExternalFormatANDROID [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "externalFormat")] public ulong ExternalFormat; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalFormatAndroid; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatProperties.gen.cs index f233be1e4e..6c10791396 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatProperties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalImageFormatProperties")] - public unsafe partial struct ExternalImageFormatProperties + [NativeName("Aliases", "VkExternalImageFormatPropertiesKHR")] + public unsafe partial struct ExternalImageFormatProperties : IExtendsChain, IExtendsChain { public ExternalImageFormatProperties ( @@ -57,5 +58,18 @@ public ExternalImageFormatProperties [NativeName("Type.Name", "VkExternalMemoryProperties")] [NativeName("Name", "externalMemoryProperties")] public ExternalMemoryProperties ExternalMemoryProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalImageFormatProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatPropertiesKHR.gen.cs index 2251f6e608..578443c455 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatPropertiesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalImageFormatPropertiesKHR")] - public unsafe partial struct ExternalImageFormatPropertiesKHR + [NativeName("AliasOf", "VkExternalImageFormatProperties")] + public unsafe partial struct ExternalImageFormatPropertiesKHR : IExtendsChain, IExtendsChain { public ExternalImageFormatPropertiesKHR ( @@ -57,5 +58,18 @@ public ExternalImageFormatPropertiesKHR [NativeName("Type.Name", "VkExternalMemoryProperties")] [NativeName("Name", "externalMemoryProperties")] public ExternalMemoryProperties ExternalMemoryProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalImageFormatProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfo.gen.cs index 28dc10a543..46e3707306 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalMemoryBufferCreateInfo")] - public unsafe partial struct ExternalMemoryBufferCreateInfo + [NativeName("Aliases", "VkExternalMemoryBufferCreateInfoKHR")] + public unsafe partial struct ExternalMemoryBufferCreateInfo : IExtendsChain { public ExternalMemoryBufferCreateInfo ( @@ -57,5 +58,18 @@ public ExternalMemoryBufferCreateInfo [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalMemoryBufferCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfoKHR.gen.cs index f34751f1cd..ee4d22610b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalMemoryBufferCreateInfoKHR")] - public unsafe partial struct ExternalMemoryBufferCreateInfoKHR + [NativeName("AliasOf", "VkExternalMemoryBufferCreateInfo")] + public unsafe partial struct ExternalMemoryBufferCreateInfoKHR : IExtendsChain { public ExternalMemoryBufferCreateInfoKHR ( @@ -57,5 +58,18 @@ public ExternalMemoryBufferCreateInfoKHR [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalMemoryBufferCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfo.gen.cs index fccbcd9be8..2422ddca20 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalMemoryImageCreateInfo")] - public unsafe partial struct ExternalMemoryImageCreateInfo + [NativeName("Aliases", "VkExternalMemoryImageCreateInfoKHR")] + public unsafe partial struct ExternalMemoryImageCreateInfo : IExtendsChain { public ExternalMemoryImageCreateInfo ( @@ -57,5 +58,18 @@ public ExternalMemoryImageCreateInfo [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalMemoryImageCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfoKHR.gen.cs index a1ada3398f..f765d45758 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalMemoryImageCreateInfoKHR")] - public unsafe partial struct ExternalMemoryImageCreateInfoKHR + [NativeName("AliasOf", "VkExternalMemoryImageCreateInfo")] + public unsafe partial struct ExternalMemoryImageCreateInfoKHR : IExtendsChain { public ExternalMemoryImageCreateInfoKHR ( @@ -57,5 +58,18 @@ public ExternalMemoryImageCreateInfoKHR [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalMemoryImageCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfoNV.gen.cs index dc0830aaca..fa97179aab 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalMemoryImageCreateInfoNV")] - public unsafe partial struct ExternalMemoryImageCreateInfoNV + public unsafe partial struct ExternalMemoryImageCreateInfoNV : IExtendsChain { public ExternalMemoryImageCreateInfoNV ( @@ -57,5 +57,18 @@ public ExternalMemoryImageCreateInfoNV [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagsNV")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlagsNV HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalMemoryImageCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryProperties.gen.cs index a72837efcc..8f62cb1b5a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryProperties.gen.cs @@ -17,6 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalMemoryProperties")] + [NativeName("Aliases", "VkExternalMemoryPropertiesKHR")] public unsafe partial struct ExternalMemoryProperties { public ExternalMemoryProperties diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryPropertiesKHR.gen.cs index 72d4dbec90..1a2d0f7e20 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryPropertiesKHR.gen.cs @@ -17,6 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalMemoryPropertiesKHR")] + [NativeName("AliasOf", "VkExternalMemoryProperties")] public unsafe partial struct ExternalMemoryPropertiesKHR { public ExternalMemoryPropertiesKHR diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphoreProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphoreProperties.gen.cs index 16c4b27c17..05d9a82b3b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphoreProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphoreProperties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalSemaphoreProperties")] - public unsafe partial struct ExternalSemaphoreProperties + [NativeName("Aliases", "VkExternalSemaphorePropertiesKHR")] + public unsafe partial struct ExternalSemaphoreProperties : IChainable { public ExternalSemaphoreProperties ( @@ -79,5 +80,18 @@ public ExternalSemaphoreProperties [NativeName("Type.Name", "VkExternalSemaphoreFeatureFlags")] [NativeName("Name", "externalSemaphoreFeatures")] public ExternalSemaphoreFeatureFlags ExternalSemaphoreFeatures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalSemaphoreProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphorePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphorePropertiesKHR.gen.cs index 07dbbc3b88..cd085a57de 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphorePropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphorePropertiesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalSemaphorePropertiesKHR")] - public unsafe partial struct ExternalSemaphorePropertiesKHR + [NativeName("AliasOf", "VkExternalSemaphoreProperties")] + public unsafe partial struct ExternalSemaphorePropertiesKHR : IChainable { public ExternalSemaphorePropertiesKHR ( @@ -79,5 +80,18 @@ public ExternalSemaphorePropertiesKHR [NativeName("Type.Name", "VkExternalSemaphoreFeatureFlags")] [NativeName("Name", "externalSemaphoreFeatures")] public ExternalSemaphoreFeatureFlags ExternalSemaphoreFeatures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalSemaphoreProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FenceCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FenceCreateInfo.gen.cs index 653706b63e..51b361f40b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FenceCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FenceCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFenceCreateInfo")] - public unsafe partial struct FenceCreateInfo + public unsafe partial struct FenceCreateInfo : IChainStart { public FenceCreateInfo ( @@ -57,5 +57,30 @@ public FenceCreateInfo [NativeName("Type.Name", "VkFenceCreateFlags")] [NativeName("Name", "flags")] public FenceCreateFlags Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FenceCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref FenceCreateInfo Chain( + out FenceCreateInfo capture) + { + capture = new FenceCreateInfo(StructureType.FenceCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FenceGetFdInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FenceGetFdInfoKHR.gen.cs index 124d64ccce..c4f6e74534 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FenceGetFdInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FenceGetFdInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFenceGetFdInfoKHR")] - public unsafe partial struct FenceGetFdInfoKHR + public unsafe partial struct FenceGetFdInfoKHR : IChainable { public FenceGetFdInfoKHR ( @@ -68,5 +68,18 @@ public FenceGetFdInfoKHR [NativeName("Type.Name", "VkExternalFenceHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalFenceHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FenceGetFDInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FenceGetWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FenceGetWin32HandleInfoKHR.gen.cs index a3588a684e..e4e3f81288 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FenceGetWin32HandleInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FenceGetWin32HandleInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFenceGetWin32HandleInfoKHR")] - public unsafe partial struct FenceGetWin32HandleInfoKHR + public unsafe partial struct FenceGetWin32HandleInfoKHR : IChainable { public FenceGetWin32HandleInfoKHR ( @@ -68,5 +68,18 @@ public FenceGetWin32HandleInfoKHR [NativeName("Type.Name", "VkExternalFenceHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalFenceHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FenceGetWin32HandleInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FilterCubicImageViewImageFormatPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FilterCubicImageViewImageFormatPropertiesEXT.gen.cs index 4c8b3e54c1..64d4e20795 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FilterCubicImageViewImageFormatPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FilterCubicImageViewImageFormatPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFilterCubicImageViewImageFormatPropertiesEXT")] - public unsafe partial struct FilterCubicImageViewImageFormatPropertiesEXT + public unsafe partial struct FilterCubicImageViewImageFormatPropertiesEXT : IExtendsChain, IExtendsChain { public FilterCubicImageViewImageFormatPropertiesEXT ( @@ -68,5 +68,18 @@ public FilterCubicImageViewImageFormatPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "filterCubicMinmax")] public Bool32 FilterCubicMinmax; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FilterCubicImageViewImageFormatPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2.gen.cs index 36eb41121e..0eb337dc04 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFormatProperties2")] - public unsafe partial struct FormatProperties2 + [NativeName("Aliases", "VkFormatProperties2KHR")] + public unsafe partial struct FormatProperties2 : IChainStart { public FormatProperties2 ( @@ -57,5 +58,30 @@ public FormatProperties2 [NativeName("Type.Name", "VkFormatProperties")] [NativeName("Name", "formatProperties")] public FormatProperties FormatProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FormatProperties2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref FormatProperties2 Chain( + out FormatProperties2 capture) + { + capture = new FormatProperties2(StructureType.FormatProperties2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2KHR.gen.cs index 91b942a809..43f83a79af 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFormatProperties2KHR")] - public unsafe partial struct FormatProperties2KHR + [NativeName("AliasOf", "VkFormatProperties2")] + public unsafe partial struct FormatProperties2KHR : IChainStart { public FormatProperties2KHR ( @@ -57,5 +58,30 @@ public FormatProperties2KHR [NativeName("Type.Name", "VkFormatProperties")] [NativeName("Name", "formatProperties")] public FormatProperties FormatProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FormatProperties2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref FormatProperties2KHR Chain( + out FormatProperties2KHR capture) + { + capture = new FormatProperties2KHR(StructureType.FormatProperties2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties3KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties3KHR.gen.cs index 5a14cb6f36..6aac48790a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties3KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties3KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFormatProperties3KHR")] - public unsafe partial struct FormatProperties3KHR + public unsafe partial struct FormatProperties3KHR : IExtendsChain, IExtendsChain { public FormatProperties3KHR ( @@ -79,5 +79,18 @@ public FormatProperties3KHR [NativeName("Type.Name", "VkFormatFeatureFlags2KHR")] [NativeName("Name", "bufferFeatures")] public FormatFeatureFlags2KHR BufferFeatures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FormatProperties3Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FragmentShadingRateAttachmentInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FragmentShadingRateAttachmentInfoKHR.gen.cs index 9079fddc00..4a84f75d6f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FragmentShadingRateAttachmentInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FragmentShadingRateAttachmentInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFragmentShadingRateAttachmentInfoKHR")] - public unsafe partial struct FragmentShadingRateAttachmentInfoKHR + public unsafe partial struct FragmentShadingRateAttachmentInfoKHR : IExtendsChain, IExtendsChain { public FragmentShadingRateAttachmentInfoKHR ( @@ -68,5 +68,18 @@ public FragmentShadingRateAttachmentInfoKHR [NativeName("Type.Name", "VkExtent2D")] [NativeName("Name", "shadingRateAttachmentTexelSize")] public Extent2D ShadingRateAttachmentTexelSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FragmentShadingRateAttachmentInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfo.gen.cs index e4335223e8..74e5b0b42a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFramebufferAttachmentImageInfo")] - public unsafe partial struct FramebufferAttachmentImageInfo + [NativeName("Aliases", "VkFramebufferAttachmentImageInfoKHR")] + public unsafe partial struct FramebufferAttachmentImageInfo : IChainable { public FramebufferAttachmentImageInfo ( @@ -123,5 +124,18 @@ public FramebufferAttachmentImageInfo [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "pViewFormats")] public Format* PViewFormats; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FramebufferAttachmentImageInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfoKHR.gen.cs index b6e72f3133..76ddaca27a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFramebufferAttachmentImageInfoKHR")] - public unsafe partial struct FramebufferAttachmentImageInfoKHR + [NativeName("AliasOf", "VkFramebufferAttachmentImageInfo")] + public unsafe partial struct FramebufferAttachmentImageInfoKHR : IChainable { public FramebufferAttachmentImageInfoKHR ( @@ -123,5 +124,18 @@ public FramebufferAttachmentImageInfoKHR [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "pViewFormats")] public Format* PViewFormats; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FramebufferAttachmentImageInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfo.gen.cs index 8ee80a493c..4fd7c1c1fc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFramebufferAttachmentsCreateInfo")] - public unsafe partial struct FramebufferAttachmentsCreateInfo + [NativeName("Aliases", "VkFramebufferAttachmentsCreateInfoKHR")] + public unsafe partial struct FramebufferAttachmentsCreateInfo : IExtendsChain { public FramebufferAttachmentsCreateInfo ( @@ -68,5 +69,18 @@ public FramebufferAttachmentsCreateInfo [NativeName("Type.Name", "VkFramebufferAttachmentImageInfo")] [NativeName("Name", "pAttachmentImageInfos")] public FramebufferAttachmentImageInfo* PAttachmentImageInfos; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FramebufferAttachmentsCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfoKHR.gen.cs index d563fe274e..f34695bfc3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFramebufferAttachmentsCreateInfoKHR")] - public unsafe partial struct FramebufferAttachmentsCreateInfoKHR + [NativeName("AliasOf", "VkFramebufferAttachmentsCreateInfo")] + public unsafe partial struct FramebufferAttachmentsCreateInfoKHR : IExtendsChain { public FramebufferAttachmentsCreateInfoKHR ( @@ -68,5 +69,18 @@ public FramebufferAttachmentsCreateInfoKHR [NativeName("Type.Name", "VkFramebufferAttachmentImageInfo")] [NativeName("Name", "pAttachmentImageInfos")] public FramebufferAttachmentImageInfo* PAttachmentImageInfos; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FramebufferAttachmentsCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferCreateInfo.gen.cs index 35fc19220b..68403aaf16 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFramebufferCreateInfo")] - public unsafe partial struct FramebufferCreateInfo + public unsafe partial struct FramebufferCreateInfo : IChainStart { public FramebufferCreateInfo ( @@ -123,5 +123,30 @@ public FramebufferCreateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "layers")] public uint Layers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FramebufferCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref FramebufferCreateInfo Chain( + out FramebufferCreateInfo capture) + { + capture = new FramebufferCreateInfo(StructureType.FramebufferCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferMixedSamplesCombinationNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferMixedSamplesCombinationNV.gen.cs index c8a9bce4da..a1ee71500b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferMixedSamplesCombinationNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferMixedSamplesCombinationNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFramebufferMixedSamplesCombinationNV")] - public unsafe partial struct FramebufferMixedSamplesCombinationNV + public unsafe partial struct FramebufferMixedSamplesCombinationNV : IChainable { public FramebufferMixedSamplesCombinationNV ( @@ -90,5 +90,18 @@ public FramebufferMixedSamplesCombinationNV [NativeName("Type.Name", "VkSampleCountFlags")] [NativeName("Name", "colorSamples")] public SampleCountFlags ColorSamples; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FramebufferMixedSamplesCombinationNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GeneratedCommandsInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GeneratedCommandsInfoNV.gen.cs index 3bfc6296c8..112593fdc2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/GeneratedCommandsInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/GeneratedCommandsInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkGeneratedCommandsInfoNV")] - public unsafe partial struct GeneratedCommandsInfoNV + public unsafe partial struct GeneratedCommandsInfoNV : IChainable { public GeneratedCommandsInfoNV ( @@ -189,5 +189,18 @@ public GeneratedCommandsInfoNV [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "sequencesIndexOffset")] public ulong SequencesIndexOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GeneratedCommandsInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GeneratedCommandsMemoryRequirementsInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GeneratedCommandsMemoryRequirementsInfoNV.gen.cs index 08407c19c7..9b8d9bddc6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/GeneratedCommandsMemoryRequirementsInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/GeneratedCommandsMemoryRequirementsInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkGeneratedCommandsMemoryRequirementsInfoNV")] - public unsafe partial struct GeneratedCommandsMemoryRequirementsInfoNV + public unsafe partial struct GeneratedCommandsMemoryRequirementsInfoNV : IChainable { public GeneratedCommandsMemoryRequirementsInfoNV ( @@ -90,5 +90,18 @@ public GeneratedCommandsMemoryRequirementsInfoNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxSequencesCount")] public uint MaxSequencesCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GeneratedCommandsMemoryRequirementsInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryAABBNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryAABBNV.gen.cs index 4a83af145b..f5eacdda19 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryAABBNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryAABBNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkGeometryAABBNV")] - public unsafe partial struct GeometryAABBNV + public unsafe partial struct GeometryAABBNV : IChainable { public GeometryAABBNV ( @@ -90,5 +90,18 @@ public GeometryAABBNV [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "offset")] public ulong Offset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GeometryAabbNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryNV.gen.cs index 1f6889102f..25ada0431e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkGeometryNV")] - public unsafe partial struct GeometryNV + public unsafe partial struct GeometryNV : IChainable { public GeometryNV ( @@ -79,5 +79,18 @@ public GeometryNV [NativeName("Type.Name", "VkGeometryFlagsKHR")] [NativeName("Name", "flags")] public GeometryFlagsKHR Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GeometryNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryTrianglesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryTrianglesNV.gen.cs index d59d5a56c3..12c885d654 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryTrianglesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryTrianglesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkGeometryTrianglesNV")] - public unsafe partial struct GeometryTrianglesNV + public unsafe partial struct GeometryTrianglesNV : IChainable { public GeometryTrianglesNV ( @@ -167,5 +167,18 @@ public GeometryTrianglesNV [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "transformOffset")] public ulong TransformOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GeometryTrianglesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsPipelineCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsPipelineCreateInfo.gen.cs index f97a24a86f..ceb21ebd03 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsPipelineCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsPipelineCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkGraphicsPipelineCreateInfo")] - public unsafe partial struct GraphicsPipelineCreateInfo + public unsafe partial struct GraphicsPipelineCreateInfo : IChainStart { public GraphicsPipelineCreateInfo ( @@ -233,5 +233,30 @@ public GraphicsPipelineCreateInfo [NativeName("Type.Name", "int32_t")] [NativeName("Name", "basePipelineIndex")] public int BasePipelineIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GraphicsPipelineCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref GraphicsPipelineCreateInfo Chain( + out GraphicsPipelineCreateInfo capture) + { + capture = new GraphicsPipelineCreateInfo(StructureType.GraphicsPipelineCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsPipelineShaderGroupsCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsPipelineShaderGroupsCreateInfoNV.gen.cs index 1348ade6f5..6a3d761091 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsPipelineShaderGroupsCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsPipelineShaderGroupsCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkGraphicsPipelineShaderGroupsCreateInfoNV")] - public unsafe partial struct GraphicsPipelineShaderGroupsCreateInfoNV + public unsafe partial struct GraphicsPipelineShaderGroupsCreateInfoNV : IExtendsChain { public GraphicsPipelineShaderGroupsCreateInfoNV ( @@ -90,5 +90,18 @@ public GraphicsPipelineShaderGroupsCreateInfoNV [NativeName("Type.Name", "VkPipeline")] [NativeName("Name", "pPipelines")] public Pipeline* PPipelines; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GraphicsPipelineShaderGroupsCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsShaderGroupCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsShaderGroupCreateInfoNV.gen.cs index c7d6b26c87..2e17280866 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsShaderGroupCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsShaderGroupCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkGraphicsShaderGroupCreateInfoNV")] - public unsafe partial struct GraphicsShaderGroupCreateInfoNV + public unsafe partial struct GraphicsShaderGroupCreateInfoNV : IChainable { public GraphicsShaderGroupCreateInfoNV ( @@ -90,5 +90,18 @@ public GraphicsShaderGroupCreateInfoNV [NativeName("Type.Name", "VkPipelineTessellationStateCreateInfo")] [NativeName("Name", "pTessellationState")] public PipelineTessellationStateCreateInfo* PTessellationState; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GraphicsShaderGroupCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/HdrMetadataEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/HdrMetadataEXT.gen.cs index bb02d2673d..a0ad5234d5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/HdrMetadataEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/HdrMetadataEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkHdrMetadataEXT")] - public unsafe partial struct HdrMetadataEXT + public unsafe partial struct HdrMetadataEXT : IChainable { public HdrMetadataEXT ( @@ -134,5 +134,18 @@ public HdrMetadataEXT [NativeName("Type.Name", "float")] [NativeName("Name", "maxFrameAverageLightLevel")] public float MaxFrameAverageLightLevel; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.HdrMetadataExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/HeadlessSurfaceCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/HeadlessSurfaceCreateInfoEXT.gen.cs index 7f571ad7ce..9e61728e3e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/HeadlessSurfaceCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/HeadlessSurfaceCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkHeadlessSurfaceCreateInfoEXT")] - public unsafe partial struct HeadlessSurfaceCreateInfoEXT + public unsafe partial struct HeadlessSurfaceCreateInfoEXT : IChainable { public HeadlessSurfaceCreateInfoEXT ( @@ -57,5 +57,18 @@ public HeadlessSurfaceCreateInfoEXT [NativeName("Type.Name", "VkHeadlessSurfaceCreateFlagsEXT")] [NativeName("Name", "flags")] public uint Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.HeadlessSurfaceCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/IOSSurfaceCreateInfoMVK.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/IOSSurfaceCreateInfoMVK.gen.cs index c50183591e..e8ac6adfe1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/IOSSurfaceCreateInfoMVK.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/IOSSurfaceCreateInfoMVK.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkIOSSurfaceCreateInfoMVK")] - public unsafe partial struct IOSSurfaceCreateInfoMVK + public unsafe partial struct IOSSurfaceCreateInfoMVK : IChainable { public IOSSurfaceCreateInfoMVK ( @@ -68,5 +68,18 @@ public IOSSurfaceCreateInfoMVK [NativeName("Type.Name", "void")] [NativeName("Name", "pView")] public void* PView; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.IosSurfaceCreateInfoMvk; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageBlit2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageBlit2KHR.gen.cs index 8de70ae9ba..4a3fb8b0c5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageBlit2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageBlit2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageBlit2KHR")] - public unsafe partial struct ImageBlit2KHR + public unsafe partial struct ImageBlit2KHR : IChainStart { public ImageBlit2KHR ( @@ -132,5 +132,30 @@ public Span AsSpan() #endif } + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageBlit2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref ImageBlit2KHR Chain( + out ImageBlit2KHR capture) + { + capture = new ImageBlit2KHR(StructureType.ImageBlit2Khr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageConstraintsInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageConstraintsInfoFUCHSIA.gen.cs index cf485ba457..293f40a1e4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageConstraintsInfoFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageConstraintsInfoFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageConstraintsInfoFUCHSIA")] - public unsafe partial struct ImageConstraintsInfoFUCHSIA + public unsafe partial struct ImageConstraintsInfoFUCHSIA : IChainable { public ImageConstraintsInfoFUCHSIA ( @@ -90,5 +90,18 @@ public ImageConstraintsInfoFUCHSIA [NativeName("Type.Name", "VkImageConstraintsInfoFlagsFUCHSIA")] [NativeName("Name", "flags")] public ImageConstraintsInfoFlagsFUCHSIA Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageConstraintsInfoFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageCopy2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageCopy2KHR.gen.cs index f27e5660d3..7c5757d644 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageCopy2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageCopy2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageCopy2KHR")] - public unsafe partial struct ImageCopy2KHR + public unsafe partial struct ImageCopy2KHR : IChainable { public ImageCopy2KHR ( @@ -101,5 +101,18 @@ public ImageCopy2KHR [NativeName("Type.Name", "VkExtent3D")] [NativeName("Name", "extent")] public Extent3D Extent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageCopy2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageCreateInfo.gen.cs index ba75174473..fc429b3d7f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageCreateInfo")] - public unsafe partial struct ImageCreateInfo + public unsafe partial struct ImageCreateInfo : IChainStart { public ImageCreateInfo ( @@ -189,5 +189,30 @@ public ImageCreateInfo [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "initialLayout")] public ImageLayout InitialLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref ImageCreateInfo Chain( + out ImageCreateInfo capture) + { + capture = new ImageCreateInfo(StructureType.ImageCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierExplicitCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierExplicitCreateInfoEXT.gen.cs index 5db9477040..f22e03e0fd 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierExplicitCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierExplicitCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageDrmFormatModifierExplicitCreateInfoEXT")] - public unsafe partial struct ImageDrmFormatModifierExplicitCreateInfoEXT + public unsafe partial struct ImageDrmFormatModifierExplicitCreateInfoEXT : IExtendsChain { public ImageDrmFormatModifierExplicitCreateInfoEXT ( @@ -79,5 +79,18 @@ public ImageDrmFormatModifierExplicitCreateInfoEXT [NativeName("Type.Name", "VkSubresourceLayout")] [NativeName("Name", "pPlaneLayouts")] public SubresourceLayout* PPlaneLayouts; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageDrmFormatModifierExplicitCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierListCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierListCreateInfoEXT.gen.cs index de075b7665..cc6cc6b50d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierListCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierListCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageDrmFormatModifierListCreateInfoEXT")] - public unsafe partial struct ImageDrmFormatModifierListCreateInfoEXT + public unsafe partial struct ImageDrmFormatModifierListCreateInfoEXT : IExtendsChain { public ImageDrmFormatModifierListCreateInfoEXT ( @@ -68,5 +68,18 @@ public ImageDrmFormatModifierListCreateInfoEXT [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pDrmFormatModifiers")] public ulong* PDrmFormatModifiers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageDrmFormatModifierListCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierPropertiesEXT.gen.cs index 80b459b479..0e3af5ce1e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageDrmFormatModifierPropertiesEXT")] - public unsafe partial struct ImageDrmFormatModifierPropertiesEXT + public unsafe partial struct ImageDrmFormatModifierPropertiesEXT : IChainable { public ImageDrmFormatModifierPropertiesEXT ( @@ -57,5 +57,18 @@ public ImageDrmFormatModifierPropertiesEXT [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "drmFormatModifier")] public ulong DrmFormatModifier; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageDrmFormatModifierPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatConstraintsInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatConstraintsInfoFUCHSIA.gen.cs index 331fe6e664..ad52981c50 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatConstraintsInfoFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatConstraintsInfoFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageFormatConstraintsInfoFUCHSIA")] - public unsafe partial struct ImageFormatConstraintsInfoFUCHSIA + public unsafe partial struct ImageFormatConstraintsInfoFUCHSIA : IChainable { public ImageFormatConstraintsInfoFUCHSIA ( @@ -112,5 +112,18 @@ public ImageFormatConstraintsInfoFUCHSIA [NativeName("Type.Name", "VkSysmemColorSpaceFUCHSIA")] [NativeName("Name", "pColorSpaces")] public SysmemColorSpaceFUCHSIA* PColorSpaces; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageFormatConstraintsInfoFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfo.gen.cs index e78df4a6aa..304c1e1ae4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageFormatListCreateInfo")] - public unsafe partial struct ImageFormatListCreateInfo + [NativeName("Aliases", "VkImageFormatListCreateInfoKHR")] + public unsafe partial struct ImageFormatListCreateInfo : IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain { public ImageFormatListCreateInfo ( @@ -68,5 +69,18 @@ public ImageFormatListCreateInfo [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "pViewFormats")] public Format* PViewFormats; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageFormatListCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfoKHR.gen.cs index 33d4830815..e86e57070c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageFormatListCreateInfoKHR")] - public unsafe partial struct ImageFormatListCreateInfoKHR + [NativeName("AliasOf", "VkImageFormatListCreateInfo")] + public unsafe partial struct ImageFormatListCreateInfoKHR : IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain { public ImageFormatListCreateInfoKHR ( @@ -68,5 +69,18 @@ public ImageFormatListCreateInfoKHR [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "pViewFormats")] public Format* PViewFormats; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageFormatListCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2.gen.cs index f8cc35c162..bdc52a598e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageFormatProperties2")] - public unsafe partial struct ImageFormatProperties2 + [NativeName("Aliases", "VkImageFormatProperties2KHR")] + public unsafe partial struct ImageFormatProperties2 : IChainStart { public ImageFormatProperties2 ( @@ -57,5 +58,30 @@ public ImageFormatProperties2 [NativeName("Type.Name", "VkImageFormatProperties")] [NativeName("Name", "imageFormatProperties")] public ImageFormatProperties ImageFormatProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageFormatProperties2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref ImageFormatProperties2 Chain( + out ImageFormatProperties2 capture) + { + capture = new ImageFormatProperties2(StructureType.ImageFormatProperties2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2KHR.gen.cs index 3e1f61fb22..83b3fe71c3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageFormatProperties2KHR")] - public unsafe partial struct ImageFormatProperties2KHR + [NativeName("AliasOf", "VkImageFormatProperties2")] + public unsafe partial struct ImageFormatProperties2KHR : IChainStart { public ImageFormatProperties2KHR ( @@ -57,5 +58,30 @@ public ImageFormatProperties2KHR [NativeName("Type.Name", "VkImageFormatProperties")] [NativeName("Name", "imageFormatProperties")] public ImageFormatProperties ImageFormatProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageFormatProperties2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref ImageFormatProperties2KHR Chain( + out ImageFormatProperties2KHR capture) + { + capture = new ImageFormatProperties2KHR(StructureType.ImageFormatProperties2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryBarrier.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryBarrier.gen.cs index 474748752e..817aecab51 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryBarrier.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryBarrier.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageMemoryBarrier")] - public unsafe partial struct ImageMemoryBarrier + public unsafe partial struct ImageMemoryBarrier : IChainStart { public ImageMemoryBarrier ( @@ -134,5 +134,30 @@ public ImageMemoryBarrier [NativeName("Type.Name", "VkImageSubresourceRange")] [NativeName("Name", "subresourceRange")] public ImageSubresourceRange SubresourceRange; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageMemoryBarrier; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref ImageMemoryBarrier Chain( + out ImageMemoryBarrier capture) + { + capture = new ImageMemoryBarrier(StructureType.ImageMemoryBarrier); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryBarrier2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryBarrier2KHR.gen.cs index aa9a8b6a64..89ea69654a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryBarrier2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryBarrier2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageMemoryBarrier2KHR")] - public unsafe partial struct ImageMemoryBarrier2KHR + public unsafe partial struct ImageMemoryBarrier2KHR : IChainStart { public ImageMemoryBarrier2KHR ( @@ -156,5 +156,30 @@ public ImageMemoryBarrier2KHR [NativeName("Type.Name", "VkImageSubresourceRange")] [NativeName("Name", "subresourceRange")] public ImageSubresourceRange SubresourceRange; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageMemoryBarrier2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref ImageMemoryBarrier2KHR Chain( + out ImageMemoryBarrier2KHR capture) + { + capture = new ImageMemoryBarrier2KHR(StructureType.ImageMemoryBarrier2Khr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2.gen.cs index 19fa8973a5..0c9698fe8d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageMemoryRequirementsInfo2")] - public unsafe partial struct ImageMemoryRequirementsInfo2 + [NativeName("Aliases", "VkImageMemoryRequirementsInfo2KHR")] + public unsafe partial struct ImageMemoryRequirementsInfo2 : IChainStart { public ImageMemoryRequirementsInfo2 ( @@ -57,5 +58,30 @@ public ImageMemoryRequirementsInfo2 [NativeName("Type.Name", "VkImage")] [NativeName("Name", "image")] public Image Image; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageMemoryRequirementsInfo2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref ImageMemoryRequirementsInfo2 Chain( + out ImageMemoryRequirementsInfo2 capture) + { + capture = new ImageMemoryRequirementsInfo2(StructureType.ImageMemoryRequirementsInfo2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2KHR.gen.cs index 2fcb389b2b..73e696010c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageMemoryRequirementsInfo2KHR")] - public unsafe partial struct ImageMemoryRequirementsInfo2KHR + [NativeName("AliasOf", "VkImageMemoryRequirementsInfo2")] + public unsafe partial struct ImageMemoryRequirementsInfo2KHR : IChainStart { public ImageMemoryRequirementsInfo2KHR ( @@ -57,5 +58,30 @@ public ImageMemoryRequirementsInfo2KHR [NativeName("Type.Name", "VkImage")] [NativeName("Name", "image")] public Image Image; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageMemoryRequirementsInfo2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref ImageMemoryRequirementsInfo2KHR Chain( + out ImageMemoryRequirementsInfo2KHR capture) + { + capture = new ImageMemoryRequirementsInfo2KHR(StructureType.ImageMemoryRequirementsInfo2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePipeSurfaceCreateInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePipeSurfaceCreateInfoFUCHSIA.gen.cs index f1bf048ab9..8b5e26153b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePipeSurfaceCreateInfoFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePipeSurfaceCreateInfoFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImagePipeSurfaceCreateInfoFUCHSIA")] - public unsafe partial struct ImagePipeSurfaceCreateInfoFUCHSIA + public unsafe partial struct ImagePipeSurfaceCreateInfoFUCHSIA : IChainable { public ImagePipeSurfaceCreateInfoFUCHSIA ( @@ -68,5 +68,18 @@ public ImagePipeSurfaceCreateInfoFUCHSIA [NativeName("Type.Name", "zx_handle_t")] [NativeName("Name", "imagePipeHandle")] public nint ImagePipeHandle; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImagepipeSurfaceCreateInfoFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfo.gen.cs index 53cb3e63e8..87711d1e5c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImagePlaneMemoryRequirementsInfo")] - public unsafe partial struct ImagePlaneMemoryRequirementsInfo + [NativeName("Aliases", "VkImagePlaneMemoryRequirementsInfoKHR")] + public unsafe partial struct ImagePlaneMemoryRequirementsInfo : IExtendsChain, IExtendsChain { public ImagePlaneMemoryRequirementsInfo ( @@ -57,5 +58,18 @@ public ImagePlaneMemoryRequirementsInfo [NativeName("Type.Name", "VkImageAspectFlagBits")] [NativeName("Name", "planeAspect")] public ImageAspectFlags PlaneAspect; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImagePlaneMemoryRequirementsInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfoKHR.gen.cs index 323b65a094..e7a1fa60ef 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImagePlaneMemoryRequirementsInfoKHR")] - public unsafe partial struct ImagePlaneMemoryRequirementsInfoKHR + [NativeName("AliasOf", "VkImagePlaneMemoryRequirementsInfo")] + public unsafe partial struct ImagePlaneMemoryRequirementsInfoKHR : IExtendsChain, IExtendsChain { public ImagePlaneMemoryRequirementsInfoKHR ( @@ -57,5 +58,18 @@ public ImagePlaneMemoryRequirementsInfoKHR [NativeName("Type.Name", "VkImageAspectFlagBits")] [NativeName("Name", "planeAspect")] public ImageAspectFlags PlaneAspect; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImagePlaneMemoryRequirementsInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageResolve2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageResolve2KHR.gen.cs index 4f3428d35a..0e84799b9d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageResolve2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageResolve2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageResolve2KHR")] - public unsafe partial struct ImageResolve2KHR + public unsafe partial struct ImageResolve2KHR : IChainable { public ImageResolve2KHR ( @@ -101,5 +101,18 @@ public ImageResolve2KHR [NativeName("Type.Name", "VkExtent3D")] [NativeName("Name", "extent")] public Extent3D Extent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageResolve2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2.gen.cs index 8466befee8..bc638fca4d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageSparseMemoryRequirementsInfo2")] - public unsafe partial struct ImageSparseMemoryRequirementsInfo2 + [NativeName("Aliases", "VkImageSparseMemoryRequirementsInfo2KHR")] + public unsafe partial struct ImageSparseMemoryRequirementsInfo2 : IChainable { public ImageSparseMemoryRequirementsInfo2 ( @@ -57,5 +58,18 @@ public ImageSparseMemoryRequirementsInfo2 [NativeName("Type.Name", "VkImage")] [NativeName("Name", "image")] public Image Image; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageSparseMemoryRequirementsInfo2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2KHR.gen.cs index cc6a00b967..7084ce1bc7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageSparseMemoryRequirementsInfo2KHR")] - public unsafe partial struct ImageSparseMemoryRequirementsInfo2KHR + [NativeName("AliasOf", "VkImageSparseMemoryRequirementsInfo2")] + public unsafe partial struct ImageSparseMemoryRequirementsInfo2KHR : IChainable { public ImageSparseMemoryRequirementsInfo2KHR ( @@ -57,5 +58,18 @@ public ImageSparseMemoryRequirementsInfo2KHR [NativeName("Type.Name", "VkImage")] [NativeName("Name", "image")] public Image Image; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageSparseMemoryRequirementsInfo2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfo.gen.cs index 2feaa37566..8dd5ed7712 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageStencilUsageCreateInfo")] - public unsafe partial struct ImageStencilUsageCreateInfo + [NativeName("Aliases", "VkImageStencilUsageCreateInfoEXT")] + public unsafe partial struct ImageStencilUsageCreateInfo : IExtendsChain, IExtendsChain, IExtendsChain { public ImageStencilUsageCreateInfo ( @@ -57,5 +58,18 @@ public ImageStencilUsageCreateInfo [NativeName("Type.Name", "VkImageUsageFlags")] [NativeName("Name", "stencilUsage")] public ImageUsageFlags StencilUsage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageStencilUsageCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfoEXT.gen.cs index 72a4cf1bb8..bfb885e18e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfoEXT.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageStencilUsageCreateInfoEXT")] - public unsafe partial struct ImageStencilUsageCreateInfoEXT + [NativeName("AliasOf", "VkImageStencilUsageCreateInfo")] + public unsafe partial struct ImageStencilUsageCreateInfoEXT : IExtendsChain, IExtendsChain, IExtendsChain { public ImageStencilUsageCreateInfoEXT ( @@ -57,5 +58,18 @@ public ImageStencilUsageCreateInfoEXT [NativeName("Type.Name", "VkImageUsageFlags")] [NativeName("Name", "stencilUsage")] public ImageUsageFlags StencilUsage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageStencilUsageCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSwapchainCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSwapchainCreateInfoKHR.gen.cs index 397b597807..a04c7e0810 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSwapchainCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSwapchainCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageSwapchainCreateInfoKHR")] - public unsafe partial struct ImageSwapchainCreateInfoKHR + public unsafe partial struct ImageSwapchainCreateInfoKHR : IExtendsChain { public ImageSwapchainCreateInfoKHR ( @@ -57,5 +57,18 @@ public ImageSwapchainCreateInfoKHR [NativeName("Type.Name", "VkSwapchainKHR")] [NativeName("Name", "swapchain")] public SwapchainKHR Swapchain; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageSwapchainCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewASTCDecodeModeEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewASTCDecodeModeEXT.gen.cs index aa72a8087e..d68176475e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewASTCDecodeModeEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewASTCDecodeModeEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageViewASTCDecodeModeEXT")] - public unsafe partial struct ImageViewASTCDecodeModeEXT + public unsafe partial struct ImageViewASTCDecodeModeEXT : IExtendsChain { public ImageViewASTCDecodeModeEXT ( @@ -57,5 +57,18 @@ public ImageViewASTCDecodeModeEXT [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "decodeMode")] public Format DecodeMode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageViewAstcDecodeModeExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewAddressPropertiesNVX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewAddressPropertiesNVX.gen.cs index 71e577e151..909b96b660 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewAddressPropertiesNVX.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewAddressPropertiesNVX.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageViewAddressPropertiesNVX")] - public unsafe partial struct ImageViewAddressPropertiesNVX + public unsafe partial struct ImageViewAddressPropertiesNVX : IChainable { public ImageViewAddressPropertiesNVX ( @@ -68,5 +68,18 @@ public ImageViewAddressPropertiesNVX [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "size")] public ulong Size; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageViewAddressPropertiesNvx; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewCreateInfo.gen.cs index 858283299f..e80bb1c913 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageViewCreateInfo")] - public unsafe partial struct ImageViewCreateInfo + public unsafe partial struct ImageViewCreateInfo : IChainStart { public ImageViewCreateInfo ( @@ -112,5 +112,30 @@ public ImageViewCreateInfo [NativeName("Type.Name", "VkImageSubresourceRange")] [NativeName("Name", "subresourceRange")] public ImageSubresourceRange SubresourceRange; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageViewCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref ImageViewCreateInfo Chain( + out ImageViewCreateInfo capture) + { + capture = new ImageViewCreateInfo(StructureType.ImageViewCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewHandleInfoNVX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewHandleInfoNVX.gen.cs index 91dc4eb119..a922d33a36 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewHandleInfoNVX.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewHandleInfoNVX.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageViewHandleInfoNVX")] - public unsafe partial struct ImageViewHandleInfoNVX + public unsafe partial struct ImageViewHandleInfoNVX : IChainable { public ImageViewHandleInfoNVX ( @@ -79,5 +79,18 @@ public ImageViewHandleInfoNVX [NativeName("Type.Name", "VkSampler")] [NativeName("Name", "sampler")] public Sampler Sampler; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageViewHandleInfoNvx; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfo.gen.cs index 14f155b444..4cf9df5e28 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageViewUsageCreateInfo")] - public unsafe partial struct ImageViewUsageCreateInfo + [NativeName("Aliases", "VkImageViewUsageCreateInfoKHR")] + public unsafe partial struct ImageViewUsageCreateInfo : IExtendsChain { public ImageViewUsageCreateInfo ( @@ -57,5 +58,18 @@ public ImageViewUsageCreateInfo [NativeName("Type.Name", "VkImageUsageFlags")] [NativeName("Name", "usage")] public ImageUsageFlags Usage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageViewUsageCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfoKHR.gen.cs index c556a2e35b..afc4dfb4c5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageViewUsageCreateInfoKHR")] - public unsafe partial struct ImageViewUsageCreateInfoKHR + [NativeName("AliasOf", "VkImageViewUsageCreateInfo")] + public unsafe partial struct ImageViewUsageCreateInfoKHR : IExtendsChain { public ImageViewUsageCreateInfoKHR ( @@ -57,5 +58,18 @@ public ImageViewUsageCreateInfoKHR [NativeName("Type.Name", "VkImageUsageFlags")] [NativeName("Name", "usage")] public ImageUsageFlags Usage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageViewUsageCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportAndroidHardwareBufferInfoANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportAndroidHardwareBufferInfoANDROID.gen.cs index d8f6aa12e8..30425fe38f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportAndroidHardwareBufferInfoANDROID.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportAndroidHardwareBufferInfoANDROID.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImportAndroidHardwareBufferInfoANDROID")] - public unsafe partial struct ImportAndroidHardwareBufferInfoANDROID + public unsafe partial struct ImportAndroidHardwareBufferInfoANDROID : IExtendsChain { public ImportAndroidHardwareBufferInfoANDROID ( @@ -57,5 +57,18 @@ public ImportAndroidHardwareBufferInfoANDROID [NativeName("Type.Name", "AHardwareBuffer")] [NativeName("Name", "buffer")] public nint* Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportAndroidHardwareBufferInfoAndroid; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportFenceFdInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportFenceFdInfoKHR.gen.cs index 7e6789e497..33c345a5a4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportFenceFdInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportFenceFdInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImportFenceFdInfoKHR")] - public unsafe partial struct ImportFenceFdInfoKHR + public unsafe partial struct ImportFenceFdInfoKHR : IChainable { public ImportFenceFdInfoKHR ( @@ -90,5 +90,18 @@ public ImportFenceFdInfoKHR [NativeName("Type.Name", "int")] [NativeName("Name", "fd")] public int Fd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportFenceFDInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportFenceWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportFenceWin32HandleInfoKHR.gen.cs index 0339e4fa24..032a5662c4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportFenceWin32HandleInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportFenceWin32HandleInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImportFenceWin32HandleInfoKHR")] - public unsafe partial struct ImportFenceWin32HandleInfoKHR + public unsafe partial struct ImportFenceWin32HandleInfoKHR : IChainable { public ImportFenceWin32HandleInfoKHR ( @@ -101,5 +101,18 @@ public ImportFenceWin32HandleInfoKHR [NativeName("Type.Name", "LPCWSTR")] [NativeName("Name", "name")] public nint Name; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportFenceWin32HandleInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryBufferCollectionFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryBufferCollectionFUCHSIA.gen.cs index 80a2d135ab..f5c9b667f7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryBufferCollectionFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryBufferCollectionFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImportMemoryBufferCollectionFUCHSIA")] - public unsafe partial struct ImportMemoryBufferCollectionFUCHSIA + public unsafe partial struct ImportMemoryBufferCollectionFUCHSIA : IExtendsChain { public ImportMemoryBufferCollectionFUCHSIA ( @@ -68,5 +68,18 @@ public ImportMemoryBufferCollectionFUCHSIA [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "index")] public uint Index; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportMemoryBufferCollectionFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryFdInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryFdInfoKHR.gen.cs index def0ab1985..d107b755d9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryFdInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryFdInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImportMemoryFdInfoKHR")] - public unsafe partial struct ImportMemoryFdInfoKHR + public unsafe partial struct ImportMemoryFdInfoKHR : IExtendsChain { public ImportMemoryFdInfoKHR ( @@ -68,5 +68,18 @@ public ImportMemoryFdInfoKHR [NativeName("Type.Name", "int")] [NativeName("Name", "fd")] public int Fd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportMemoryFDInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryHostPointerInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryHostPointerInfoEXT.gen.cs index 0255955dea..523ced75e0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryHostPointerInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryHostPointerInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImportMemoryHostPointerInfoEXT")] - public unsafe partial struct ImportMemoryHostPointerInfoEXT + public unsafe partial struct ImportMemoryHostPointerInfoEXT : IExtendsChain { public ImportMemoryHostPointerInfoEXT ( @@ -68,5 +68,18 @@ public ImportMemoryHostPointerInfoEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pHostPointer")] public void* PHostPointer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportMemoryHostPointerInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryWin32HandleInfoKHR.gen.cs index 801296c564..5c80dfa4da 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryWin32HandleInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryWin32HandleInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImportMemoryWin32HandleInfoKHR")] - public unsafe partial struct ImportMemoryWin32HandleInfoKHR + public unsafe partial struct ImportMemoryWin32HandleInfoKHR : IExtendsChain { public ImportMemoryWin32HandleInfoKHR ( @@ -79,5 +79,18 @@ public ImportMemoryWin32HandleInfoKHR [NativeName("Type.Name", "LPCWSTR")] [NativeName("Name", "name")] public nint Name; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportMemoryWin32HandleInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryWin32HandleInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryWin32HandleInfoNV.gen.cs index 37338c2efd..ff5ace4ae0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryWin32HandleInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryWin32HandleInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImportMemoryWin32HandleInfoNV")] - public unsafe partial struct ImportMemoryWin32HandleInfoNV + public unsafe partial struct ImportMemoryWin32HandleInfoNV : IExtendsChain { public ImportMemoryWin32HandleInfoNV ( @@ -68,5 +68,18 @@ public ImportMemoryWin32HandleInfoNV [NativeName("Type.Name", "HANDLE")] [NativeName("Name", "handle")] public nint Handle; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportMemoryWin32HandleInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryZirconHandleInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryZirconHandleInfoFUCHSIA.gen.cs index d976a49740..2938dd1b5c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryZirconHandleInfoFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryZirconHandleInfoFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImportMemoryZirconHandleInfoFUCHSIA")] - public unsafe partial struct ImportMemoryZirconHandleInfoFUCHSIA + public unsafe partial struct ImportMemoryZirconHandleInfoFUCHSIA : IExtendsChain { public ImportMemoryZirconHandleInfoFUCHSIA ( @@ -68,5 +68,18 @@ public ImportMemoryZirconHandleInfoFUCHSIA [NativeName("Type.Name", "zx_handle_t")] [NativeName("Name", "handle")] public nint Handle; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportMemoryZirconHandleInfoFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreFdInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreFdInfoKHR.gen.cs index 71d8b56932..7e9e5e16fc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreFdInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreFdInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImportSemaphoreFdInfoKHR")] - public unsafe partial struct ImportSemaphoreFdInfoKHR + public unsafe partial struct ImportSemaphoreFdInfoKHR : IChainable { public ImportSemaphoreFdInfoKHR ( @@ -90,5 +90,18 @@ public ImportSemaphoreFdInfoKHR [NativeName("Type.Name", "int")] [NativeName("Name", "fd")] public int Fd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportSemaphoreFDInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreWin32HandleInfoKHR.gen.cs index bfdf714ef5..6b742902fd 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreWin32HandleInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreWin32HandleInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImportSemaphoreWin32HandleInfoKHR")] - public unsafe partial struct ImportSemaphoreWin32HandleInfoKHR + public unsafe partial struct ImportSemaphoreWin32HandleInfoKHR : IChainable { public ImportSemaphoreWin32HandleInfoKHR ( @@ -101,5 +101,18 @@ public ImportSemaphoreWin32HandleInfoKHR [NativeName("Type.Name", "LPCWSTR")] [NativeName("Name", "name")] public nint Name; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportSemaphoreWin32HandleInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreZirconHandleInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreZirconHandleInfoFUCHSIA.gen.cs index b5614c1119..b76e26324c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreZirconHandleInfoFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreZirconHandleInfoFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImportSemaphoreZirconHandleInfoFUCHSIA")] - public unsafe partial struct ImportSemaphoreZirconHandleInfoFUCHSIA + public unsafe partial struct ImportSemaphoreZirconHandleInfoFUCHSIA : IChainable { public ImportSemaphoreZirconHandleInfoFUCHSIA ( @@ -90,5 +90,18 @@ public ImportSemaphoreZirconHandleInfoFUCHSIA [NativeName("Type.Name", "zx_handle_t")] [NativeName("Name", "zirconHandle")] public nint ZirconHandle; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportSemaphoreZirconHandleInfoFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/IndirectCommandsLayoutCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/IndirectCommandsLayoutCreateInfoNV.gen.cs index 3ed04b5431..65963ecf99 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/IndirectCommandsLayoutCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/IndirectCommandsLayoutCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkIndirectCommandsLayoutCreateInfoNV")] - public unsafe partial struct IndirectCommandsLayoutCreateInfoNV + public unsafe partial struct IndirectCommandsLayoutCreateInfoNV : IChainable { public IndirectCommandsLayoutCreateInfoNV ( @@ -112,5 +112,18 @@ public IndirectCommandsLayoutCreateInfoNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pStreamStrides")] public uint* PStreamStrides; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.IndirectCommandsLayoutCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/IndirectCommandsLayoutTokenNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/IndirectCommandsLayoutTokenNV.gen.cs index 79c0aad4af..1f2b7bd5c7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/IndirectCommandsLayoutTokenNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/IndirectCommandsLayoutTokenNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkIndirectCommandsLayoutTokenNV")] - public unsafe partial struct IndirectCommandsLayoutTokenNV + public unsafe partial struct IndirectCommandsLayoutTokenNV : IChainable { public IndirectCommandsLayoutTokenNV ( @@ -189,5 +189,18 @@ public IndirectCommandsLayoutTokenNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pIndexTypeValues")] public uint* PIndexTypeValues; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.IndirectCommandsLayoutTokenNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/InitializePerformanceApiInfoINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/InitializePerformanceApiInfoINTEL.gen.cs index d67ffda0b2..bf32981596 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/InitializePerformanceApiInfoINTEL.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/InitializePerformanceApiInfoINTEL.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkInitializePerformanceApiInfoINTEL")] - public unsafe partial struct InitializePerformanceApiInfoINTEL + public unsafe partial struct InitializePerformanceApiInfoINTEL : IChainable { public InitializePerformanceApiInfoINTEL ( @@ -57,5 +57,18 @@ public InitializePerformanceApiInfoINTEL [NativeName("Type.Name", "void")] [NativeName("Name", "pUserData")] public void* PUserData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.InitializePerformanceApiInfoIntel; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/InputAttachmentAspectReference.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/InputAttachmentAspectReference.gen.cs index 89202a59cf..f228fe6bf6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/InputAttachmentAspectReference.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/InputAttachmentAspectReference.gen.cs @@ -17,6 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkInputAttachmentAspectReference")] + [NativeName("Aliases", "VkInputAttachmentAspectReferenceKHR")] public unsafe partial struct InputAttachmentAspectReference { public InputAttachmentAspectReference diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/InputAttachmentAspectReferenceKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/InputAttachmentAspectReferenceKHR.gen.cs index c955cd3646..3ab8ecdcc8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/InputAttachmentAspectReferenceKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/InputAttachmentAspectReferenceKHR.gen.cs @@ -17,6 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkInputAttachmentAspectReferenceKHR")] + [NativeName("AliasOf", "VkInputAttachmentAspectReference")] public unsafe partial struct InputAttachmentAspectReferenceKHR { public InputAttachmentAspectReferenceKHR diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/InstanceCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/InstanceCreateInfo.gen.cs index 3764310cca..0734f12f5d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/InstanceCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/InstanceCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkInstanceCreateInfo")] - public unsafe partial struct InstanceCreateInfo + public unsafe partial struct InstanceCreateInfo : IChainStart { public InstanceCreateInfo ( @@ -112,5 +112,30 @@ public InstanceCreateInfo [NativeName("Type.Name", "char")] [NativeName("Name", "ppEnabledExtensionNames")] public byte** PpEnabledExtensionNames; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.InstanceCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref InstanceCreateInfo Chain( + out InstanceCreateInfo capture) + { + capture = new InstanceCreateInfo(StructureType.InstanceCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MacOSSurfaceCreateInfoMVK.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MacOSSurfaceCreateInfoMVK.gen.cs index 8ee06b1482..dfc6d089c1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MacOSSurfaceCreateInfoMVK.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MacOSSurfaceCreateInfoMVK.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMacOSSurfaceCreateInfoMVK")] - public unsafe partial struct MacOSSurfaceCreateInfoMVK + public unsafe partial struct MacOSSurfaceCreateInfoMVK : IChainable { public MacOSSurfaceCreateInfoMVK ( @@ -68,5 +68,18 @@ public MacOSSurfaceCreateInfoMVK [NativeName("Type.Name", "void")] [NativeName("Name", "pView")] public void* PView; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MacosSurfaceCreateInfoMvk; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MappedMemoryRange.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MappedMemoryRange.gen.cs index 77a5f8a49b..2503402f50 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MappedMemoryRange.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MappedMemoryRange.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMappedMemoryRange")] - public unsafe partial struct MappedMemoryRange + public unsafe partial struct MappedMemoryRange : IChainable { public MappedMemoryRange ( @@ -79,5 +79,18 @@ public MappedMemoryRange [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "size")] public ulong Size; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MappedMemoryRange; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfo.gen.cs index e94f86c417..09f8f4190d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryAllocateFlagsInfo")] - public unsafe partial struct MemoryAllocateFlagsInfo + [NativeName("Aliases", "VkMemoryAllocateFlagsInfoKHR")] + public unsafe partial struct MemoryAllocateFlagsInfo : IExtendsChain { public MemoryAllocateFlagsInfo ( @@ -68,5 +69,18 @@ public MemoryAllocateFlagsInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "deviceMask")] public uint DeviceMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryAllocateFlagsInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfoKHR.gen.cs index 349215fbab..d4fa2cadcd 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryAllocateFlagsInfoKHR")] - public unsafe partial struct MemoryAllocateFlagsInfoKHR + [NativeName("AliasOf", "VkMemoryAllocateFlagsInfo")] + public unsafe partial struct MemoryAllocateFlagsInfoKHR : IExtendsChain { public MemoryAllocateFlagsInfoKHR ( @@ -68,5 +69,18 @@ public MemoryAllocateFlagsInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "deviceMask")] public uint DeviceMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryAllocateFlagsInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateInfo.gen.cs index 578e86d502..ed87eb27e6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryAllocateInfo")] - public unsafe partial struct MemoryAllocateInfo + public unsafe partial struct MemoryAllocateInfo : IChainStart { public MemoryAllocateInfo ( @@ -68,5 +68,30 @@ public MemoryAllocateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryTypeIndex")] public uint MemoryTypeIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryAllocateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref MemoryAllocateInfo Chain( + out MemoryAllocateInfo capture) + { + capture = new MemoryAllocateInfo(StructureType.MemoryAllocateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryBarrier.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryBarrier.gen.cs index 5eb1bccc30..f4edf1deef 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryBarrier.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryBarrier.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryBarrier")] - public unsafe partial struct MemoryBarrier + public unsafe partial struct MemoryBarrier : IChainable { public MemoryBarrier ( @@ -68,5 +68,18 @@ public MemoryBarrier [NativeName("Type.Name", "VkAccessFlags")] [NativeName("Name", "dstAccessMask")] public AccessFlags DstAccessMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryBarrier; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryBarrier2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryBarrier2KHR.gen.cs index daee4a7a4e..a67688b227 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryBarrier2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryBarrier2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryBarrier2KHR")] - public unsafe partial struct MemoryBarrier2KHR + public unsafe partial struct MemoryBarrier2KHR : IExtendsChain, IExtendsChain { public MemoryBarrier2KHR ( @@ -90,5 +90,18 @@ public MemoryBarrier2KHR [NativeName("Type.Name", "VkAccessFlags2KHR")] [NativeName("Name", "dstAccessMask")] public AccessFlags2KHR DstAccessMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryBarrier2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfo.gen.cs index ee5f5fe6e8..61883a7652 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryDedicatedAllocateInfo")] - public unsafe partial struct MemoryDedicatedAllocateInfo + [NativeName("Aliases", "VkMemoryDedicatedAllocateInfoKHR")] + public unsafe partial struct MemoryDedicatedAllocateInfo : IExtendsChain { public MemoryDedicatedAllocateInfo ( @@ -68,5 +69,18 @@ public MemoryDedicatedAllocateInfo [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryDedicatedAllocateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfoKHR.gen.cs index 604a6eb9e7..d3f6e9d4d6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryDedicatedAllocateInfoKHR")] - public unsafe partial struct MemoryDedicatedAllocateInfoKHR + [NativeName("AliasOf", "VkMemoryDedicatedAllocateInfo")] + public unsafe partial struct MemoryDedicatedAllocateInfoKHR : IExtendsChain { public MemoryDedicatedAllocateInfoKHR ( @@ -68,5 +69,18 @@ public MemoryDedicatedAllocateInfoKHR [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryDedicatedAllocateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirements.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirements.gen.cs index aa07e862df..09c7637d37 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirements.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirements.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryDedicatedRequirements")] - public unsafe partial struct MemoryDedicatedRequirements + [NativeName("Aliases", "VkMemoryDedicatedRequirementsKHR")] + public unsafe partial struct MemoryDedicatedRequirements : IExtendsChain, IExtendsChain { public MemoryDedicatedRequirements ( @@ -68,5 +69,18 @@ public MemoryDedicatedRequirements [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "requiresDedicatedAllocation")] public Bool32 RequiresDedicatedAllocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryDedicatedRequirements; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirementsKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirementsKHR.gen.cs index 59c07f803d..d24a40ffef 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirementsKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirementsKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryDedicatedRequirementsKHR")] - public unsafe partial struct MemoryDedicatedRequirementsKHR + [NativeName("AliasOf", "VkMemoryDedicatedRequirements")] + public unsafe partial struct MemoryDedicatedRequirementsKHR : IExtendsChain, IExtendsChain { public MemoryDedicatedRequirementsKHR ( @@ -68,5 +69,18 @@ public MemoryDedicatedRequirementsKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "requiresDedicatedAllocation")] public Bool32 RequiresDedicatedAllocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryDedicatedRequirements; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryFdPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryFdPropertiesKHR.gen.cs index fb33bbf2a6..4bcfde07db 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryFdPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryFdPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryFdPropertiesKHR")] - public unsafe partial struct MemoryFdPropertiesKHR + public unsafe partial struct MemoryFdPropertiesKHR : IChainable { public MemoryFdPropertiesKHR ( @@ -57,5 +57,18 @@ public MemoryFdPropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryTypeBits")] public uint MemoryTypeBits; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryFDPropertiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetAndroidHardwareBufferInfoANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetAndroidHardwareBufferInfoANDROID.gen.cs index c5a997815e..692d5af61a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetAndroidHardwareBufferInfoANDROID.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetAndroidHardwareBufferInfoANDROID.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryGetAndroidHardwareBufferInfoANDROID")] - public unsafe partial struct MemoryGetAndroidHardwareBufferInfoANDROID + public unsafe partial struct MemoryGetAndroidHardwareBufferInfoANDROID : IChainable { public MemoryGetAndroidHardwareBufferInfoANDROID ( @@ -57,5 +57,18 @@ public MemoryGetAndroidHardwareBufferInfoANDROID [NativeName("Type.Name", "VkDeviceMemory")] [NativeName("Name", "memory")] public DeviceMemory Memory; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryGetAndroidHardwareBufferInfoAndroid; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetFdInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetFdInfoKHR.gen.cs index 411ebdd9da..3d391739d3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetFdInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetFdInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryGetFdInfoKHR")] - public unsafe partial struct MemoryGetFdInfoKHR + public unsafe partial struct MemoryGetFdInfoKHR : IChainable { public MemoryGetFdInfoKHR ( @@ -68,5 +68,18 @@ public MemoryGetFdInfoKHR [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryGetFDInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetRemoteAddressInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetRemoteAddressInfoNV.gen.cs index 766774d587..92553ca9bc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetRemoteAddressInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetRemoteAddressInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryGetRemoteAddressInfoNV")] - public unsafe partial struct MemoryGetRemoteAddressInfoNV + public unsafe partial struct MemoryGetRemoteAddressInfoNV : IChainable { public MemoryGetRemoteAddressInfoNV ( @@ -68,5 +68,18 @@ public MemoryGetRemoteAddressInfoNV [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryGetRemoteAddressInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetWin32HandleInfoKHR.gen.cs index b94b305a7e..8234fcbe8d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetWin32HandleInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetWin32HandleInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryGetWin32HandleInfoKHR")] - public unsafe partial struct MemoryGetWin32HandleInfoKHR + public unsafe partial struct MemoryGetWin32HandleInfoKHR : IChainable { public MemoryGetWin32HandleInfoKHR ( @@ -68,5 +68,18 @@ public MemoryGetWin32HandleInfoKHR [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryGetWin32HandleInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetZirconHandleInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetZirconHandleInfoFUCHSIA.gen.cs index 734d2f25bb..5793983341 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetZirconHandleInfoFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetZirconHandleInfoFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryGetZirconHandleInfoFUCHSIA")] - public unsafe partial struct MemoryGetZirconHandleInfoFUCHSIA + public unsafe partial struct MemoryGetZirconHandleInfoFUCHSIA : IChainable { public MemoryGetZirconHandleInfoFUCHSIA ( @@ -68,5 +68,18 @@ public MemoryGetZirconHandleInfoFUCHSIA [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryGetZirconHandleInfoFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryHostPointerPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryHostPointerPropertiesEXT.gen.cs index 3644bb884d..603c2802a6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryHostPointerPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryHostPointerPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryHostPointerPropertiesEXT")] - public unsafe partial struct MemoryHostPointerPropertiesEXT + public unsafe partial struct MemoryHostPointerPropertiesEXT : IChainable { public MemoryHostPointerPropertiesEXT ( @@ -57,5 +57,18 @@ public MemoryHostPointerPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryTypeBits")] public uint MemoryTypeBits; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryHostPointerPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfo.gen.cs index 9398144d9a..7809439d96 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryOpaqueCaptureAddressAllocateInfo")] - public unsafe partial struct MemoryOpaqueCaptureAddressAllocateInfo + [NativeName("Aliases", "VkMemoryOpaqueCaptureAddressAllocateInfoKHR")] + public unsafe partial struct MemoryOpaqueCaptureAddressAllocateInfo : IExtendsChain { public MemoryOpaqueCaptureAddressAllocateInfo ( @@ -57,5 +58,18 @@ public MemoryOpaqueCaptureAddressAllocateInfo [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "opaqueCaptureAddress")] public ulong OpaqueCaptureAddress; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryOpaqueCaptureAddressAllocateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfoKHR.gen.cs index 9ac9530346..accdc8f182 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryOpaqueCaptureAddressAllocateInfoKHR")] - public unsafe partial struct MemoryOpaqueCaptureAddressAllocateInfoKHR + [NativeName("AliasOf", "VkMemoryOpaqueCaptureAddressAllocateInfo")] + public unsafe partial struct MemoryOpaqueCaptureAddressAllocateInfoKHR : IExtendsChain { public MemoryOpaqueCaptureAddressAllocateInfoKHR ( @@ -57,5 +58,18 @@ public MemoryOpaqueCaptureAddressAllocateInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "opaqueCaptureAddress")] public ulong OpaqueCaptureAddress; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryOpaqueCaptureAddressAllocateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryPriorityAllocateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryPriorityAllocateInfoEXT.gen.cs index 935c0bb355..2ba48bfaf0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryPriorityAllocateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryPriorityAllocateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryPriorityAllocateInfoEXT")] - public unsafe partial struct MemoryPriorityAllocateInfoEXT + public unsafe partial struct MemoryPriorityAllocateInfoEXT : IExtendsChain { public MemoryPriorityAllocateInfoEXT ( @@ -57,5 +57,18 @@ public MemoryPriorityAllocateInfoEXT [NativeName("Type.Name", "float")] [NativeName("Name", "priority")] public float Priority; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryPriorityAllocateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2.gen.cs index 434d557288..5947666128 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryRequirements2")] - public unsafe partial struct MemoryRequirements2 + [NativeName("Aliases", "VkMemoryRequirements2KHR")] + public unsafe partial struct MemoryRequirements2 : IChainStart { public MemoryRequirements2 ( @@ -57,5 +58,30 @@ public MemoryRequirements2 [NativeName("Type.Name", "VkMemoryRequirements")] [NativeName("Name", "memoryRequirements")] public MemoryRequirements MemoryRequirements; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryRequirements2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref MemoryRequirements2 Chain( + out MemoryRequirements2 capture) + { + capture = new MemoryRequirements2(StructureType.MemoryRequirements2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2KHR.gen.cs index 5fb7a35b40..6ecf24f9a8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryRequirements2KHR")] - public unsafe partial struct MemoryRequirements2KHR + [NativeName("AliasOf", "VkMemoryRequirements2")] + public unsafe partial struct MemoryRequirements2KHR : IChainStart { public MemoryRequirements2KHR ( @@ -57,5 +58,30 @@ public MemoryRequirements2KHR [NativeName("Type.Name", "VkMemoryRequirements")] [NativeName("Name", "memoryRequirements")] public MemoryRequirements MemoryRequirements; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryRequirements2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref MemoryRequirements2KHR Chain( + out MemoryRequirements2KHR capture) + { + capture = new MemoryRequirements2KHR(StructureType.MemoryRequirements2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryWin32HandlePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryWin32HandlePropertiesKHR.gen.cs index e3f148fa46..26a003fb60 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryWin32HandlePropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryWin32HandlePropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryWin32HandlePropertiesKHR")] - public unsafe partial struct MemoryWin32HandlePropertiesKHR + public unsafe partial struct MemoryWin32HandlePropertiesKHR : IChainable { public MemoryWin32HandlePropertiesKHR ( @@ -57,5 +57,18 @@ public MemoryWin32HandlePropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryTypeBits")] public uint MemoryTypeBits; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryWin32HandlePropertiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryZirconHandlePropertiesFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryZirconHandlePropertiesFUCHSIA.gen.cs index b742347e72..472528c962 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryZirconHandlePropertiesFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryZirconHandlePropertiesFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryZirconHandlePropertiesFUCHSIA")] - public unsafe partial struct MemoryZirconHandlePropertiesFUCHSIA + public unsafe partial struct MemoryZirconHandlePropertiesFUCHSIA : IChainable { public MemoryZirconHandlePropertiesFUCHSIA ( @@ -57,5 +57,18 @@ public MemoryZirconHandlePropertiesFUCHSIA [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryTypeBits")] public uint MemoryTypeBits; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryZirconHandlePropertiesFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MetalSurfaceCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MetalSurfaceCreateInfoEXT.gen.cs index 4fcaa07245..849fbc02c4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MetalSurfaceCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MetalSurfaceCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMetalSurfaceCreateInfoEXT")] - public unsafe partial struct MetalSurfaceCreateInfoEXT + public unsafe partial struct MetalSurfaceCreateInfoEXT : IChainable { public MetalSurfaceCreateInfoEXT ( @@ -68,5 +68,18 @@ public MetalSurfaceCreateInfoEXT [NativeName("Type.Name", "CAMetalLayer")] [NativeName("Name", "pLayer")] public nint* PLayer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MetalSurfaceCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MultisamplePropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MultisamplePropertiesEXT.gen.cs index 2192632d17..f1c1601e80 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MultisamplePropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MultisamplePropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMultisamplePropertiesEXT")] - public unsafe partial struct MultisamplePropertiesEXT + public unsafe partial struct MultisamplePropertiesEXT : IChainable { public MultisamplePropertiesEXT ( @@ -57,5 +57,18 @@ public MultisamplePropertiesEXT [NativeName("Type.Name", "VkExtent2D")] [NativeName("Name", "maxSampleLocationGridSize")] public Extent2D MaxSampleLocationGridSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MultisamplePropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MultiviewPerViewAttributesInfoNVX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MultiviewPerViewAttributesInfoNVX.gen.cs index 9b1309d727..c434910779 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MultiviewPerViewAttributesInfoNVX.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MultiviewPerViewAttributesInfoNVX.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMultiviewPerViewAttributesInfoNVX")] - public unsafe partial struct MultiviewPerViewAttributesInfoNVX + public unsafe partial struct MultiviewPerViewAttributesInfoNVX : IExtendsChain, IExtendsChain, IExtendsChain { public MultiviewPerViewAttributesInfoNVX ( @@ -68,5 +68,18 @@ public MultiviewPerViewAttributesInfoNVX [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "perViewAttributesPositionXOnly")] public Bool32 PerViewAttributesPositionXOnly; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MultiviewPerViewAttributesInfoNvx; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MutableDescriptorTypeCreateInfoVALVE.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MutableDescriptorTypeCreateInfoVALVE.gen.cs index 6dfd9f7d0b..b8ca0b3ebf 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MutableDescriptorTypeCreateInfoVALVE.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MutableDescriptorTypeCreateInfoVALVE.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMutableDescriptorTypeCreateInfoVALVE")] - public unsafe partial struct MutableDescriptorTypeCreateInfoVALVE + public unsafe partial struct MutableDescriptorTypeCreateInfoVALVE : IExtendsChain, IExtendsChain { public MutableDescriptorTypeCreateInfoVALVE ( @@ -68,5 +68,18 @@ public MutableDescriptorTypeCreateInfoVALVE [NativeName("Type.Name", "VkMutableDescriptorTypeListVALVE")] [NativeName("Name", "pMutableDescriptorTypeLists")] public MutableDescriptorTypeListVALVE* PMutableDescriptorTypeLists; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MutableDescriptorTypeCreateInfoValve; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/NativeBufferANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/NativeBufferANDROID.gen.cs index a871356874..29424b8632 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/NativeBufferANDROID.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/NativeBufferANDROID.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkNativeBufferANDROID")] - public unsafe partial struct NativeBufferANDROID + public unsafe partial struct NativeBufferANDROID : IChainable { public NativeBufferANDROID ( @@ -101,5 +101,18 @@ public NativeBufferANDROID [NativeName("Type.Name", "VkNativeBufferUsage2ANDROID")] [NativeName("Name", "usage2")] public NativeBufferUsage2ANDROID Usage2; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.NativeBufferAndroid; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceConfigurationAcquireInfoINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceConfigurationAcquireInfoINTEL.gen.cs index 643e6bd7fb..70d78cebbe 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceConfigurationAcquireInfoINTEL.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceConfigurationAcquireInfoINTEL.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPerformanceConfigurationAcquireInfoINTEL")] - public unsafe partial struct PerformanceConfigurationAcquireInfoINTEL + public unsafe partial struct PerformanceConfigurationAcquireInfoINTEL : IChainable { public PerformanceConfigurationAcquireInfoINTEL ( @@ -57,5 +57,18 @@ public PerformanceConfigurationAcquireInfoINTEL [NativeName("Type.Name", "VkPerformanceConfigurationTypeINTEL")] [NativeName("Name", "type")] public PerformanceConfigurationTypeINTEL Type; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PerformanceConfigurationAcquireInfoIntel; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceCounterDescriptionKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceCounterDescriptionKHR.gen.cs index d0af0f6b46..b644fdbe95 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceCounterDescriptionKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceCounterDescriptionKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPerformanceCounterDescriptionKHR")] - public unsafe partial struct PerformanceCounterDescriptionKHR + public unsafe partial struct PerformanceCounterDescriptionKHR : IChainable { public PerformanceCounterDescriptionKHR ( @@ -72,5 +72,18 @@ public PerformanceCounterDescriptionKHR [NativeName("Type.Name", "char")] [NativeName("Name", "description")] public fixed byte Description[256]; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PerformanceCounterDescriptionKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceCounterKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceCounterKHR.gen.cs index 02ae97c977..bf361b42e6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceCounterKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceCounterKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPerformanceCounterKHR")] - public unsafe partial struct PerformanceCounterKHR + public unsafe partial struct PerformanceCounterKHR : IChainable { public PerformanceCounterKHR ( @@ -84,5 +84,18 @@ public PerformanceCounterKHR [NativeName("Type.Name", "uint8_t")] [NativeName("Name", "uuid")] public fixed byte Uuid[16]; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PerformanceCounterKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceMarkerInfoINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceMarkerInfoINTEL.gen.cs index 865b97a089..8d633b873b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceMarkerInfoINTEL.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceMarkerInfoINTEL.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPerformanceMarkerInfoINTEL")] - public unsafe partial struct PerformanceMarkerInfoINTEL + public unsafe partial struct PerformanceMarkerInfoINTEL : IChainable { public PerformanceMarkerInfoINTEL ( @@ -57,5 +57,18 @@ public PerformanceMarkerInfoINTEL [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "marker")] public ulong Marker; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PerformanceMarkerInfoIntel; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceOverrideInfoINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceOverrideInfoINTEL.gen.cs index 49f4c17597..313898b413 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceOverrideInfoINTEL.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceOverrideInfoINTEL.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPerformanceOverrideInfoINTEL")] - public unsafe partial struct PerformanceOverrideInfoINTEL + public unsafe partial struct PerformanceOverrideInfoINTEL : IChainable { public PerformanceOverrideInfoINTEL ( @@ -79,5 +79,18 @@ public PerformanceOverrideInfoINTEL [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "parameter")] public ulong Parameter; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PerformanceOverrideInfoIntel; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceQuerySubmitInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceQuerySubmitInfoKHR.gen.cs index 7db26dfc9c..2f37cdbd74 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceQuerySubmitInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceQuerySubmitInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPerformanceQuerySubmitInfoKHR")] - public unsafe partial struct PerformanceQuerySubmitInfoKHR + public unsafe partial struct PerformanceQuerySubmitInfoKHR : IExtendsChain, IExtendsChain { public PerformanceQuerySubmitInfoKHR ( @@ -57,5 +57,18 @@ public PerformanceQuerySubmitInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "counterPassIndex")] public uint CounterPassIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PerformanceQuerySubmitInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceStreamMarkerInfoINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceStreamMarkerInfoINTEL.gen.cs index a46295bf88..104ec26323 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceStreamMarkerInfoINTEL.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceStreamMarkerInfoINTEL.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPerformanceStreamMarkerInfoINTEL")] - public unsafe partial struct PerformanceStreamMarkerInfoINTEL + public unsafe partial struct PerformanceStreamMarkerInfoINTEL : IChainable { public PerformanceStreamMarkerInfoINTEL ( @@ -57,5 +57,18 @@ public PerformanceStreamMarkerInfoINTEL [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "marker")] public uint Marker; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PerformanceStreamMarkerInfoIntel; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeatures.gen.cs index 3ffdaae961..cc0e28c051 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevice16BitStorageFeatures")] - public unsafe partial struct PhysicalDevice16BitStorageFeatures + [NativeName("Aliases", "VkPhysicalDevice16BitStorageFeaturesKHR")] + public unsafe partial struct PhysicalDevice16BitStorageFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDevice16BitStorageFeatures ( @@ -90,5 +91,18 @@ public PhysicalDevice16BitStorageFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "storageInputOutput16")] public Bool32 StorageInputOutput16; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevice16BitStorageFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeaturesKHR.gen.cs index dc7f82fc2c..733aa0dc46 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevice16BitStorageFeaturesKHR")] - public unsafe partial struct PhysicalDevice16BitStorageFeaturesKHR + [NativeName("AliasOf", "VkPhysicalDevice16BitStorageFeatures")] + public unsafe partial struct PhysicalDevice16BitStorageFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDevice16BitStorageFeaturesKHR ( @@ -90,5 +91,18 @@ public PhysicalDevice16BitStorageFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "storageInputOutput16")] public Bool32 StorageInputOutput16; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevice16BitStorageFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice4444FormatsFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice4444FormatsFeaturesEXT.gen.cs index b0bfaff10c..fb8b023a62 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice4444FormatsFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice4444FormatsFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevice4444FormatsFeaturesEXT")] - public unsafe partial struct PhysicalDevice4444FormatsFeaturesEXT + public unsafe partial struct PhysicalDevice4444FormatsFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDevice4444FormatsFeaturesEXT ( @@ -68,5 +68,18 @@ public PhysicalDevice4444FormatsFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "formatA4B4G4R4")] public Bool32 FormatA4B4G4R4; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevice4444FormatsFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeatures.gen.cs index ad813e3e3d..05c462a123 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevice8BitStorageFeatures")] - public unsafe partial struct PhysicalDevice8BitStorageFeatures + [NativeName("Aliases", "VkPhysicalDevice8BitStorageFeaturesKHR")] + public unsafe partial struct PhysicalDevice8BitStorageFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDevice8BitStorageFeatures ( @@ -79,5 +80,18 @@ public PhysicalDevice8BitStorageFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "storagePushConstant8")] public Bool32 StoragePushConstant8; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevice8BitStorageFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeaturesKHR.gen.cs index 8f39a66a6c..33f58b99fa 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevice8BitStorageFeaturesKHR")] - public unsafe partial struct PhysicalDevice8BitStorageFeaturesKHR + [NativeName("AliasOf", "VkPhysicalDevice8BitStorageFeatures")] + public unsafe partial struct PhysicalDevice8BitStorageFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDevice8BitStorageFeaturesKHR ( @@ -79,5 +80,18 @@ public PhysicalDevice8BitStorageFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "storagePushConstant8")] public Bool32 StoragePushConstant8; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevice8BitStorageFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceASTCDecodeFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceASTCDecodeFeaturesEXT.gen.cs index a488347e44..6e13314303 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceASTCDecodeFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceASTCDecodeFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceASTCDecodeFeaturesEXT")] - public unsafe partial struct PhysicalDeviceASTCDecodeFeaturesEXT + public unsafe partial struct PhysicalDeviceASTCDecodeFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceASTCDecodeFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceASTCDecodeFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "decodeModeSharedExponent")] public Bool32 DecodeModeSharedExponent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceAstcDecodeFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceAccelerationStructureFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceAccelerationStructureFeaturesKHR.gen.cs index 944257597c..b09f235981 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceAccelerationStructureFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceAccelerationStructureFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceAccelerationStructureFeaturesKHR")] - public unsafe partial struct PhysicalDeviceAccelerationStructureFeaturesKHR + public unsafe partial struct PhysicalDeviceAccelerationStructureFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceAccelerationStructureFeaturesKHR ( @@ -101,5 +101,18 @@ public PhysicalDeviceAccelerationStructureFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "descriptorBindingAccelerationStructureUpdateAfterBind")] public Bool32 DescriptorBindingAccelerationStructureUpdateAfterBind; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceAccelerationStructurePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceAccelerationStructurePropertiesKHR.gen.cs index 2d5f0cdfd0..9bc345dde1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceAccelerationStructurePropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceAccelerationStructurePropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceAccelerationStructurePropertiesKHR")] - public unsafe partial struct PhysicalDeviceAccelerationStructurePropertiesKHR + public unsafe partial struct PhysicalDeviceAccelerationStructurePropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDeviceAccelerationStructurePropertiesKHR ( @@ -134,5 +134,18 @@ public PhysicalDeviceAccelerationStructurePropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "minAccelerationStructureScratchOffsetAlignment")] public uint MinAccelerationStructureScratchOffsetAlignment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceAccelerationStructurePropertiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBlendOperationAdvancedFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBlendOperationAdvancedFeaturesEXT.gen.cs index 74126f7509..700ca3a4e2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBlendOperationAdvancedFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBlendOperationAdvancedFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceBlendOperationAdvancedFeaturesEXT")] - public unsafe partial struct PhysicalDeviceBlendOperationAdvancedFeaturesEXT + public unsafe partial struct PhysicalDeviceBlendOperationAdvancedFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceBlendOperationAdvancedFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceBlendOperationAdvancedFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "advancedBlendCoherentOperations")] public Bool32 AdvancedBlendCoherentOperations; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceBlendOperationAdvancedFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBlendOperationAdvancedPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBlendOperationAdvancedPropertiesEXT.gen.cs index 1c4c0dca21..ac354ffeae 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBlendOperationAdvancedPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBlendOperationAdvancedPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT")] - public unsafe partial struct PhysicalDeviceBlendOperationAdvancedPropertiesEXT + public unsafe partial struct PhysicalDeviceBlendOperationAdvancedPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceBlendOperationAdvancedPropertiesEXT ( @@ -112,5 +112,18 @@ public PhysicalDeviceBlendOperationAdvancedPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "advancedBlendAllOperations")] public Bool32 AdvancedBlendAllOperations; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceBlendOperationAdvancedPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBorderColorSwizzleFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBorderColorSwizzleFeaturesEXT.gen.cs index 92b8806436..e741ee0097 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBorderColorSwizzleFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBorderColorSwizzleFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceBorderColorSwizzleFeaturesEXT")] - public unsafe partial struct PhysicalDeviceBorderColorSwizzleFeaturesEXT + public unsafe partial struct PhysicalDeviceBorderColorSwizzleFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceBorderColorSwizzleFeaturesEXT ( @@ -68,5 +68,18 @@ public PhysicalDeviceBorderColorSwizzleFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "borderColorSwizzleFromImage")] public Bool32 BorderColorSwizzleFromImage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceBorderColorSwizzleFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferAddressFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferAddressFeaturesEXT.gen.cs index 4a63786968..72d78cfa0c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferAddressFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferAddressFeaturesEXT.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceBufferAddressFeaturesEXT")] - public unsafe partial struct PhysicalDeviceBufferAddressFeaturesEXT + [NativeName("AliasOf", "VkPhysicalDeviceBufferDeviceAddressFeaturesEXT")] + public unsafe partial struct PhysicalDeviceBufferAddressFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceBufferAddressFeaturesEXT ( @@ -79,5 +80,18 @@ public PhysicalDeviceBufferAddressFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "bufferDeviceAddressMultiDevice")] public Bool32 BufferDeviceAddressMultiDevice; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceBufferDeviceAddressFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeatures.gen.cs index 72694ea1ad..e6a150ad1f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceBufferDeviceAddressFeatures")] - public unsafe partial struct PhysicalDeviceBufferDeviceAddressFeatures + [NativeName("Aliases", "VkPhysicalDeviceBufferDeviceAddressFeaturesKHR")] + public unsafe partial struct PhysicalDeviceBufferDeviceAddressFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceBufferDeviceAddressFeatures ( @@ -79,5 +80,18 @@ public PhysicalDeviceBufferDeviceAddressFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "bufferDeviceAddressMultiDevice")] public Bool32 BufferDeviceAddressMultiDevice; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceBufferDeviceAddressFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesEXT.gen.cs index 3651804522..8a24e664d6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesEXT.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceBufferDeviceAddressFeaturesEXT")] - public unsafe partial struct PhysicalDeviceBufferDeviceAddressFeaturesEXT + [NativeName("Aliases", "VkPhysicalDeviceBufferAddressFeaturesEXT")] + public unsafe partial struct PhysicalDeviceBufferDeviceAddressFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceBufferDeviceAddressFeaturesEXT ( @@ -79,5 +80,18 @@ public PhysicalDeviceBufferDeviceAddressFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "bufferDeviceAddressMultiDevice")] public Bool32 BufferDeviceAddressMultiDevice; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceBufferDeviceAddressFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesKHR.gen.cs index a033f6998e..24e19f8fe4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceBufferDeviceAddressFeaturesKHR")] - public unsafe partial struct PhysicalDeviceBufferDeviceAddressFeaturesKHR + [NativeName("AliasOf", "VkPhysicalDeviceBufferDeviceAddressFeatures")] + public unsafe partial struct PhysicalDeviceBufferDeviceAddressFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceBufferDeviceAddressFeaturesKHR ( @@ -79,5 +80,18 @@ public PhysicalDeviceBufferDeviceAddressFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "bufferDeviceAddressMultiDevice")] public Bool32 BufferDeviceAddressMultiDevice; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceBufferDeviceAddressFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCoherentMemoryFeaturesAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCoherentMemoryFeaturesAMD.gen.cs index 5b9bb6aedb..2afac53aa9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCoherentMemoryFeaturesAMD.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCoherentMemoryFeaturesAMD.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceCoherentMemoryFeaturesAMD")] - public unsafe partial struct PhysicalDeviceCoherentMemoryFeaturesAMD + public unsafe partial struct PhysicalDeviceCoherentMemoryFeaturesAMD : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceCoherentMemoryFeaturesAMD ( @@ -57,5 +57,18 @@ public PhysicalDeviceCoherentMemoryFeaturesAMD [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "deviceCoherentMemory")] public Bool32 DeviceCoherentMemory; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceCoherentMemoryFeaturesAmd; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceColorWriteEnableFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceColorWriteEnableFeaturesEXT.gen.cs index 1de3edc91b..7bf00dc08d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceColorWriteEnableFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceColorWriteEnableFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceColorWriteEnableFeaturesEXT")] - public unsafe partial struct PhysicalDeviceColorWriteEnableFeaturesEXT + public unsafe partial struct PhysicalDeviceColorWriteEnableFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceColorWriteEnableFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceColorWriteEnableFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "colorWriteEnable")] public Bool32 ColorWriteEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceColorWriteEnableFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceComputeShaderDerivativesFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceComputeShaderDerivativesFeaturesNV.gen.cs index e870ce4077..a7a5897f24 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceComputeShaderDerivativesFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceComputeShaderDerivativesFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceComputeShaderDerivativesFeaturesNV")] - public unsafe partial struct PhysicalDeviceComputeShaderDerivativesFeaturesNV + public unsafe partial struct PhysicalDeviceComputeShaderDerivativesFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceComputeShaderDerivativesFeaturesNV ( @@ -68,5 +68,18 @@ public PhysicalDeviceComputeShaderDerivativesFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "computeDerivativeGroupLinear")] public Bool32 ComputeDerivativeGroupLinear; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceComputeShaderDerivativesFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceConditionalRenderingFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceConditionalRenderingFeaturesEXT.gen.cs index bd68973d19..4d4dbf0932 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceConditionalRenderingFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceConditionalRenderingFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceConditionalRenderingFeaturesEXT")] - public unsafe partial struct PhysicalDeviceConditionalRenderingFeaturesEXT + public unsafe partial struct PhysicalDeviceConditionalRenderingFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceConditionalRenderingFeaturesEXT ( @@ -68,5 +68,18 @@ public PhysicalDeviceConditionalRenderingFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "inheritedConditionalRendering")] public Bool32 InheritedConditionalRendering; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceConditionalRenderingFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceConservativeRasterizationPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceConservativeRasterizationPropertiesEXT.gen.cs index 80dfb183ac..cd86756a5c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceConservativeRasterizationPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceConservativeRasterizationPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceConservativeRasterizationPropertiesEXT")] - public unsafe partial struct PhysicalDeviceConservativeRasterizationPropertiesEXT + public unsafe partial struct PhysicalDeviceConservativeRasterizationPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceConservativeRasterizationPropertiesEXT ( @@ -145,5 +145,18 @@ public PhysicalDeviceConservativeRasterizationPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "conservativeRasterizationPostDepthCoverage")] public Bool32 ConservativeRasterizationPostDepthCoverage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceConservativeRasterizationPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCooperativeMatrixFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCooperativeMatrixFeaturesNV.gen.cs index 28c3ba756f..e4c2421b99 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCooperativeMatrixFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCooperativeMatrixFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceCooperativeMatrixFeaturesNV")] - public unsafe partial struct PhysicalDeviceCooperativeMatrixFeaturesNV + public unsafe partial struct PhysicalDeviceCooperativeMatrixFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceCooperativeMatrixFeaturesNV ( @@ -68,5 +68,18 @@ public PhysicalDeviceCooperativeMatrixFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "cooperativeMatrixRobustBufferAccess")] public Bool32 CooperativeMatrixRobustBufferAccess; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceCooperativeMatrixFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCooperativeMatrixPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCooperativeMatrixPropertiesNV.gen.cs index e5b0ebcdee..c12e48f67e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCooperativeMatrixPropertiesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCooperativeMatrixPropertiesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceCooperativeMatrixPropertiesNV")] - public unsafe partial struct PhysicalDeviceCooperativeMatrixPropertiesNV + public unsafe partial struct PhysicalDeviceCooperativeMatrixPropertiesNV : IExtendsChain, IExtendsChain { public PhysicalDeviceCooperativeMatrixPropertiesNV ( @@ -57,5 +57,18 @@ public PhysicalDeviceCooperativeMatrixPropertiesNV [NativeName("Type.Name", "VkShaderStageFlags")] [NativeName("Name", "cooperativeMatrixSupportedStages")] public ShaderStageFlags CooperativeMatrixSupportedStages; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceCooperativeMatrixPropertiesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCornerSampledImageFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCornerSampledImageFeaturesNV.gen.cs index 85cfe29d4c..5f7e7c39d7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCornerSampledImageFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCornerSampledImageFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceCornerSampledImageFeaturesNV")] - public unsafe partial struct PhysicalDeviceCornerSampledImageFeaturesNV + public unsafe partial struct PhysicalDeviceCornerSampledImageFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceCornerSampledImageFeaturesNV ( @@ -57,5 +57,18 @@ public PhysicalDeviceCornerSampledImageFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "cornerSampledImage")] public Bool32 CornerSampledImage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceCornerSampledImageFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCoverageReductionModeFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCoverageReductionModeFeaturesNV.gen.cs index 1f2f02e01a..cf87868abb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCoverageReductionModeFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCoverageReductionModeFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceCoverageReductionModeFeaturesNV")] - public unsafe partial struct PhysicalDeviceCoverageReductionModeFeaturesNV + public unsafe partial struct PhysicalDeviceCoverageReductionModeFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceCoverageReductionModeFeaturesNV ( @@ -57,5 +57,18 @@ public PhysicalDeviceCoverageReductionModeFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "coverageReductionMode")] public Bool32 CoverageReductionMode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceCoverageReductionModeFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCustomBorderColorFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCustomBorderColorFeaturesEXT.gen.cs index f51c857928..3c491ad86e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCustomBorderColorFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCustomBorderColorFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceCustomBorderColorFeaturesEXT")] - public unsafe partial struct PhysicalDeviceCustomBorderColorFeaturesEXT + public unsafe partial struct PhysicalDeviceCustomBorderColorFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceCustomBorderColorFeaturesEXT ( @@ -68,5 +68,18 @@ public PhysicalDeviceCustomBorderColorFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "customBorderColorWithoutFormat")] public Bool32 CustomBorderColorWithoutFormat; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceCustomBorderColorFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCustomBorderColorPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCustomBorderColorPropertiesEXT.gen.cs index 6960df45e8..88933221d8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCustomBorderColorPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCustomBorderColorPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceCustomBorderColorPropertiesEXT")] - public unsafe partial struct PhysicalDeviceCustomBorderColorPropertiesEXT + public unsafe partial struct PhysicalDeviceCustomBorderColorPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceCustomBorderColorPropertiesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceCustomBorderColorPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxCustomBorderColorSamplers")] public uint MaxCustomBorderColorSamplers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceCustomBorderColorPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV.gen.cs index a6632ba7bd..6492df196b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV")] - public unsafe partial struct PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV + public unsafe partial struct PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV ( @@ -57,5 +57,18 @@ public PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "dedicatedAllocationImageAliasing")] public Bool32 DedicatedAllocationImageAliasing; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthClipEnableFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthClipEnableFeaturesEXT.gen.cs index 7d4127d32f..a0d7f78634 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthClipEnableFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthClipEnableFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDepthClipEnableFeaturesEXT")] - public unsafe partial struct PhysicalDeviceDepthClipEnableFeaturesEXT + public unsafe partial struct PhysicalDeviceDepthClipEnableFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceDepthClipEnableFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceDepthClipEnableFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "depthClipEnable")] public Bool32 DepthClipEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDepthClipEnableFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolveProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolveProperties.gen.cs index 5d40ccc428..70173d2919 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolveProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolveProperties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDepthStencilResolveProperties")] - public unsafe partial struct PhysicalDeviceDepthStencilResolveProperties + [NativeName("Aliases", "VkPhysicalDeviceDepthStencilResolvePropertiesKHR")] + public unsafe partial struct PhysicalDeviceDepthStencilResolveProperties : IExtendsChain, IExtendsChain { public PhysicalDeviceDepthStencilResolveProperties ( @@ -90,5 +91,18 @@ public PhysicalDeviceDepthStencilResolveProperties [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "independentResolve")] public Bool32 IndependentResolve; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDepthStencilResolveProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolvePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolvePropertiesKHR.gen.cs index d90b2dc7cd..503f81d7ef 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolvePropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolvePropertiesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDepthStencilResolvePropertiesKHR")] - public unsafe partial struct PhysicalDeviceDepthStencilResolvePropertiesKHR + [NativeName("AliasOf", "VkPhysicalDeviceDepthStencilResolveProperties")] + public unsafe partial struct PhysicalDeviceDepthStencilResolvePropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDeviceDepthStencilResolvePropertiesKHR ( @@ -90,5 +91,18 @@ public PhysicalDeviceDepthStencilResolvePropertiesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "independentResolve")] public Bool32 IndependentResolve; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDepthStencilResolveProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeatures.gen.cs index e54ebcdc73..8d981fa538 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDescriptorIndexingFeatures")] - public unsafe partial struct PhysicalDeviceDescriptorIndexingFeatures + [NativeName("Aliases", "VkPhysicalDeviceDescriptorIndexingFeaturesEXT")] + public unsafe partial struct PhysicalDeviceDescriptorIndexingFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceDescriptorIndexingFeatures ( @@ -266,5 +267,18 @@ public PhysicalDeviceDescriptorIndexingFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "runtimeDescriptorArray")] public Bool32 RuntimeDescriptorArray; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDescriptorIndexingFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeaturesEXT.gen.cs index 4ab18527b5..ea4ab5b098 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeaturesEXT.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDescriptorIndexingFeaturesEXT")] - public unsafe partial struct PhysicalDeviceDescriptorIndexingFeaturesEXT + [NativeName("AliasOf", "VkPhysicalDeviceDescriptorIndexingFeatures")] + public unsafe partial struct PhysicalDeviceDescriptorIndexingFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceDescriptorIndexingFeaturesEXT ( @@ -266,5 +267,18 @@ public PhysicalDeviceDescriptorIndexingFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "runtimeDescriptorArray")] public Bool32 RuntimeDescriptorArray; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDescriptorIndexingFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingProperties.gen.cs index 21f90850bd..52396b5c05 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingProperties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDescriptorIndexingProperties")] - public unsafe partial struct PhysicalDeviceDescriptorIndexingProperties + [NativeName("Aliases", "VkPhysicalDeviceDescriptorIndexingPropertiesEXT")] + public unsafe partial struct PhysicalDeviceDescriptorIndexingProperties : IExtendsChain, IExtendsChain { public PhysicalDeviceDescriptorIndexingProperties ( @@ -299,5 +300,18 @@ public PhysicalDeviceDescriptorIndexingProperties [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxDescriptorSetUpdateAfterBindInputAttachments")] public uint MaxDescriptorSetUpdateAfterBindInputAttachments; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDescriptorIndexingProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingPropertiesEXT.gen.cs index 5b645661f5..488cd53545 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingPropertiesEXT.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDescriptorIndexingPropertiesEXT")] - public unsafe partial struct PhysicalDeviceDescriptorIndexingPropertiesEXT + [NativeName("AliasOf", "VkPhysicalDeviceDescriptorIndexingProperties")] + public unsafe partial struct PhysicalDeviceDescriptorIndexingPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceDescriptorIndexingPropertiesEXT ( @@ -299,5 +300,18 @@ public PhysicalDeviceDescriptorIndexingPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxDescriptorSetUpdateAfterBindInputAttachments")] public uint MaxDescriptorSetUpdateAfterBindInputAttachments; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDescriptorIndexingProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceGeneratedCommandsFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceGeneratedCommandsFeaturesNV.gen.cs index 1a9e1f6f37..6897510821 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceGeneratedCommandsFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceGeneratedCommandsFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDeviceGeneratedCommandsFeaturesNV")] - public unsafe partial struct PhysicalDeviceDeviceGeneratedCommandsFeaturesNV + public unsafe partial struct PhysicalDeviceDeviceGeneratedCommandsFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceDeviceGeneratedCommandsFeaturesNV ( @@ -57,5 +57,18 @@ public PhysicalDeviceDeviceGeneratedCommandsFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "deviceGeneratedCommands")] public Bool32 DeviceGeneratedCommands; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDeviceGeneratedCommandsFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceGeneratedCommandsPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceGeneratedCommandsPropertiesNV.gen.cs index d8292d1263..74653ab4ce 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceGeneratedCommandsPropertiesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceGeneratedCommandsPropertiesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDeviceGeneratedCommandsPropertiesNV")] - public unsafe partial struct PhysicalDeviceDeviceGeneratedCommandsPropertiesNV + public unsafe partial struct PhysicalDeviceDeviceGeneratedCommandsPropertiesNV : IExtendsChain, IExtendsChain { public PhysicalDeviceDeviceGeneratedCommandsPropertiesNV ( @@ -145,5 +145,18 @@ public PhysicalDeviceDeviceGeneratedCommandsPropertiesNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "minIndirectCommandsBufferOffsetAlignment")] public uint MinIndirectCommandsBufferOffsetAlignment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDeviceGeneratedCommandsPropertiesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceMemoryReportFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceMemoryReportFeaturesEXT.gen.cs index 3b6cc4a601..60cbf93413 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceMemoryReportFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceMemoryReportFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDeviceMemoryReportFeaturesEXT")] - public unsafe partial struct PhysicalDeviceDeviceMemoryReportFeaturesEXT + public unsafe partial struct PhysicalDeviceDeviceMemoryReportFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceDeviceMemoryReportFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceDeviceMemoryReportFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "deviceMemoryReport")] public Bool32 DeviceMemoryReport; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDeviceMemoryReportFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDiagnosticsConfigFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDiagnosticsConfigFeaturesNV.gen.cs index 0efdc51b48..98883f3e8d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDiagnosticsConfigFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDiagnosticsConfigFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDiagnosticsConfigFeaturesNV")] - public unsafe partial struct PhysicalDeviceDiagnosticsConfigFeaturesNV + public unsafe partial struct PhysicalDeviceDiagnosticsConfigFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceDiagnosticsConfigFeaturesNV ( @@ -57,5 +57,18 @@ public PhysicalDeviceDiagnosticsConfigFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "diagnosticsConfig")] public Bool32 DiagnosticsConfig; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDiagnosticsConfigFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDiscardRectanglePropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDiscardRectanglePropertiesEXT.gen.cs index 038b44de8e..396df1fccb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDiscardRectanglePropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDiscardRectanglePropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDiscardRectanglePropertiesEXT")] - public unsafe partial struct PhysicalDeviceDiscardRectanglePropertiesEXT + public unsafe partial struct PhysicalDeviceDiscardRectanglePropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceDiscardRectanglePropertiesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceDiscardRectanglePropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxDiscardRectangles")] public uint MaxDiscardRectangles; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDiscardRectanglePropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverProperties.gen.cs index da964dd1f9..5493359505 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverProperties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDriverProperties")] - public unsafe partial struct PhysicalDeviceDriverProperties + [NativeName("Aliases", "VkPhysicalDeviceDriverPropertiesKHR")] + public unsafe partial struct PhysicalDeviceDriverProperties : IExtendsChain, IExtendsChain { public PhysicalDeviceDriverProperties ( @@ -78,5 +79,18 @@ public PhysicalDeviceDriverProperties [NativeName("Type.Name", "VkConformanceVersion")] [NativeName("Name", "conformanceVersion")] public ConformanceVersion ConformanceVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDriverProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverPropertiesKHR.gen.cs index 7e1301dd45..e71f1163ce 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverPropertiesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDriverPropertiesKHR")] - public unsafe partial struct PhysicalDeviceDriverPropertiesKHR + [NativeName("AliasOf", "VkPhysicalDeviceDriverProperties")] + public unsafe partial struct PhysicalDeviceDriverPropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDeviceDriverPropertiesKHR ( @@ -78,5 +79,18 @@ public PhysicalDeviceDriverPropertiesKHR [NativeName("Type.Name", "VkConformanceVersion")] [NativeName("Name", "conformanceVersion")] public ConformanceVersion ConformanceVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDriverProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDrmPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDrmPropertiesEXT.gen.cs index b3c9f8bb23..0912a7c1b1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDrmPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDrmPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDrmPropertiesEXT")] - public unsafe partial struct PhysicalDeviceDrmPropertiesEXT + public unsafe partial struct PhysicalDeviceDrmPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceDrmPropertiesEXT ( @@ -112,5 +112,18 @@ public PhysicalDeviceDrmPropertiesEXT [NativeName("Type.Name", "int64_t")] [NativeName("Name", "renderMinor")] public long RenderMinor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDrmPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDynamicRenderingFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDynamicRenderingFeaturesKHR.gen.cs index e2702a9cf8..fb494fef71 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDynamicRenderingFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDynamicRenderingFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDynamicRenderingFeaturesKHR")] - public unsafe partial struct PhysicalDeviceDynamicRenderingFeaturesKHR + public unsafe partial struct PhysicalDeviceDynamicRenderingFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceDynamicRenderingFeaturesKHR ( @@ -57,5 +57,18 @@ public PhysicalDeviceDynamicRenderingFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "dynamicRendering")] public Bool32 DynamicRendering; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDynamicRenderingFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExclusiveScissorFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExclusiveScissorFeaturesNV.gen.cs index d60eee12dd..f95929303b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExclusiveScissorFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExclusiveScissorFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExclusiveScissorFeaturesNV")] - public unsafe partial struct PhysicalDeviceExclusiveScissorFeaturesNV + public unsafe partial struct PhysicalDeviceExclusiveScissorFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceExclusiveScissorFeaturesNV ( @@ -57,5 +57,18 @@ public PhysicalDeviceExclusiveScissorFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "exclusiveScissor")] public Bool32 ExclusiveScissor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExclusiveScissorFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExtendedDynamicState2FeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExtendedDynamicState2FeaturesEXT.gen.cs index 436ede350a..809ab28667 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExtendedDynamicState2FeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExtendedDynamicState2FeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExtendedDynamicState2FeaturesEXT")] - public unsafe partial struct PhysicalDeviceExtendedDynamicState2FeaturesEXT + public unsafe partial struct PhysicalDeviceExtendedDynamicState2FeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceExtendedDynamicState2FeaturesEXT ( @@ -79,5 +79,18 @@ public PhysicalDeviceExtendedDynamicState2FeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "extendedDynamicState2PatchControlPoints")] public Bool32 ExtendedDynamicState2PatchControlPoints; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExtendedDynamicState2FeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExtendedDynamicStateFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExtendedDynamicStateFeaturesEXT.gen.cs index 095369c306..17b5b061cc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExtendedDynamicStateFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExtendedDynamicStateFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExtendedDynamicStateFeaturesEXT")] - public unsafe partial struct PhysicalDeviceExtendedDynamicStateFeaturesEXT + public unsafe partial struct PhysicalDeviceExtendedDynamicStateFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceExtendedDynamicStateFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceExtendedDynamicStateFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "extendedDynamicState")] public Bool32 ExtendedDynamicState; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExtendedDynamicStateFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfo.gen.cs index ead84c4e20..e98ccdc257 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalBufferInfo")] - public unsafe partial struct PhysicalDeviceExternalBufferInfo + [NativeName("Aliases", "VkPhysicalDeviceExternalBufferInfoKHR")] + public unsafe partial struct PhysicalDeviceExternalBufferInfo : IChainable { public PhysicalDeviceExternalBufferInfo ( @@ -79,5 +80,18 @@ public PhysicalDeviceExternalBufferInfo [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalBufferInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfoKHR.gen.cs index 0ea403be72..2c9f6b3883 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalBufferInfoKHR")] - public unsafe partial struct PhysicalDeviceExternalBufferInfoKHR + [NativeName("AliasOf", "VkPhysicalDeviceExternalBufferInfo")] + public unsafe partial struct PhysicalDeviceExternalBufferInfoKHR : IChainable { public PhysicalDeviceExternalBufferInfoKHR ( @@ -79,5 +80,18 @@ public PhysicalDeviceExternalBufferInfoKHR [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalBufferInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfo.gen.cs index 0e39013aee..c8214ffd81 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalFenceInfo")] - public unsafe partial struct PhysicalDeviceExternalFenceInfo + [NativeName("Aliases", "VkPhysicalDeviceExternalFenceInfoKHR")] + public unsafe partial struct PhysicalDeviceExternalFenceInfo : IChainable { public PhysicalDeviceExternalFenceInfo ( @@ -57,5 +58,18 @@ public PhysicalDeviceExternalFenceInfo [NativeName("Type.Name", "VkExternalFenceHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalFenceHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalFenceInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfoKHR.gen.cs index bff095483a..7c85621697 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalFenceInfoKHR")] - public unsafe partial struct PhysicalDeviceExternalFenceInfoKHR + [NativeName("AliasOf", "VkPhysicalDeviceExternalFenceInfo")] + public unsafe partial struct PhysicalDeviceExternalFenceInfoKHR : IChainable { public PhysicalDeviceExternalFenceInfoKHR ( @@ -57,5 +58,18 @@ public PhysicalDeviceExternalFenceInfoKHR [NativeName("Type.Name", "VkExternalFenceHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalFenceHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalFenceInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfo.gen.cs index 40a110c063..7d0296d530 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalImageFormatInfo")] - public unsafe partial struct PhysicalDeviceExternalImageFormatInfo + [NativeName("Aliases", "VkPhysicalDeviceExternalImageFormatInfoKHR")] + public unsafe partial struct PhysicalDeviceExternalImageFormatInfo : IExtendsChain, IExtendsChain { public PhysicalDeviceExternalImageFormatInfo ( @@ -57,5 +58,18 @@ public PhysicalDeviceExternalImageFormatInfo [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalImageFormatInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfoKHR.gen.cs index 8149a5bebd..313e0b51d7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalImageFormatInfoKHR")] - public unsafe partial struct PhysicalDeviceExternalImageFormatInfoKHR + [NativeName("AliasOf", "VkPhysicalDeviceExternalImageFormatInfo")] + public unsafe partial struct PhysicalDeviceExternalImageFormatInfoKHR : IExtendsChain, IExtendsChain { public PhysicalDeviceExternalImageFormatInfoKHR ( @@ -57,5 +58,18 @@ public PhysicalDeviceExternalImageFormatInfoKHR [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalImageFormatInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalMemoryHostPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalMemoryHostPropertiesEXT.gen.cs index 754af5e798..54a76d8b6b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalMemoryHostPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalMemoryHostPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalMemoryHostPropertiesEXT")] - public unsafe partial struct PhysicalDeviceExternalMemoryHostPropertiesEXT + public unsafe partial struct PhysicalDeviceExternalMemoryHostPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceExternalMemoryHostPropertiesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceExternalMemoryHostPropertiesEXT [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "minImportedHostPointerAlignment")] public ulong MinImportedHostPointerAlignment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalMemoryHostPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalMemoryRDMAFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalMemoryRDMAFeaturesNV.gen.cs index 88cb7ace3f..69ee84d003 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalMemoryRDMAFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalMemoryRDMAFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalMemoryRDMAFeaturesNV")] - public unsafe partial struct PhysicalDeviceExternalMemoryRDMAFeaturesNV + public unsafe partial struct PhysicalDeviceExternalMemoryRDMAFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceExternalMemoryRDMAFeaturesNV ( @@ -57,5 +57,18 @@ public PhysicalDeviceExternalMemoryRDMAFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "externalMemoryRDMA")] public Bool32 ExternalMemoryRdma; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalMemoryRdmaFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfo.gen.cs index 0dd995e60e..a36c7692c3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalSemaphoreInfo")] - public unsafe partial struct PhysicalDeviceExternalSemaphoreInfo + [NativeName("Aliases", "VkPhysicalDeviceExternalSemaphoreInfoKHR")] + public unsafe partial struct PhysicalDeviceExternalSemaphoreInfo : IChainStart { public PhysicalDeviceExternalSemaphoreInfo ( @@ -57,5 +58,30 @@ public PhysicalDeviceExternalSemaphoreInfo [NativeName("Type.Name", "VkExternalSemaphoreHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalSemaphoreHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalSemaphoreInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PhysicalDeviceExternalSemaphoreInfo Chain( + out PhysicalDeviceExternalSemaphoreInfo capture) + { + capture = new PhysicalDeviceExternalSemaphoreInfo(StructureType.PhysicalDeviceExternalSemaphoreInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfoKHR.gen.cs index d5e07ed20e..be4514d51e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalSemaphoreInfoKHR")] - public unsafe partial struct PhysicalDeviceExternalSemaphoreInfoKHR + [NativeName("AliasOf", "VkPhysicalDeviceExternalSemaphoreInfo")] + public unsafe partial struct PhysicalDeviceExternalSemaphoreInfoKHR : IChainStart { public PhysicalDeviceExternalSemaphoreInfoKHR ( @@ -57,5 +58,30 @@ public PhysicalDeviceExternalSemaphoreInfoKHR [NativeName("Type.Name", "VkExternalSemaphoreHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalSemaphoreHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalSemaphoreInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PhysicalDeviceExternalSemaphoreInfoKHR Chain( + out PhysicalDeviceExternalSemaphoreInfoKHR capture) + { + capture = new PhysicalDeviceExternalSemaphoreInfoKHR(StructureType.PhysicalDeviceExternalSemaphoreInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2.gen.cs index f4e1773ec7..d8b8af4ace 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFeatures2")] - public unsafe partial struct PhysicalDeviceFeatures2 + [NativeName("Aliases", "VkPhysicalDeviceFeatures2KHR")] + public unsafe partial struct PhysicalDeviceFeatures2 : IChainStart, IExtendsChain { public PhysicalDeviceFeatures2 ( @@ -57,5 +58,30 @@ public PhysicalDeviceFeatures2 [NativeName("Type.Name", "VkPhysicalDeviceFeatures")] [NativeName("Name", "features")] public PhysicalDeviceFeatures Features; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFeatures2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PhysicalDeviceFeatures2 Chain( + out PhysicalDeviceFeatures2 capture) + { + capture = new PhysicalDeviceFeatures2(StructureType.PhysicalDeviceFeatures2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2KHR.gen.cs index 20b4e344fe..24225ac347 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFeatures2KHR")] - public unsafe partial struct PhysicalDeviceFeatures2KHR + [NativeName("AliasOf", "VkPhysicalDeviceFeatures2")] + public unsafe partial struct PhysicalDeviceFeatures2KHR : IChainStart, IExtendsChain { public PhysicalDeviceFeatures2KHR ( @@ -57,5 +58,30 @@ public PhysicalDeviceFeatures2KHR [NativeName("Type.Name", "VkPhysicalDeviceFeatures")] [NativeName("Name", "features")] public PhysicalDeviceFeatures Features; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFeatures2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PhysicalDeviceFeatures2KHR Chain( + out PhysicalDeviceFeatures2KHR capture) + { + capture = new PhysicalDeviceFeatures2KHR(StructureType.PhysicalDeviceFeatures2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloat16Int8FeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloat16Int8FeaturesKHR.gen.cs index acac75bd9f..ec4ad9c598 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloat16Int8FeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloat16Int8FeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFloat16Int8FeaturesKHR")] - public unsafe partial struct PhysicalDeviceFloat16Int8FeaturesKHR + [NativeName("AliasOf", "VkPhysicalDeviceShaderFloat16Int8Features")] + public unsafe partial struct PhysicalDeviceFloat16Int8FeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceFloat16Int8FeaturesKHR ( @@ -68,5 +69,18 @@ public PhysicalDeviceFloat16Int8FeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderInt8")] public Bool32 ShaderInt8; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderFloat16Int8Features; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsProperties.gen.cs index 5a56e03703..4dac523f3d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsProperties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFloatControlsProperties")] - public unsafe partial struct PhysicalDeviceFloatControlsProperties + [NativeName("Aliases", "VkPhysicalDeviceFloatControlsPropertiesKHR")] + public unsafe partial struct PhysicalDeviceFloatControlsProperties : IExtendsChain, IExtendsChain { public PhysicalDeviceFloatControlsProperties ( @@ -233,5 +234,18 @@ public PhysicalDeviceFloatControlsProperties [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderRoundingModeRTZFloat64")] public Bool32 ShaderRoundingModeRtzfloat64; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFloatControlsProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsPropertiesKHR.gen.cs index 414ce966f6..7fc9939933 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsPropertiesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFloatControlsPropertiesKHR")] - public unsafe partial struct PhysicalDeviceFloatControlsPropertiesKHR + [NativeName("AliasOf", "VkPhysicalDeviceFloatControlsProperties")] + public unsafe partial struct PhysicalDeviceFloatControlsPropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDeviceFloatControlsPropertiesKHR ( @@ -233,5 +234,18 @@ public PhysicalDeviceFloatControlsPropertiesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderRoundingModeRTZFloat64")] public Bool32 ShaderRoundingModeRtzfloat64; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFloatControlsProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMap2FeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMap2FeaturesEXT.gen.cs index e376432c25..da82850c5f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMap2FeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMap2FeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFragmentDensityMap2FeaturesEXT")] - public unsafe partial struct PhysicalDeviceFragmentDensityMap2FeaturesEXT + public unsafe partial struct PhysicalDeviceFragmentDensityMap2FeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceFragmentDensityMap2FeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceFragmentDensityMap2FeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "fragmentDensityMapDeferred")] public Bool32 FragmentDensityMapDeferred; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentDensityMap2FeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMap2PropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMap2PropertiesEXT.gen.cs index 0b097976b0..a6a375c0a0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMap2PropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMap2PropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFragmentDensityMap2PropertiesEXT")] - public unsafe partial struct PhysicalDeviceFragmentDensityMap2PropertiesEXT + public unsafe partial struct PhysicalDeviceFragmentDensityMap2PropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceFragmentDensityMap2PropertiesEXT ( @@ -90,5 +90,18 @@ public PhysicalDeviceFragmentDensityMap2PropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxDescriptorSetSubsampledSamplers")] public uint MaxDescriptorSetSubsampledSamplers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentDensityMap2PropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMapFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMapFeaturesEXT.gen.cs index 8724d9f3d8..a5a63eccf2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMapFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMapFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFragmentDensityMapFeaturesEXT")] - public unsafe partial struct PhysicalDeviceFragmentDensityMapFeaturesEXT + public unsafe partial struct PhysicalDeviceFragmentDensityMapFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceFragmentDensityMapFeaturesEXT ( @@ -79,5 +79,18 @@ public PhysicalDeviceFragmentDensityMapFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "fragmentDensityMapNonSubsampledImages")] public Bool32 FragmentDensityMapNonSubsampledImages; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentDensityMapFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMapPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMapPropertiesEXT.gen.cs index 9adfaed054..d8b796806d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMapPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMapPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFragmentDensityMapPropertiesEXT")] - public unsafe partial struct PhysicalDeviceFragmentDensityMapPropertiesEXT + public unsafe partial struct PhysicalDeviceFragmentDensityMapPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceFragmentDensityMapPropertiesEXT ( @@ -79,5 +79,18 @@ public PhysicalDeviceFragmentDensityMapPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "fragmentDensityInvocations")] public Bool32 FragmentDensityInvocations; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentDensityMapPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShaderBarycentricFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShaderBarycentricFeaturesNV.gen.cs index 4de881fe47..34562cecc1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShaderBarycentricFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShaderBarycentricFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV")] - public unsafe partial struct PhysicalDeviceFragmentShaderBarycentricFeaturesNV + public unsafe partial struct PhysicalDeviceFragmentShaderBarycentricFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceFragmentShaderBarycentricFeaturesNV ( @@ -57,5 +57,18 @@ public PhysicalDeviceFragmentShaderBarycentricFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "fragmentShaderBarycentric")] public Bool32 FragmentShaderBarycentric; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentShaderBarycentricFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShaderInterlockFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShaderInterlockFeaturesEXT.gen.cs index 2453b85f62..42bae2f7c2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShaderInterlockFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShaderInterlockFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT")] - public unsafe partial struct PhysicalDeviceFragmentShaderInterlockFeaturesEXT + public unsafe partial struct PhysicalDeviceFragmentShaderInterlockFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceFragmentShaderInterlockFeaturesEXT ( @@ -79,5 +79,18 @@ public PhysicalDeviceFragmentShaderInterlockFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "fragmentShaderShadingRateInterlock")] public Bool32 FragmentShaderShadingRateInterlock; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentShaderInterlockFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateEnumsFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateEnumsFeaturesNV.gen.cs index ba46090b4e..4b8871c8a1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateEnumsFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateEnumsFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFragmentShadingRateEnumsFeaturesNV")] - public unsafe partial struct PhysicalDeviceFragmentShadingRateEnumsFeaturesNV + public unsafe partial struct PhysicalDeviceFragmentShadingRateEnumsFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceFragmentShadingRateEnumsFeaturesNV ( @@ -79,5 +79,18 @@ public PhysicalDeviceFragmentShadingRateEnumsFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "noInvocationFragmentShadingRates")] public Bool32 NoInvocationFragmentShadingRates; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentShadingRateEnumsFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateEnumsPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateEnumsPropertiesNV.gen.cs index e8e18ea03b..30888370a1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateEnumsPropertiesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateEnumsPropertiesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFragmentShadingRateEnumsPropertiesNV")] - public unsafe partial struct PhysicalDeviceFragmentShadingRateEnumsPropertiesNV + public unsafe partial struct PhysicalDeviceFragmentShadingRateEnumsPropertiesNV : IExtendsChain, IExtendsChain { public PhysicalDeviceFragmentShadingRateEnumsPropertiesNV ( @@ -57,5 +57,18 @@ public PhysicalDeviceFragmentShadingRateEnumsPropertiesNV [NativeName("Type.Name", "VkSampleCountFlagBits")] [NativeName("Name", "maxFragmentShadingRateInvocationCount")] public SampleCountFlags MaxFragmentShadingRateInvocationCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentShadingRateEnumsPropertiesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateFeaturesKHR.gen.cs index 4e78097452..441040d1b5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFragmentShadingRateFeaturesKHR")] - public unsafe partial struct PhysicalDeviceFragmentShadingRateFeaturesKHR + public unsafe partial struct PhysicalDeviceFragmentShadingRateFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceFragmentShadingRateFeaturesKHR ( @@ -79,5 +79,18 @@ public PhysicalDeviceFragmentShadingRateFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "attachmentFragmentShadingRate")] public Bool32 AttachmentFragmentShadingRate; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentShadingRateFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateKHR.gen.cs index ecd249e727..3a66f062db 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFragmentShadingRateKHR")] - public unsafe partial struct PhysicalDeviceFragmentShadingRateKHR + public unsafe partial struct PhysicalDeviceFragmentShadingRateKHR : IChainable { public PhysicalDeviceFragmentShadingRateKHR ( @@ -68,5 +68,18 @@ public PhysicalDeviceFragmentShadingRateKHR [NativeName("Type.Name", "VkExtent2D")] [NativeName("Name", "fragmentSize")] public Extent2D FragmentSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentShadingRateKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRatePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRatePropertiesKHR.gen.cs index 6c4807d17e..b805fe0f96 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRatePropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRatePropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFragmentShadingRatePropertiesKHR")] - public unsafe partial struct PhysicalDeviceFragmentShadingRatePropertiesKHR + public unsafe partial struct PhysicalDeviceFragmentShadingRatePropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDeviceFragmentShadingRatePropertiesKHR ( @@ -233,5 +233,18 @@ public PhysicalDeviceFragmentShadingRatePropertiesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "fragmentShadingRateStrictMultiplyCombiner")] public Bool32 FragmentShadingRateStrictMultiplyCombiner; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentShadingRatePropertiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGlobalPriorityQueryFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGlobalPriorityQueryFeaturesEXT.gen.cs index 4eb645bca2..13b6ec1aee 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGlobalPriorityQueryFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGlobalPriorityQueryFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT")] - public unsafe partial struct PhysicalDeviceGlobalPriorityQueryFeaturesEXT + public unsafe partial struct PhysicalDeviceGlobalPriorityQueryFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceGlobalPriorityQueryFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceGlobalPriorityQueryFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "globalPriorityQuery")] public Bool32 GlobalPriorityQuery; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceGlobalPriorityQueryFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupProperties.gen.cs index 6c4a90021e..6325c27c20 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupProperties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceGroupProperties")] - public unsafe partial struct PhysicalDeviceGroupProperties + [NativeName("Aliases", "VkPhysicalDeviceGroupPropertiesKHR")] + public unsafe partial struct PhysicalDeviceGroupProperties : IChainable { public PhysicalDeviceGroupProperties ( @@ -130,5 +131,18 @@ public Span AsSpan() [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "subsetAllocation")] public Bool32 SubsetAllocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceGroupProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupPropertiesKHR.gen.cs index a47145b20e..eaec7162f9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupPropertiesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceGroupPropertiesKHR")] - public unsafe partial struct PhysicalDeviceGroupPropertiesKHR + [NativeName("AliasOf", "VkPhysicalDeviceGroupProperties")] + public unsafe partial struct PhysicalDeviceGroupPropertiesKHR : IChainable { public PhysicalDeviceGroupPropertiesKHR ( @@ -130,5 +131,18 @@ public Span AsSpan() [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "subsetAllocation")] public Bool32 SubsetAllocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceGroupProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeatures.gen.cs index 90b4d2b957..d423c4fb3a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceHostQueryResetFeatures")] - public unsafe partial struct PhysicalDeviceHostQueryResetFeatures + [NativeName("Aliases", "VkPhysicalDeviceHostQueryResetFeaturesEXT")] + public unsafe partial struct PhysicalDeviceHostQueryResetFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceHostQueryResetFeatures ( @@ -57,5 +58,18 @@ public PhysicalDeviceHostQueryResetFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "hostQueryReset")] public Bool32 HostQueryReset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceHostQueryResetFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeaturesEXT.gen.cs index 960759f908..7d1d2292d4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeaturesEXT.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceHostQueryResetFeaturesEXT")] - public unsafe partial struct PhysicalDeviceHostQueryResetFeaturesEXT + [NativeName("AliasOf", "VkPhysicalDeviceHostQueryResetFeatures")] + public unsafe partial struct PhysicalDeviceHostQueryResetFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceHostQueryResetFeaturesEXT ( @@ -57,5 +58,18 @@ public PhysicalDeviceHostQueryResetFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "hostQueryReset")] public Bool32 HostQueryReset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceHostQueryResetFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDProperties.gen.cs index f31f1d221c..7feaa32658 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDProperties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceIDProperties")] - public unsafe partial struct PhysicalDeviceIDProperties + [NativeName("Aliases", "VkPhysicalDeviceIDPropertiesKHR")] + public unsafe partial struct PhysicalDeviceIDProperties : IExtendsChain, IExtendsChain { public PhysicalDeviceIDProperties ( @@ -83,5 +84,18 @@ public PhysicalDeviceIDProperties [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "deviceLUIDValid")] public Bool32 DeviceLuidvalid; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceIDProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDPropertiesKHR.gen.cs index 6361368c62..fe329ec530 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDPropertiesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceIDPropertiesKHR")] - public unsafe partial struct PhysicalDeviceIDPropertiesKHR + [NativeName("AliasOf", "VkPhysicalDeviceIDProperties")] + public unsafe partial struct PhysicalDeviceIDPropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDeviceIDPropertiesKHR ( @@ -83,5 +84,18 @@ public PhysicalDeviceIDPropertiesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "deviceLUIDValid")] public Bool32 DeviceLuidvalid; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceIDProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageDrmFormatModifierInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageDrmFormatModifierInfoEXT.gen.cs index cd2f57ab1a..03b4c438ec 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageDrmFormatModifierInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageDrmFormatModifierInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceImageDrmFormatModifierInfoEXT")] - public unsafe partial struct PhysicalDeviceImageDrmFormatModifierInfoEXT + public unsafe partial struct PhysicalDeviceImageDrmFormatModifierInfoEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceImageDrmFormatModifierInfoEXT ( @@ -90,5 +90,18 @@ public PhysicalDeviceImageDrmFormatModifierInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pQueueFamilyIndices")] public uint* PQueueFamilyIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceImageDrmFormatModifierInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2.gen.cs index 7712df5d2e..ad467815e8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceImageFormatInfo2")] - public unsafe partial struct PhysicalDeviceImageFormatInfo2 + [NativeName("Aliases", "VkPhysicalDeviceImageFormatInfo2KHR")] + public unsafe partial struct PhysicalDeviceImageFormatInfo2 : IChainStart { public PhysicalDeviceImageFormatInfo2 ( @@ -101,5 +102,30 @@ public PhysicalDeviceImageFormatInfo2 [NativeName("Type.Name", "VkImageCreateFlags")] [NativeName("Name", "flags")] public ImageCreateFlags Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceImageFormatInfo2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PhysicalDeviceImageFormatInfo2 Chain( + out PhysicalDeviceImageFormatInfo2 capture) + { + capture = new PhysicalDeviceImageFormatInfo2(StructureType.PhysicalDeviceImageFormatInfo2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2KHR.gen.cs index 848c64f026..57d33ff47b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceImageFormatInfo2KHR")] - public unsafe partial struct PhysicalDeviceImageFormatInfo2KHR + [NativeName("AliasOf", "VkPhysicalDeviceImageFormatInfo2")] + public unsafe partial struct PhysicalDeviceImageFormatInfo2KHR : IChainStart { public PhysicalDeviceImageFormatInfo2KHR ( @@ -101,5 +102,30 @@ public PhysicalDeviceImageFormatInfo2KHR [NativeName("Type.Name", "VkImageCreateFlags")] [NativeName("Name", "flags")] public ImageCreateFlags Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceImageFormatInfo2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PhysicalDeviceImageFormatInfo2KHR Chain( + out PhysicalDeviceImageFormatInfo2KHR capture) + { + capture = new PhysicalDeviceImageFormatInfo2KHR(StructureType.PhysicalDeviceImageFormatInfo2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageRobustnessFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageRobustnessFeaturesEXT.gen.cs index f80443a309..60eb6c80fb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageRobustnessFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageRobustnessFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceImageRobustnessFeaturesEXT")] - public unsafe partial struct PhysicalDeviceImageRobustnessFeaturesEXT + public unsafe partial struct PhysicalDeviceImageRobustnessFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceImageRobustnessFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceImageRobustnessFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "robustImageAccess")] public Bool32 RobustImageAccess; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceImageRobustnessFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageViewImageFormatInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageViewImageFormatInfoEXT.gen.cs index 5f201cb781..2b6a0ce1fd 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageViewImageFormatInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageViewImageFormatInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceImageViewImageFormatInfoEXT")] - public unsafe partial struct PhysicalDeviceImageViewImageFormatInfoEXT + public unsafe partial struct PhysicalDeviceImageViewImageFormatInfoEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceImageViewImageFormatInfoEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceImageViewImageFormatInfoEXT [NativeName("Type.Name", "VkImageViewType")] [NativeName("Name", "imageViewType")] public ImageViewType ImageViewType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceImageViewImageFormatInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeatures.gen.cs index 7a2a0bfd3d..a3a3d9cac5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceImagelessFramebufferFeatures")] - public unsafe partial struct PhysicalDeviceImagelessFramebufferFeatures + [NativeName("Aliases", "VkPhysicalDeviceImagelessFramebufferFeaturesKHR")] + public unsafe partial struct PhysicalDeviceImagelessFramebufferFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceImagelessFramebufferFeatures ( @@ -57,5 +58,18 @@ public PhysicalDeviceImagelessFramebufferFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "imagelessFramebuffer")] public Bool32 ImagelessFramebuffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceImagelessFramebufferFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeaturesKHR.gen.cs index d7587d883f..8074d45947 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceImagelessFramebufferFeaturesKHR")] - public unsafe partial struct PhysicalDeviceImagelessFramebufferFeaturesKHR + [NativeName("AliasOf", "VkPhysicalDeviceImagelessFramebufferFeatures")] + public unsafe partial struct PhysicalDeviceImagelessFramebufferFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceImagelessFramebufferFeaturesKHR ( @@ -57,5 +58,18 @@ public PhysicalDeviceImagelessFramebufferFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "imagelessFramebuffer")] public Bool32 ImagelessFramebuffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceImagelessFramebufferFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIndexTypeUint8FeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIndexTypeUint8FeaturesEXT.gen.cs index d44ebe10e8..7af1af5fe7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIndexTypeUint8FeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIndexTypeUint8FeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceIndexTypeUint8FeaturesEXT")] - public unsafe partial struct PhysicalDeviceIndexTypeUint8FeaturesEXT + public unsafe partial struct PhysicalDeviceIndexTypeUint8FeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceIndexTypeUint8FeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceIndexTypeUint8FeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "indexTypeUint8")] public Bool32 IndexTypeUint8; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceIndexTypeUint8FeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInheritedViewportScissorFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInheritedViewportScissorFeaturesNV.gen.cs index ae1e766fab..78fe6cebd2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInheritedViewportScissorFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInheritedViewportScissorFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceInheritedViewportScissorFeaturesNV")] - public unsafe partial struct PhysicalDeviceInheritedViewportScissorFeaturesNV + public unsafe partial struct PhysicalDeviceInheritedViewportScissorFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceInheritedViewportScissorFeaturesNV ( @@ -57,5 +57,18 @@ public PhysicalDeviceInheritedViewportScissorFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "inheritedViewportScissor2D")] public Bool32 InheritedViewportScissor2D; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceInheritedViewportScissorFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInlineUniformBlockFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInlineUniformBlockFeaturesEXT.gen.cs index 129b165694..517c7e0688 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInlineUniformBlockFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInlineUniformBlockFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceInlineUniformBlockFeaturesEXT")] - public unsafe partial struct PhysicalDeviceInlineUniformBlockFeaturesEXT + public unsafe partial struct PhysicalDeviceInlineUniformBlockFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceInlineUniformBlockFeaturesEXT ( @@ -68,5 +68,18 @@ public PhysicalDeviceInlineUniformBlockFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "descriptorBindingInlineUniformBlockUpdateAfterBind")] public Bool32 DescriptorBindingInlineUniformBlockUpdateAfterBind; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceInlineUniformBlockFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInlineUniformBlockPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInlineUniformBlockPropertiesEXT.gen.cs index 784c293632..2fac728bae 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInlineUniformBlockPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInlineUniformBlockPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceInlineUniformBlockPropertiesEXT")] - public unsafe partial struct PhysicalDeviceInlineUniformBlockPropertiesEXT + public unsafe partial struct PhysicalDeviceInlineUniformBlockPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceInlineUniformBlockPropertiesEXT ( @@ -101,5 +101,18 @@ public PhysicalDeviceInlineUniformBlockPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxDescriptorSetUpdateAfterBindInlineUniformBlocks")] public uint MaxDescriptorSetUpdateAfterBindInlineUniformBlocks; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceInlineUniformBlockPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInvocationMaskFeaturesHUAWEI.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInvocationMaskFeaturesHUAWEI.gen.cs index d76e32277b..948371139a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInvocationMaskFeaturesHUAWEI.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInvocationMaskFeaturesHUAWEI.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceInvocationMaskFeaturesHUAWEI")] - public unsafe partial struct PhysicalDeviceInvocationMaskFeaturesHUAWEI + public unsafe partial struct PhysicalDeviceInvocationMaskFeaturesHUAWEI : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceInvocationMaskFeaturesHUAWEI ( @@ -57,5 +57,18 @@ public PhysicalDeviceInvocationMaskFeaturesHUAWEI [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "invocationMask")] public Bool32 InvocationMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceInvocationMaskFeaturesHuawei; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceLineRasterizationFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceLineRasterizationFeaturesEXT.gen.cs index 6c595aff75..ecb55a4b1b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceLineRasterizationFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceLineRasterizationFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceLineRasterizationFeaturesEXT")] - public unsafe partial struct PhysicalDeviceLineRasterizationFeaturesEXT + public unsafe partial struct PhysicalDeviceLineRasterizationFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceLineRasterizationFeaturesEXT ( @@ -112,5 +112,18 @@ public PhysicalDeviceLineRasterizationFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "stippledSmoothLines")] public Bool32 StippledSmoothLines; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceLineRasterizationFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceLineRasterizationPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceLineRasterizationPropertiesEXT.gen.cs index f0626eb715..e87128faff 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceLineRasterizationPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceLineRasterizationPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceLineRasterizationPropertiesEXT")] - public unsafe partial struct PhysicalDeviceLineRasterizationPropertiesEXT + public unsafe partial struct PhysicalDeviceLineRasterizationPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceLineRasterizationPropertiesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceLineRasterizationPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "lineSubPixelPrecisionBits")] public uint LineSubPixelPrecisionBits; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceLineRasterizationPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3Properties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3Properties.gen.cs index d411527072..ba0aea0199 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3Properties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3Properties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMaintenance3Properties")] - public unsafe partial struct PhysicalDeviceMaintenance3Properties + [NativeName("Aliases", "VkPhysicalDeviceMaintenance3PropertiesKHR")] + public unsafe partial struct PhysicalDeviceMaintenance3Properties : IExtendsChain, IExtendsChain { public PhysicalDeviceMaintenance3Properties ( @@ -68,5 +69,18 @@ public PhysicalDeviceMaintenance3Properties [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "maxMemoryAllocationSize")] public ulong MaxMemoryAllocationSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMaintenance3Properties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3PropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3PropertiesKHR.gen.cs index fe3bbf0c93..5fa435054f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3PropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3PropertiesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMaintenance3PropertiesKHR")] - public unsafe partial struct PhysicalDeviceMaintenance3PropertiesKHR + [NativeName("AliasOf", "VkPhysicalDeviceMaintenance3Properties")] + public unsafe partial struct PhysicalDeviceMaintenance3PropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDeviceMaintenance3PropertiesKHR ( @@ -68,5 +69,18 @@ public PhysicalDeviceMaintenance3PropertiesKHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "maxMemoryAllocationSize")] public ulong MaxMemoryAllocationSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMaintenance3Properties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance4FeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance4FeaturesKHR.gen.cs index 87dbbfa2be..2c3f9fa758 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance4FeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance4FeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMaintenance4FeaturesKHR")] - public unsafe partial struct PhysicalDeviceMaintenance4FeaturesKHR + public unsafe partial struct PhysicalDeviceMaintenance4FeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceMaintenance4FeaturesKHR ( @@ -57,5 +57,18 @@ public PhysicalDeviceMaintenance4FeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "maintenance4")] public Bool32 Maintenance4; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMaintenance4FeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance4PropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance4PropertiesKHR.gen.cs index 846a2bab22..23e071479d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance4PropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance4PropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMaintenance4PropertiesKHR")] - public unsafe partial struct PhysicalDeviceMaintenance4PropertiesKHR + public unsafe partial struct PhysicalDeviceMaintenance4PropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDeviceMaintenance4PropertiesKHR ( @@ -57,5 +57,18 @@ public PhysicalDeviceMaintenance4PropertiesKHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "maxBufferSize")] public ulong MaxBufferSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMaintenance4PropertiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryBudgetPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryBudgetPropertiesEXT.gen.cs index ecdfc59030..b7c7498f19 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryBudgetPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryBudgetPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMemoryBudgetPropertiesEXT")] - public unsafe partial struct PhysicalDeviceMemoryBudgetPropertiesEXT + public unsafe partial struct PhysicalDeviceMemoryBudgetPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceMemoryBudgetPropertiesEXT ( @@ -56,5 +56,18 @@ public PhysicalDeviceMemoryBudgetPropertiesEXT [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "heapUsage")] public fixed ulong HeapUsage[16]; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMemoryBudgetPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryPriorityFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryPriorityFeaturesEXT.gen.cs index b0fbffe427..9ef48c07a3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryPriorityFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryPriorityFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMemoryPriorityFeaturesEXT")] - public unsafe partial struct PhysicalDeviceMemoryPriorityFeaturesEXT + public unsafe partial struct PhysicalDeviceMemoryPriorityFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceMemoryPriorityFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceMemoryPriorityFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "memoryPriority")] public Bool32 MemoryPriority; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMemoryPriorityFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2.gen.cs index c3f6a378ce..c67bd53872 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMemoryProperties2")] - public unsafe partial struct PhysicalDeviceMemoryProperties2 + [NativeName("Aliases", "VkPhysicalDeviceMemoryProperties2KHR")] + public unsafe partial struct PhysicalDeviceMemoryProperties2 : IChainStart { public PhysicalDeviceMemoryProperties2 ( @@ -57,5 +58,30 @@ public PhysicalDeviceMemoryProperties2 [NativeName("Type.Name", "VkPhysicalDeviceMemoryProperties")] [NativeName("Name", "memoryProperties")] public PhysicalDeviceMemoryProperties MemoryProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMemoryProperties2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PhysicalDeviceMemoryProperties2 Chain( + out PhysicalDeviceMemoryProperties2 capture) + { + capture = new PhysicalDeviceMemoryProperties2(StructureType.PhysicalDeviceMemoryProperties2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2KHR.gen.cs index 6446da8fb8..e5fcce0339 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMemoryProperties2KHR")] - public unsafe partial struct PhysicalDeviceMemoryProperties2KHR + [NativeName("AliasOf", "VkPhysicalDeviceMemoryProperties2")] + public unsafe partial struct PhysicalDeviceMemoryProperties2KHR : IChainStart { public PhysicalDeviceMemoryProperties2KHR ( @@ -57,5 +58,30 @@ public PhysicalDeviceMemoryProperties2KHR [NativeName("Type.Name", "VkPhysicalDeviceMemoryProperties")] [NativeName("Name", "memoryProperties")] public PhysicalDeviceMemoryProperties MemoryProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMemoryProperties2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PhysicalDeviceMemoryProperties2KHR Chain( + out PhysicalDeviceMemoryProperties2KHR capture) + { + capture = new PhysicalDeviceMemoryProperties2KHR(StructureType.PhysicalDeviceMemoryProperties2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMeshShaderFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMeshShaderFeaturesNV.gen.cs index 342a7f4294..be171ca4b4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMeshShaderFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMeshShaderFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMeshShaderFeaturesNV")] - public unsafe partial struct PhysicalDeviceMeshShaderFeaturesNV + public unsafe partial struct PhysicalDeviceMeshShaderFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceMeshShaderFeaturesNV ( @@ -68,5 +68,18 @@ public PhysicalDeviceMeshShaderFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "meshShader")] public Bool32 MeshShader; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMeshShaderFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMeshShaderPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMeshShaderPropertiesNV.gen.cs index ffa88a1f73..d56385a311 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMeshShaderPropertiesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMeshShaderPropertiesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMeshShaderPropertiesNV")] - public unsafe partial struct PhysicalDeviceMeshShaderPropertiesNV + public unsafe partial struct PhysicalDeviceMeshShaderPropertiesNV : IExtendsChain, IExtendsChain { public PhysicalDeviceMeshShaderPropertiesNV ( @@ -177,5 +177,18 @@ public PhysicalDeviceMeshShaderPropertiesNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "meshOutputPerPrimitiveGranularity")] public uint MeshOutputPerPrimitiveGranularity; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMeshShaderPropertiesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiDrawFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiDrawFeaturesEXT.gen.cs index 3169388c21..22dcdfda0e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiDrawFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiDrawFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMultiDrawFeaturesEXT")] - public unsafe partial struct PhysicalDeviceMultiDrawFeaturesEXT + public unsafe partial struct PhysicalDeviceMultiDrawFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceMultiDrawFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceMultiDrawFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "multiDraw")] public Bool32 MultiDraw; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMultiDrawFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiDrawPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiDrawPropertiesEXT.gen.cs index 17c42d1b67..bb0ef7b633 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiDrawPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiDrawPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMultiDrawPropertiesEXT")] - public unsafe partial struct PhysicalDeviceMultiDrawPropertiesEXT + public unsafe partial struct PhysicalDeviceMultiDrawPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceMultiDrawPropertiesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceMultiDrawPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxMultiDrawCount")] public uint MaxMultiDrawCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMultiDrawPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeatures.gen.cs index a5276091b6..12fa4d29bc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMultiviewFeatures")] - public unsafe partial struct PhysicalDeviceMultiviewFeatures + [NativeName("Aliases", "VkPhysicalDeviceMultiviewFeaturesKHR")] + public unsafe partial struct PhysicalDeviceMultiviewFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceMultiviewFeatures ( @@ -79,5 +80,18 @@ public PhysicalDeviceMultiviewFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "multiviewTessellationShader")] public Bool32 MultiviewTessellationShader; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMultiviewFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeaturesKHR.gen.cs index 0f569628fd..477fe740aa 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMultiviewFeaturesKHR")] - public unsafe partial struct PhysicalDeviceMultiviewFeaturesKHR + [NativeName("AliasOf", "VkPhysicalDeviceMultiviewFeatures")] + public unsafe partial struct PhysicalDeviceMultiviewFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceMultiviewFeaturesKHR ( @@ -79,5 +80,18 @@ public PhysicalDeviceMultiviewFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "multiviewTessellationShader")] public Bool32 MultiviewTessellationShader; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMultiviewFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX.gen.cs index 13c3a70e2a..135fc68d76 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMultiviewPerViewAttributesPropertiesNVX")] - public unsafe partial struct PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX + public unsafe partial struct PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX : IExtendsChain, IExtendsChain { public PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX ( @@ -57,5 +57,18 @@ public PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "perViewPositionAllComponents")] public Bool32 PerViewPositionAllComponents; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMultiviewPerViewAttributesPropertiesNvx; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewProperties.gen.cs index ab2c7d3560..8046392813 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewProperties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMultiviewProperties")] - public unsafe partial struct PhysicalDeviceMultiviewProperties + [NativeName("Aliases", "VkPhysicalDeviceMultiviewPropertiesKHR")] + public unsafe partial struct PhysicalDeviceMultiviewProperties : IExtendsChain, IExtendsChain { public PhysicalDeviceMultiviewProperties ( @@ -68,5 +69,18 @@ public PhysicalDeviceMultiviewProperties [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxMultiviewInstanceIndex")] public uint MaxMultiviewInstanceIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMultiviewProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewPropertiesKHR.gen.cs index 76fb088b5b..bc30aab94d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewPropertiesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMultiviewPropertiesKHR")] - public unsafe partial struct PhysicalDeviceMultiviewPropertiesKHR + [NativeName("AliasOf", "VkPhysicalDeviceMultiviewProperties")] + public unsafe partial struct PhysicalDeviceMultiviewPropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDeviceMultiviewPropertiesKHR ( @@ -68,5 +69,18 @@ public PhysicalDeviceMultiviewPropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxMultiviewInstanceIndex")] public uint MaxMultiviewInstanceIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMultiviewProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMutableDescriptorTypeFeaturesVALVE.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMutableDescriptorTypeFeaturesVALVE.gen.cs index ea53c0ba28..81b8650255 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMutableDescriptorTypeFeaturesVALVE.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMutableDescriptorTypeFeaturesVALVE.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE")] - public unsafe partial struct PhysicalDeviceMutableDescriptorTypeFeaturesVALVE + public unsafe partial struct PhysicalDeviceMutableDescriptorTypeFeaturesVALVE : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceMutableDescriptorTypeFeaturesVALVE ( @@ -57,5 +57,18 @@ public PhysicalDeviceMutableDescriptorTypeFeaturesVALVE [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "mutableDescriptorType")] public Bool32 MutableDescriptorType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMutableDescriptorTypeFeaturesValve; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePCIBusInfoPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePCIBusInfoPropertiesEXT.gen.cs index 541026d0f9..966694fc01 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePCIBusInfoPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePCIBusInfoPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePCIBusInfoPropertiesEXT")] - public unsafe partial struct PhysicalDevicePCIBusInfoPropertiesEXT + public unsafe partial struct PhysicalDevicePCIBusInfoPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDevicePCIBusInfoPropertiesEXT ( @@ -90,5 +90,18 @@ public PhysicalDevicePCIBusInfoPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pciFunction")] public uint PciFunction; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePciBusInfoPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT.gen.cs index 83103d80e2..4ffc0b7c35 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePageableDeviceLocalMemoryFeaturesEXT")] - public unsafe partial struct PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT + public unsafe partial struct PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "pageableDeviceLocalMemory")] public Bool32 PageableDeviceLocalMemory; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePageableDeviceLocalMemoryFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePerformanceQueryFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePerformanceQueryFeaturesKHR.gen.cs index af502ea695..fe5ef2ab61 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePerformanceQueryFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePerformanceQueryFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePerformanceQueryFeaturesKHR")] - public unsafe partial struct PhysicalDevicePerformanceQueryFeaturesKHR + public unsafe partial struct PhysicalDevicePerformanceQueryFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDevicePerformanceQueryFeaturesKHR ( @@ -68,5 +68,18 @@ public PhysicalDevicePerformanceQueryFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "performanceCounterMultipleQueryPools")] public Bool32 PerformanceCounterMultipleQueryPools; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePerformanceQueryFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePerformanceQueryPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePerformanceQueryPropertiesKHR.gen.cs index dc81ff8b19..6ce4a5914f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePerformanceQueryPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePerformanceQueryPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePerformanceQueryPropertiesKHR")] - public unsafe partial struct PhysicalDevicePerformanceQueryPropertiesKHR + public unsafe partial struct PhysicalDevicePerformanceQueryPropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDevicePerformanceQueryPropertiesKHR ( @@ -57,5 +57,18 @@ public PhysicalDevicePerformanceQueryPropertiesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "allowCommandBufferQueryCopies")] public Bool32 AllowCommandBufferQueryCopies; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePerformanceQueryPropertiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePipelineCreationCacheControlFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePipelineCreationCacheControlFeaturesEXT.gen.cs index 51c1f5bbda..6e7ae484b9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePipelineCreationCacheControlFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePipelineCreationCacheControlFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT")] - public unsafe partial struct PhysicalDevicePipelineCreationCacheControlFeaturesEXT + public unsafe partial struct PhysicalDevicePipelineCreationCacheControlFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDevicePipelineCreationCacheControlFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDevicePipelineCreationCacheControlFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "pipelineCreationCacheControl")] public Bool32 PipelineCreationCacheControl; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePipelineCreationCacheControlFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePipelineExecutablePropertiesFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePipelineExecutablePropertiesFeaturesKHR.gen.cs index 2c0c152b9c..bab58cc982 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePipelineExecutablePropertiesFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePipelineExecutablePropertiesFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePipelineExecutablePropertiesFeaturesKHR")] - public unsafe partial struct PhysicalDevicePipelineExecutablePropertiesFeaturesKHR + public unsafe partial struct PhysicalDevicePipelineExecutablePropertiesFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDevicePipelineExecutablePropertiesFeaturesKHR ( @@ -57,5 +57,18 @@ public PhysicalDevicePipelineExecutablePropertiesFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "pipelineExecutableInfo")] public Bool32 PipelineExecutableInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePipelineExecutablePropertiesFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingProperties.gen.cs index af4432e044..bfc7da014f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingProperties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePointClippingProperties")] - public unsafe partial struct PhysicalDevicePointClippingProperties + [NativeName("Aliases", "VkPhysicalDevicePointClippingPropertiesKHR")] + public unsafe partial struct PhysicalDevicePointClippingProperties : IExtendsChain, IExtendsChain { public PhysicalDevicePointClippingProperties ( @@ -57,5 +58,18 @@ public PhysicalDevicePointClippingProperties [NativeName("Type.Name", "VkPointClippingBehavior")] [NativeName("Name", "pointClippingBehavior")] public PointClippingBehavior PointClippingBehavior; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePointClippingProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingPropertiesKHR.gen.cs index f5a57662b5..b32ea0027b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingPropertiesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePointClippingPropertiesKHR")] - public unsafe partial struct PhysicalDevicePointClippingPropertiesKHR + [NativeName("AliasOf", "VkPhysicalDevicePointClippingProperties")] + public unsafe partial struct PhysicalDevicePointClippingPropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDevicePointClippingPropertiesKHR ( @@ -57,5 +58,18 @@ public PhysicalDevicePointClippingPropertiesKHR [NativeName("Type.Name", "VkPointClippingBehavior")] [NativeName("Name", "pointClippingBehavior")] public PointClippingBehavior PointClippingBehavior; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePointClippingProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePortabilitySubsetFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePortabilitySubsetFeaturesKHR.gen.cs index 670295a1e2..b3383755d5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePortabilitySubsetFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePortabilitySubsetFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePortabilitySubsetFeaturesKHR")] - public unsafe partial struct PhysicalDevicePortabilitySubsetFeaturesKHR + public unsafe partial struct PhysicalDevicePortabilitySubsetFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDevicePortabilitySubsetFeaturesKHR ( @@ -211,5 +211,18 @@ public PhysicalDevicePortabilitySubsetFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "vertexAttributeAccessBeyondStride")] public Bool32 VertexAttributeAccessBeyondStride; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePortabilitySubsetFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePortabilitySubsetPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePortabilitySubsetPropertiesKHR.gen.cs index 653a19b7e1..de918e3303 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePortabilitySubsetPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePortabilitySubsetPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePortabilitySubsetPropertiesKHR")] - public unsafe partial struct PhysicalDevicePortabilitySubsetPropertiesKHR + public unsafe partial struct PhysicalDevicePortabilitySubsetPropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDevicePortabilitySubsetPropertiesKHR ( @@ -57,5 +57,18 @@ public PhysicalDevicePortabilitySubsetPropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "minVertexInputBindingStrideAlignment")] public uint MinVertexInputBindingStrideAlignment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePortabilitySubsetPropertiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentIdFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentIdFeaturesKHR.gen.cs index 7a313d2103..093535fe99 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentIdFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentIdFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePresentIdFeaturesKHR")] - public unsafe partial struct PhysicalDevicePresentIdFeaturesKHR + public unsafe partial struct PhysicalDevicePresentIdFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDevicePresentIdFeaturesKHR ( @@ -57,5 +57,18 @@ public PhysicalDevicePresentIdFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "presentId")] public Bool32 PresentId; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePresentIDFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentWaitFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentWaitFeaturesKHR.gen.cs index 7c70bec94e..c268eb35f3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentWaitFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentWaitFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePresentWaitFeaturesKHR")] - public unsafe partial struct PhysicalDevicePresentWaitFeaturesKHR + public unsafe partial struct PhysicalDevicePresentWaitFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDevicePresentWaitFeaturesKHR ( @@ -57,5 +57,18 @@ public PhysicalDevicePresentWaitFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "presentWait")] public Bool32 PresentWait; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePresentWaitFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentationPropertiesANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentationPropertiesANDROID.gen.cs index 018ba3b19c..3a2800399e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentationPropertiesANDROID.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentationPropertiesANDROID.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePresentationPropertiesANDROID")] - public unsafe partial struct PhysicalDevicePresentationPropertiesANDROID + public unsafe partial struct PhysicalDevicePresentationPropertiesANDROID : IChainable { public PhysicalDevicePresentationPropertiesANDROID ( @@ -57,5 +57,18 @@ public PhysicalDevicePresentationPropertiesANDROID [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "sharedImage")] public Bool32 SharedImage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePresentationPropertiesAndroid; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT.gen.cs index cfc2a15a7e..4267f455e0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePrimitiveTopologyListRestartFeaturesEXT")] - public unsafe partial struct PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT + public unsafe partial struct PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT ( @@ -68,5 +68,18 @@ public PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "primitiveTopologyPatchListRestart")] public Bool32 PrimitiveTopologyPatchListRestart; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePrimitiveTopologyListRestartFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePrivateDataFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePrivateDataFeaturesEXT.gen.cs index 4cc9c2b120..f35b3d8209 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePrivateDataFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePrivateDataFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePrivateDataFeaturesEXT")] - public unsafe partial struct PhysicalDevicePrivateDataFeaturesEXT + public unsafe partial struct PhysicalDevicePrivateDataFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDevicePrivateDataFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDevicePrivateDataFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "privateData")] public Bool32 PrivateData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePrivateDataFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2.gen.cs index 3cb15e6234..a78352c241 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceProperties2")] - public unsafe partial struct PhysicalDeviceProperties2 + [NativeName("Aliases", "VkPhysicalDeviceProperties2KHR")] + public unsafe partial struct PhysicalDeviceProperties2 : IChainStart { public PhysicalDeviceProperties2 ( @@ -57,5 +58,30 @@ public PhysicalDeviceProperties2 [NativeName("Type.Name", "VkPhysicalDeviceProperties")] [NativeName("Name", "properties")] public PhysicalDeviceProperties Properties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceProperties2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PhysicalDeviceProperties2 Chain( + out PhysicalDeviceProperties2 capture) + { + capture = new PhysicalDeviceProperties2(StructureType.PhysicalDeviceProperties2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2KHR.gen.cs index 18136a8ab4..43103027bf 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceProperties2KHR")] - public unsafe partial struct PhysicalDeviceProperties2KHR + [NativeName("AliasOf", "VkPhysicalDeviceProperties2")] + public unsafe partial struct PhysicalDeviceProperties2KHR : IChainStart { public PhysicalDeviceProperties2KHR ( @@ -57,5 +58,30 @@ public PhysicalDeviceProperties2KHR [NativeName("Type.Name", "VkPhysicalDeviceProperties")] [NativeName("Name", "properties")] public PhysicalDeviceProperties Properties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceProperties2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PhysicalDeviceProperties2KHR Chain( + out PhysicalDeviceProperties2KHR capture) + { + capture = new PhysicalDeviceProperties2KHR(StructureType.PhysicalDeviceProperties2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProtectedMemoryFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProtectedMemoryFeatures.gen.cs index 813c4ba1ed..4aac4c7960 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProtectedMemoryFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProtectedMemoryFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceProtectedMemoryFeatures")] - public unsafe partial struct PhysicalDeviceProtectedMemoryFeatures + public unsafe partial struct PhysicalDeviceProtectedMemoryFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceProtectedMemoryFeatures ( @@ -57,5 +57,18 @@ public PhysicalDeviceProtectedMemoryFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "protectedMemory")] public Bool32 ProtectedMemory; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceProtectedMemoryFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProtectedMemoryProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProtectedMemoryProperties.gen.cs index c7f18ffb3d..c18cf88b01 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProtectedMemoryProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProtectedMemoryProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceProtectedMemoryProperties")] - public unsafe partial struct PhysicalDeviceProtectedMemoryProperties + public unsafe partial struct PhysicalDeviceProtectedMemoryProperties : IExtendsChain, IExtendsChain { public PhysicalDeviceProtectedMemoryProperties ( @@ -57,5 +57,18 @@ public PhysicalDeviceProtectedMemoryProperties [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "protectedNoFault")] public Bool32 ProtectedNoFault; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceProtectedMemoryProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProvokingVertexFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProvokingVertexFeaturesEXT.gen.cs index 425cab6640..425105a4e1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProvokingVertexFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProvokingVertexFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceProvokingVertexFeaturesEXT")] - public unsafe partial struct PhysicalDeviceProvokingVertexFeaturesEXT + public unsafe partial struct PhysicalDeviceProvokingVertexFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceProvokingVertexFeaturesEXT ( @@ -68,5 +68,18 @@ public PhysicalDeviceProvokingVertexFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "transformFeedbackPreservesProvokingVertex")] public Bool32 TransformFeedbackPreservesProvokingVertex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceProvokingVertexFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProvokingVertexPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProvokingVertexPropertiesEXT.gen.cs index 40b450791a..726f9d496d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProvokingVertexPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProvokingVertexPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceProvokingVertexPropertiesEXT")] - public unsafe partial struct PhysicalDeviceProvokingVertexPropertiesEXT + public unsafe partial struct PhysicalDeviceProvokingVertexPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceProvokingVertexPropertiesEXT ( @@ -68,5 +68,18 @@ public PhysicalDeviceProvokingVertexPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "transformFeedbackPreservesTriangleFanProvokingVertex")] public Bool32 TransformFeedbackPreservesTriangleFanProvokingVertex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceProvokingVertexPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePushDescriptorPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePushDescriptorPropertiesKHR.gen.cs index 8dec550efd..fe1bc5a4d9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePushDescriptorPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePushDescriptorPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePushDescriptorPropertiesKHR")] - public unsafe partial struct PhysicalDevicePushDescriptorPropertiesKHR + public unsafe partial struct PhysicalDevicePushDescriptorPropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDevicePushDescriptorPropertiesKHR ( @@ -57,5 +57,18 @@ public PhysicalDevicePushDescriptorPropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxPushDescriptors")] public uint MaxPushDescriptors; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePushDescriptorPropertiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRGBA10X6FormatsFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRGBA10X6FormatsFeaturesEXT.gen.cs index 0b20691f99..d97f5993f9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRGBA10X6FormatsFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRGBA10X6FormatsFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT")] - public unsafe partial struct PhysicalDeviceRGBA10X6FormatsFeaturesEXT + public unsafe partial struct PhysicalDeviceRGBA10X6FormatsFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceRGBA10X6FormatsFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceRGBA10X6FormatsFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "formatRgba10x6WithoutYCbCrSampler")] public Bool32 FormatRgba10x6WithoutYCbCrSampler; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRgba10X6FormatsFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayQueryFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayQueryFeaturesKHR.gen.cs index de7d0288e1..f9b84401ff 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayQueryFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayQueryFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceRayQueryFeaturesKHR")] - public unsafe partial struct PhysicalDeviceRayQueryFeaturesKHR + public unsafe partial struct PhysicalDeviceRayQueryFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceRayQueryFeaturesKHR ( @@ -57,5 +57,18 @@ public PhysicalDeviceRayQueryFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "rayQuery")] public Bool32 RayQuery; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRayQueryFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingMotionBlurFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingMotionBlurFeaturesNV.gen.cs index e078094f16..2b94874fac 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingMotionBlurFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingMotionBlurFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceRayTracingMotionBlurFeaturesNV")] - public unsafe partial struct PhysicalDeviceRayTracingMotionBlurFeaturesNV + public unsafe partial struct PhysicalDeviceRayTracingMotionBlurFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceRayTracingMotionBlurFeaturesNV ( @@ -68,5 +68,18 @@ public PhysicalDeviceRayTracingMotionBlurFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "rayTracingMotionBlurPipelineTraceRaysIndirect")] public Bool32 RayTracingMotionBlurPipelineTraceRaysIndirect; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRayTracingMotionBlurFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPipelineFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPipelineFeaturesKHR.gen.cs index f34205a06d..73ced5a172 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPipelineFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPipelineFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceRayTracingPipelineFeaturesKHR")] - public unsafe partial struct PhysicalDeviceRayTracingPipelineFeaturesKHR + public unsafe partial struct PhysicalDeviceRayTracingPipelineFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceRayTracingPipelineFeaturesKHR ( @@ -101,5 +101,18 @@ public PhysicalDeviceRayTracingPipelineFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "rayTraversalPrimitiveCulling")] public Bool32 RayTraversalPrimitiveCulling; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRayTracingPipelineFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPipelinePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPipelinePropertiesKHR.gen.cs index f0c275d2de..610727cff0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPipelinePropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPipelinePropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceRayTracingPipelinePropertiesKHR")] - public unsafe partial struct PhysicalDeviceRayTracingPipelinePropertiesKHR + public unsafe partial struct PhysicalDeviceRayTracingPipelinePropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDeviceRayTracingPipelinePropertiesKHR ( @@ -134,5 +134,18 @@ public PhysicalDeviceRayTracingPipelinePropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxRayHitAttributeSize")] public uint MaxRayHitAttributeSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRayTracingPipelinePropertiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPropertiesNV.gen.cs index be7b5e0f44..a502280f55 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPropertiesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPropertiesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceRayTracingPropertiesNV")] - public unsafe partial struct PhysicalDeviceRayTracingPropertiesNV + public unsafe partial struct PhysicalDeviceRayTracingPropertiesNV : IExtendsChain, IExtendsChain { public PhysicalDeviceRayTracingPropertiesNV ( @@ -134,5 +134,18 @@ public PhysicalDeviceRayTracingPropertiesNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxDescriptorSetAccelerationStructures")] public uint MaxDescriptorSetAccelerationStructures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRayTracingPropertiesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRepresentativeFragmentTestFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRepresentativeFragmentTestFeaturesNV.gen.cs index f32f19627d..10048a5a0f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRepresentativeFragmentTestFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRepresentativeFragmentTestFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceRepresentativeFragmentTestFeaturesNV")] - public unsafe partial struct PhysicalDeviceRepresentativeFragmentTestFeaturesNV + public unsafe partial struct PhysicalDeviceRepresentativeFragmentTestFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceRepresentativeFragmentTestFeaturesNV ( @@ -57,5 +57,18 @@ public PhysicalDeviceRepresentativeFragmentTestFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "representativeFragmentTest")] public Bool32 RepresentativeFragmentTest; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRepresentativeFragmentTestFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRobustness2FeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRobustness2FeaturesEXT.gen.cs index 89b4613ec8..580bc836a3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRobustness2FeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRobustness2FeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceRobustness2FeaturesEXT")] - public unsafe partial struct PhysicalDeviceRobustness2FeaturesEXT + public unsafe partial struct PhysicalDeviceRobustness2FeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceRobustness2FeaturesEXT ( @@ -79,5 +79,18 @@ public PhysicalDeviceRobustness2FeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "nullDescriptor")] public Bool32 NullDescriptor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRobustness2FeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRobustness2PropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRobustness2PropertiesEXT.gen.cs index 62b18c6c47..faa9501cb6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRobustness2PropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRobustness2PropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceRobustness2PropertiesEXT")] - public unsafe partial struct PhysicalDeviceRobustness2PropertiesEXT + public unsafe partial struct PhysicalDeviceRobustness2PropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceRobustness2PropertiesEXT ( @@ -68,5 +68,18 @@ public PhysicalDeviceRobustness2PropertiesEXT [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "robustUniformBufferAccessSizeAlignment")] public ulong RobustUniformBufferAccessSizeAlignment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRobustness2PropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSampleLocationsPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSampleLocationsPropertiesEXT.gen.cs index 5009a57cea..6b63bd65f0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSampleLocationsPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSampleLocationsPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSampleLocationsPropertiesEXT")] - public unsafe partial struct PhysicalDeviceSampleLocationsPropertiesEXT + public unsafe partial struct PhysicalDeviceSampleLocationsPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceSampleLocationsPropertiesEXT ( @@ -95,5 +95,18 @@ public PhysicalDeviceSampleLocationsPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "variableSampleLocations")] public Bool32 VariableSampleLocations; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSampleLocationsPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxProperties.gen.cs index 2152bc626d..0fd71e36c9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxProperties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSamplerFilterMinmaxProperties")] - public unsafe partial struct PhysicalDeviceSamplerFilterMinmaxProperties + [NativeName("Aliases", "VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT")] + public unsafe partial struct PhysicalDeviceSamplerFilterMinmaxProperties : IExtendsChain, IExtendsChain { public PhysicalDeviceSamplerFilterMinmaxProperties ( @@ -68,5 +69,18 @@ public PhysicalDeviceSamplerFilterMinmaxProperties [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "filterMinmaxImageComponentMapping")] public Bool32 FilterMinmaxImageComponentMapping; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSamplerFilterMinmaxProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxPropertiesEXT.gen.cs index 7d3aee1097..43b2b35696 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxPropertiesEXT.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT")] - public unsafe partial struct PhysicalDeviceSamplerFilterMinmaxPropertiesEXT + [NativeName("AliasOf", "VkPhysicalDeviceSamplerFilterMinmaxProperties")] + public unsafe partial struct PhysicalDeviceSamplerFilterMinmaxPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceSamplerFilterMinmaxPropertiesEXT ( @@ -68,5 +69,18 @@ public PhysicalDeviceSamplerFilterMinmaxPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "filterMinmaxImageComponentMapping")] public Bool32 FilterMinmaxImageComponentMapping; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSamplerFilterMinmaxProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeatures.gen.cs index 96a15c26b2..bf4cd37cf9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSamplerYcbcrConversionFeatures")] - public unsafe partial struct PhysicalDeviceSamplerYcbcrConversionFeatures + [NativeName("Aliases", "VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR")] + public unsafe partial struct PhysicalDeviceSamplerYcbcrConversionFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceSamplerYcbcrConversionFeatures ( @@ -57,5 +58,18 @@ public PhysicalDeviceSamplerYcbcrConversionFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "samplerYcbcrConversion")] public Bool32 SamplerYcbcrConversion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSamplerYcbcrConversionFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeaturesKHR.gen.cs index b8ba9cb9dc..ea1b0f03d5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR")] - public unsafe partial struct PhysicalDeviceSamplerYcbcrConversionFeaturesKHR + [NativeName("AliasOf", "VkPhysicalDeviceSamplerYcbcrConversionFeatures")] + public unsafe partial struct PhysicalDeviceSamplerYcbcrConversionFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceSamplerYcbcrConversionFeaturesKHR ( @@ -57,5 +58,18 @@ public PhysicalDeviceSamplerYcbcrConversionFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "samplerYcbcrConversion")] public Bool32 SamplerYcbcrConversion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSamplerYcbcrConversionFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeatures.gen.cs index 6ed8cb0809..f9615a7c22 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceScalarBlockLayoutFeatures")] - public unsafe partial struct PhysicalDeviceScalarBlockLayoutFeatures + [NativeName("Aliases", "VkPhysicalDeviceScalarBlockLayoutFeaturesEXT")] + public unsafe partial struct PhysicalDeviceScalarBlockLayoutFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceScalarBlockLayoutFeatures ( @@ -57,5 +58,18 @@ public PhysicalDeviceScalarBlockLayoutFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "scalarBlockLayout")] public Bool32 ScalarBlockLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceScalarBlockLayoutFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeaturesEXT.gen.cs index 05c40b771e..7bf8b76e34 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeaturesEXT.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceScalarBlockLayoutFeaturesEXT")] - public unsafe partial struct PhysicalDeviceScalarBlockLayoutFeaturesEXT + [NativeName("AliasOf", "VkPhysicalDeviceScalarBlockLayoutFeatures")] + public unsafe partial struct PhysicalDeviceScalarBlockLayoutFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceScalarBlockLayoutFeaturesEXT ( @@ -57,5 +58,18 @@ public PhysicalDeviceScalarBlockLayoutFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "scalarBlockLayout")] public Bool32 ScalarBlockLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceScalarBlockLayoutFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeatures.gen.cs index 0b8fb76dff..0fda8dc2b8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures")] - public unsafe partial struct PhysicalDeviceSeparateDepthStencilLayoutsFeatures + [NativeName("Aliases", "VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR")] + public unsafe partial struct PhysicalDeviceSeparateDepthStencilLayoutsFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceSeparateDepthStencilLayoutsFeatures ( @@ -57,5 +58,18 @@ public PhysicalDeviceSeparateDepthStencilLayoutsFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "separateDepthStencilLayouts")] public Bool32 SeparateDepthStencilLayouts; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSeparateDepthStencilLayoutsFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR.gen.cs index 70883b2b8d..850b417c6c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR")] - public unsafe partial struct PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR + [NativeName("AliasOf", "VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures")] + public unsafe partial struct PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR ( @@ -57,5 +58,18 @@ public PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "separateDepthStencilLayouts")] public Bool32 SeparateDepthStencilLayouts; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSeparateDepthStencilLayoutsFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicFloat2FeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicFloat2FeaturesEXT.gen.cs index e7edcb81ea..fbd4dfb868 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicFloat2FeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicFloat2FeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT")] - public unsafe partial struct PhysicalDeviceShaderAtomicFloat2FeaturesEXT + public unsafe partial struct PhysicalDeviceShaderAtomicFloat2FeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderAtomicFloat2FeaturesEXT ( @@ -178,5 +178,18 @@ public PhysicalDeviceShaderAtomicFloat2FeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "sparseImageFloat32AtomicMinMax")] public Bool32 SparseImageFloat32AtomicMinMax; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderAtomicFloat2FeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicFloatFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicFloatFeaturesEXT.gen.cs index 7417b8baae..cde0ac7b33 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicFloatFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicFloatFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderAtomicFloatFeaturesEXT")] - public unsafe partial struct PhysicalDeviceShaderAtomicFloatFeaturesEXT + public unsafe partial struct PhysicalDeviceShaderAtomicFloatFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderAtomicFloatFeaturesEXT ( @@ -178,5 +178,18 @@ public PhysicalDeviceShaderAtomicFloatFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "sparseImageFloat32AtomicAdd")] public Bool32 SparseImageFloat32AtomicAdd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderAtomicFloatFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64Features.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64Features.gen.cs index 8622c16e5e..17eeaf7a88 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64Features.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64Features.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderAtomicInt64Features")] - public unsafe partial struct PhysicalDeviceShaderAtomicInt64Features + [NativeName("Aliases", "VkPhysicalDeviceShaderAtomicInt64FeaturesKHR")] + public unsafe partial struct PhysicalDeviceShaderAtomicInt64Features : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderAtomicInt64Features ( @@ -68,5 +69,18 @@ public PhysicalDeviceShaderAtomicInt64Features [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderSharedInt64Atomics")] public Bool32 ShaderSharedInt64Atomics; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderAtomicInt64Features; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64FeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64FeaturesKHR.gen.cs index 57a49dcd8b..84baf3b9fa 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64FeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64FeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderAtomicInt64FeaturesKHR")] - public unsafe partial struct PhysicalDeviceShaderAtomicInt64FeaturesKHR + [NativeName("AliasOf", "VkPhysicalDeviceShaderAtomicInt64Features")] + public unsafe partial struct PhysicalDeviceShaderAtomicInt64FeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderAtomicInt64FeaturesKHR ( @@ -68,5 +69,18 @@ public PhysicalDeviceShaderAtomicInt64FeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderSharedInt64Atomics")] public Bool32 ShaderSharedInt64Atomics; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderAtomicInt64Features; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderClockFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderClockFeaturesKHR.gen.cs index 15a1d53cf7..6b79398d83 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderClockFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderClockFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderClockFeaturesKHR")] - public unsafe partial struct PhysicalDeviceShaderClockFeaturesKHR + public unsafe partial struct PhysicalDeviceShaderClockFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderClockFeaturesKHR ( @@ -68,5 +68,18 @@ public PhysicalDeviceShaderClockFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderDeviceClock")] public Bool32 ShaderDeviceClock; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderClockFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderCoreProperties2AMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderCoreProperties2AMD.gen.cs index 56f03e9655..5ded1ccd30 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderCoreProperties2AMD.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderCoreProperties2AMD.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderCoreProperties2AMD")] - public unsafe partial struct PhysicalDeviceShaderCoreProperties2AMD + public unsafe partial struct PhysicalDeviceShaderCoreProperties2AMD : IExtendsChain, IExtendsChain { public PhysicalDeviceShaderCoreProperties2AMD ( @@ -68,5 +68,18 @@ public PhysicalDeviceShaderCoreProperties2AMD [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "activeComputeUnitCount")] public uint ActiveComputeUnitCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderCoreProperties2Amd; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderCorePropertiesAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderCorePropertiesAMD.gen.cs index f36f0edc5e..2bbda65464 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderCorePropertiesAMD.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderCorePropertiesAMD.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderCorePropertiesAMD")] - public unsafe partial struct PhysicalDeviceShaderCorePropertiesAMD + public unsafe partial struct PhysicalDeviceShaderCorePropertiesAMD : IExtendsChain, IExtendsChain { public PhysicalDeviceShaderCorePropertiesAMD ( @@ -200,5 +200,18 @@ public PhysicalDeviceShaderCorePropertiesAMD [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "vgprAllocationGranularity")] public uint VgprAllocationGranularity; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderCorePropertiesAmd; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT.gen.cs index 9c39f62017..05c010f5a4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT")] - public unsafe partial struct PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT + public unsafe partial struct PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderDemoteToHelperInvocation")] public Bool32 ShaderDemoteToHelperInvocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderDemoteToHelperInvocationFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParameterFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParameterFeatures.gen.cs index b2846c7ad5..82422a4d0d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParameterFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParameterFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderDrawParameterFeatures")] - public unsafe partial struct PhysicalDeviceShaderDrawParameterFeatures + [NativeName("AliasOf", "VkPhysicalDeviceShaderDrawParametersFeatures")] + public unsafe partial struct PhysicalDeviceShaderDrawParameterFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderDrawParameterFeatures ( @@ -57,5 +58,18 @@ public PhysicalDeviceShaderDrawParameterFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderDrawParameters")] public Bool32 ShaderDrawParameters; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderDrawParametersFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParametersFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParametersFeatures.gen.cs index 9102fdafda..9b24046e40 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParametersFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParametersFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderDrawParametersFeatures")] - public unsafe partial struct PhysicalDeviceShaderDrawParametersFeatures + [NativeName("Aliases", "VkPhysicalDeviceShaderDrawParameterFeatures")] + public unsafe partial struct PhysicalDeviceShaderDrawParametersFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderDrawParametersFeatures ( @@ -57,5 +58,18 @@ public PhysicalDeviceShaderDrawParametersFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderDrawParameters")] public Bool32 ShaderDrawParameters; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderDrawParametersFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8Features.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8Features.gen.cs index 9273d0683b..d262887e4f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8Features.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8Features.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderFloat16Int8Features")] - public unsafe partial struct PhysicalDeviceShaderFloat16Int8Features + [NativeName("Aliases", "VkPhysicalDeviceShaderFloat16Int8FeaturesKHR, VkPhysicalDeviceFloat16Int8FeaturesKHR")] + public unsafe partial struct PhysicalDeviceShaderFloat16Int8Features : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderFloat16Int8Features ( @@ -68,5 +69,18 @@ public PhysicalDeviceShaderFloat16Int8Features [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderInt8")] public Bool32 ShaderInt8; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderFloat16Int8Features; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8FeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8FeaturesKHR.gen.cs index 891fc818f0..7cfa898e6b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8FeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8FeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderFloat16Int8FeaturesKHR")] - public unsafe partial struct PhysicalDeviceShaderFloat16Int8FeaturesKHR + [NativeName("AliasOf", "VkPhysicalDeviceShaderFloat16Int8Features")] + public unsafe partial struct PhysicalDeviceShaderFloat16Int8FeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderFloat16Int8FeaturesKHR ( @@ -68,5 +69,18 @@ public PhysicalDeviceShaderFloat16Int8FeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderInt8")] public Bool32 ShaderInt8; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderFloat16Int8Features; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderImageAtomicInt64FeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderImageAtomicInt64FeaturesEXT.gen.cs index 803dd639e9..3426536a59 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderImageAtomicInt64FeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderImageAtomicInt64FeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderImageAtomicInt64FeaturesEXT")] - public unsafe partial struct PhysicalDeviceShaderImageAtomicInt64FeaturesEXT + public unsafe partial struct PhysicalDeviceShaderImageAtomicInt64FeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderImageAtomicInt64FeaturesEXT ( @@ -68,5 +68,18 @@ public PhysicalDeviceShaderImageAtomicInt64FeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "sparseImageInt64Atomics")] public Bool32 SparseImageInt64Atomics; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderImageAtomicInt64FeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderImageFootprintFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderImageFootprintFeaturesNV.gen.cs index 5bd0041ea3..3e5746c305 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderImageFootprintFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderImageFootprintFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderImageFootprintFeaturesNV")] - public unsafe partial struct PhysicalDeviceShaderImageFootprintFeaturesNV + public unsafe partial struct PhysicalDeviceShaderImageFootprintFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderImageFootprintFeaturesNV ( @@ -57,5 +57,18 @@ public PhysicalDeviceShaderImageFootprintFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "imageFootprint")] public Bool32 ImageFootprint; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderImageFootprintFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerDotProductFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerDotProductFeaturesKHR.gen.cs index 2c3b0e3ccd..9bc96e7673 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerDotProductFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerDotProductFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR")] - public unsafe partial struct PhysicalDeviceShaderIntegerDotProductFeaturesKHR + public unsafe partial struct PhysicalDeviceShaderIntegerDotProductFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderIntegerDotProductFeaturesKHR ( @@ -57,5 +57,18 @@ public PhysicalDeviceShaderIntegerDotProductFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderIntegerDotProduct")] public Bool32 ShaderIntegerDotProduct; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderIntegerDotProductFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerDotProductPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerDotProductPropertiesKHR.gen.cs index 5c854ed0bf..8744de0f48 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerDotProductPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerDotProductPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR")] - public unsafe partial struct PhysicalDeviceShaderIntegerDotProductPropertiesKHR + public unsafe partial struct PhysicalDeviceShaderIntegerDotProductPropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDeviceShaderIntegerDotProductPropertiesKHR ( @@ -376,5 +376,18 @@ public PhysicalDeviceShaderIntegerDotProductPropertiesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated")] public Bool32 IntegerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderIntegerDotProductPropertiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL.gen.cs index b8408d7048..48b1fdb830 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderIntegerFunctions2FeaturesINTEL")] - public unsafe partial struct PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL + public unsafe partial struct PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL ( @@ -57,5 +57,18 @@ public PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderIntegerFunctions2")] public Bool32 ShaderIntegerFunctions2; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderIntegerFunctions2FeaturesIntel; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSMBuiltinsFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSMBuiltinsFeaturesNV.gen.cs index d9269716f2..9e15d17054 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSMBuiltinsFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSMBuiltinsFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderSMBuiltinsFeaturesNV")] - public unsafe partial struct PhysicalDeviceShaderSMBuiltinsFeaturesNV + public unsafe partial struct PhysicalDeviceShaderSMBuiltinsFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderSMBuiltinsFeaturesNV ( @@ -57,5 +57,18 @@ public PhysicalDeviceShaderSMBuiltinsFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderSMBuiltins")] public Bool32 ShaderSmbuiltins; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderSMBuiltinsFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSMBuiltinsPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSMBuiltinsPropertiesNV.gen.cs index d68d45c909..d358ba3854 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSMBuiltinsPropertiesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSMBuiltinsPropertiesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderSMBuiltinsPropertiesNV")] - public unsafe partial struct PhysicalDeviceShaderSMBuiltinsPropertiesNV + public unsafe partial struct PhysicalDeviceShaderSMBuiltinsPropertiesNV : IExtendsChain, IExtendsChain { public PhysicalDeviceShaderSMBuiltinsPropertiesNV ( @@ -68,5 +68,18 @@ public PhysicalDeviceShaderSMBuiltinsPropertiesNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "shaderWarpsPerSM")] public uint ShaderWarpsPerSM; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderSMBuiltinsPropertiesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeatures.gen.cs index 853a3e5ba9..725ecff761 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures")] - public unsafe partial struct PhysicalDeviceShaderSubgroupExtendedTypesFeatures + [NativeName("Aliases", "VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR")] + public unsafe partial struct PhysicalDeviceShaderSubgroupExtendedTypesFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderSubgroupExtendedTypesFeatures ( @@ -57,5 +58,18 @@ public PhysicalDeviceShaderSubgroupExtendedTypesFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderSubgroupExtendedTypes")] public Bool32 ShaderSubgroupExtendedTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderSubgroupExtendedTypesFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR.gen.cs index 65fa208eba..5289ad8376 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR")] - public unsafe partial struct PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR + [NativeName("AliasOf", "VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures")] + public unsafe partial struct PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR ( @@ -57,5 +58,18 @@ public PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderSubgroupExtendedTypes")] public Bool32 ShaderSubgroupExtendedTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderSubgroupExtendedTypesFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR.gen.cs index d47801bd4e..9611dd9ffa 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR")] - public unsafe partial struct PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR + public unsafe partial struct PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR ( @@ -57,5 +57,18 @@ public PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderSubgroupUniformControlFlow")] public Bool32 ShaderSubgroupUniformControlFlow; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderTerminateInvocationFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderTerminateInvocationFeaturesKHR.gen.cs index 43188f1e24..ae656d6828 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderTerminateInvocationFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderTerminateInvocationFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR")] - public unsafe partial struct PhysicalDeviceShaderTerminateInvocationFeaturesKHR + public unsafe partial struct PhysicalDeviceShaderTerminateInvocationFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShaderTerminateInvocationFeaturesKHR ( @@ -57,5 +57,18 @@ public PhysicalDeviceShaderTerminateInvocationFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderTerminateInvocation")] public Bool32 ShaderTerminateInvocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderTerminateInvocationFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShadingRateImageFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShadingRateImageFeaturesNV.gen.cs index 912e84b0bd..be3458eab1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShadingRateImageFeaturesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShadingRateImageFeaturesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShadingRateImageFeaturesNV")] - public unsafe partial struct PhysicalDeviceShadingRateImageFeaturesNV + public unsafe partial struct PhysicalDeviceShadingRateImageFeaturesNV : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceShadingRateImageFeaturesNV ( @@ -68,5 +68,18 @@ public PhysicalDeviceShadingRateImageFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shadingRateCoarseSampleOrder")] public Bool32 ShadingRateCoarseSampleOrder; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShadingRateImageFeaturesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShadingRateImagePropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShadingRateImagePropertiesNV.gen.cs index b42091b867..51667cc5de 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShadingRateImagePropertiesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShadingRateImagePropertiesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShadingRateImagePropertiesNV")] - public unsafe partial struct PhysicalDeviceShadingRateImagePropertiesNV + public unsafe partial struct PhysicalDeviceShadingRateImagePropertiesNV : IExtendsChain, IExtendsChain { public PhysicalDeviceShadingRateImagePropertiesNV ( @@ -79,5 +79,18 @@ public PhysicalDeviceShadingRateImagePropertiesNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "shadingRateMaxCoarseSamples")] public uint ShadingRateMaxCoarseSamples; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShadingRateImagePropertiesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2.gen.cs index 5fab9ffc4f..4515c678a7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSparseImageFormatInfo2")] - public unsafe partial struct PhysicalDeviceSparseImageFormatInfo2 + [NativeName("Aliases", "VkPhysicalDeviceSparseImageFormatInfo2KHR")] + public unsafe partial struct PhysicalDeviceSparseImageFormatInfo2 : IChainable { public PhysicalDeviceSparseImageFormatInfo2 ( @@ -101,5 +102,18 @@ public PhysicalDeviceSparseImageFormatInfo2 [NativeName("Type.Name", "VkImageTiling")] [NativeName("Name", "tiling")] public ImageTiling Tiling; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSparseImageFormatInfo2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2KHR.gen.cs index e2f7ed656b..5aeec425c1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSparseImageFormatInfo2KHR")] - public unsafe partial struct PhysicalDeviceSparseImageFormatInfo2KHR + [NativeName("AliasOf", "VkPhysicalDeviceSparseImageFormatInfo2")] + public unsafe partial struct PhysicalDeviceSparseImageFormatInfo2KHR : IChainable { public PhysicalDeviceSparseImageFormatInfo2KHR ( @@ -101,5 +102,18 @@ public PhysicalDeviceSparseImageFormatInfo2KHR [NativeName("Type.Name", "VkImageTiling")] [NativeName("Name", "tiling")] public ImageTiling Tiling; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSparseImageFormatInfo2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupProperties.gen.cs index 31786c4382..ebd1985579 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSubgroupProperties")] - public unsafe partial struct PhysicalDeviceSubgroupProperties + public unsafe partial struct PhysicalDeviceSubgroupProperties : IExtendsChain, IExtendsChain { public PhysicalDeviceSubgroupProperties ( @@ -90,5 +90,18 @@ public PhysicalDeviceSubgroupProperties [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "quadOperationsInAllStages")] public Bool32 QuadOperationsInAllStages; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSubgroupProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupSizeControlFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupSizeControlFeaturesEXT.gen.cs index 4247fba02a..fb8534078a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupSizeControlFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupSizeControlFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSubgroupSizeControlFeaturesEXT")] - public unsafe partial struct PhysicalDeviceSubgroupSizeControlFeaturesEXT + public unsafe partial struct PhysicalDeviceSubgroupSizeControlFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceSubgroupSizeControlFeaturesEXT ( @@ -68,5 +68,18 @@ public PhysicalDeviceSubgroupSizeControlFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "computeFullSubgroups")] public Bool32 ComputeFullSubgroups; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSubgroupSizeControlFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupSizeControlPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupSizeControlPropertiesEXT.gen.cs index 7a70402d4d..857e4eefca 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupSizeControlPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupSizeControlPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSubgroupSizeControlPropertiesEXT")] - public unsafe partial struct PhysicalDeviceSubgroupSizeControlPropertiesEXT + public unsafe partial struct PhysicalDeviceSubgroupSizeControlPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceSubgroupSizeControlPropertiesEXT ( @@ -90,5 +90,18 @@ public PhysicalDeviceSubgroupSizeControlPropertiesEXT [NativeName("Type.Name", "VkShaderStageFlags")] [NativeName("Name", "requiredSubgroupSizeStages")] public ShaderStageFlags RequiredSubgroupSizeStages; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSubgroupSizeControlPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubpassShadingFeaturesHUAWEI.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubpassShadingFeaturesHUAWEI.gen.cs index 1be8200327..c658c452bc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubpassShadingFeaturesHUAWEI.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubpassShadingFeaturesHUAWEI.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSubpassShadingFeaturesHUAWEI")] - public unsafe partial struct PhysicalDeviceSubpassShadingFeaturesHUAWEI + public unsafe partial struct PhysicalDeviceSubpassShadingFeaturesHUAWEI : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceSubpassShadingFeaturesHUAWEI ( @@ -57,5 +57,18 @@ public PhysicalDeviceSubpassShadingFeaturesHUAWEI [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "subpassShading")] public Bool32 SubpassShading; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSubpassShadingFeaturesHuawei; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubpassShadingPropertiesHUAWEI.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubpassShadingPropertiesHUAWEI.gen.cs index 4233d50a11..9bc4791c4f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubpassShadingPropertiesHUAWEI.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubpassShadingPropertiesHUAWEI.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSubpassShadingPropertiesHUAWEI")] - public unsafe partial struct PhysicalDeviceSubpassShadingPropertiesHUAWEI + public unsafe partial struct PhysicalDeviceSubpassShadingPropertiesHUAWEI : IExtendsChain, IExtendsChain { public PhysicalDeviceSubpassShadingPropertiesHUAWEI ( @@ -57,5 +57,18 @@ public PhysicalDeviceSubpassShadingPropertiesHUAWEI [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxSubpassShadingWorkgroupSizeAspectRatio")] public uint MaxSubpassShadingWorkgroupSizeAspectRatio; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSubpassShadingPropertiesHuawei; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSurfaceInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSurfaceInfo2KHR.gen.cs index 82e3f0c7bb..8ac21ca77e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSurfaceInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSurfaceInfo2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSurfaceInfo2KHR")] - public unsafe partial struct PhysicalDeviceSurfaceInfo2KHR + public unsafe partial struct PhysicalDeviceSurfaceInfo2KHR : IChainStart { public PhysicalDeviceSurfaceInfo2KHR ( @@ -57,5 +57,30 @@ public PhysicalDeviceSurfaceInfo2KHR [NativeName("Type.Name", "VkSurfaceKHR")] [NativeName("Name", "surface")] public SurfaceKHR Surface; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSurfaceInfo2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PhysicalDeviceSurfaceInfo2KHR Chain( + out PhysicalDeviceSurfaceInfo2KHR capture) + { + capture = new PhysicalDeviceSurfaceInfo2KHR(StructureType.PhysicalDeviceSurfaceInfo2Khr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSynchronization2FeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSynchronization2FeaturesKHR.gen.cs index 1579ad5f0c..c1767747aa 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSynchronization2FeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSynchronization2FeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSynchronization2FeaturesKHR")] - public unsafe partial struct PhysicalDeviceSynchronization2FeaturesKHR + public unsafe partial struct PhysicalDeviceSynchronization2FeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceSynchronization2FeaturesKHR ( @@ -57,5 +57,18 @@ public PhysicalDeviceSynchronization2FeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "synchronization2")] public Bool32 Synchronization2; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSynchronization2FeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTexelBufferAlignmentFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTexelBufferAlignmentFeaturesEXT.gen.cs index 9cf25135db..428205e86a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTexelBufferAlignmentFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTexelBufferAlignmentFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT")] - public unsafe partial struct PhysicalDeviceTexelBufferAlignmentFeaturesEXT + public unsafe partial struct PhysicalDeviceTexelBufferAlignmentFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceTexelBufferAlignmentFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceTexelBufferAlignmentFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "texelBufferAlignment")] public Bool32 TexelBufferAlignment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTexelBufferAlignmentFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTexelBufferAlignmentPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTexelBufferAlignmentPropertiesEXT.gen.cs index 2daeac205c..8550959185 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTexelBufferAlignmentPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTexelBufferAlignmentPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT")] - public unsafe partial struct PhysicalDeviceTexelBufferAlignmentPropertiesEXT + public unsafe partial struct PhysicalDeviceTexelBufferAlignmentPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceTexelBufferAlignmentPropertiesEXT ( @@ -90,5 +90,18 @@ public PhysicalDeviceTexelBufferAlignmentPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "uniformTexelBufferOffsetSingleTexelAlignment")] public Bool32 UniformTexelBufferOffsetSingleTexelAlignment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTexelBufferAlignmentPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT.gen.cs index 227e8e122e..7000850f5b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT")] - public unsafe partial struct PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT + public unsafe partial struct PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "textureCompressionASTC_HDR")] public Bool32 TextureCompressionAstcHdr; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTextureCompressionAstcHdrFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeatures.gen.cs index 1287770909..272cc6dece 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceTimelineSemaphoreFeatures")] - public unsafe partial struct PhysicalDeviceTimelineSemaphoreFeatures + [NativeName("Aliases", "VkPhysicalDeviceTimelineSemaphoreFeaturesKHR")] + public unsafe partial struct PhysicalDeviceTimelineSemaphoreFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceTimelineSemaphoreFeatures ( @@ -57,5 +58,18 @@ public PhysicalDeviceTimelineSemaphoreFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "timelineSemaphore")] public Bool32 TimelineSemaphore; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTimelineSemaphoreFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeaturesKHR.gen.cs index fd70840a7e..b953e6aba8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceTimelineSemaphoreFeaturesKHR")] - public unsafe partial struct PhysicalDeviceTimelineSemaphoreFeaturesKHR + [NativeName("AliasOf", "VkPhysicalDeviceTimelineSemaphoreFeatures")] + public unsafe partial struct PhysicalDeviceTimelineSemaphoreFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceTimelineSemaphoreFeaturesKHR ( @@ -57,5 +58,18 @@ public PhysicalDeviceTimelineSemaphoreFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "timelineSemaphore")] public Bool32 TimelineSemaphore; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTimelineSemaphoreFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreProperties.gen.cs index c4df2bbecc..1725e621fc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreProperties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceTimelineSemaphoreProperties")] - public unsafe partial struct PhysicalDeviceTimelineSemaphoreProperties + [NativeName("Aliases", "VkPhysicalDeviceTimelineSemaphorePropertiesKHR")] + public unsafe partial struct PhysicalDeviceTimelineSemaphoreProperties : IExtendsChain, IExtendsChain { public PhysicalDeviceTimelineSemaphoreProperties ( @@ -57,5 +58,18 @@ public PhysicalDeviceTimelineSemaphoreProperties [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "maxTimelineSemaphoreValueDifference")] public ulong MaxTimelineSemaphoreValueDifference; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTimelineSemaphoreProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphorePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphorePropertiesKHR.gen.cs index 7e54c7f883..c0269e6c2a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphorePropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphorePropertiesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceTimelineSemaphorePropertiesKHR")] - public unsafe partial struct PhysicalDeviceTimelineSemaphorePropertiesKHR + [NativeName("AliasOf", "VkPhysicalDeviceTimelineSemaphoreProperties")] + public unsafe partial struct PhysicalDeviceTimelineSemaphorePropertiesKHR : IExtendsChain, IExtendsChain { public PhysicalDeviceTimelineSemaphorePropertiesKHR ( @@ -57,5 +58,18 @@ public PhysicalDeviceTimelineSemaphorePropertiesKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "maxTimelineSemaphoreValueDifference")] public ulong MaxTimelineSemaphoreValueDifference; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTimelineSemaphoreProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceToolPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceToolPropertiesEXT.gen.cs index 94cd10fbb5..5c1f80e654 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceToolPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceToolPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceToolPropertiesEXT")] - public unsafe partial struct PhysicalDeviceToolPropertiesEXT + public unsafe partial struct PhysicalDeviceToolPropertiesEXT : IChainable { public PhysicalDeviceToolPropertiesEXT ( @@ -77,5 +77,18 @@ public PhysicalDeviceToolPropertiesEXT [NativeName("Type.Name", "char")] [NativeName("Name", "layer")] public fixed byte Layer[256]; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceToolPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTransformFeedbackFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTransformFeedbackFeaturesEXT.gen.cs index 9f371e4c95..04441302d7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTransformFeedbackFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTransformFeedbackFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceTransformFeedbackFeaturesEXT")] - public unsafe partial struct PhysicalDeviceTransformFeedbackFeaturesEXT + public unsafe partial struct PhysicalDeviceTransformFeedbackFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceTransformFeedbackFeaturesEXT ( @@ -68,5 +68,18 @@ public PhysicalDeviceTransformFeedbackFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "geometryStreams")] public Bool32 GeometryStreams; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTransformFeedbackFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTransformFeedbackPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTransformFeedbackPropertiesEXT.gen.cs index dd0e900a7b..caae53115e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTransformFeedbackPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTransformFeedbackPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceTransformFeedbackPropertiesEXT")] - public unsafe partial struct PhysicalDeviceTransformFeedbackPropertiesEXT + public unsafe partial struct PhysicalDeviceTransformFeedbackPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceTransformFeedbackPropertiesEXT ( @@ -156,5 +156,18 @@ public PhysicalDeviceTransformFeedbackPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "transformFeedbackDraw")] public Bool32 TransformFeedbackDraw; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTransformFeedbackPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeatures.gen.cs index 6274f055d2..09ff66c214 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceUniformBufferStandardLayoutFeatures")] - public unsafe partial struct PhysicalDeviceUniformBufferStandardLayoutFeatures + [NativeName("Aliases", "VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR")] + public unsafe partial struct PhysicalDeviceUniformBufferStandardLayoutFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceUniformBufferStandardLayoutFeatures ( @@ -57,5 +58,18 @@ public PhysicalDeviceUniformBufferStandardLayoutFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "uniformBufferStandardLayout")] public Bool32 UniformBufferStandardLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceUniformBufferStandardLayoutFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR.gen.cs index 007bab55de..4200bc0765 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR")] - public unsafe partial struct PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR + [NativeName("AliasOf", "VkPhysicalDeviceUniformBufferStandardLayoutFeatures")] + public unsafe partial struct PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR ( @@ -57,5 +58,18 @@ public PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "uniformBufferStandardLayout")] public Bool32 UniformBufferStandardLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceUniformBufferStandardLayoutFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeatures.gen.cs index ddeced77df..a622e08708 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVariablePointerFeatures")] - public unsafe partial struct PhysicalDeviceVariablePointerFeatures + [NativeName("AliasOf", "VkPhysicalDeviceVariablePointersFeatures")] + public unsafe partial struct PhysicalDeviceVariablePointerFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceVariablePointerFeatures ( @@ -68,5 +69,18 @@ public PhysicalDeviceVariablePointerFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "variablePointers")] public Bool32 VariablePointers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVariablePointersFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeaturesKHR.gen.cs index 9d47c69893..4880626c33 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVariablePointerFeaturesKHR")] - public unsafe partial struct PhysicalDeviceVariablePointerFeaturesKHR + [NativeName("AliasOf", "VkPhysicalDeviceVariablePointersFeatures")] + public unsafe partial struct PhysicalDeviceVariablePointerFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceVariablePointerFeaturesKHR ( @@ -68,5 +69,18 @@ public PhysicalDeviceVariablePointerFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "variablePointers")] public Bool32 VariablePointers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVariablePointersFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeatures.gen.cs index a3d7e0284e..0d46397d3d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVariablePointersFeatures")] - public unsafe partial struct PhysicalDeviceVariablePointersFeatures + [NativeName("Aliases", "VkPhysicalDeviceVariablePointersFeaturesKHR, VkPhysicalDeviceVariablePointerFeaturesKHR, VkPhysicalDeviceVariablePointerFeatures")] + public unsafe partial struct PhysicalDeviceVariablePointersFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceVariablePointersFeatures ( @@ -68,5 +69,18 @@ public PhysicalDeviceVariablePointersFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "variablePointers")] public Bool32 VariablePointers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVariablePointersFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeaturesKHR.gen.cs index eda4cacf36..64baa74c15 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVariablePointersFeaturesKHR")] - public unsafe partial struct PhysicalDeviceVariablePointersFeaturesKHR + [NativeName("AliasOf", "VkPhysicalDeviceVariablePointersFeatures")] + public unsafe partial struct PhysicalDeviceVariablePointersFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceVariablePointersFeaturesKHR ( @@ -68,5 +69,18 @@ public PhysicalDeviceVariablePointersFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "variablePointers")] public Bool32 VariablePointers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVariablePointersFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexAttributeDivisorFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexAttributeDivisorFeaturesEXT.gen.cs index be23fe3627..c2458d9083 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexAttributeDivisorFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexAttributeDivisorFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT")] - public unsafe partial struct PhysicalDeviceVertexAttributeDivisorFeaturesEXT + public unsafe partial struct PhysicalDeviceVertexAttributeDivisorFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceVertexAttributeDivisorFeaturesEXT ( @@ -68,5 +68,18 @@ public PhysicalDeviceVertexAttributeDivisorFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "vertexAttributeInstanceRateZeroDivisor")] public Bool32 VertexAttributeInstanceRateZeroDivisor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVertexAttributeDivisorFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexAttributeDivisorPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexAttributeDivisorPropertiesEXT.gen.cs index 074f541486..6b5a7bdc95 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexAttributeDivisorPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexAttributeDivisorPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT")] - public unsafe partial struct PhysicalDeviceVertexAttributeDivisorPropertiesEXT + public unsafe partial struct PhysicalDeviceVertexAttributeDivisorPropertiesEXT : IExtendsChain, IExtendsChain { public PhysicalDeviceVertexAttributeDivisorPropertiesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceVertexAttributeDivisorPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxVertexAttribDivisor")] public uint MaxVertexAttribDivisor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVertexAttributeDivisorPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexInputDynamicStateFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexInputDynamicStateFeaturesEXT.gen.cs index a03c67bb64..07853385ba 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexInputDynamicStateFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexInputDynamicStateFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVertexInputDynamicStateFeaturesEXT")] - public unsafe partial struct PhysicalDeviceVertexInputDynamicStateFeaturesEXT + public unsafe partial struct PhysicalDeviceVertexInputDynamicStateFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceVertexInputDynamicStateFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceVertexInputDynamicStateFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "vertexInputDynamicState")] public Bool32 VertexInputDynamicState; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVertexInputDynamicStateFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVideoFormatInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVideoFormatInfoKHR.gen.cs index 8e6ebcac80..4b4f17e975 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVideoFormatInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVideoFormatInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVideoFormatInfoKHR")] - public unsafe partial struct PhysicalDeviceVideoFormatInfoKHR + public unsafe partial struct PhysicalDeviceVideoFormatInfoKHR : IChainable { public PhysicalDeviceVideoFormatInfoKHR ( @@ -68,5 +68,18 @@ public PhysicalDeviceVideoFormatInfoKHR [NativeName("Type.Name", "VkVideoProfilesKHR")] [NativeName("Name", "pVideoProfiles")] public VideoProfilesKHR* PVideoProfiles; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVideoFormatInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan11Features.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan11Features.gen.cs index 5b91d525b5..a676845be1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan11Features.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan11Features.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVulkan11Features")] - public unsafe partial struct PhysicalDeviceVulkan11Features + public unsafe partial struct PhysicalDeviceVulkan11Features : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceVulkan11Features ( @@ -178,5 +178,18 @@ public PhysicalDeviceVulkan11Features [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderDrawParameters")] public Bool32 ShaderDrawParameters; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVulkan11Features; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan11Properties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan11Properties.gen.cs index 2f5715ed1a..24f09bdb0a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan11Properties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan11Properties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVulkan11Properties")] - public unsafe partial struct PhysicalDeviceVulkan11Properties + public unsafe partial struct PhysicalDeviceVulkan11Properties : IExtendsChain, IExtendsChain { public PhysicalDeviceVulkan11Properties ( @@ -193,5 +193,18 @@ public PhysicalDeviceVulkan11Properties [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "maxMemoryAllocationSize")] public ulong MaxMemoryAllocationSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVulkan11Properties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan12Features.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan12Features.gen.cs index 2d104d2b8e..302e4e3420 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan12Features.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan12Features.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVulkan12Features")] - public unsafe partial struct PhysicalDeviceVulkan12Features + public unsafe partial struct PhysicalDeviceVulkan12Features : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceVulkan12Features ( @@ -563,5 +563,18 @@ public PhysicalDeviceVulkan12Features [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "subgroupBroadcastDynamicId")] public Bool32 SubgroupBroadcastDynamicId; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVulkan12Features; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan12Properties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan12Properties.gen.cs index 6edaee6722..bacc18db42 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan12Properties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan12Properties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVulkan12Properties")] - public unsafe partial struct PhysicalDeviceVulkan12Properties + public unsafe partial struct PhysicalDeviceVulkan12Properties : IExtendsChain, IExtendsChain { public PhysicalDeviceVulkan12Properties ( @@ -606,5 +606,18 @@ public PhysicalDeviceVulkan12Properties [NativeName("Type.Name", "VkSampleCountFlags")] [NativeName("Name", "framebufferIntegerColorSampleCounts")] public SampleCountFlags FramebufferIntegerColorSampleCounts; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVulkan12Properties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeatures.gen.cs index 20f2697e09..ae0b84288b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeatures.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVulkanMemoryModelFeatures")] - public unsafe partial struct PhysicalDeviceVulkanMemoryModelFeatures + [NativeName("Aliases", "VkPhysicalDeviceVulkanMemoryModelFeaturesKHR")] + public unsafe partial struct PhysicalDeviceVulkanMemoryModelFeatures : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceVulkanMemoryModelFeatures ( @@ -79,5 +80,18 @@ public PhysicalDeviceVulkanMemoryModelFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "vulkanMemoryModelAvailabilityVisibilityChains")] public Bool32 VulkanMemoryModelAvailabilityVisibilityChains; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVulkanMemoryModelFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeaturesKHR.gen.cs index 3fc26e2710..b4a4db9487 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeaturesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVulkanMemoryModelFeaturesKHR")] - public unsafe partial struct PhysicalDeviceVulkanMemoryModelFeaturesKHR + [NativeName("AliasOf", "VkPhysicalDeviceVulkanMemoryModelFeatures")] + public unsafe partial struct PhysicalDeviceVulkanMemoryModelFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceVulkanMemoryModelFeaturesKHR ( @@ -79,5 +80,18 @@ public PhysicalDeviceVulkanMemoryModelFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "vulkanMemoryModelAvailabilityVisibilityChains")] public Bool32 VulkanMemoryModelAvailabilityVisibilityChains; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVulkanMemoryModelFeatures; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR.gen.cs index 50ee55afe2..3a926482f0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR")] - public unsafe partial struct PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR + public unsafe partial struct PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR ( @@ -90,5 +90,18 @@ public PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "workgroupMemoryExplicitLayout16BitAccess")] public Bool32 WorkgroupMemoryExplicitLayout16BitAccess; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT.gen.cs index 40b4b7382e..ffa214ddc5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT")] - public unsafe partial struct PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT + public unsafe partial struct PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "ycbcr2plane444Formats")] public Bool32 Ycbcr2plane444formats; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceYcbcr2Plane444FormatsFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceYcbcrImageArraysFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceYcbcrImageArraysFeaturesEXT.gen.cs index 18e18452db..7fd43f4b51 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceYcbcrImageArraysFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceYcbcrImageArraysFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceYcbcrImageArraysFeaturesEXT")] - public unsafe partial struct PhysicalDeviceYcbcrImageArraysFeaturesEXT + public unsafe partial struct PhysicalDeviceYcbcrImageArraysFeaturesEXT : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceYcbcrImageArraysFeaturesEXT ( @@ -57,5 +57,18 @@ public PhysicalDeviceYcbcrImageArraysFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "ycbcrImageArrays")] public Bool32 YcbcrImageArrays; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceYcbcrImageArraysFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR.gen.cs index 6325f69aa1..3a09475d19 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR")] - public unsafe partial struct PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR + public unsafe partial struct PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR : IExtendsChain, IExtendsChain, IExtendsChain { public PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR ( @@ -57,5 +57,18 @@ public PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderZeroInitializeWorkgroupMemory")] public Bool32 ShaderZeroInitializeWorkgroupMemory; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCacheCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCacheCreateInfo.gen.cs index 0402ab0707..cf70dba5eb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCacheCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCacheCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineCacheCreateInfo")] - public unsafe partial struct PipelineCacheCreateInfo + public unsafe partial struct PipelineCacheCreateInfo : IChainable { public PipelineCacheCreateInfo ( @@ -79,5 +79,18 @@ public PipelineCacheCreateInfo [NativeName("Type.Name", "void")] [NativeName("Name", "pInitialData")] public void* PInitialData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineCacheCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorBlendAdvancedStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorBlendAdvancedStateCreateInfoEXT.gen.cs index 01e04fb865..19849dad79 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorBlendAdvancedStateCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorBlendAdvancedStateCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineColorBlendAdvancedStateCreateInfoEXT")] - public unsafe partial struct PipelineColorBlendAdvancedStateCreateInfoEXT + public unsafe partial struct PipelineColorBlendAdvancedStateCreateInfoEXT : IExtendsChain { public PipelineColorBlendAdvancedStateCreateInfoEXT ( @@ -79,5 +79,18 @@ public PipelineColorBlendAdvancedStateCreateInfoEXT [NativeName("Type.Name", "VkBlendOverlapEXT")] [NativeName("Name", "blendOverlap")] public BlendOverlapEXT BlendOverlap; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineColorBlendAdvancedStateCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorBlendStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorBlendStateCreateInfo.gen.cs index d49f734d50..d8039a43f5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorBlendStateCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorBlendStateCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineColorBlendStateCreateInfo")] - public unsafe partial struct PipelineColorBlendStateCreateInfo + public unsafe partial struct PipelineColorBlendStateCreateInfo : IChainStart { public PipelineColorBlendStateCreateInfo ( @@ -106,5 +106,30 @@ public PipelineColorBlendStateCreateInfo [NativeName("Type.Name", "float")] [NativeName("Name", "blendConstants")] public fixed float BlendConstants[4]; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineColorBlendStateCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PipelineColorBlendStateCreateInfo Chain( + out PipelineColorBlendStateCreateInfo capture) + { + capture = new PipelineColorBlendStateCreateInfo(StructureType.PipelineColorBlendStateCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorWriteCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorWriteCreateInfoEXT.gen.cs index 48c112a615..633a6b1707 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorWriteCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorWriteCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineColorWriteCreateInfoEXT")] - public unsafe partial struct PipelineColorWriteCreateInfoEXT + public unsafe partial struct PipelineColorWriteCreateInfoEXT : IExtendsChain { public PipelineColorWriteCreateInfoEXT ( @@ -68,5 +68,18 @@ public PipelineColorWriteCreateInfoEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "pColorWriteEnables")] public Bool32* PColorWriteEnables; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineColorWriteCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCompilerControlCreateInfoAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCompilerControlCreateInfoAMD.gen.cs index ae67f41b37..bd1d429943 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCompilerControlCreateInfoAMD.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCompilerControlCreateInfoAMD.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineCompilerControlCreateInfoAMD")] - public unsafe partial struct PipelineCompilerControlCreateInfoAMD + public unsafe partial struct PipelineCompilerControlCreateInfoAMD : IExtendsChain, IExtendsChain { public PipelineCompilerControlCreateInfoAMD ( @@ -57,5 +57,18 @@ public PipelineCompilerControlCreateInfoAMD [NativeName("Type.Name", "VkPipelineCompilerControlFlagsAMD")] [NativeName("Name", "compilerControlFlags")] public PipelineCompilerControlFlagsAMD CompilerControlFlags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineCompilerControlCreateInfoAmd; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageModulationStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageModulationStateCreateInfoNV.gen.cs index 84ab26cbbb..4461dd7572 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageModulationStateCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageModulationStateCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineCoverageModulationStateCreateInfoNV")] - public unsafe partial struct PipelineCoverageModulationStateCreateInfoNV + public unsafe partial struct PipelineCoverageModulationStateCreateInfoNV : IExtendsChain { public PipelineCoverageModulationStateCreateInfoNV ( @@ -101,5 +101,18 @@ public PipelineCoverageModulationStateCreateInfoNV [NativeName("Type.Name", "float")] [NativeName("Name", "pCoverageModulationTable")] public float* PCoverageModulationTable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineCoverageModulationStateCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageReductionStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageReductionStateCreateInfoNV.gen.cs index 4a3c8a2c61..fde670ed19 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageReductionStateCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageReductionStateCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineCoverageReductionStateCreateInfoNV")] - public unsafe partial struct PipelineCoverageReductionStateCreateInfoNV + public unsafe partial struct PipelineCoverageReductionStateCreateInfoNV : IExtendsChain { public PipelineCoverageReductionStateCreateInfoNV ( @@ -68,5 +68,18 @@ public PipelineCoverageReductionStateCreateInfoNV [NativeName("Type.Name", "VkCoverageReductionModeNV")] [NativeName("Name", "coverageReductionMode")] public CoverageReductionModeNV CoverageReductionMode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineCoverageReductionStateCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageToColorStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageToColorStateCreateInfoNV.gen.cs index 922e52b172..0c80462eaa 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageToColorStateCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageToColorStateCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineCoverageToColorStateCreateInfoNV")] - public unsafe partial struct PipelineCoverageToColorStateCreateInfoNV + public unsafe partial struct PipelineCoverageToColorStateCreateInfoNV : IExtendsChain { public PipelineCoverageToColorStateCreateInfoNV ( @@ -79,5 +79,18 @@ public PipelineCoverageToColorStateCreateInfoNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "coverageToColorLocation")] public uint CoverageToColorLocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineCoverageToColorStateCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCreationFeedbackCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCreationFeedbackCreateInfoEXT.gen.cs index 494cc0b518..f3e5e05e89 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCreationFeedbackCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCreationFeedbackCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineCreationFeedbackCreateInfoEXT")] - public unsafe partial struct PipelineCreationFeedbackCreateInfoEXT + public unsafe partial struct PipelineCreationFeedbackCreateInfoEXT : IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain { public PipelineCreationFeedbackCreateInfoEXT ( @@ -79,5 +79,18 @@ public PipelineCreationFeedbackCreateInfoEXT [NativeName("Type.Name", "VkPipelineCreationFeedbackEXT")] [NativeName("Name", "pPipelineStageCreationFeedbacks")] public PipelineCreationFeedbackEXT* PPipelineStageCreationFeedbacks; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineCreationFeedbackCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDepthStencilStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDepthStencilStateCreateInfo.gen.cs index 2ef827c074..95039f1b78 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDepthStencilStateCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDepthStencilStateCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineDepthStencilStateCreateInfo")] - public unsafe partial struct PipelineDepthStencilStateCreateInfo + public unsafe partial struct PipelineDepthStencilStateCreateInfo : IChainable { public PipelineDepthStencilStateCreateInfo ( @@ -156,5 +156,18 @@ public PipelineDepthStencilStateCreateInfo [NativeName("Type.Name", "float")] [NativeName("Name", "maxDepthBounds")] public float MaxDepthBounds; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineDepthStencilStateCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDiscardRectangleStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDiscardRectangleStateCreateInfoEXT.gen.cs index 492574c36d..0470e8da91 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDiscardRectangleStateCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDiscardRectangleStateCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineDiscardRectangleStateCreateInfoEXT")] - public unsafe partial struct PipelineDiscardRectangleStateCreateInfoEXT + public unsafe partial struct PipelineDiscardRectangleStateCreateInfoEXT : IExtendsChain { public PipelineDiscardRectangleStateCreateInfoEXT ( @@ -90,5 +90,18 @@ public PipelineDiscardRectangleStateCreateInfoEXT [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "pDiscardRectangles")] public Rect2D* PDiscardRectangles; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineDiscardRectangleStateCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDynamicStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDynamicStateCreateInfo.gen.cs index e8b1a84e9c..ae2ae4a97f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDynamicStateCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDynamicStateCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineDynamicStateCreateInfo")] - public unsafe partial struct PipelineDynamicStateCreateInfo + public unsafe partial struct PipelineDynamicStateCreateInfo : IChainable { public PipelineDynamicStateCreateInfo ( @@ -79,5 +79,18 @@ public PipelineDynamicStateCreateInfo [NativeName("Type.Name", "VkDynamicState")] [NativeName("Name", "pDynamicStates")] public DynamicState* PDynamicStates; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineDynamicStateCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableInfoKHR.gen.cs index 6b066aa83f..46e41aa3cd 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineExecutableInfoKHR")] - public unsafe partial struct PipelineExecutableInfoKHR + public unsafe partial struct PipelineExecutableInfoKHR : IChainable { public PipelineExecutableInfoKHR ( @@ -68,5 +68,18 @@ public PipelineExecutableInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "executableIndex")] public uint ExecutableIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineExecutableInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableInternalRepresentationKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableInternalRepresentationKHR.gen.cs index 7de5cf19f4..84dc92bf77 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableInternalRepresentationKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableInternalRepresentationKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineExecutableInternalRepresentationKHR")] - public unsafe partial struct PipelineExecutableInternalRepresentationKHR + public unsafe partial struct PipelineExecutableInternalRepresentationKHR : IChainable { public PipelineExecutableInternalRepresentationKHR ( @@ -89,5 +89,18 @@ public PipelineExecutableInternalRepresentationKHR [NativeName("Type.Name", "void")] [NativeName("Name", "pData")] public void* PData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineExecutableInternalRepresentationKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutablePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutablePropertiesKHR.gen.cs index 81191d37a0..5fcb638ab9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutablePropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutablePropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineExecutablePropertiesKHR")] - public unsafe partial struct PipelineExecutablePropertiesKHR + public unsafe partial struct PipelineExecutablePropertiesKHR : IChainable { public PipelineExecutablePropertiesKHR ( @@ -78,5 +78,18 @@ public PipelineExecutablePropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "subgroupSize")] public uint SubgroupSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineExecutablePropertiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableStatisticKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableStatisticKHR.gen.cs index 4765b3e6a1..0987401239 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableStatisticKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableStatisticKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineExecutableStatisticKHR")] - public unsafe partial struct PipelineExecutableStatisticKHR + public unsafe partial struct PipelineExecutableStatisticKHR : IChainable { public PipelineExecutableStatisticKHR ( @@ -78,5 +78,18 @@ public PipelineExecutableStatisticKHR [NativeName("Type.Name", "VkPipelineExecutableStatisticValueKHR")] [NativeName("Name", "value")] public PipelineExecutableStatisticValueKHR Value; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineExecutableStatisticKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineFragmentShadingRateEnumStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineFragmentShadingRateEnumStateCreateInfoNV.gen.cs index 4beb07b185..4227a7392e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineFragmentShadingRateEnumStateCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineFragmentShadingRateEnumStateCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineFragmentShadingRateEnumStateCreateInfoNV")] - public unsafe partial struct PipelineFragmentShadingRateEnumStateCreateInfoNV + public unsafe partial struct PipelineFragmentShadingRateEnumStateCreateInfoNV : IExtendsChain { public PipelineFragmentShadingRateEnumStateCreateInfoNV ( @@ -100,5 +100,18 @@ public Span AsSpan() #endif } + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineFragmentShadingRateEnumStateCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineFragmentShadingRateStateCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineFragmentShadingRateStateCreateInfoKHR.gen.cs index e97767c30d..968cdce4cb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineFragmentShadingRateStateCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineFragmentShadingRateStateCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineFragmentShadingRateStateCreateInfoKHR")] - public unsafe partial struct PipelineFragmentShadingRateStateCreateInfoKHR + public unsafe partial struct PipelineFragmentShadingRateStateCreateInfoKHR : IExtendsChain { public PipelineFragmentShadingRateStateCreateInfoKHR ( @@ -89,5 +89,18 @@ public Span AsSpan() #endif } + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineFragmentShadingRateStateCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineInfoKHR.gen.cs index 5f36ace08c..9d708331f3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineInfoKHR")] - public unsafe partial struct PipelineInfoKHR + public unsafe partial struct PipelineInfoKHR : IChainable { public PipelineInfoKHR ( @@ -57,5 +57,18 @@ public PipelineInfoKHR [NativeName("Type.Name", "VkPipeline")] [NativeName("Name", "pipeline")] public Pipeline Pipeline; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineInputAssemblyStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineInputAssemblyStateCreateInfo.gen.cs index b82af0adbd..4fe7211360 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineInputAssemblyStateCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineInputAssemblyStateCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineInputAssemblyStateCreateInfo")] - public unsafe partial struct PipelineInputAssemblyStateCreateInfo + public unsafe partial struct PipelineInputAssemblyStateCreateInfo : IChainable { public PipelineInputAssemblyStateCreateInfo ( @@ -79,5 +79,18 @@ public PipelineInputAssemblyStateCreateInfo [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "primitiveRestartEnable")] public Bool32 PrimitiveRestartEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineInputAssemblyStateCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineLayoutCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineLayoutCreateInfo.gen.cs index d63fb5d3a6..6a8a86daa7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineLayoutCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineLayoutCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineLayoutCreateInfo")] - public unsafe partial struct PipelineLayoutCreateInfo + public unsafe partial struct PipelineLayoutCreateInfo : IChainable { public PipelineLayoutCreateInfo ( @@ -101,5 +101,18 @@ public PipelineLayoutCreateInfo [NativeName("Type.Name", "VkPushConstantRange")] [NativeName("Name", "pPushConstantRanges")] public PushConstantRange* PPushConstantRanges; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineLayoutCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineLibraryCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineLibraryCreateInfoKHR.gen.cs index 07bb02bb40..19e7f22166 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineLibraryCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineLibraryCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineLibraryCreateInfoKHR")] - public unsafe partial struct PipelineLibraryCreateInfoKHR + public unsafe partial struct PipelineLibraryCreateInfoKHR : IChainable { public PipelineLibraryCreateInfoKHR ( @@ -68,5 +68,18 @@ public PipelineLibraryCreateInfoKHR [NativeName("Type.Name", "VkPipeline")] [NativeName("Name", "pLibraries")] public Pipeline* PLibraries; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineLibraryCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineMultisampleStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineMultisampleStateCreateInfo.gen.cs index 318cd5d511..e9e6d22150 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineMultisampleStateCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineMultisampleStateCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineMultisampleStateCreateInfo")] - public unsafe partial struct PipelineMultisampleStateCreateInfo + public unsafe partial struct PipelineMultisampleStateCreateInfo : IChainStart { public PipelineMultisampleStateCreateInfo ( @@ -123,5 +123,30 @@ public PipelineMultisampleStateCreateInfo [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "alphaToOneEnable")] public Bool32 AlphaToOneEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineMultisampleStateCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PipelineMultisampleStateCreateInfo Chain( + out PipelineMultisampleStateCreateInfo capture) + { + capture = new PipelineMultisampleStateCreateInfo(StructureType.PipelineMultisampleStateCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationConservativeStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationConservativeStateCreateInfoEXT.gen.cs index 5d241b4e73..7497a046c6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationConservativeStateCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationConservativeStateCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineRasterizationConservativeStateCreateInfoEXT")] - public unsafe partial struct PipelineRasterizationConservativeStateCreateInfoEXT + public unsafe partial struct PipelineRasterizationConservativeStateCreateInfoEXT : IExtendsChain { public PipelineRasterizationConservativeStateCreateInfoEXT ( @@ -79,5 +79,18 @@ public PipelineRasterizationConservativeStateCreateInfoEXT [NativeName("Type.Name", "float")] [NativeName("Name", "extraPrimitiveOverestimationSize")] public float ExtraPrimitiveOverestimationSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRasterizationConservativeStateCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationDepthClipStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationDepthClipStateCreateInfoEXT.gen.cs index bab89d4847..1ba6ecfa79 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationDepthClipStateCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationDepthClipStateCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineRasterizationDepthClipStateCreateInfoEXT")] - public unsafe partial struct PipelineRasterizationDepthClipStateCreateInfoEXT + public unsafe partial struct PipelineRasterizationDepthClipStateCreateInfoEXT : IExtendsChain { public PipelineRasterizationDepthClipStateCreateInfoEXT ( @@ -68,5 +68,18 @@ public PipelineRasterizationDepthClipStateCreateInfoEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "depthClipEnable")] public Bool32 DepthClipEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRasterizationDepthClipStateCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationLineStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationLineStateCreateInfoEXT.gen.cs index 82d0c910f9..1b62472ad5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationLineStateCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationLineStateCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineRasterizationLineStateCreateInfoEXT")] - public unsafe partial struct PipelineRasterizationLineStateCreateInfoEXT + public unsafe partial struct PipelineRasterizationLineStateCreateInfoEXT : IExtendsChain { public PipelineRasterizationLineStateCreateInfoEXT ( @@ -90,5 +90,18 @@ public PipelineRasterizationLineStateCreateInfoEXT [NativeName("Type.Name", "uint16_t")] [NativeName("Name", "lineStipplePattern")] public ushort LineStipplePattern; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRasterizationLineStateCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationProvokingVertexStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationProvokingVertexStateCreateInfoEXT.gen.cs index f15039a0cf..c904522527 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationProvokingVertexStateCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationProvokingVertexStateCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineRasterizationProvokingVertexStateCreateInfoEXT")] - public unsafe partial struct PipelineRasterizationProvokingVertexStateCreateInfoEXT + public unsafe partial struct PipelineRasterizationProvokingVertexStateCreateInfoEXT : IExtendsChain { public PipelineRasterizationProvokingVertexStateCreateInfoEXT ( @@ -57,5 +57,18 @@ public PipelineRasterizationProvokingVertexStateCreateInfoEXT [NativeName("Type.Name", "VkProvokingVertexModeEXT")] [NativeName("Name", "provokingVertexMode")] public ProvokingVertexModeEXT ProvokingVertexMode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRasterizationProvokingVertexStateCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateCreateInfo.gen.cs index 3ce3258f4a..37d62c69ed 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineRasterizationStateCreateInfo")] - public unsafe partial struct PipelineRasterizationStateCreateInfo + public unsafe partial struct PipelineRasterizationStateCreateInfo : IChainStart { public PipelineRasterizationStateCreateInfo ( @@ -167,5 +167,30 @@ public PipelineRasterizationStateCreateInfo [NativeName("Type.Name", "float")] [NativeName("Name", "lineWidth")] public float LineWidth; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRasterizationStateCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PipelineRasterizationStateCreateInfo Chain( + out PipelineRasterizationStateCreateInfo capture) + { + capture = new PipelineRasterizationStateCreateInfo(StructureType.PipelineRasterizationStateCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateRasterizationOrderAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateRasterizationOrderAMD.gen.cs index 6140ec8070..f47d102509 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateRasterizationOrderAMD.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateRasterizationOrderAMD.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineRasterizationStateRasterizationOrderAMD")] - public unsafe partial struct PipelineRasterizationStateRasterizationOrderAMD + public unsafe partial struct PipelineRasterizationStateRasterizationOrderAMD : IExtendsChain { public PipelineRasterizationStateRasterizationOrderAMD ( @@ -57,5 +57,18 @@ public PipelineRasterizationStateRasterizationOrderAMD [NativeName("Type.Name", "VkRasterizationOrderAMD")] [NativeName("Name", "rasterizationOrder")] public RasterizationOrderAMD RasterizationOrder; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRasterizationStateRasterizationOrderAmd; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateStreamCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateStreamCreateInfoEXT.gen.cs index 71bc58cfe3..d8e5b04e0a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateStreamCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateStreamCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineRasterizationStateStreamCreateInfoEXT")] - public unsafe partial struct PipelineRasterizationStateStreamCreateInfoEXT + public unsafe partial struct PipelineRasterizationStateStreamCreateInfoEXT : IExtendsChain { public PipelineRasterizationStateStreamCreateInfoEXT ( @@ -68,5 +68,18 @@ public PipelineRasterizationStateStreamCreateInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "rasterizationStream")] public uint RasterizationStream; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRasterizationStateStreamCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRenderingCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRenderingCreateInfoKHR.gen.cs index 7dfdb6e735..5669cee355 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRenderingCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRenderingCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineRenderingCreateInfoKHR")] - public unsafe partial struct PipelineRenderingCreateInfoKHR + public unsafe partial struct PipelineRenderingCreateInfoKHR : IExtendsChain { public PipelineRenderingCreateInfoKHR ( @@ -101,5 +101,18 @@ public PipelineRenderingCreateInfoKHR [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "stencilAttachmentFormat")] public Format StencilAttachmentFormat; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRenderingCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRepresentativeFragmentTestStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRepresentativeFragmentTestStateCreateInfoNV.gen.cs index 661020a823..199b275929 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRepresentativeFragmentTestStateCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRepresentativeFragmentTestStateCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineRepresentativeFragmentTestStateCreateInfoNV")] - public unsafe partial struct PipelineRepresentativeFragmentTestStateCreateInfoNV + public unsafe partial struct PipelineRepresentativeFragmentTestStateCreateInfoNV : IExtendsChain { public PipelineRepresentativeFragmentTestStateCreateInfoNV ( @@ -57,5 +57,18 @@ public PipelineRepresentativeFragmentTestStateCreateInfoNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "representativeFragmentTestEnable")] public Bool32 RepresentativeFragmentTestEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRepresentativeFragmentTestStateCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineSampleLocationsStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineSampleLocationsStateCreateInfoEXT.gen.cs index a6d57e4415..149bc36ce6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineSampleLocationsStateCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineSampleLocationsStateCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineSampleLocationsStateCreateInfoEXT")] - public unsafe partial struct PipelineSampleLocationsStateCreateInfoEXT + public unsafe partial struct PipelineSampleLocationsStateCreateInfoEXT : IExtendsChain { public PipelineSampleLocationsStateCreateInfoEXT ( @@ -68,5 +68,18 @@ public PipelineSampleLocationsStateCreateInfoEXT [NativeName("Type.Name", "VkSampleLocationsInfoEXT")] [NativeName("Name", "sampleLocationsInfo")] public SampleLocationsInfoEXT SampleLocationsInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineSampleLocationsStateCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineShaderStageCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineShaderStageCreateInfo.gen.cs index 117230668e..8501ccddd6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineShaderStageCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineShaderStageCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineShaderStageCreateInfo")] - public unsafe partial struct PipelineShaderStageCreateInfo + public unsafe partial struct PipelineShaderStageCreateInfo : IChainStart { public PipelineShaderStageCreateInfo ( @@ -101,5 +101,30 @@ public PipelineShaderStageCreateInfo [NativeName("Type.Name", "VkSpecializationInfo")] [NativeName("Name", "pSpecializationInfo")] public SpecializationInfo* PSpecializationInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineShaderStageCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PipelineShaderStageCreateInfo Chain( + out PipelineShaderStageCreateInfo capture) + { + capture = new PipelineShaderStageCreateInfo(StructureType.PipelineShaderStageCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT.gen.cs index 01d5dd31c2..3baa87932a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT")] - public unsafe partial struct PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT + public unsafe partial struct PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT : IExtendsChain { public PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT ( @@ -57,5 +57,18 @@ public PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "requiredSubgroupSize")] public uint RequiredSubgroupSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineShaderStageRequiredSubgroupSizeCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfo.gen.cs index ee73090b4a..6e87548afa 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineTessellationDomainOriginStateCreateInfo")] - public unsafe partial struct PipelineTessellationDomainOriginStateCreateInfo + [NativeName("Aliases", "VkPipelineTessellationDomainOriginStateCreateInfoKHR")] + public unsafe partial struct PipelineTessellationDomainOriginStateCreateInfo : IExtendsChain { public PipelineTessellationDomainOriginStateCreateInfo ( @@ -57,5 +58,18 @@ public PipelineTessellationDomainOriginStateCreateInfo [NativeName("Type.Name", "VkTessellationDomainOrigin")] [NativeName("Name", "domainOrigin")] public TessellationDomainOrigin DomainOrigin; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineTessellationDomainOriginStateCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfoKHR.gen.cs index da8ba064ed..cb03b9b1b0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineTessellationDomainOriginStateCreateInfoKHR")] - public unsafe partial struct PipelineTessellationDomainOriginStateCreateInfoKHR + [NativeName("AliasOf", "VkPipelineTessellationDomainOriginStateCreateInfo")] + public unsafe partial struct PipelineTessellationDomainOriginStateCreateInfoKHR : IExtendsChain { public PipelineTessellationDomainOriginStateCreateInfoKHR ( @@ -57,5 +58,18 @@ public PipelineTessellationDomainOriginStateCreateInfoKHR [NativeName("Type.Name", "VkTessellationDomainOrigin")] [NativeName("Name", "domainOrigin")] public TessellationDomainOrigin DomainOrigin; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineTessellationDomainOriginStateCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationStateCreateInfo.gen.cs index 18ece41ec7..a2a3127ea8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationStateCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationStateCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineTessellationStateCreateInfo")] - public unsafe partial struct PipelineTessellationStateCreateInfo + public unsafe partial struct PipelineTessellationStateCreateInfo : IChainStart { public PipelineTessellationStateCreateInfo ( @@ -68,5 +68,30 @@ public PipelineTessellationStateCreateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "patchControlPoints")] public uint PatchControlPoints; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineTessellationStateCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PipelineTessellationStateCreateInfo Chain( + out PipelineTessellationStateCreateInfo capture) + { + capture = new PipelineTessellationStateCreateInfo(StructureType.PipelineTessellationStateCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineVertexInputDivisorStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineVertexInputDivisorStateCreateInfoEXT.gen.cs index 4060a03f7d..b9ea7b4fc0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineVertexInputDivisorStateCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineVertexInputDivisorStateCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineVertexInputDivisorStateCreateInfoEXT")] - public unsafe partial struct PipelineVertexInputDivisorStateCreateInfoEXT + public unsafe partial struct PipelineVertexInputDivisorStateCreateInfoEXT : IExtendsChain { public PipelineVertexInputDivisorStateCreateInfoEXT ( @@ -68,5 +68,18 @@ public PipelineVertexInputDivisorStateCreateInfoEXT [NativeName("Type.Name", "VkVertexInputBindingDivisorDescriptionEXT")] [NativeName("Name", "pVertexBindingDivisors")] public VertexInputBindingDivisorDescriptionEXT* PVertexBindingDivisors; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineVertexInputDivisorStateCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineVertexInputStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineVertexInputStateCreateInfo.gen.cs index afcf90b6ae..ad75134542 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineVertexInputStateCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineVertexInputStateCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineVertexInputStateCreateInfo")] - public unsafe partial struct PipelineVertexInputStateCreateInfo + public unsafe partial struct PipelineVertexInputStateCreateInfo : IChainStart { public PipelineVertexInputStateCreateInfo ( @@ -101,5 +101,30 @@ public PipelineVertexInputStateCreateInfo [NativeName("Type.Name", "VkVertexInputAttributeDescription")] [NativeName("Name", "pVertexAttributeDescriptions")] public VertexInputAttributeDescription* PVertexAttributeDescriptions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineVertexInputStateCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PipelineVertexInputStateCreateInfo Chain( + out PipelineVertexInputStateCreateInfo capture) + { + capture = new PipelineVertexInputStateCreateInfo(StructureType.PipelineVertexInputStateCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportCoarseSampleOrderStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportCoarseSampleOrderStateCreateInfoNV.gen.cs index b2a36a8af0..f7191aa68e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportCoarseSampleOrderStateCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportCoarseSampleOrderStateCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineViewportCoarseSampleOrderStateCreateInfoNV")] - public unsafe partial struct PipelineViewportCoarseSampleOrderStateCreateInfoNV + public unsafe partial struct PipelineViewportCoarseSampleOrderStateCreateInfoNV : IExtendsChain { public PipelineViewportCoarseSampleOrderStateCreateInfoNV ( @@ -79,5 +79,18 @@ public PipelineViewportCoarseSampleOrderStateCreateInfoNV [NativeName("Type.Name", "VkCoarseSampleOrderCustomNV")] [NativeName("Name", "pCustomSampleOrders")] public CoarseSampleOrderCustomNV* PCustomSampleOrders; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineViewportCoarseSampleOrderStateCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportExclusiveScissorStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportExclusiveScissorStateCreateInfoNV.gen.cs index ea773767db..6d64affc94 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportExclusiveScissorStateCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportExclusiveScissorStateCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineViewportExclusiveScissorStateCreateInfoNV")] - public unsafe partial struct PipelineViewportExclusiveScissorStateCreateInfoNV + public unsafe partial struct PipelineViewportExclusiveScissorStateCreateInfoNV : IExtendsChain { public PipelineViewportExclusiveScissorStateCreateInfoNV ( @@ -68,5 +68,18 @@ public PipelineViewportExclusiveScissorStateCreateInfoNV [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "pExclusiveScissors")] public Rect2D* PExclusiveScissors; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineViewportExclusiveScissorStateCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportShadingRateImageStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportShadingRateImageStateCreateInfoNV.gen.cs index 07706fa6de..a335365e92 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportShadingRateImageStateCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportShadingRateImageStateCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineViewportShadingRateImageStateCreateInfoNV")] - public unsafe partial struct PipelineViewportShadingRateImageStateCreateInfoNV + public unsafe partial struct PipelineViewportShadingRateImageStateCreateInfoNV : IExtendsChain { public PipelineViewportShadingRateImageStateCreateInfoNV ( @@ -79,5 +79,18 @@ public PipelineViewportShadingRateImageStateCreateInfoNV [NativeName("Type.Name", "VkShadingRatePaletteNV")] [NativeName("Name", "pShadingRatePalettes")] public ShadingRatePaletteNV* PShadingRatePalettes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineViewportShadingRateImageStateCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportStateCreateInfo.gen.cs index eda9a78a40..97de0b0397 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportStateCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportStateCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineViewportStateCreateInfo")] - public unsafe partial struct PipelineViewportStateCreateInfo + public unsafe partial struct PipelineViewportStateCreateInfo : IChainStart { public PipelineViewportStateCreateInfo ( @@ -101,5 +101,30 @@ public PipelineViewportStateCreateInfo [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "pScissors")] public Rect2D* PScissors; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineViewportStateCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PipelineViewportStateCreateInfo Chain( + out PipelineViewportStateCreateInfo capture) + { + capture = new PipelineViewportStateCreateInfo(StructureType.PipelineViewportStateCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportSwizzleStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportSwizzleStateCreateInfoNV.gen.cs index d1f7c59b63..42744374b0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportSwizzleStateCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportSwizzleStateCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineViewportSwizzleStateCreateInfoNV")] - public unsafe partial struct PipelineViewportSwizzleStateCreateInfoNV + public unsafe partial struct PipelineViewportSwizzleStateCreateInfoNV : IExtendsChain { public PipelineViewportSwizzleStateCreateInfoNV ( @@ -79,5 +79,18 @@ public PipelineViewportSwizzleStateCreateInfoNV [NativeName("Type.Name", "VkViewportSwizzleNV")] [NativeName("Name", "pViewportSwizzles")] public ViewportSwizzleNV* PViewportSwizzles; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineViewportSwizzleStateCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportWScalingStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportWScalingStateCreateInfoNV.gen.cs index ccc7f9d365..7d24c66f2e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportWScalingStateCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportWScalingStateCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineViewportWScalingStateCreateInfoNV")] - public unsafe partial struct PipelineViewportWScalingStateCreateInfoNV + public unsafe partial struct PipelineViewportWScalingStateCreateInfoNV : IExtendsChain { public PipelineViewportWScalingStateCreateInfoNV ( @@ -79,5 +79,18 @@ public PipelineViewportWScalingStateCreateInfoNV [NativeName("Type.Name", "VkViewportWScalingNV")] [NativeName("Name", "pViewportWScalings")] public ViewportWScalingNV* PViewportWScalings; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineViewportWScalingStateCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PresentFrameTokenGGP.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PresentFrameTokenGGP.gen.cs index 6bd22c0921..13b77eccf6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PresentFrameTokenGGP.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PresentFrameTokenGGP.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPresentFrameTokenGGP")] - public unsafe partial struct PresentFrameTokenGGP + public unsafe partial struct PresentFrameTokenGGP : IExtendsChain { public PresentFrameTokenGGP ( @@ -57,5 +57,18 @@ public PresentFrameTokenGGP [NativeName("Type.Name", "GgpFrameToken")] [NativeName("Name", "frameToken")] public nint FrameToken; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PresentFrameTokenGgp; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PresentIdKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PresentIdKHR.gen.cs index 93930f6e55..a4c86084b6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PresentIdKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PresentIdKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPresentIdKHR")] - public unsafe partial struct PresentIdKHR + public unsafe partial struct PresentIdKHR : IExtendsChain { public PresentIdKHR ( @@ -68,5 +68,18 @@ public PresentIdKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pPresentIds")] public ulong* PPresentIds; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PresentIDKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PresentInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PresentInfoKHR.gen.cs index 82be4a197a..c6a0e3aacb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PresentInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PresentInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPresentInfoKHR")] - public unsafe partial struct PresentInfoKHR + public unsafe partial struct PresentInfoKHR : IChainStart { public PresentInfoKHR ( @@ -112,5 +112,30 @@ public PresentInfoKHR [NativeName("Type.Name", "VkResult")] [NativeName("Name", "pResults")] public Result* PResults; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PresentInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref PresentInfoKHR Chain( + out PresentInfoKHR capture) + { + capture = new PresentInfoKHR(StructureType.PresentInfoKhr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PresentRegionsKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PresentRegionsKHR.gen.cs index 3c04317c95..0bd4236c61 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PresentRegionsKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PresentRegionsKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPresentRegionsKHR")] - public unsafe partial struct PresentRegionsKHR + public unsafe partial struct PresentRegionsKHR : IExtendsChain { public PresentRegionsKHR ( @@ -68,5 +68,18 @@ public PresentRegionsKHR [NativeName("Type.Name", "VkPresentRegionKHR")] [NativeName("Name", "pRegions")] public PresentRegionKHR* PRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PresentRegionsKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PresentTimesInfoGOOGLE.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PresentTimesInfoGOOGLE.gen.cs index 64906c33d1..cf6943c85a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PresentTimesInfoGOOGLE.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PresentTimesInfoGOOGLE.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPresentTimesInfoGOOGLE")] - public unsafe partial struct PresentTimesInfoGOOGLE + public unsafe partial struct PresentTimesInfoGOOGLE : IExtendsChain { public PresentTimesInfoGOOGLE ( @@ -68,5 +68,18 @@ public PresentTimesInfoGOOGLE [NativeName("Type.Name", "VkPresentTimeGOOGLE")] [NativeName("Name", "pTimes")] public PresentTimeGOOGLE* PTimes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PresentTimesInfoGoogle; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PrivateDataSlotCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PrivateDataSlotCreateInfoEXT.gen.cs index f8dcce2115..3402f80d83 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PrivateDataSlotCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PrivateDataSlotCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPrivateDataSlotCreateInfoEXT")] - public unsafe partial struct PrivateDataSlotCreateInfoEXT + public unsafe partial struct PrivateDataSlotCreateInfoEXT : IChainable { public PrivateDataSlotCreateInfoEXT ( @@ -57,5 +57,18 @@ public PrivateDataSlotCreateInfoEXT [NativeName("Type.Name", "VkPrivateDataSlotCreateFlagsEXT")] [NativeName("Name", "flags")] public PrivateDataSlotCreateFlagsEXT Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PrivateDataSlotCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ProtectedSubmitInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ProtectedSubmitInfo.gen.cs index 2374c848d4..d998011345 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ProtectedSubmitInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ProtectedSubmitInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkProtectedSubmitInfo")] - public unsafe partial struct ProtectedSubmitInfo + public unsafe partial struct ProtectedSubmitInfo : IExtendsChain { public ProtectedSubmitInfo ( @@ -57,5 +57,18 @@ public ProtectedSubmitInfo [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "protectedSubmit")] public Bool32 ProtectedSubmit; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ProtectedSubmitInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolCreateInfo.gen.cs index d8189773c7..c3442a5f22 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkQueryPoolCreateInfo")] - public unsafe partial struct QueryPoolCreateInfo + public unsafe partial struct QueryPoolCreateInfo : IChainStart { public QueryPoolCreateInfo ( @@ -90,5 +90,30 @@ public QueryPoolCreateInfo [NativeName("Type.Name", "VkQueryPipelineStatisticFlags")] [NativeName("Name", "pipelineStatistics")] public QueryPipelineStatisticFlags PipelineStatistics; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueryPoolCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref QueryPoolCreateInfo Chain( + out QueryPoolCreateInfo capture) + { + capture = new QueryPoolCreateInfo(StructureType.QueryPoolCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolCreateInfoINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolCreateInfoINTEL.gen.cs index 42d4d421f6..f5d8282b43 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolCreateInfoINTEL.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolCreateInfoINTEL.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkQueryPoolCreateInfoINTEL")] - public unsafe partial struct QueryPoolCreateInfoINTEL + [NativeName("AliasOf", "VkQueryPoolPerformanceQueryCreateInfoINTEL")] + public unsafe partial struct QueryPoolCreateInfoINTEL : IExtendsChain { public QueryPoolCreateInfoINTEL ( @@ -57,5 +58,18 @@ public QueryPoolCreateInfoINTEL [NativeName("Type.Name", "VkQueryPoolSamplingModeINTEL")] [NativeName("Name", "performanceCountersSampling")] public QueryPoolSamplingModeINTEL PerformanceCountersSampling; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueryPoolPerformanceQueryCreateInfoIntel; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolPerformanceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolPerformanceCreateInfoKHR.gen.cs index bcb945e86c..46beaf8ce3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolPerformanceCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolPerformanceCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkQueryPoolPerformanceCreateInfoKHR")] - public unsafe partial struct QueryPoolPerformanceCreateInfoKHR + public unsafe partial struct QueryPoolPerformanceCreateInfoKHR : IExtendsChain { public QueryPoolPerformanceCreateInfoKHR ( @@ -79,5 +79,18 @@ public QueryPoolPerformanceCreateInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pCounterIndices")] public uint* PCounterIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueryPoolPerformanceCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolPerformanceQueryCreateInfoINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolPerformanceQueryCreateInfoINTEL.gen.cs index 9962fec41c..9f8357785f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolPerformanceQueryCreateInfoINTEL.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolPerformanceQueryCreateInfoINTEL.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkQueryPoolPerformanceQueryCreateInfoINTEL")] - public unsafe partial struct QueryPoolPerformanceQueryCreateInfoINTEL + [NativeName("Aliases", "VkQueryPoolCreateInfoINTEL")] + public unsafe partial struct QueryPoolPerformanceQueryCreateInfoINTEL : IExtendsChain { public QueryPoolPerformanceQueryCreateInfoINTEL ( @@ -57,5 +58,18 @@ public QueryPoolPerformanceQueryCreateInfoINTEL [NativeName("Type.Name", "VkQueryPoolSamplingModeINTEL")] [NativeName("Name", "performanceCountersSampling")] public QueryPoolSamplingModeINTEL PerformanceCountersSampling; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueryPoolPerformanceQueryCreateInfoIntel; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyCheckpointProperties2NV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyCheckpointProperties2NV.gen.cs index 8d451eab1b..7cbc5554fa 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyCheckpointProperties2NV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyCheckpointProperties2NV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkQueueFamilyCheckpointProperties2NV")] - public unsafe partial struct QueueFamilyCheckpointProperties2NV + public unsafe partial struct QueueFamilyCheckpointProperties2NV : IExtendsChain, IExtendsChain { public QueueFamilyCheckpointProperties2NV ( @@ -57,5 +57,18 @@ public QueueFamilyCheckpointProperties2NV [NativeName("Type.Name", "VkPipelineStageFlags2KHR")] [NativeName("Name", "checkpointExecutionStageMask")] public PipelineStageFlags2KHR CheckpointExecutionStageMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueueFamilyCheckpointProperties2NV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyCheckpointPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyCheckpointPropertiesNV.gen.cs index fc34a3c18a..43512e3bea 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyCheckpointPropertiesNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyCheckpointPropertiesNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkQueueFamilyCheckpointPropertiesNV")] - public unsafe partial struct QueueFamilyCheckpointPropertiesNV + public unsafe partial struct QueueFamilyCheckpointPropertiesNV : IExtendsChain, IExtendsChain { public QueueFamilyCheckpointPropertiesNV ( @@ -57,5 +57,18 @@ public QueueFamilyCheckpointPropertiesNV [NativeName("Type.Name", "VkPipelineStageFlags")] [NativeName("Name", "checkpointExecutionStageMask")] public PipelineStageFlags CheckpointExecutionStageMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueueFamilyCheckpointPropertiesNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyGlobalPriorityPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyGlobalPriorityPropertiesEXT.gen.cs index 3372bcc325..87d603f2bb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyGlobalPriorityPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyGlobalPriorityPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkQueueFamilyGlobalPriorityPropertiesEXT")] - public unsafe partial struct QueueFamilyGlobalPriorityPropertiesEXT + public unsafe partial struct QueueFamilyGlobalPriorityPropertiesEXT : IExtendsChain, IExtendsChain { public QueueFamilyGlobalPriorityPropertiesEXT ( @@ -103,5 +103,18 @@ public Span AsSpan() #endif } + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueueFamilyGlobalPriorityPropertiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2.gen.cs index 1b9a34e75f..6ae0677b72 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkQueueFamilyProperties2")] - public unsafe partial struct QueueFamilyProperties2 + [NativeName("Aliases", "VkQueueFamilyProperties2KHR")] + public unsafe partial struct QueueFamilyProperties2 : IChainStart { public QueueFamilyProperties2 ( @@ -57,5 +58,30 @@ public QueueFamilyProperties2 [NativeName("Type.Name", "VkQueueFamilyProperties")] [NativeName("Name", "queueFamilyProperties")] public QueueFamilyProperties QueueFamilyProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueueFamilyProperties2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref QueueFamilyProperties2 Chain( + out QueueFamilyProperties2 capture) + { + capture = new QueueFamilyProperties2(StructureType.QueueFamilyProperties2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2KHR.gen.cs index c672fb2adc..99ac654b27 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkQueueFamilyProperties2KHR")] - public unsafe partial struct QueueFamilyProperties2KHR + [NativeName("AliasOf", "VkQueueFamilyProperties2")] + public unsafe partial struct QueueFamilyProperties2KHR : IChainStart { public QueueFamilyProperties2KHR ( @@ -57,5 +58,30 @@ public QueueFamilyProperties2KHR [NativeName("Type.Name", "VkQueueFamilyProperties")] [NativeName("Name", "queueFamilyProperties")] public QueueFamilyProperties QueueFamilyProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueueFamilyProperties2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref QueueFamilyProperties2KHR Chain( + out QueueFamilyProperties2KHR capture) + { + capture = new QueueFamilyProperties2KHR(StructureType.QueueFamilyProperties2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineCreateInfoKHR.gen.cs index 1605b519e7..bcc22be889 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRayTracingPipelineCreateInfoKHR")] - public unsafe partial struct RayTracingPipelineCreateInfoKHR + public unsafe partial struct RayTracingPipelineCreateInfoKHR : IChainStart { public RayTracingPipelineCreateInfoKHR ( @@ -178,5 +178,30 @@ public RayTracingPipelineCreateInfoKHR [NativeName("Type.Name", "int32_t")] [NativeName("Name", "basePipelineIndex")] public int BasePipelineIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RayTracingPipelineCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref RayTracingPipelineCreateInfoKHR Chain( + out RayTracingPipelineCreateInfoKHR capture) + { + capture = new RayTracingPipelineCreateInfoKHR(StructureType.RayTracingPipelineCreateInfoKhr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineCreateInfoNV.gen.cs index 7e63706b2f..62fa65fe9d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRayTracingPipelineCreateInfoNV")] - public unsafe partial struct RayTracingPipelineCreateInfoNV + public unsafe partial struct RayTracingPipelineCreateInfoNV : IChainStart { public RayTracingPipelineCreateInfoNV ( @@ -145,5 +145,30 @@ public RayTracingPipelineCreateInfoNV [NativeName("Type.Name", "int32_t")] [NativeName("Name", "basePipelineIndex")] public int BasePipelineIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RayTracingPipelineCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref RayTracingPipelineCreateInfoNV Chain( + out RayTracingPipelineCreateInfoNV capture) + { + capture = new RayTracingPipelineCreateInfoNV(StructureType.RayTracingPipelineCreateInfoNV); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineInterfaceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineInterfaceCreateInfoKHR.gen.cs index 5ea369c8d3..23149ea244 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineInterfaceCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineInterfaceCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRayTracingPipelineInterfaceCreateInfoKHR")] - public unsafe partial struct RayTracingPipelineInterfaceCreateInfoKHR + public unsafe partial struct RayTracingPipelineInterfaceCreateInfoKHR : IChainable { public RayTracingPipelineInterfaceCreateInfoKHR ( @@ -68,5 +68,18 @@ public RayTracingPipelineInterfaceCreateInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxPipelineRayHitAttributeSize")] public uint MaxPipelineRayHitAttributeSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RayTracingPipelineInterfaceCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingShaderGroupCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingShaderGroupCreateInfoKHR.gen.cs index 247444d970..b8c71d1089 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingShaderGroupCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingShaderGroupCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRayTracingShaderGroupCreateInfoKHR")] - public unsafe partial struct RayTracingShaderGroupCreateInfoKHR + public unsafe partial struct RayTracingShaderGroupCreateInfoKHR : IChainable { public RayTracingShaderGroupCreateInfoKHR ( @@ -112,5 +112,18 @@ public RayTracingShaderGroupCreateInfoKHR [NativeName("Type.Name", "void")] [NativeName("Name", "pShaderGroupCaptureReplayHandle")] public void* PShaderGroupCaptureReplayHandle; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RayTracingShaderGroupCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingShaderGroupCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingShaderGroupCreateInfoNV.gen.cs index 0d2b7aaba1..35338636a0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingShaderGroupCreateInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingShaderGroupCreateInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRayTracingShaderGroupCreateInfoNV")] - public unsafe partial struct RayTracingShaderGroupCreateInfoNV + public unsafe partial struct RayTracingShaderGroupCreateInfoNV : IChainable { public RayTracingShaderGroupCreateInfoNV ( @@ -101,5 +101,18 @@ public RayTracingShaderGroupCreateInfoNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "intersectionShader")] public uint IntersectionShader; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RayTracingShaderGroupCreateInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfo.gen.cs index 071199ea38..c5837f0319 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassAttachmentBeginInfo")] - public unsafe partial struct RenderPassAttachmentBeginInfo + [NativeName("Aliases", "VkRenderPassAttachmentBeginInfoKHR")] + public unsafe partial struct RenderPassAttachmentBeginInfo : IExtendsChain { public RenderPassAttachmentBeginInfo ( @@ -68,5 +69,18 @@ public RenderPassAttachmentBeginInfo [NativeName("Type.Name", "VkImageView")] [NativeName("Name", "pAttachments")] public ImageView* PAttachments; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassAttachmentBeginInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfoKHR.gen.cs index 062082e015..256050ee1c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassAttachmentBeginInfoKHR")] - public unsafe partial struct RenderPassAttachmentBeginInfoKHR + [NativeName("AliasOf", "VkRenderPassAttachmentBeginInfo")] + public unsafe partial struct RenderPassAttachmentBeginInfoKHR : IExtendsChain { public RenderPassAttachmentBeginInfoKHR ( @@ -68,5 +69,18 @@ public RenderPassAttachmentBeginInfoKHR [NativeName("Type.Name", "VkImageView")] [NativeName("Name", "pAttachments")] public ImageView* PAttachments; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassAttachmentBeginInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassBeginInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassBeginInfo.gen.cs index 0c3e4e37e0..d3dcf4fb46 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassBeginInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassBeginInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassBeginInfo")] - public unsafe partial struct RenderPassBeginInfo + public unsafe partial struct RenderPassBeginInfo : IChainStart { public RenderPassBeginInfo ( @@ -101,5 +101,30 @@ public RenderPassBeginInfo [NativeName("Type.Name", "VkClearValue")] [NativeName("Name", "pClearValues")] public ClearValue* PClearValues; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassBeginInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref RenderPassBeginInfo Chain( + out RenderPassBeginInfo capture) + { + capture = new RenderPassBeginInfo(StructureType.RenderPassBeginInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo.gen.cs index c280724ab3..c75ea73c65 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassCreateInfo")] - public unsafe partial struct RenderPassCreateInfo + public unsafe partial struct RenderPassCreateInfo : IChainStart { public RenderPassCreateInfo ( @@ -123,5 +123,30 @@ public RenderPassCreateInfo [NativeName("Type.Name", "VkSubpassDependency")] [NativeName("Name", "pDependencies")] public SubpassDependency* PDependencies; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref RenderPassCreateInfo Chain( + out RenderPassCreateInfo capture) + { + capture = new RenderPassCreateInfo(StructureType.RenderPassCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2.gen.cs index 8499729d63..bf1273d232 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassCreateInfo2")] - public unsafe partial struct RenderPassCreateInfo2 + [NativeName("Aliases", "VkRenderPassCreateInfo2KHR")] + public unsafe partial struct RenderPassCreateInfo2 : IChainStart { public RenderPassCreateInfo2 ( @@ -145,5 +146,30 @@ public RenderPassCreateInfo2 [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pCorrelatedViewMasks")] public uint* PCorrelatedViewMasks; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassCreateInfo2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref RenderPassCreateInfo2 Chain( + out RenderPassCreateInfo2 capture) + { + capture = new RenderPassCreateInfo2(StructureType.RenderPassCreateInfo2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2KHR.gen.cs index d4aae52ac3..80e2211f4e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassCreateInfo2KHR")] - public unsafe partial struct RenderPassCreateInfo2KHR + [NativeName("AliasOf", "VkRenderPassCreateInfo2")] + public unsafe partial struct RenderPassCreateInfo2KHR : IChainStart { public RenderPassCreateInfo2KHR ( @@ -145,5 +146,30 @@ public RenderPassCreateInfo2KHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pCorrelatedViewMasks")] public uint* PCorrelatedViewMasks; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassCreateInfo2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref RenderPassCreateInfo2KHR Chain( + out RenderPassCreateInfo2KHR capture) + { + capture = new RenderPassCreateInfo2KHR(StructureType.RenderPassCreateInfo2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassFragmentDensityMapCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassFragmentDensityMapCreateInfoEXT.gen.cs index 9d07fb74a8..8148df5c8e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassFragmentDensityMapCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassFragmentDensityMapCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassFragmentDensityMapCreateInfoEXT")] - public unsafe partial struct RenderPassFragmentDensityMapCreateInfoEXT + public unsafe partial struct RenderPassFragmentDensityMapCreateInfoEXT : IExtendsChain, IExtendsChain, IExtendsChain { public RenderPassFragmentDensityMapCreateInfoEXT ( @@ -57,5 +57,18 @@ public RenderPassFragmentDensityMapCreateInfoEXT [NativeName("Type.Name", "VkAttachmentReference")] [NativeName("Name", "fragmentDensityMapAttachment")] public AttachmentReference FragmentDensityMapAttachment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassFragmentDensityMapCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfo.gen.cs index 668301b76b..f0d4fa6a6d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassInputAttachmentAspectCreateInfo")] - public unsafe partial struct RenderPassInputAttachmentAspectCreateInfo + [NativeName("Aliases", "VkRenderPassInputAttachmentAspectCreateInfoKHR")] + public unsafe partial struct RenderPassInputAttachmentAspectCreateInfo : IExtendsChain { public RenderPassInputAttachmentAspectCreateInfo ( @@ -68,5 +69,18 @@ public RenderPassInputAttachmentAspectCreateInfo [NativeName("Type.Name", "VkInputAttachmentAspectReference")] [NativeName("Name", "pAspectReferences")] public InputAttachmentAspectReference* PAspectReferences; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassInputAttachmentAspectCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfoKHR.gen.cs index 6664956b0d..e4784837aa 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassInputAttachmentAspectCreateInfoKHR")] - public unsafe partial struct RenderPassInputAttachmentAspectCreateInfoKHR + [NativeName("AliasOf", "VkRenderPassInputAttachmentAspectCreateInfo")] + public unsafe partial struct RenderPassInputAttachmentAspectCreateInfoKHR : IExtendsChain { public RenderPassInputAttachmentAspectCreateInfoKHR ( @@ -68,5 +69,18 @@ public RenderPassInputAttachmentAspectCreateInfoKHR [NativeName("Type.Name", "VkInputAttachmentAspectReference")] [NativeName("Name", "pAspectReferences")] public InputAttachmentAspectReference* PAspectReferences; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassInputAttachmentAspectCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfo.gen.cs index 6630255c68..75a893c782 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassMultiviewCreateInfo")] - public unsafe partial struct RenderPassMultiviewCreateInfo + [NativeName("Aliases", "VkRenderPassMultiviewCreateInfoKHR")] + public unsafe partial struct RenderPassMultiviewCreateInfo : IExtendsChain { public RenderPassMultiviewCreateInfo ( @@ -112,5 +113,18 @@ public RenderPassMultiviewCreateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pCorrelationMasks")] public uint* PCorrelationMasks; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassMultiviewCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfoKHR.gen.cs index 65194b6d9a..d443fa5fdb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassMultiviewCreateInfoKHR")] - public unsafe partial struct RenderPassMultiviewCreateInfoKHR + [NativeName("AliasOf", "VkRenderPassMultiviewCreateInfo")] + public unsafe partial struct RenderPassMultiviewCreateInfoKHR : IExtendsChain { public RenderPassMultiviewCreateInfoKHR ( @@ -112,5 +113,18 @@ public RenderPassMultiviewCreateInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pCorrelationMasks")] public uint* PCorrelationMasks; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassMultiviewCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassSampleLocationsBeginInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassSampleLocationsBeginInfoEXT.gen.cs index ddba77768c..8a5b0b6ca0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassSampleLocationsBeginInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassSampleLocationsBeginInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassSampleLocationsBeginInfoEXT")] - public unsafe partial struct RenderPassSampleLocationsBeginInfoEXT + public unsafe partial struct RenderPassSampleLocationsBeginInfoEXT : IExtendsChain { public RenderPassSampleLocationsBeginInfoEXT ( @@ -90,5 +90,18 @@ public RenderPassSampleLocationsBeginInfoEXT [NativeName("Type.Name", "VkSubpassSampleLocationsEXT")] [NativeName("Name", "pPostSubpassSampleLocations")] public SubpassSampleLocationsEXT* PPostSubpassSampleLocations; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassSampleLocationsBeginInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassTransformBeginInfoQCOM.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassTransformBeginInfoQCOM.gen.cs index 205e660fd8..15c9cd7864 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassTransformBeginInfoQCOM.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassTransformBeginInfoQCOM.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassTransformBeginInfoQCOM")] - public unsafe partial struct RenderPassTransformBeginInfoQCOM + public unsafe partial struct RenderPassTransformBeginInfoQCOM : IExtendsChain { public RenderPassTransformBeginInfoQCOM ( @@ -57,5 +57,18 @@ public RenderPassTransformBeginInfoQCOM [NativeName("Type.Name", "VkSurfaceTransformFlagBitsKHR")] [NativeName("Name", "transform")] public SurfaceTransformFlagsKHR Transform; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassTransformBeginInfoQCom; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingAttachmentInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingAttachmentInfoKHR.gen.cs index 5d89ffdf75..631442064f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingAttachmentInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingAttachmentInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderingAttachmentInfoKHR")] - public unsafe partial struct RenderingAttachmentInfoKHR + public unsafe partial struct RenderingAttachmentInfoKHR : IChainable { public RenderingAttachmentInfoKHR ( @@ -134,5 +134,18 @@ public RenderingAttachmentInfoKHR [NativeName("Type.Name", "VkClearValue")] [NativeName("Name", "clearValue")] public ClearValue ClearValue; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderingAttachmentInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingFragmentDensityMapAttachmentInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingFragmentDensityMapAttachmentInfoEXT.gen.cs index 72c1e1d492..8e87f0206e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingFragmentDensityMapAttachmentInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingFragmentDensityMapAttachmentInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderingFragmentDensityMapAttachmentInfoEXT")] - public unsafe partial struct RenderingFragmentDensityMapAttachmentInfoEXT + public unsafe partial struct RenderingFragmentDensityMapAttachmentInfoEXT : IExtendsChain { public RenderingFragmentDensityMapAttachmentInfoEXT ( @@ -68,5 +68,18 @@ public RenderingFragmentDensityMapAttachmentInfoEXT [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "imageLayout")] public ImageLayout ImageLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderingFragmentDensityMapAttachmentInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingFragmentShadingRateAttachmentInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingFragmentShadingRateAttachmentInfoKHR.gen.cs index 6f29e02319..feea5282b0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingFragmentShadingRateAttachmentInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingFragmentShadingRateAttachmentInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderingFragmentShadingRateAttachmentInfoKHR")] - public unsafe partial struct RenderingFragmentShadingRateAttachmentInfoKHR + public unsafe partial struct RenderingFragmentShadingRateAttachmentInfoKHR : IExtendsChain { public RenderingFragmentShadingRateAttachmentInfoKHR ( @@ -79,5 +79,18 @@ public RenderingFragmentShadingRateAttachmentInfoKHR [NativeName("Type.Name", "VkExtent2D")] [NativeName("Name", "shadingRateAttachmentTexelSize")] public Extent2D ShadingRateAttachmentTexelSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderingFragmentShadingRateAttachmentInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingInfoKHR.gen.cs index 31ad589b96..0bc5110b6d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderingInfoKHR")] - public unsafe partial struct RenderingInfoKHR + public unsafe partial struct RenderingInfoKHR : IChainStart { public RenderingInfoKHR ( @@ -134,5 +134,30 @@ public RenderingInfoKHR [NativeName("Type.Name", "VkRenderingAttachmentInfoKHR")] [NativeName("Name", "pStencilAttachment")] public RenderingAttachmentInfoKHR* PStencilAttachment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderingInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref RenderingInfoKHR Chain( + out RenderingInfoKHR capture) + { + capture = new RenderingInfoKHR(StructureType.RenderingInfoKhr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ResolveImageInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ResolveImageInfo2KHR.gen.cs index dc5d59b0d4..13d1e4fe36 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ResolveImageInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ResolveImageInfo2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkResolveImageInfo2KHR")] - public unsafe partial struct ResolveImageInfo2KHR + public unsafe partial struct ResolveImageInfo2KHR : IChainable { public ResolveImageInfo2KHR ( @@ -112,5 +112,18 @@ public ResolveImageInfo2KHR [NativeName("Type.Name", "VkImageResolve2KHR")] [NativeName("Name", "pRegions")] public ImageResolve2KHR* PRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ResolveImageInfo2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SampleLocationsInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SampleLocationsInfoEXT.gen.cs index 39bf6f1a3e..e4c2213846 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SampleLocationsInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SampleLocationsInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSampleLocationsInfoEXT")] - public unsafe partial struct SampleLocationsInfoEXT + public unsafe partial struct SampleLocationsInfoEXT : IExtendsChain, IExtendsChain { public SampleLocationsInfoEXT ( @@ -90,5 +90,18 @@ public SampleLocationsInfoEXT [NativeName("Type.Name", "VkSampleLocationEXT")] [NativeName("Name", "pSampleLocations")] public SampleLocationEXT* PSampleLocations; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SampleLocationsInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerBorderColorComponentMappingCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerBorderColorComponentMappingCreateInfoEXT.gen.cs index b4daf5c649..702e9fea44 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerBorderColorComponentMappingCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerBorderColorComponentMappingCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerBorderColorComponentMappingCreateInfoEXT")] - public unsafe partial struct SamplerBorderColorComponentMappingCreateInfoEXT + public unsafe partial struct SamplerBorderColorComponentMappingCreateInfoEXT : IExtendsChain { public SamplerBorderColorComponentMappingCreateInfoEXT ( @@ -68,5 +68,18 @@ public SamplerBorderColorComponentMappingCreateInfoEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "srgb")] public Bool32 Srgb; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerBorderColorComponentMappingCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerCreateInfo.gen.cs index 6dab9a319f..69b5f3e6d1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerCreateInfo")] - public unsafe partial struct SamplerCreateInfo + public unsafe partial struct SamplerCreateInfo : IChainStart { public SamplerCreateInfo ( @@ -222,5 +222,30 @@ public SamplerCreateInfo [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "unnormalizedCoordinates")] public Bool32 UnnormalizedCoordinates; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref SamplerCreateInfo Chain( + out SamplerCreateInfo capture) + { + capture = new SamplerCreateInfo(StructureType.SamplerCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerCustomBorderColorCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerCustomBorderColorCreateInfoEXT.gen.cs index 5d19e32103..1b29dee989 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerCustomBorderColorCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerCustomBorderColorCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerCustomBorderColorCreateInfoEXT")] - public unsafe partial struct SamplerCustomBorderColorCreateInfoEXT + public unsafe partial struct SamplerCustomBorderColorCreateInfoEXT : IExtendsChain { public SamplerCustomBorderColorCreateInfoEXT ( @@ -68,5 +68,18 @@ public SamplerCustomBorderColorCreateInfoEXT [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "format")] public Format Format; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerCustomBorderColorCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfo.gen.cs index 8d20b05eca..cd32c74188 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerReductionModeCreateInfo")] - public unsafe partial struct SamplerReductionModeCreateInfo + [NativeName("Aliases", "VkSamplerReductionModeCreateInfoEXT")] + public unsafe partial struct SamplerReductionModeCreateInfo : IExtendsChain { public SamplerReductionModeCreateInfo ( @@ -57,5 +58,18 @@ public SamplerReductionModeCreateInfo [NativeName("Type.Name", "VkSamplerReductionMode")] [NativeName("Name", "reductionMode")] public SamplerReductionMode ReductionMode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerReductionModeCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfoEXT.gen.cs index e476417d36..cab3d4603a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfoEXT.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerReductionModeCreateInfoEXT")] - public unsafe partial struct SamplerReductionModeCreateInfoEXT + [NativeName("AliasOf", "VkSamplerReductionModeCreateInfo")] + public unsafe partial struct SamplerReductionModeCreateInfoEXT : IExtendsChain { public SamplerReductionModeCreateInfoEXT ( @@ -57,5 +58,18 @@ public SamplerReductionModeCreateInfoEXT [NativeName("Type.Name", "VkSamplerReductionMode")] [NativeName("Name", "reductionMode")] public SamplerReductionMode ReductionMode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerReductionModeCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfo.gen.cs index 304c61bcba..5d96b4917b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerYcbcrConversionCreateInfo")] - public unsafe partial struct SamplerYcbcrConversionCreateInfo + [NativeName("Aliases", "VkSamplerYcbcrConversionCreateInfoKHR")] + public unsafe partial struct SamplerYcbcrConversionCreateInfo : IChainStart { public SamplerYcbcrConversionCreateInfo ( @@ -134,5 +135,30 @@ public SamplerYcbcrConversionCreateInfo [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "forceExplicitReconstruction")] public Bool32 ForceExplicitReconstruction; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerYcbcrConversionCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref SamplerYcbcrConversionCreateInfo Chain( + out SamplerYcbcrConversionCreateInfo capture) + { + capture = new SamplerYcbcrConversionCreateInfo(StructureType.SamplerYcbcrConversionCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfoKHR.gen.cs index e248e865aa..391fc5220a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerYcbcrConversionCreateInfoKHR")] - public unsafe partial struct SamplerYcbcrConversionCreateInfoKHR + [NativeName("AliasOf", "VkSamplerYcbcrConversionCreateInfo")] + public unsafe partial struct SamplerYcbcrConversionCreateInfoKHR : IChainStart { public SamplerYcbcrConversionCreateInfoKHR ( @@ -134,5 +135,30 @@ public SamplerYcbcrConversionCreateInfoKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "forceExplicitReconstruction")] public Bool32 ForceExplicitReconstruction; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerYcbcrConversionCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref SamplerYcbcrConversionCreateInfoKHR Chain( + out SamplerYcbcrConversionCreateInfoKHR capture) + { + capture = new SamplerYcbcrConversionCreateInfoKHR(StructureType.SamplerYcbcrConversionCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatProperties.gen.cs index 05d0e2137d..ec53b11c81 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatProperties.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerYcbcrConversionImageFormatProperties")] - public unsafe partial struct SamplerYcbcrConversionImageFormatProperties + [NativeName("Aliases", "VkSamplerYcbcrConversionImageFormatPropertiesKHR")] + public unsafe partial struct SamplerYcbcrConversionImageFormatProperties : IExtendsChain, IExtendsChain { public SamplerYcbcrConversionImageFormatProperties ( @@ -57,5 +58,18 @@ public SamplerYcbcrConversionImageFormatProperties [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "combinedImageSamplerDescriptorCount")] public uint CombinedImageSamplerDescriptorCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerYcbcrConversionImageFormatProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatPropertiesKHR.gen.cs index 0c21e4986f..598470834e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatPropertiesKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerYcbcrConversionImageFormatPropertiesKHR")] - public unsafe partial struct SamplerYcbcrConversionImageFormatPropertiesKHR + [NativeName("AliasOf", "VkSamplerYcbcrConversionImageFormatProperties")] + public unsafe partial struct SamplerYcbcrConversionImageFormatPropertiesKHR : IExtendsChain, IExtendsChain { public SamplerYcbcrConversionImageFormatPropertiesKHR ( @@ -57,5 +58,18 @@ public SamplerYcbcrConversionImageFormatPropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "combinedImageSamplerDescriptorCount")] public uint CombinedImageSamplerDescriptorCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerYcbcrConversionImageFormatProperties; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfo.gen.cs index 6af5edf275..b399096fd3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerYcbcrConversionInfo")] - public unsafe partial struct SamplerYcbcrConversionInfo + [NativeName("Aliases", "VkSamplerYcbcrConversionInfoKHR")] + public unsafe partial struct SamplerYcbcrConversionInfo : IExtendsChain, IExtendsChain { public SamplerYcbcrConversionInfo ( @@ -57,5 +58,18 @@ public SamplerYcbcrConversionInfo [NativeName("Type.Name", "VkSamplerYcbcrConversion")] [NativeName("Name", "conversion")] public SamplerYcbcrConversion Conversion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerYcbcrConversionInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfoKHR.gen.cs index 88a8056674..7105e0b410 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerYcbcrConversionInfoKHR")] - public unsafe partial struct SamplerYcbcrConversionInfoKHR + [NativeName("AliasOf", "VkSamplerYcbcrConversionInfo")] + public unsafe partial struct SamplerYcbcrConversionInfoKHR : IExtendsChain, IExtendsChain { public SamplerYcbcrConversionInfoKHR ( @@ -57,5 +58,18 @@ public SamplerYcbcrConversionInfoKHR [NativeName("Type.Name", "VkSamplerYcbcrConversion")] [NativeName("Name", "conversion")] public SamplerYcbcrConversion Conversion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerYcbcrConversionInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ScreenSurfaceCreateInfoQNX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ScreenSurfaceCreateInfoQNX.gen.cs index f439d147f0..4ca8c7367a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ScreenSurfaceCreateInfoQNX.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ScreenSurfaceCreateInfoQNX.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkScreenSurfaceCreateInfoQNX")] - public unsafe partial struct ScreenSurfaceCreateInfoQNX + public unsafe partial struct ScreenSurfaceCreateInfoQNX : IChainable { public ScreenSurfaceCreateInfoQNX ( @@ -79,5 +79,18 @@ public ScreenSurfaceCreateInfoQNX [NativeName("Type.Name", "_screen_window")] [NativeName("Name", "window")] public void* Window; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ScreenSurfaceCreateInfoQnx; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreCreateInfo.gen.cs index 5865e6c45d..6101a5e932 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreCreateInfo")] - public unsafe partial struct SemaphoreCreateInfo + public unsafe partial struct SemaphoreCreateInfo : IChainStart { public SemaphoreCreateInfo ( @@ -57,5 +57,30 @@ public SemaphoreCreateInfo [NativeName("Type.Name", "VkSemaphoreCreateFlags")] [NativeName("Name", "flags")] public uint Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref SemaphoreCreateInfo Chain( + out SemaphoreCreateInfo capture) + { + capture = new SemaphoreCreateInfo(StructureType.SemaphoreCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetFdInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetFdInfoKHR.gen.cs index 502a8caafa..7957e55263 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetFdInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetFdInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreGetFdInfoKHR")] - public unsafe partial struct SemaphoreGetFdInfoKHR + public unsafe partial struct SemaphoreGetFdInfoKHR : IChainable { public SemaphoreGetFdInfoKHR ( @@ -68,5 +68,18 @@ public SemaphoreGetFdInfoKHR [NativeName("Type.Name", "VkExternalSemaphoreHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalSemaphoreHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreGetFDInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetWin32HandleInfoKHR.gen.cs index d588742132..9de68ebf1b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetWin32HandleInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetWin32HandleInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreGetWin32HandleInfoKHR")] - public unsafe partial struct SemaphoreGetWin32HandleInfoKHR + public unsafe partial struct SemaphoreGetWin32HandleInfoKHR : IChainable { public SemaphoreGetWin32HandleInfoKHR ( @@ -68,5 +68,18 @@ public SemaphoreGetWin32HandleInfoKHR [NativeName("Type.Name", "VkExternalSemaphoreHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalSemaphoreHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreGetWin32HandleInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetZirconHandleInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetZirconHandleInfoFUCHSIA.gen.cs index b1cff9174f..14bcc1900c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetZirconHandleInfoFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetZirconHandleInfoFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreGetZirconHandleInfoFUCHSIA")] - public unsafe partial struct SemaphoreGetZirconHandleInfoFUCHSIA + public unsafe partial struct SemaphoreGetZirconHandleInfoFUCHSIA : IChainable { public SemaphoreGetZirconHandleInfoFUCHSIA ( @@ -68,5 +68,18 @@ public SemaphoreGetZirconHandleInfoFUCHSIA [NativeName("Type.Name", "VkExternalSemaphoreHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalSemaphoreHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreGetZirconHandleInfoFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfo.gen.cs index 130fe8fec6..2f3851bf61 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreSignalInfo")] - public unsafe partial struct SemaphoreSignalInfo + [NativeName("Aliases", "VkSemaphoreSignalInfoKHR")] + public unsafe partial struct SemaphoreSignalInfo : IChainable { public SemaphoreSignalInfo ( @@ -68,5 +69,18 @@ public SemaphoreSignalInfo [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "value")] public ulong Value; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreSignalInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfoKHR.gen.cs index 9c24dcff6a..9869d1487b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreSignalInfoKHR")] - public unsafe partial struct SemaphoreSignalInfoKHR + [NativeName("AliasOf", "VkSemaphoreSignalInfo")] + public unsafe partial struct SemaphoreSignalInfoKHR : IChainable { public SemaphoreSignalInfoKHR ( @@ -68,5 +69,18 @@ public SemaphoreSignalInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "value")] public ulong Value; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreSignalInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSubmitInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSubmitInfoKHR.gen.cs index 31c189fa57..92877cacf3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSubmitInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSubmitInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreSubmitInfoKHR")] - public unsafe partial struct SemaphoreSubmitInfoKHR + public unsafe partial struct SemaphoreSubmitInfoKHR : IChainable { public SemaphoreSubmitInfoKHR ( @@ -90,5 +90,18 @@ public SemaphoreSubmitInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "deviceIndex")] public uint DeviceIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreSubmitInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfo.gen.cs index 9d3db84a7c..b9f532a5d4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreTypeCreateInfo")] - public unsafe partial struct SemaphoreTypeCreateInfo + [NativeName("Aliases", "VkSemaphoreTypeCreateInfoKHR")] + public unsafe partial struct SemaphoreTypeCreateInfo : IExtendsChain, IExtendsChain, IExtendsChain { public SemaphoreTypeCreateInfo ( @@ -68,5 +69,18 @@ public SemaphoreTypeCreateInfo [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "initialValue")] public ulong InitialValue; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreTypeCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfoKHR.gen.cs index 203a962761..8cd0c48178 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreTypeCreateInfoKHR")] - public unsafe partial struct SemaphoreTypeCreateInfoKHR + [NativeName("AliasOf", "VkSemaphoreTypeCreateInfo")] + public unsafe partial struct SemaphoreTypeCreateInfoKHR : IExtendsChain, IExtendsChain, IExtendsChain { public SemaphoreTypeCreateInfoKHR ( @@ -68,5 +69,18 @@ public SemaphoreTypeCreateInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "initialValue")] public ulong InitialValue; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreTypeCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfo.gen.cs index 1217904fa9..cf861173f3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreWaitInfo")] - public unsafe partial struct SemaphoreWaitInfo + [NativeName("Aliases", "VkSemaphoreWaitInfoKHR")] + public unsafe partial struct SemaphoreWaitInfo : IChainable { public SemaphoreWaitInfo ( @@ -90,5 +91,18 @@ public SemaphoreWaitInfo [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pValues")] public ulong* PValues; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreWaitInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfoKHR.gen.cs index 364863905d..b9534061ee 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreWaitInfoKHR")] - public unsafe partial struct SemaphoreWaitInfoKHR + [NativeName("AliasOf", "VkSemaphoreWaitInfo")] + public unsafe partial struct SemaphoreWaitInfoKHR : IChainable { public SemaphoreWaitInfoKHR ( @@ -90,5 +91,18 @@ public SemaphoreWaitInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pValues")] public ulong* PValues; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreWaitInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ShaderModuleCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ShaderModuleCreateInfo.gen.cs index 6a1e449e64..b2b7ee4df8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ShaderModuleCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ShaderModuleCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkShaderModuleCreateInfo")] - public unsafe partial struct ShaderModuleCreateInfo + public unsafe partial struct ShaderModuleCreateInfo : IChainStart { public ShaderModuleCreateInfo ( @@ -79,5 +79,30 @@ public ShaderModuleCreateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pCode")] public uint* PCode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ShaderModuleCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref ShaderModuleCreateInfo Chain( + out ShaderModuleCreateInfo capture) + { + capture = new ShaderModuleCreateInfo(StructureType.ShaderModuleCreateInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ShaderModuleValidationCacheCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ShaderModuleValidationCacheCreateInfoEXT.gen.cs index 029c67a9ce..1ca2decfee 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ShaderModuleValidationCacheCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ShaderModuleValidationCacheCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkShaderModuleValidationCacheCreateInfoEXT")] - public unsafe partial struct ShaderModuleValidationCacheCreateInfoEXT + public unsafe partial struct ShaderModuleValidationCacheCreateInfoEXT : IExtendsChain { public ShaderModuleValidationCacheCreateInfoEXT ( @@ -57,5 +57,18 @@ public ShaderModuleValidationCacheCreateInfoEXT [NativeName("Type.Name", "VkValidationCacheEXT")] [NativeName("Name", "validationCache")] public ValidationCacheEXT ValidationCache; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ShaderModuleValidationCacheCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SharedPresentSurfaceCapabilitiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SharedPresentSurfaceCapabilitiesKHR.gen.cs index caec89aecd..1b6ddf5ab1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SharedPresentSurfaceCapabilitiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SharedPresentSurfaceCapabilitiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSharedPresentSurfaceCapabilitiesKHR")] - public unsafe partial struct SharedPresentSurfaceCapabilitiesKHR + public unsafe partial struct SharedPresentSurfaceCapabilitiesKHR : IExtendsChain { public SharedPresentSurfaceCapabilitiesKHR ( @@ -57,5 +57,18 @@ public SharedPresentSurfaceCapabilitiesKHR [NativeName("Type.Name", "VkImageUsageFlags")] [NativeName("Name", "sharedPresentSupportedUsageFlags")] public ImageUsageFlags SharedPresentSupportedUsageFlags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SharedPresentSurfaceCapabilitiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2.gen.cs index d05deb4c3e..3c159f5d53 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSparseImageFormatProperties2")] - public unsafe partial struct SparseImageFormatProperties2 + [NativeName("Aliases", "VkSparseImageFormatProperties2KHR")] + public unsafe partial struct SparseImageFormatProperties2 : IChainable { public SparseImageFormatProperties2 ( @@ -57,5 +58,18 @@ public SparseImageFormatProperties2 [NativeName("Type.Name", "VkSparseImageFormatProperties")] [NativeName("Name", "properties")] public SparseImageFormatProperties Properties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SparseImageFormatProperties2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2KHR.gen.cs index 5f8f130730..87d9946aae 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSparseImageFormatProperties2KHR")] - public unsafe partial struct SparseImageFormatProperties2KHR + [NativeName("AliasOf", "VkSparseImageFormatProperties2")] + public unsafe partial struct SparseImageFormatProperties2KHR : IChainable { public SparseImageFormatProperties2KHR ( @@ -57,5 +58,18 @@ public SparseImageFormatProperties2KHR [NativeName("Type.Name", "VkSparseImageFormatProperties")] [NativeName("Name", "properties")] public SparseImageFormatProperties Properties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SparseImageFormatProperties2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2.gen.cs index c9c89970eb..0df5a90d37 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSparseImageMemoryRequirements2")] - public unsafe partial struct SparseImageMemoryRequirements2 + [NativeName("Aliases", "VkSparseImageMemoryRequirements2KHR")] + public unsafe partial struct SparseImageMemoryRequirements2 : IChainable { public SparseImageMemoryRequirements2 ( @@ -57,5 +58,18 @@ public SparseImageMemoryRequirements2 [NativeName("Type.Name", "VkSparseImageMemoryRequirements")] [NativeName("Name", "memoryRequirements")] public SparseImageMemoryRequirements MemoryRequirements; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SparseImageMemoryRequirements2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2KHR.gen.cs index e00ad53012..830bebc86a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSparseImageMemoryRequirements2KHR")] - public unsafe partial struct SparseImageMemoryRequirements2KHR + [NativeName("AliasOf", "VkSparseImageMemoryRequirements2")] + public unsafe partial struct SparseImageMemoryRequirements2KHR : IChainable { public SparseImageMemoryRequirements2KHR ( @@ -57,5 +58,18 @@ public SparseImageMemoryRequirements2KHR [NativeName("Type.Name", "VkSparseImageMemoryRequirements")] [NativeName("Name", "memoryRequirements")] public SparseImageMemoryRequirements MemoryRequirements; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SparseImageMemoryRequirements2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/StreamDescriptorSurfaceCreateInfoGGP.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/StreamDescriptorSurfaceCreateInfoGGP.gen.cs index f3468b7c73..e8cfaacb16 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/StreamDescriptorSurfaceCreateInfoGGP.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/StreamDescriptorSurfaceCreateInfoGGP.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkStreamDescriptorSurfaceCreateInfoGGP")] - public unsafe partial struct StreamDescriptorSurfaceCreateInfoGGP + public unsafe partial struct StreamDescriptorSurfaceCreateInfoGGP : IChainable { public StreamDescriptorSurfaceCreateInfoGGP ( @@ -68,5 +68,18 @@ public StreamDescriptorSurfaceCreateInfoGGP [NativeName("Type.Name", "GgpStreamDescriptor")] [NativeName("Name", "streamDescriptor")] public nint StreamDescriptor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.StreamDescriptorSurfaceCreateInfoGgp; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubmitInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubmitInfo.gen.cs index a157486bb5..cf6014436c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubmitInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubmitInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubmitInfo")] - public unsafe partial struct SubmitInfo + public unsafe partial struct SubmitInfo : IChainStart { public SubmitInfo ( @@ -123,5 +123,30 @@ public SubmitInfo [NativeName("Type.Name", "VkSemaphore")] [NativeName("Name", "pSignalSemaphores")] public Semaphore* PSignalSemaphores; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubmitInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref SubmitInfo Chain( + out SubmitInfo capture) + { + capture = new SubmitInfo(StructureType.SubmitInfo); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubmitInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubmitInfo2KHR.gen.cs index 67251e39b5..830554611d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubmitInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubmitInfo2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubmitInfo2KHR")] - public unsafe partial struct SubmitInfo2KHR + public unsafe partial struct SubmitInfo2KHR : IChainStart { public SubmitInfo2KHR ( @@ -123,5 +123,30 @@ public SubmitInfo2KHR [NativeName("Type.Name", "VkSemaphoreSubmitInfoKHR")] [NativeName("Name", "pSignalSemaphoreInfos")] public SemaphoreSubmitInfoKHR* PSignalSemaphoreInfos; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubmitInfo2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref SubmitInfo2KHR Chain( + out SubmitInfo2KHR capture) + { + capture = new SubmitInfo2KHR(StructureType.SubmitInfo2Khr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfo.gen.cs index a5ca819c45..47fbc78e8f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassBeginInfo")] - public unsafe partial struct SubpassBeginInfo + [NativeName("Aliases", "VkSubpassBeginInfoKHR")] + public unsafe partial struct SubpassBeginInfo : IChainable { public SubpassBeginInfo ( @@ -57,5 +58,18 @@ public SubpassBeginInfo [NativeName("Type.Name", "VkSubpassContents")] [NativeName("Name", "contents")] public SubpassContents Contents; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassBeginInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfoKHR.gen.cs index 20a1eea2d3..14e69cef98 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassBeginInfoKHR")] - public unsafe partial struct SubpassBeginInfoKHR + [NativeName("AliasOf", "VkSubpassBeginInfo")] + public unsafe partial struct SubpassBeginInfoKHR : IChainable { public SubpassBeginInfoKHR ( @@ -57,5 +58,18 @@ public SubpassBeginInfoKHR [NativeName("Type.Name", "VkSubpassContents")] [NativeName("Name", "contents")] public SubpassContents Contents; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassBeginInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2.gen.cs index 746615fba6..4ed93b563e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassDependency2")] - public unsafe partial struct SubpassDependency2 + [NativeName("Aliases", "VkSubpassDependency2KHR")] + public unsafe partial struct SubpassDependency2 : IChainStart { public SubpassDependency2 ( @@ -134,5 +135,30 @@ public SubpassDependency2 [NativeName("Type.Name", "int32_t")] [NativeName("Name", "viewOffset")] public int ViewOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassDependency2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref SubpassDependency2 Chain( + out SubpassDependency2 capture) + { + capture = new SubpassDependency2(StructureType.SubpassDependency2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2KHR.gen.cs index d6737774bc..bc97473360 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassDependency2KHR")] - public unsafe partial struct SubpassDependency2KHR + [NativeName("AliasOf", "VkSubpassDependency2")] + public unsafe partial struct SubpassDependency2KHR : IChainStart { public SubpassDependency2KHR ( @@ -134,5 +135,30 @@ public SubpassDependency2KHR [NativeName("Type.Name", "int32_t")] [NativeName("Name", "viewOffset")] public int ViewOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassDependency2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref SubpassDependency2KHR Chain( + out SubpassDependency2KHR capture) + { + capture = new SubpassDependency2KHR(StructureType.SubpassDependency2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2.gen.cs index 77e30fe74b..b130cf9587 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassDescription2")] - public unsafe partial struct SubpassDescription2 + [NativeName("Aliases", "VkSubpassDescription2KHR")] + public unsafe partial struct SubpassDescription2 : IChainStart { public SubpassDescription2 ( @@ -167,5 +168,30 @@ public SubpassDescription2 [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pPreserveAttachments")] public uint* PPreserveAttachments; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassDescription2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref SubpassDescription2 Chain( + out SubpassDescription2 capture) + { + capture = new SubpassDescription2(StructureType.SubpassDescription2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2KHR.gen.cs index c3aa14b16f..0bae434102 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2KHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassDescription2KHR")] - public unsafe partial struct SubpassDescription2KHR + [NativeName("AliasOf", "VkSubpassDescription2")] + public unsafe partial struct SubpassDescription2KHR : IChainStart { public SubpassDescription2KHR ( @@ -167,5 +168,30 @@ public SubpassDescription2KHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pPreserveAttachments")] public uint* PPreserveAttachments; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassDescription2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref SubpassDescription2KHR Chain( + out SubpassDescription2KHR capture) + { + capture = new SubpassDescription2KHR(StructureType.SubpassDescription2); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolve.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolve.gen.cs index 8083053c62..2b5edc66cb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolve.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolve.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassDescriptionDepthStencilResolve")] - public unsafe partial struct SubpassDescriptionDepthStencilResolve + [NativeName("Aliases", "VkSubpassDescriptionDepthStencilResolveKHR")] + public unsafe partial struct SubpassDescriptionDepthStencilResolve : IExtendsChain, IExtendsChain { public SubpassDescriptionDepthStencilResolve ( @@ -79,5 +80,18 @@ public SubpassDescriptionDepthStencilResolve [NativeName("Type.Name", "VkAttachmentReference2")] [NativeName("Name", "pDepthStencilResolveAttachment")] public AttachmentReference2* PDepthStencilResolveAttachment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassDescriptionDepthStencilResolve; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolveKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolveKHR.gen.cs index 1be093b3c3..97ddb65446 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolveKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolveKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassDescriptionDepthStencilResolveKHR")] - public unsafe partial struct SubpassDescriptionDepthStencilResolveKHR + [NativeName("AliasOf", "VkSubpassDescriptionDepthStencilResolve")] + public unsafe partial struct SubpassDescriptionDepthStencilResolveKHR : IExtendsChain, IExtendsChain { public SubpassDescriptionDepthStencilResolveKHR ( @@ -79,5 +80,18 @@ public SubpassDescriptionDepthStencilResolveKHR [NativeName("Type.Name", "VkAttachmentReference2")] [NativeName("Name", "pDepthStencilResolveAttachment")] public AttachmentReference2* PDepthStencilResolveAttachment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassDescriptionDepthStencilResolve; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfo.gen.cs index f02ccbc138..2b87549d4e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassEndInfo")] - public unsafe partial struct SubpassEndInfo + [NativeName("Aliases", "VkSubpassEndInfoKHR")] + public unsafe partial struct SubpassEndInfo : IChainable { public SubpassEndInfo ( @@ -46,5 +47,18 @@ public SubpassEndInfo [NativeName("Type.Name", "void")] [NativeName("Name", "pNext")] public void* PNext; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassEndInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfoKHR.gen.cs index 2776328fe2..4ff4eaf24c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassEndInfoKHR")] - public unsafe partial struct SubpassEndInfoKHR + [NativeName("AliasOf", "VkSubpassEndInfo")] + public unsafe partial struct SubpassEndInfoKHR : IChainable { public SubpassEndInfoKHR ( @@ -46,5 +47,18 @@ public SubpassEndInfoKHR [NativeName("Type.Name", "void")] [NativeName("Name", "pNext")] public void* PNext; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassEndInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassShadingPipelineCreateInfoHUAWEI.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassShadingPipelineCreateInfoHUAWEI.gen.cs index c4a2f7af0c..18ff28f1b3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassShadingPipelineCreateInfoHUAWEI.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassShadingPipelineCreateInfoHUAWEI.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassShadingPipelineCreateInfoHUAWEI")] - public unsafe partial struct SubpassShadingPipelineCreateInfoHUAWEI + public unsafe partial struct SubpassShadingPipelineCreateInfoHUAWEI : IExtendsChain { public SubpassShadingPipelineCreateInfoHUAWEI ( @@ -68,5 +68,18 @@ public SubpassShadingPipelineCreateInfoHUAWEI [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "subpass")] public uint Subpass; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassShadingPipelineCreateInfoHuawei; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilities2EXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilities2EXT.gen.cs index ded2d024b5..171f949645 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilities2EXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilities2EXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSurfaceCapabilities2EXT")] - public unsafe partial struct SurfaceCapabilities2EXT + public unsafe partial struct SurfaceCapabilities2EXT : IChainable { public SurfaceCapabilities2EXT ( @@ -167,5 +167,18 @@ public SurfaceCapabilities2EXT [NativeName("Type.Name", "VkSurfaceCounterFlagsEXT")] [NativeName("Name", "supportedSurfaceCounters")] public SurfaceCounterFlagsEXT SupportedSurfaceCounters; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SurfaceCapabilities2Ext; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilities2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilities2KHR.gen.cs index 2d010ea1d3..a6efc11858 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilities2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilities2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSurfaceCapabilities2KHR")] - public unsafe partial struct SurfaceCapabilities2KHR + public unsafe partial struct SurfaceCapabilities2KHR : IChainStart { public SurfaceCapabilities2KHR ( @@ -57,5 +57,30 @@ public SurfaceCapabilities2KHR [NativeName("Type.Name", "VkSurfaceCapabilitiesKHR")] [NativeName("Name", "surfaceCapabilities")] public SurfaceCapabilitiesKHR SurfaceCapabilities; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SurfaceCapabilities2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref SurfaceCapabilities2KHR Chain( + out SurfaceCapabilities2KHR capture) + { + capture = new SurfaceCapabilities2KHR(StructureType.SurfaceCapabilities2Khr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilitiesFullScreenExclusiveEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilitiesFullScreenExclusiveEXT.gen.cs index b98733f169..a6761332bc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilitiesFullScreenExclusiveEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilitiesFullScreenExclusiveEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSurfaceCapabilitiesFullScreenExclusiveEXT")] - public unsafe partial struct SurfaceCapabilitiesFullScreenExclusiveEXT + public unsafe partial struct SurfaceCapabilitiesFullScreenExclusiveEXT : IExtendsChain { public SurfaceCapabilitiesFullScreenExclusiveEXT ( @@ -57,5 +57,18 @@ public SurfaceCapabilitiesFullScreenExclusiveEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "fullScreenExclusiveSupported")] public Bool32 FullScreenExclusiveSupported; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SurfaceCapabilitiesFullScreenExclusiveExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFormat2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFormat2KHR.gen.cs index 46a11663b6..93eee5a785 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFormat2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFormat2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSurfaceFormat2KHR")] - public unsafe partial struct SurfaceFormat2KHR + public unsafe partial struct SurfaceFormat2KHR : IChainable { public SurfaceFormat2KHR ( @@ -57,5 +57,18 @@ public SurfaceFormat2KHR [NativeName("Type.Name", "VkSurfaceFormatKHR")] [NativeName("Name", "surfaceFormat")] public SurfaceFormatKHR SurfaceFormat; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SurfaceFormat2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFullScreenExclusiveInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFullScreenExclusiveInfoEXT.gen.cs index 7cd2f3adc6..14f8788770 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFullScreenExclusiveInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFullScreenExclusiveInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSurfaceFullScreenExclusiveInfoEXT")] - public unsafe partial struct SurfaceFullScreenExclusiveInfoEXT + public unsafe partial struct SurfaceFullScreenExclusiveInfoEXT : IExtendsChain, IExtendsChain { public SurfaceFullScreenExclusiveInfoEXT ( @@ -57,5 +57,18 @@ public SurfaceFullScreenExclusiveInfoEXT [NativeName("Type.Name", "VkFullScreenExclusiveEXT")] [NativeName("Name", "fullScreenExclusive")] public FullScreenExclusiveEXT FullScreenExclusive; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SurfaceFullScreenExclusiveInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFullScreenExclusiveWin32InfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFullScreenExclusiveWin32InfoEXT.gen.cs index 469fee9b83..98eb0a15f9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFullScreenExclusiveWin32InfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFullScreenExclusiveWin32InfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSurfaceFullScreenExclusiveWin32InfoEXT")] - public unsafe partial struct SurfaceFullScreenExclusiveWin32InfoEXT + public unsafe partial struct SurfaceFullScreenExclusiveWin32InfoEXT : IExtendsChain, IExtendsChain { public SurfaceFullScreenExclusiveWin32InfoEXT ( @@ -57,5 +57,18 @@ public SurfaceFullScreenExclusiveWin32InfoEXT [NativeName("Type.Name", "HMONITOR")] [NativeName("Name", "hmonitor")] public nint Hmonitor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SurfaceFullScreenExclusiveWin32InfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceProtectedCapabilitiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceProtectedCapabilitiesKHR.gen.cs index 67a3352024..0537016e2e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceProtectedCapabilitiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceProtectedCapabilitiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSurfaceProtectedCapabilitiesKHR")] - public unsafe partial struct SurfaceProtectedCapabilitiesKHR + public unsafe partial struct SurfaceProtectedCapabilitiesKHR : IExtendsChain { public SurfaceProtectedCapabilitiesKHR ( @@ -57,5 +57,18 @@ public SurfaceProtectedCapabilitiesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "supportsProtected")] public Bool32 SupportsProtected; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SurfaceProtectedCapabilitiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainCounterCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainCounterCreateInfoEXT.gen.cs index 4069dd2e77..549987eded 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainCounterCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainCounterCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSwapchainCounterCreateInfoEXT")] - public unsafe partial struct SwapchainCounterCreateInfoEXT + public unsafe partial struct SwapchainCounterCreateInfoEXT : IExtendsChain { public SwapchainCounterCreateInfoEXT ( @@ -57,5 +57,18 @@ public SwapchainCounterCreateInfoEXT [NativeName("Type.Name", "VkSurfaceCounterFlagsEXT")] [NativeName("Name", "surfaceCounters")] public SurfaceCounterFlagsEXT SurfaceCounters; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SwapchainCounterCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainCreateInfoKHR.gen.cs index 80338cbdf8..884dd31681 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSwapchainCreateInfoKHR")] - public unsafe partial struct SwapchainCreateInfoKHR + public unsafe partial struct SwapchainCreateInfoKHR : IChainStart { public SwapchainCreateInfoKHR ( @@ -222,5 +222,30 @@ public SwapchainCreateInfoKHR [NativeName("Type.Name", "VkSwapchainKHR")] [NativeName("Name", "oldSwapchain")] public SwapchainKHR OldSwapchain; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SwapchainCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref SwapchainCreateInfoKHR Chain( + out SwapchainCreateInfoKHR capture) + { + capture = new SwapchainCreateInfoKHR(StructureType.SwapchainCreateInfoKhr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainDisplayNativeHdrCreateInfoAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainDisplayNativeHdrCreateInfoAMD.gen.cs index 038669c69a..1d6b7ac882 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainDisplayNativeHdrCreateInfoAMD.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainDisplayNativeHdrCreateInfoAMD.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSwapchainDisplayNativeHdrCreateInfoAMD")] - public unsafe partial struct SwapchainDisplayNativeHdrCreateInfoAMD + public unsafe partial struct SwapchainDisplayNativeHdrCreateInfoAMD : IExtendsChain { public SwapchainDisplayNativeHdrCreateInfoAMD ( @@ -57,5 +57,18 @@ public SwapchainDisplayNativeHdrCreateInfoAMD [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "localDimmingEnable")] public Bool32 LocalDimmingEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SwapchainDisplayNativeHdrCreateInfoAmd; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainImageCreateInfoANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainImageCreateInfoANDROID.gen.cs index 058a6b0a6f..d706f1e8b0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainImageCreateInfoANDROID.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainImageCreateInfoANDROID.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSwapchainImageCreateInfoANDROID")] - public unsafe partial struct SwapchainImageCreateInfoANDROID + public unsafe partial struct SwapchainImageCreateInfoANDROID : IChainable { public SwapchainImageCreateInfoANDROID ( @@ -57,5 +57,18 @@ public SwapchainImageCreateInfoANDROID [NativeName("Type.Name", "VkSwapchainImageUsageFlagsANDROID")] [NativeName("Name", "usage")] public SwapchainImageUsageFlagsANDROID Usage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SwapchainImageCreateInfoAndroid; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SysmemColorSpaceFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SysmemColorSpaceFUCHSIA.gen.cs index 39d0ac3f2a..a50dde569e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SysmemColorSpaceFUCHSIA.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SysmemColorSpaceFUCHSIA.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSysmemColorSpaceFUCHSIA")] - public unsafe partial struct SysmemColorSpaceFUCHSIA + public unsafe partial struct SysmemColorSpaceFUCHSIA : IChainable { public SysmemColorSpaceFUCHSIA ( @@ -57,5 +57,18 @@ public SysmemColorSpaceFUCHSIA [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "colorSpace")] public uint ColorSpace; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SysmemColorSpaceFuchsia; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/TextureLODGatherFormatPropertiesAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/TextureLODGatherFormatPropertiesAMD.gen.cs index 1ebf41c071..32cfce2e42 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/TextureLODGatherFormatPropertiesAMD.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/TextureLODGatherFormatPropertiesAMD.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkTextureLODGatherFormatPropertiesAMD")] - public unsafe partial struct TextureLODGatherFormatPropertiesAMD + public unsafe partial struct TextureLODGatherFormatPropertiesAMD : IExtendsChain, IExtendsChain { public TextureLODGatherFormatPropertiesAMD ( @@ -57,5 +57,18 @@ public TextureLODGatherFormatPropertiesAMD [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "supportsTextureGatherLODBiasAMD")] public Bool32 SupportsTextureGatherLodbiasAmd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.TextureLodGatherFormatPropertiesAmd; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfo.gen.cs index 77da3ce58a..22516073e3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfo.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkTimelineSemaphoreSubmitInfo")] - public unsafe partial struct TimelineSemaphoreSubmitInfo + [NativeName("Aliases", "VkTimelineSemaphoreSubmitInfoKHR")] + public unsafe partial struct TimelineSemaphoreSubmitInfo : IExtendsChain, IExtendsChain { public TimelineSemaphoreSubmitInfo ( @@ -90,5 +91,18 @@ public TimelineSemaphoreSubmitInfo [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pSignalSemaphoreValues")] public ulong* PSignalSemaphoreValues; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.TimelineSemaphoreSubmitInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfoKHR.gen.cs index aa1a2a7fba..72985fb017 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfoKHR.gen.cs @@ -17,7 +17,8 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkTimelineSemaphoreSubmitInfoKHR")] - public unsafe partial struct TimelineSemaphoreSubmitInfoKHR + [NativeName("AliasOf", "VkTimelineSemaphoreSubmitInfo")] + public unsafe partial struct TimelineSemaphoreSubmitInfoKHR : IExtendsChain, IExtendsChain { public TimelineSemaphoreSubmitInfoKHR ( @@ -90,5 +91,18 @@ public TimelineSemaphoreSubmitInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pSignalSemaphoreValues")] public ulong* PSignalSemaphoreValues; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.TimelineSemaphoreSubmitInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/TransformMatrixKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/TransformMatrixKHR.gen.cs index 8646dc8873..36b9dd30d9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/TransformMatrixKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/TransformMatrixKHR.gen.cs @@ -17,6 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkTransformMatrixKHR")] + [NativeName("Aliases", "VkTransformMatrixNV")] public unsafe partial struct TransformMatrixKHR { /// diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/TransformMatrixNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/TransformMatrixNV.gen.cs index 46a0a757d8..23488e2ad8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/TransformMatrixNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/TransformMatrixNV.gen.cs @@ -17,6 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkTransformMatrixNV")] + [NativeName("AliasOf", "VkTransformMatrixKHR")] public unsafe partial struct TransformMatrixNV { /// diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationCacheCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationCacheCreateInfoEXT.gen.cs index 6307a7a559..2b8a21bc7c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationCacheCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationCacheCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkValidationCacheCreateInfoEXT")] - public unsafe partial struct ValidationCacheCreateInfoEXT + public unsafe partial struct ValidationCacheCreateInfoEXT : IChainable { public ValidationCacheCreateInfoEXT ( @@ -79,5 +79,18 @@ public ValidationCacheCreateInfoEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pInitialData")] public void* PInitialData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ValidationCacheCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationFeaturesEXT.gen.cs index 2323272ea6..aceef23a65 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkValidationFeaturesEXT")] - public unsafe partial struct ValidationFeaturesEXT + public unsafe partial struct ValidationFeaturesEXT : IExtendsChain { public ValidationFeaturesEXT ( @@ -90,5 +90,18 @@ public ValidationFeaturesEXT [NativeName("Type.Name", "VkValidationFeatureDisableEXT")] [NativeName("Name", "pDisabledValidationFeatures")] public ValidationFeatureDisableEXT* PDisabledValidationFeatures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ValidationFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationFlagsEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationFlagsEXT.gen.cs index 50427e37d7..4dbac26c1b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationFlagsEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationFlagsEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkValidationFlagsEXT")] - public unsafe partial struct ValidationFlagsEXT + public unsafe partial struct ValidationFlagsEXT : IExtendsChain { public ValidationFlagsEXT ( @@ -68,5 +68,18 @@ public ValidationFlagsEXT [NativeName("Type.Name", "VkValidationCheckEXT")] [NativeName("Name", "pDisabledValidationChecks")] public ValidationCheckEXT* PDisabledValidationChecks; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ValidationFlagsExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VertexInputAttributeDescription2EXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VertexInputAttributeDescription2EXT.gen.cs index efb345de94..c2f46577b1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VertexInputAttributeDescription2EXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VertexInputAttributeDescription2EXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVertexInputAttributeDescription2EXT")] - public unsafe partial struct VertexInputAttributeDescription2EXT + public unsafe partial struct VertexInputAttributeDescription2EXT : IChainable { public VertexInputAttributeDescription2EXT ( @@ -90,5 +90,18 @@ public VertexInputAttributeDescription2EXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "offset")] public uint Offset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VertexInputAttributeDescription2Ext; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VertexInputBindingDescription2EXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VertexInputBindingDescription2EXT.gen.cs index 08e0a0eb8e..315257cdb0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VertexInputBindingDescription2EXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VertexInputBindingDescription2EXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVertexInputBindingDescription2EXT")] - public unsafe partial struct VertexInputBindingDescription2EXT + public unsafe partial struct VertexInputBindingDescription2EXT : IChainable { public VertexInputBindingDescription2EXT ( @@ -90,5 +90,18 @@ public VertexInputBindingDescription2EXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "divisor")] public uint Divisor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VertexInputBindingDescription2Ext; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ViSurfaceCreateInfoNN.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ViSurfaceCreateInfoNN.gen.cs index 1838713401..4244a4840b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ViSurfaceCreateInfoNN.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ViSurfaceCreateInfoNN.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkViSurfaceCreateInfoNN")] - public unsafe partial struct ViSurfaceCreateInfoNN + public unsafe partial struct ViSurfaceCreateInfoNN : IChainable { public ViSurfaceCreateInfoNN ( @@ -68,5 +68,18 @@ public ViSurfaceCreateInfoNN [NativeName("Type.Name", "void")] [NativeName("Name", "window")] public void* Window; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VISurfaceCreateInfoNN; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoBeginCodingInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoBeginCodingInfoKHR.gen.cs index e5e1915b17..237aa574d0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoBeginCodingInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoBeginCodingInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoBeginCodingInfoKHR")] - public unsafe partial struct VideoBeginCodingInfoKHR + public unsafe partial struct VideoBeginCodingInfoKHR : IChainable { public VideoBeginCodingInfoKHR ( @@ -112,5 +112,18 @@ public VideoBeginCodingInfoKHR [NativeName("Type.Name", "VkVideoReferenceSlotKHR")] [NativeName("Name", "pReferenceSlots")] public VideoReferenceSlotKHR* PReferenceSlots; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoBeginCodingInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoBindMemoryKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoBindMemoryKHR.gen.cs index f352b4fa81..0d4d74741b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoBindMemoryKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoBindMemoryKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoBindMemoryKHR")] - public unsafe partial struct VideoBindMemoryKHR + public unsafe partial struct VideoBindMemoryKHR : IChainable { public VideoBindMemoryKHR ( @@ -90,5 +90,18 @@ public VideoBindMemoryKHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "memorySize")] public ulong MemorySize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoBindMemoryKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoCapabilitiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoCapabilitiesKHR.gen.cs index 18b4f48228..77722fa3a3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoCapabilitiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoCapabilitiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoCapabilitiesKHR")] - public unsafe partial struct VideoCapabilitiesKHR + public unsafe partial struct VideoCapabilitiesKHR : IChainStart { public VideoCapabilitiesKHR ( @@ -134,5 +134,30 @@ public VideoCapabilitiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxReferencePicturesActiveCount")] public uint MaxReferencePicturesActiveCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoCapabilitiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref VideoCapabilitiesKHR Chain( + out VideoCapabilitiesKHR capture) + { + capture = new VideoCapabilitiesKHR(StructureType.VideoCapabilitiesKhr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoCodingControlInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoCodingControlInfoKHR.gen.cs index 46bf44a872..a425881517 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoCodingControlInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoCodingControlInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoCodingControlInfoKHR")] - public unsafe partial struct VideoCodingControlInfoKHR + public unsafe partial struct VideoCodingControlInfoKHR : IChainStart { public VideoCodingControlInfoKHR ( @@ -57,5 +57,30 @@ public VideoCodingControlInfoKHR [NativeName("Type.Name", "VkVideoCodingControlFlagsKHR")] [NativeName("Name", "flags")] public VideoCodingControlFlagsKHR Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoCodingControlInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref VideoCodingControlInfoKHR Chain( + out VideoCodingControlInfoKHR capture) + { + capture = new VideoCodingControlInfoKHR(StructureType.VideoCodingControlInfoKhr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264CapabilitiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264CapabilitiesEXT.gen.cs index 121ab9106f..9d9f182b4d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264CapabilitiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264CapabilitiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeH264CapabilitiesEXT")] - public unsafe partial struct VideoDecodeH264CapabilitiesEXT + public unsafe partial struct VideoDecodeH264CapabilitiesEXT : IExtendsChain { public VideoDecodeH264CapabilitiesEXT ( @@ -79,5 +79,18 @@ public VideoDecodeH264CapabilitiesEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "stdExtensionVersion")] public ExtensionProperties StdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264CapabilitiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264DpbSlotInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264DpbSlotInfoEXT.gen.cs index 1296ea86de..762bacfc04 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264DpbSlotInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264DpbSlotInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeH264DpbSlotInfoEXT")] - public unsafe partial struct VideoDecodeH264DpbSlotInfoEXT + public unsafe partial struct VideoDecodeH264DpbSlotInfoEXT : IExtendsChain { public VideoDecodeH264DpbSlotInfoEXT ( @@ -57,5 +57,18 @@ public VideoDecodeH264DpbSlotInfoEXT [NativeName("Type.Name", "StdVideoDecodeH264ReferenceInfo")] [NativeName("Name", "pStdReferenceInfo")] public Video.StdVideoDecodeH264ReferenceInfo* PStdReferenceInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264DpbSlotInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264MvcEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264MvcEXT.gen.cs index 7b14e7b638..cafb8a9342 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264MvcEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264MvcEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeH264MvcEXT")] - public unsafe partial struct VideoDecodeH264MvcEXT + public unsafe partial struct VideoDecodeH264MvcEXT : IExtendsChain { public VideoDecodeH264MvcEXT ( @@ -57,5 +57,18 @@ public VideoDecodeH264MvcEXT [NativeName("Type.Name", "StdVideoDecodeH264Mvc")] [NativeName("Name", "pStdMvc")] public Video.StdVideoDecodeH264Mvc* PStdMvc; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264MvcExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264PictureInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264PictureInfoEXT.gen.cs index a5150cb305..05cd286209 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264PictureInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264PictureInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeH264PictureInfoEXT")] - public unsafe partial struct VideoDecodeH264PictureInfoEXT + public unsafe partial struct VideoDecodeH264PictureInfoEXT : IChainStart, IExtendsChain { public VideoDecodeH264PictureInfoEXT ( @@ -79,5 +79,30 @@ public VideoDecodeH264PictureInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pSlicesDataOffsets")] public uint* PSlicesDataOffsets; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264PictureInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref VideoDecodeH264PictureInfoEXT Chain( + out VideoDecodeH264PictureInfoEXT capture) + { + capture = new VideoDecodeH264PictureInfoEXT(StructureType.VideoDecodeH264PictureInfoExt); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264ProfileEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264ProfileEXT.gen.cs index 9951b87fcf..babf192107 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264ProfileEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264ProfileEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeH264ProfileEXT")] - public unsafe partial struct VideoDecodeH264ProfileEXT + public unsafe partial struct VideoDecodeH264ProfileEXT : IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain { public VideoDecodeH264ProfileEXT ( @@ -68,5 +68,18 @@ public VideoDecodeH264ProfileEXT [NativeName("Type.Name", "VkVideoDecodeH264PictureLayoutFlagsEXT")] [NativeName("Name", "pictureLayout")] public VideoDecodeH264PictureLayoutFlagsEXT PictureLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264ProfileExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionCreateInfoEXT.gen.cs index fae1cc3e97..da2e0a41c5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeH264SessionCreateInfoEXT")] - public unsafe partial struct VideoDecodeH264SessionCreateInfoEXT + public unsafe partial struct VideoDecodeH264SessionCreateInfoEXT : IExtendsChain { public VideoDecodeH264SessionCreateInfoEXT ( @@ -68,5 +68,18 @@ public VideoDecodeH264SessionCreateInfoEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "pStdExtensionVersion")] public ExtensionProperties* PStdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264SessionCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionParametersAddInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionParametersAddInfoEXT.gen.cs index 56deadf169..99ce23b6b6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionParametersAddInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionParametersAddInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeH264SessionParametersAddInfoEXT")] - public unsafe partial struct VideoDecodeH264SessionParametersAddInfoEXT + public unsafe partial struct VideoDecodeH264SessionParametersAddInfoEXT : IExtendsChain { public VideoDecodeH264SessionParametersAddInfoEXT ( @@ -90,5 +90,18 @@ public VideoDecodeH264SessionParametersAddInfoEXT [NativeName("Type.Name", "StdVideoH264PictureParameterSet")] [NativeName("Name", "pPpsStd")] public Video.StdVideoH264PictureParameterSet* PPpsStd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264SessionParametersAddInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionParametersCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionParametersCreateInfoEXT.gen.cs index 1a5ae0da00..8b8e21dca5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionParametersCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionParametersCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeH264SessionParametersCreateInfoEXT")] - public unsafe partial struct VideoDecodeH264SessionParametersCreateInfoEXT + public unsafe partial struct VideoDecodeH264SessionParametersCreateInfoEXT : IExtendsChain { public VideoDecodeH264SessionParametersCreateInfoEXT ( @@ -79,5 +79,18 @@ public VideoDecodeH264SessionParametersCreateInfoEXT [NativeName("Type.Name", "VkVideoDecodeH264SessionParametersAddInfoEXT")] [NativeName("Name", "pParametersAddInfo")] public VideoDecodeH264SessionParametersAddInfoEXT* PParametersAddInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264SessionParametersCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265CapabilitiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265CapabilitiesEXT.gen.cs index 72c8ef847b..cdd745489d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265CapabilitiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265CapabilitiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeH265CapabilitiesEXT")] - public unsafe partial struct VideoDecodeH265CapabilitiesEXT + public unsafe partial struct VideoDecodeH265CapabilitiesEXT : IExtendsChain { public VideoDecodeH265CapabilitiesEXT ( @@ -68,5 +68,18 @@ public VideoDecodeH265CapabilitiesEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "stdExtensionVersion")] public ExtensionProperties StdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH265CapabilitiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265DpbSlotInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265DpbSlotInfoEXT.gen.cs index 67cc6de101..de651a5c5a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265DpbSlotInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265DpbSlotInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeH265DpbSlotInfoEXT")] - public unsafe partial struct VideoDecodeH265DpbSlotInfoEXT + public unsafe partial struct VideoDecodeH265DpbSlotInfoEXT : IExtendsChain { public VideoDecodeH265DpbSlotInfoEXT ( @@ -57,5 +57,18 @@ public VideoDecodeH265DpbSlotInfoEXT [NativeName("Type.Name", "StdVideoDecodeH265ReferenceInfo")] [NativeName("Name", "pStdReferenceInfo")] public Video.StdVideoDecodeH265ReferenceInfo* PStdReferenceInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH265DpbSlotInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265PictureInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265PictureInfoEXT.gen.cs index 61c6f7e0fe..1eb57937b7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265PictureInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265PictureInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeH265PictureInfoEXT")] - public unsafe partial struct VideoDecodeH265PictureInfoEXT + public unsafe partial struct VideoDecodeH265PictureInfoEXT : IExtendsChain { public VideoDecodeH265PictureInfoEXT ( @@ -79,5 +79,18 @@ public VideoDecodeH265PictureInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pSlicesDataOffsets")] public uint* PSlicesDataOffsets; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH265PictureInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265ProfileEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265ProfileEXT.gen.cs index eef3d81712..e21c5c1999 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265ProfileEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265ProfileEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeH265ProfileEXT")] - public unsafe partial struct VideoDecodeH265ProfileEXT + public unsafe partial struct VideoDecodeH265ProfileEXT : IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain { public VideoDecodeH265ProfileEXT ( @@ -57,5 +57,18 @@ public VideoDecodeH265ProfileEXT [NativeName("Type.Name", "StdVideoH265ProfileIdc")] [NativeName("Name", "stdProfileIdc")] public Video.StdVideoH265ProfileIdc StdProfileIdc; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH265ProfileExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionCreateInfoEXT.gen.cs index 8368d28e7e..b6a9c0ed45 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeH265SessionCreateInfoEXT")] - public unsafe partial struct VideoDecodeH265SessionCreateInfoEXT + public unsafe partial struct VideoDecodeH265SessionCreateInfoEXT : IExtendsChain { public VideoDecodeH265SessionCreateInfoEXT ( @@ -68,5 +68,18 @@ public VideoDecodeH265SessionCreateInfoEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "pStdExtensionVersion")] public ExtensionProperties* PStdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH265SessionCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionParametersAddInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionParametersAddInfoEXT.gen.cs index 452554677a..a15c7fbb63 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionParametersAddInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionParametersAddInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeH265SessionParametersAddInfoEXT")] - public unsafe partial struct VideoDecodeH265SessionParametersAddInfoEXT + public unsafe partial struct VideoDecodeH265SessionParametersAddInfoEXT : IExtendsChain { public VideoDecodeH265SessionParametersAddInfoEXT ( @@ -90,5 +90,18 @@ public VideoDecodeH265SessionParametersAddInfoEXT [NativeName("Type.Name", "StdVideoH265PictureParameterSet")] [NativeName("Name", "pPpsStd")] public Video.StdVideoH265PictureParameterSet* PPpsStd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH265SessionParametersAddInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionParametersCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionParametersCreateInfoEXT.gen.cs index 8b69608b3c..f9f884a89c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionParametersCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionParametersCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeH265SessionParametersCreateInfoEXT")] - public unsafe partial struct VideoDecodeH265SessionParametersCreateInfoEXT + public unsafe partial struct VideoDecodeH265SessionParametersCreateInfoEXT : IExtendsChain { public VideoDecodeH265SessionParametersCreateInfoEXT ( @@ -79,5 +79,18 @@ public VideoDecodeH265SessionParametersCreateInfoEXT [NativeName("Type.Name", "VkVideoDecodeH265SessionParametersAddInfoEXT")] [NativeName("Name", "pParametersAddInfo")] public VideoDecodeH265SessionParametersAddInfoEXT* PParametersAddInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH265SessionParametersCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeInfoKHR.gen.cs index 2baaafe34a..f619eeced6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoDecodeInfoKHR")] - public unsafe partial struct VideoDecodeInfoKHR + public unsafe partial struct VideoDecodeInfoKHR : IChainStart { public VideoDecodeInfoKHR ( @@ -156,5 +156,30 @@ public VideoDecodeInfoKHR [NativeName("Type.Name", "VkVideoReferenceSlotKHR")] [NativeName("Name", "pReferenceSlots")] public VideoReferenceSlotKHR* PReferenceSlots; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref VideoDecodeInfoKHR Chain( + out VideoDecodeInfoKHR capture) + { + capture = new VideoDecodeInfoKHR(StructureType.VideoDecodeInfoKhr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264CapabilitiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264CapabilitiesEXT.gen.cs index 33038d0288..d00b490151 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264CapabilitiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264CapabilitiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH264CapabilitiesEXT")] - public unsafe partial struct VideoEncodeH264CapabilitiesEXT + public unsafe partial struct VideoEncodeH264CapabilitiesEXT : IExtendsChain { public VideoEncodeH264CapabilitiesEXT ( @@ -167,5 +167,18 @@ public VideoEncodeH264CapabilitiesEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "stdExtensionVersion")] public ExtensionProperties StdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264CapabilitiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264DpbSlotInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264DpbSlotInfoEXT.gen.cs index 20e3771f4c..ce42771758 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264DpbSlotInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264DpbSlotInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH264DpbSlotInfoEXT")] - public unsafe partial struct VideoEncodeH264DpbSlotInfoEXT + public unsafe partial struct VideoEncodeH264DpbSlotInfoEXT : IChainable { public VideoEncodeH264DpbSlotInfoEXT ( @@ -68,5 +68,18 @@ public VideoEncodeH264DpbSlotInfoEXT [NativeName("Type.Name", "StdVideoEncodeH264PictureInfo")] [NativeName("Name", "pStdPictureInfo")] public Video.StdVideoEncodeH264PictureInfo* PStdPictureInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264DpbSlotInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264EmitPictureParametersEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264EmitPictureParametersEXT.gen.cs index b4c78804d6..e2e5132add 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264EmitPictureParametersEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264EmitPictureParametersEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH264EmitPictureParametersEXT")] - public unsafe partial struct VideoEncodeH264EmitPictureParametersEXT + public unsafe partial struct VideoEncodeH264EmitPictureParametersEXT : IExtendsChain { public VideoEncodeH264EmitPictureParametersEXT ( @@ -90,5 +90,18 @@ public VideoEncodeH264EmitPictureParametersEXT [NativeName("Type.Name", "uint8_t")] [NativeName("Name", "ppsIdEntries")] public byte* PpsIdEntries; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264EmitPictureParametersExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264NaluSliceEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264NaluSliceEXT.gen.cs index adbdc19daf..de4cbb2bb1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264NaluSliceEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264NaluSliceEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH264NaluSliceEXT")] - public unsafe partial struct VideoEncodeH264NaluSliceEXT + public unsafe partial struct VideoEncodeH264NaluSliceEXT : IChainable { public VideoEncodeH264NaluSliceEXT ( @@ -145,5 +145,18 @@ public VideoEncodeH264NaluSliceEXT [NativeName("Type.Name", "uint8_t")] [NativeName("Name", "maxQp")] public byte MaxQp; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264NaluSliceExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264ProfileEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264ProfileEXT.gen.cs index e51ce683c0..a060de1d98 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264ProfileEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264ProfileEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH264ProfileEXT")] - public unsafe partial struct VideoEncodeH264ProfileEXT + public unsafe partial struct VideoEncodeH264ProfileEXT : IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain { public VideoEncodeH264ProfileEXT ( @@ -57,5 +57,18 @@ public VideoEncodeH264ProfileEXT [NativeName("Type.Name", "StdVideoH264ProfileIdc")] [NativeName("Name", "stdProfileIdc")] public Video.StdVideoH264ProfileIdc StdProfileIdc; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264ProfileExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionCreateInfoEXT.gen.cs index de619cb0d8..bfe822b3f8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH264SessionCreateInfoEXT")] - public unsafe partial struct VideoEncodeH264SessionCreateInfoEXT + public unsafe partial struct VideoEncodeH264SessionCreateInfoEXT : IExtendsChain { public VideoEncodeH264SessionCreateInfoEXT ( @@ -79,5 +79,18 @@ public VideoEncodeH264SessionCreateInfoEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "pStdExtensionVersion")] public ExtensionProperties* PStdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264SessionCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionParametersAddInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionParametersAddInfoEXT.gen.cs index b45e0bb0b8..62fade5732 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionParametersAddInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionParametersAddInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH264SessionParametersAddInfoEXT")] - public unsafe partial struct VideoEncodeH264SessionParametersAddInfoEXT + public unsafe partial struct VideoEncodeH264SessionParametersAddInfoEXT : IExtendsChain { public VideoEncodeH264SessionParametersAddInfoEXT ( @@ -90,5 +90,18 @@ public VideoEncodeH264SessionParametersAddInfoEXT [NativeName("Type.Name", "StdVideoH264PictureParameterSet")] [NativeName("Name", "pPpsStd")] public Video.StdVideoH264PictureParameterSet* PPpsStd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264SessionParametersAddInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionParametersCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionParametersCreateInfoEXT.gen.cs index 3639270d9c..64fbaccbd6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionParametersCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionParametersCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH264SessionParametersCreateInfoEXT")] - public unsafe partial struct VideoEncodeH264SessionParametersCreateInfoEXT + public unsafe partial struct VideoEncodeH264SessionParametersCreateInfoEXT : IExtendsChain { public VideoEncodeH264SessionParametersCreateInfoEXT ( @@ -79,5 +79,18 @@ public VideoEncodeH264SessionParametersCreateInfoEXT [NativeName("Type.Name", "VkVideoEncodeH264SessionParametersAddInfoEXT")] [NativeName("Name", "pParametersAddInfo")] public VideoEncodeH264SessionParametersAddInfoEXT* PParametersAddInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264SessionParametersCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264VclFrameInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264VclFrameInfoEXT.gen.cs index c3f06adf3a..e1b33966e0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264VclFrameInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264VclFrameInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH264VclFrameInfoEXT")] - public unsafe partial struct VideoEncodeH264VclFrameInfoEXT + public unsafe partial struct VideoEncodeH264VclFrameInfoEXT : IExtendsChain { public VideoEncodeH264VclFrameInfoEXT ( @@ -123,5 +123,18 @@ public VideoEncodeH264VclFrameInfoEXT [NativeName("Type.Name", "VkVideoEncodeH264DpbSlotInfoEXT")] [NativeName("Name", "pCurrentPictureInfo")] public VideoEncodeH264DpbSlotInfoEXT* PCurrentPictureInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264VclFrameInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265CapabilitiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265CapabilitiesEXT.gen.cs index d7e72d755f..4f5d3fa339 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265CapabilitiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265CapabilitiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH265CapabilitiesEXT")] - public unsafe partial struct VideoEncodeH265CapabilitiesEXT + public unsafe partial struct VideoEncodeH265CapabilitiesEXT : IExtendsChain { public VideoEncodeH265CapabilitiesEXT ( @@ -167,5 +167,18 @@ public VideoEncodeH265CapabilitiesEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "stdExtensionVersion")] public ExtensionProperties StdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265CapabilitiesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265DpbSlotInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265DpbSlotInfoEXT.gen.cs index 56e940dec0..d8859c0d91 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265DpbSlotInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265DpbSlotInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH265DpbSlotInfoEXT")] - public unsafe partial struct VideoEncodeH265DpbSlotInfoEXT + public unsafe partial struct VideoEncodeH265DpbSlotInfoEXT : IChainable { public VideoEncodeH265DpbSlotInfoEXT ( @@ -68,5 +68,18 @@ public VideoEncodeH265DpbSlotInfoEXT [NativeName("Type.Name", "StdVideoEncodeH265ReferenceInfo")] [NativeName("Name", "pStdReferenceInfo")] public Video.StdVideoEncodeH265ReferenceInfo* PStdReferenceInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265DpbSlotInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265EmitPictureParametersEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265EmitPictureParametersEXT.gen.cs index 872afaeb5c..540a504a34 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265EmitPictureParametersEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265EmitPictureParametersEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH265EmitPictureParametersEXT")] - public unsafe partial struct VideoEncodeH265EmitPictureParametersEXT + public unsafe partial struct VideoEncodeH265EmitPictureParametersEXT : IExtendsChain { public VideoEncodeH265EmitPictureParametersEXT ( @@ -112,5 +112,18 @@ public VideoEncodeH265EmitPictureParametersEXT [NativeName("Type.Name", "uint8_t")] [NativeName("Name", "ppsIdEntries")] public byte* PpsIdEntries; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265EmitPictureParametersExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265NaluSliceEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265NaluSliceEXT.gen.cs index 5d3c7a0e31..70b4ad7ab0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265NaluSliceEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265NaluSliceEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH265NaluSliceEXT")] - public unsafe partial struct VideoEncodeH265NaluSliceEXT + public unsafe partial struct VideoEncodeH265NaluSliceEXT : IChainable { public VideoEncodeH265NaluSliceEXT ( @@ -79,5 +79,18 @@ public VideoEncodeH265NaluSliceEXT [NativeName("Type.Name", "StdVideoEncodeH265SliceHeader")] [NativeName("Name", "pSliceHeaderStd")] public Video.StdVideoEncodeH265SliceHeader* PSliceHeaderStd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265NaluSliceExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265ProfileEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265ProfileEXT.gen.cs index 653c8289de..c91c92e7ef 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265ProfileEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265ProfileEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH265ProfileEXT")] - public unsafe partial struct VideoEncodeH265ProfileEXT + public unsafe partial struct VideoEncodeH265ProfileEXT : IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain { public VideoEncodeH265ProfileEXT ( @@ -57,5 +57,18 @@ public VideoEncodeH265ProfileEXT [NativeName("Type.Name", "StdVideoH265ProfileIdc")] [NativeName("Name", "stdProfileIdc")] public Video.StdVideoH265ProfileIdc StdProfileIdc; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265ProfileExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265ReferenceListsEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265ReferenceListsEXT.gen.cs index cddb17f77c..512f089427 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265ReferenceListsEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265ReferenceListsEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH265ReferenceListsEXT")] - public unsafe partial struct VideoEncodeH265ReferenceListsEXT + public unsafe partial struct VideoEncodeH265ReferenceListsEXT : IChainable { public VideoEncodeH265ReferenceListsEXT ( @@ -101,5 +101,18 @@ public VideoEncodeH265ReferenceListsEXT [NativeName("Type.Name", "StdVideoEncodeH265ReferenceModifications")] [NativeName("Name", "pReferenceModifications")] public Video.StdVideoEncodeH265ReferenceModifications* PReferenceModifications; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265ReferenceListsExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionCreateInfoEXT.gen.cs index 3f5ac731a4..9666dca7f2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH265SessionCreateInfoEXT")] - public unsafe partial struct VideoEncodeH265SessionCreateInfoEXT + public unsafe partial struct VideoEncodeH265SessionCreateInfoEXT : IExtendsChain { public VideoEncodeH265SessionCreateInfoEXT ( @@ -68,5 +68,18 @@ public VideoEncodeH265SessionCreateInfoEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "pStdExtensionVersion")] public ExtensionProperties* PStdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265SessionCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionParametersAddInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionParametersAddInfoEXT.gen.cs index ea28c8a692..664ac83b7e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionParametersAddInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionParametersAddInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH265SessionParametersAddInfoEXT")] - public unsafe partial struct VideoEncodeH265SessionParametersAddInfoEXT + public unsafe partial struct VideoEncodeH265SessionParametersAddInfoEXT : IExtendsChain { public VideoEncodeH265SessionParametersAddInfoEXT ( @@ -112,5 +112,18 @@ public VideoEncodeH265SessionParametersAddInfoEXT [NativeName("Type.Name", "StdVideoH265PictureParameterSet")] [NativeName("Name", "pPpsStd")] public Video.StdVideoH265PictureParameterSet* PPpsStd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265SessionParametersAddInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionParametersCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionParametersCreateInfoEXT.gen.cs index 62a04b678f..8196cdc36c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionParametersCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionParametersCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH265SessionParametersCreateInfoEXT")] - public unsafe partial struct VideoEncodeH265SessionParametersCreateInfoEXT + public unsafe partial struct VideoEncodeH265SessionParametersCreateInfoEXT : IExtendsChain { public VideoEncodeH265SessionParametersCreateInfoEXT ( @@ -90,5 +90,18 @@ public VideoEncodeH265SessionParametersCreateInfoEXT [NativeName("Type.Name", "VkVideoEncodeH265SessionParametersAddInfoEXT")] [NativeName("Name", "pParametersAddInfo")] public VideoEncodeH265SessionParametersAddInfoEXT* PParametersAddInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265SessionParametersCreateInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265VclFrameInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265VclFrameInfoEXT.gen.cs index cf7c4fcffc..382c2a2547 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265VclFrameInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265VclFrameInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeH265VclFrameInfoEXT")] - public unsafe partial struct VideoEncodeH265VclFrameInfoEXT + public unsafe partial struct VideoEncodeH265VclFrameInfoEXT : IExtendsChain { public VideoEncodeH265VclFrameInfoEXT ( @@ -90,5 +90,18 @@ public VideoEncodeH265VclFrameInfoEXT [NativeName("Type.Name", "StdVideoEncodeH265PictureInfo")] [NativeName("Name", "pCurrentPictureInfo")] public Video.StdVideoEncodeH265PictureInfo* PCurrentPictureInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265VclFrameInfoExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeInfoKHR.gen.cs index ebd8319e71..65ea4574d3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeInfoKHR")] - public unsafe partial struct VideoEncodeInfoKHR + public unsafe partial struct VideoEncodeInfoKHR : IChainStart { public VideoEncodeInfoKHR ( @@ -156,5 +156,30 @@ public VideoEncodeInfoKHR [NativeName("Type.Name", "VkVideoReferenceSlotKHR")] [NativeName("Name", "pReferenceSlots")] public VideoReferenceSlotKHR* PReferenceSlots; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref VideoEncodeInfoKHR Chain( + out VideoEncodeInfoKHR capture) + { + capture = new VideoEncodeInfoKHR(StructureType.VideoEncodeInfoKhr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeRateControlInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeRateControlInfoKHR.gen.cs index 2dba36b355..b028132a8d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeRateControlInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeRateControlInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEncodeRateControlInfoKHR")] - public unsafe partial struct VideoEncodeRateControlInfoKHR + public unsafe partial struct VideoEncodeRateControlInfoKHR : IExtendsChain { public VideoEncodeRateControlInfoKHR ( @@ -123,5 +123,18 @@ public VideoEncodeRateControlInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "virtualBufferSizeInMs")] public uint VirtualBufferSizeInMs; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeRateControlInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEndCodingInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEndCodingInfoKHR.gen.cs index d9347f7443..53ea2b6925 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEndCodingInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEndCodingInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoEndCodingInfoKHR")] - public unsafe partial struct VideoEndCodingInfoKHR + public unsafe partial struct VideoEndCodingInfoKHR : IChainable { public VideoEndCodingInfoKHR ( @@ -57,5 +57,18 @@ public VideoEndCodingInfoKHR [NativeName("Type.Name", "VkVideoEndCodingFlagsKHR")] [NativeName("Name", "flags")] public uint Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEndCodingInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoFormatPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoFormatPropertiesKHR.gen.cs index 83b4031298..fd1a58eb87 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoFormatPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoFormatPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoFormatPropertiesKHR")] - public unsafe partial struct VideoFormatPropertiesKHR + public unsafe partial struct VideoFormatPropertiesKHR : IChainable { public VideoFormatPropertiesKHR ( @@ -57,5 +57,18 @@ public VideoFormatPropertiesKHR [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "format")] public Format Format; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoFormatPropertiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoGetMemoryPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoGetMemoryPropertiesKHR.gen.cs index d16dbe3cb6..504eb823e2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoGetMemoryPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoGetMemoryPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoGetMemoryPropertiesKHR")] - public unsafe partial struct VideoGetMemoryPropertiesKHR + public unsafe partial struct VideoGetMemoryPropertiesKHR : IChainable { public VideoGetMemoryPropertiesKHR ( @@ -68,5 +68,18 @@ public VideoGetMemoryPropertiesKHR [NativeName("Type.Name", "VkMemoryRequirements2")] [NativeName("Name", "pMemoryRequirements")] public MemoryRequirements2* PMemoryRequirements; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoGetMemoryPropertiesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoPictureResourceKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoPictureResourceKHR.gen.cs index d414e22715..ef90018136 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoPictureResourceKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoPictureResourceKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoPictureResourceKHR")] - public unsafe partial struct VideoPictureResourceKHR + public unsafe partial struct VideoPictureResourceKHR : IChainable { public VideoPictureResourceKHR ( @@ -90,5 +90,18 @@ public VideoPictureResourceKHR [NativeName("Type.Name", "VkImageView")] [NativeName("Name", "imageViewBinding")] public ImageView ImageViewBinding; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoPictureResourceKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoProfileKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoProfileKHR.gen.cs index e0aa5c2cfc..787aeb18eb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoProfileKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoProfileKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoProfileKHR")] - public unsafe partial struct VideoProfileKHR + public unsafe partial struct VideoProfileKHR : IChainStart, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain { public VideoProfileKHR ( @@ -90,5 +90,30 @@ public VideoProfileKHR [NativeName("Type.Name", "VkVideoComponentBitDepthFlagsKHR")] [NativeName("Name", "chromaBitDepth")] public VideoComponentBitDepthFlagsKHR ChromaBitDepth; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoProfileKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref VideoProfileKHR Chain( + out VideoProfileKHR capture) + { + capture = new VideoProfileKHR(StructureType.VideoProfileKhr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoProfilesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoProfilesKHR.gen.cs index 32571501cc..e21ba70370 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoProfilesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoProfilesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoProfilesKHR")] - public unsafe partial struct VideoProfilesKHR + public unsafe partial struct VideoProfilesKHR : IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain, IExtendsChain { public VideoProfilesKHR ( @@ -68,5 +68,18 @@ public VideoProfilesKHR [NativeName("Type.Name", "VkVideoProfileKHR")] [NativeName("Name", "pProfiles")] public VideoProfileKHR* PProfiles; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoProfilesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoQueueFamilyProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoQueueFamilyProperties2KHR.gen.cs index bac7505dd1..552cd51a02 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoQueueFamilyProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoQueueFamilyProperties2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoQueueFamilyProperties2KHR")] - public unsafe partial struct VideoQueueFamilyProperties2KHR + public unsafe partial struct VideoQueueFamilyProperties2KHR : IExtendsChain, IExtendsChain { public VideoQueueFamilyProperties2KHR ( @@ -57,5 +57,18 @@ public VideoQueueFamilyProperties2KHR [NativeName("Type.Name", "VkVideoCodecOperationFlagsKHR")] [NativeName("Name", "videoCodecOperations")] public VideoCodecOperationFlagsKHR VideoCodecOperations; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoQueueFamilyProperties2Khr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoReferenceSlotKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoReferenceSlotKHR.gen.cs index d17e1eb207..71f37fce8f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoReferenceSlotKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoReferenceSlotKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoReferenceSlotKHR")] - public unsafe partial struct VideoReferenceSlotKHR + public unsafe partial struct VideoReferenceSlotKHR : IChainStart { public VideoReferenceSlotKHR ( @@ -68,5 +68,30 @@ public VideoReferenceSlotKHR [NativeName("Type.Name", "VkVideoPictureResourceKHR")] [NativeName("Name", "pPictureResource")] public VideoPictureResourceKHR* PPictureResource; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoReferenceSlotKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref VideoReferenceSlotKHR Chain( + out VideoReferenceSlotKHR capture) + { + capture = new VideoReferenceSlotKHR(StructureType.VideoReferenceSlotKhr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionCreateInfoKHR.gen.cs index 75b9d3dd17..9e23404cd6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoSessionCreateInfoKHR")] - public unsafe partial struct VideoSessionCreateInfoKHR + public unsafe partial struct VideoSessionCreateInfoKHR : IChainStart { public VideoSessionCreateInfoKHR ( @@ -134,5 +134,30 @@ public VideoSessionCreateInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxReferencePicturesActiveCount")] public uint MaxReferencePicturesActiveCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoSessionCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref VideoSessionCreateInfoKHR Chain( + out VideoSessionCreateInfoKHR capture) + { + capture = new VideoSessionCreateInfoKHR(StructureType.VideoSessionCreateInfoKhr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionParametersCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionParametersCreateInfoKHR.gen.cs index ee866bc6a9..14bcf8cb8b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionParametersCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionParametersCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoSessionParametersCreateInfoKHR")] - public unsafe partial struct VideoSessionParametersCreateInfoKHR + public unsafe partial struct VideoSessionParametersCreateInfoKHR : IChainStart { public VideoSessionParametersCreateInfoKHR ( @@ -68,5 +68,30 @@ public VideoSessionParametersCreateInfoKHR [NativeName("Type.Name", "VkVideoSessionKHR")] [NativeName("Name", "videoSession")] public VideoSessionKHR VideoSession; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoSessionParametersCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref VideoSessionParametersCreateInfoKHR Chain( + out VideoSessionParametersCreateInfoKHR capture) + { + capture = new VideoSessionParametersCreateInfoKHR(StructureType.VideoSessionParametersCreateInfoKhr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionParametersUpdateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionParametersUpdateInfoKHR.gen.cs index efb45c39b1..c2da2a218e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionParametersUpdateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionParametersUpdateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkVideoSessionParametersUpdateInfoKHR")] - public unsafe partial struct VideoSessionParametersUpdateInfoKHR + public unsafe partial struct VideoSessionParametersUpdateInfoKHR : IChainStart { public VideoSessionParametersUpdateInfoKHR ( @@ -57,5 +57,30 @@ public VideoSessionParametersUpdateInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "updateSequenceCount")] public uint UpdateSequenceCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoSessionParametersUpdateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref VideoSessionParametersUpdateInfoKHR Chain( + out VideoSessionParametersUpdateInfoKHR capture) + { + capture = new VideoSessionParametersUpdateInfoKHR(StructureType.VideoSessionParametersUpdateInfoKhr); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/WaylandSurfaceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/WaylandSurfaceCreateInfoKHR.gen.cs index a61d0fc406..0c700bcfc3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/WaylandSurfaceCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/WaylandSurfaceCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkWaylandSurfaceCreateInfoKHR")] - public unsafe partial struct WaylandSurfaceCreateInfoKHR + public unsafe partial struct WaylandSurfaceCreateInfoKHR : IChainable { public WaylandSurfaceCreateInfoKHR ( @@ -79,5 +79,18 @@ public WaylandSurfaceCreateInfoKHR [NativeName("Type.Name", "wl_surface")] [NativeName("Name", "surface")] public nint* Surface; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.WaylandSurfaceCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/Win32KeyedMutexAcquireReleaseInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/Win32KeyedMutexAcquireReleaseInfoKHR.gen.cs index 86f9e6a569..aa3d12b4f8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/Win32KeyedMutexAcquireReleaseInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/Win32KeyedMutexAcquireReleaseInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkWin32KeyedMutexAcquireReleaseInfoKHR")] - public unsafe partial struct Win32KeyedMutexAcquireReleaseInfoKHR + public unsafe partial struct Win32KeyedMutexAcquireReleaseInfoKHR : IExtendsChain, IExtendsChain { public Win32KeyedMutexAcquireReleaseInfoKHR ( @@ -123,5 +123,18 @@ public Win32KeyedMutexAcquireReleaseInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pReleaseKeys")] public ulong* PReleaseKeys; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.Win32KeyedMutexAcquireReleaseInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/Win32KeyedMutexAcquireReleaseInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/Win32KeyedMutexAcquireReleaseInfoNV.gen.cs index 19c515e137..1ce8e41f49 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/Win32KeyedMutexAcquireReleaseInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/Win32KeyedMutexAcquireReleaseInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkWin32KeyedMutexAcquireReleaseInfoNV")] - public unsafe partial struct Win32KeyedMutexAcquireReleaseInfoNV + public unsafe partial struct Win32KeyedMutexAcquireReleaseInfoNV : IExtendsChain, IExtendsChain { public Win32KeyedMutexAcquireReleaseInfoNV ( @@ -123,5 +123,18 @@ public Win32KeyedMutexAcquireReleaseInfoNV [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pReleaseKeys")] public ulong* PReleaseKeys; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.Win32KeyedMutexAcquireReleaseInfoNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/Win32SurfaceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/Win32SurfaceCreateInfoKHR.gen.cs index 9cfabde2c7..25a3bd9c2c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/Win32SurfaceCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/Win32SurfaceCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkWin32SurfaceCreateInfoKHR")] - public unsafe partial struct Win32SurfaceCreateInfoKHR + public unsafe partial struct Win32SurfaceCreateInfoKHR : IChainable { public Win32SurfaceCreateInfoKHR ( @@ -79,5 +79,18 @@ public Win32SurfaceCreateInfoKHR [NativeName("Type.Name", "HWND")] [NativeName("Name", "hwnd")] public nint Hwnd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.Win32SurfaceCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSet.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSet.gen.cs index 84b99f16fd..7f3c2b2d81 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSet.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSet.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkWriteDescriptorSet")] - public unsafe partial struct WriteDescriptorSet + public unsafe partial struct WriteDescriptorSet : IChainStart { public WriteDescriptorSet ( @@ -134,5 +134,30 @@ public WriteDescriptorSet [NativeName("Type.Name", "VkBufferView")] [NativeName("Name", "pTexelBufferView")] public BufferView* PTexelBufferView; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.WriteDescriptorSet; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + /// + /// Convenience method to start a chain. + /// + /// The newly created chain root + /// A reference to the newly created chain. + public static unsafe ref WriteDescriptorSet Chain( + out WriteDescriptorSet capture) + { + capture = new WriteDescriptorSet(StructureType.WriteDescriptorSet); + return ref capture; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetAccelerationStructureKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetAccelerationStructureKHR.gen.cs index 687ddbeeea..bae0ea79f5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetAccelerationStructureKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetAccelerationStructureKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkWriteDescriptorSetAccelerationStructureKHR")] - public unsafe partial struct WriteDescriptorSetAccelerationStructureKHR + public unsafe partial struct WriteDescriptorSetAccelerationStructureKHR : IExtendsChain { public WriteDescriptorSetAccelerationStructureKHR ( @@ -68,5 +68,18 @@ public WriteDescriptorSetAccelerationStructureKHR [NativeName("Type.Name", "VkAccelerationStructureKHR")] [NativeName("Name", "pAccelerationStructures")] public AccelerationStructureKHR* PAccelerationStructures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.WriteDescriptorSetAccelerationStructureKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetAccelerationStructureNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetAccelerationStructureNV.gen.cs index a60422bca8..df0dd1caab 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetAccelerationStructureNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetAccelerationStructureNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkWriteDescriptorSetAccelerationStructureNV")] - public unsafe partial struct WriteDescriptorSetAccelerationStructureNV + public unsafe partial struct WriteDescriptorSetAccelerationStructureNV : IExtendsChain { public WriteDescriptorSetAccelerationStructureNV ( @@ -68,5 +68,18 @@ public WriteDescriptorSetAccelerationStructureNV [NativeName("Type.Name", "VkAccelerationStructureNV")] [NativeName("Name", "pAccelerationStructures")] public AccelerationStructureNV* PAccelerationStructures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.WriteDescriptorSetAccelerationStructureNV; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetInlineUniformBlockEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetInlineUniformBlockEXT.gen.cs index 493dd06d7d..fa8442f2bd 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetInlineUniformBlockEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetInlineUniformBlockEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkWriteDescriptorSetInlineUniformBlockEXT")] - public unsafe partial struct WriteDescriptorSetInlineUniformBlockEXT + public unsafe partial struct WriteDescriptorSetInlineUniformBlockEXT : IExtendsChain { public WriteDescriptorSetInlineUniformBlockEXT ( @@ -68,5 +68,18 @@ public WriteDescriptorSetInlineUniformBlockEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pData")] public void* PData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.WriteDescriptorSetInlineUniformBlockExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/XcbSurfaceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/XcbSurfaceCreateInfoKHR.gen.cs index 113870ecf3..6bec60c4d4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/XcbSurfaceCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/XcbSurfaceCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkXcbSurfaceCreateInfoKHR")] - public unsafe partial struct XcbSurfaceCreateInfoKHR + public unsafe partial struct XcbSurfaceCreateInfoKHR : IChainable { public XcbSurfaceCreateInfoKHR ( @@ -79,5 +79,18 @@ public XcbSurfaceCreateInfoKHR [NativeName("Type.Name", "xcb_window_t")] [NativeName("Name", "window")] public nint Window; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.XcbSurfaceCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/XlibSurfaceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/XlibSurfaceCreateInfoKHR.gen.cs index 40181f2a2f..86aa4ddfaa 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/XlibSurfaceCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/XlibSurfaceCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkXlibSurfaceCreateInfoKHR")] - public unsafe partial struct XlibSurfaceCreateInfoKHR + public unsafe partial struct XlibSurfaceCreateInfoKHR : IChainable { public XlibSurfaceCreateInfoKHR ( @@ -79,5 +79,18 @@ public XlibSurfaceCreateInfoKHR [NativeName("Type.Name", "Window")] [NativeName("Name", "window")] public nint Window; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.XlibSurfaceCreateInfoKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } } }