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..c7fe1f7822 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/StructWriter.cs b/src/Core/Silk.NET.BuildTools/Bind/StructWriter.cs index 4d5c5b8f1b..aa960adad5 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,20 @@ 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; + foreach (var attr in @struct.Attributes) { if (attr.Name == "BuildToolsIntrinsic") { + if (attr.Arguments.Count > 1 && attr.Arguments[0] == "$VKSTRUCTUREDTYPE") + { + structuredType = attr.Arguments[1]; + } + continue; } @@ -78,7 +85,10 @@ public static void WriteStruct } sw.WriteLine($" [NativeName(\"Name\", \"{@struct.NativeName}\")]"); - sw.WriteLine($" public unsafe partial struct {@struct.Name}"); + sw.WriteLine + ( + $" public unsafe partial struct {@struct.Name}{(structuredType is not null ? " : IStructuredType" : string.Empty)}" + ); sw.WriteLine(" {"); if (guid is not null) { @@ -214,7 +224,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 +358,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 +375,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 +394,34 @@ 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 + ( + @"; + }" + ); + } + sw.WriteLine(" }"); sw.WriteLine("}"); sw.Flush(); @@ -395,7 +434,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 +509,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 +518,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 +535,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 +565,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 +656,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/Converters/Readers/VulkanReader.cs b/src/Core/Silk.NET.BuildTools/Converters/Readers/VulkanReader.cs index 923bdf914a..8e978d8bbb 100644 --- a/src/Core/Silk.NET.BuildTools/Converters/Readers/VulkanReader.cs +++ b/src/Core/Silk.NET.BuildTools/Converters/Readers/VulkanReader.cs @@ -55,47 +55,62 @@ private Dictionary ConvertStructs(VulkanSpecification spec, Bind { var prefix = task.FunctionPrefix; var ret = new Dictionary(); + foreach (var s in spec.Structures) { - ret.Add - ( - s.Name, 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 + 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) + var sTypeField = @struct.Fields + .FirstOrDefault(f => f.Name == "SType" && f.Type.Name == "VkStructureType"); + if (sTypeField is not null) + { + @struct.Attributes.Add + ( + new() + { + Name = "BuildToolsIntrinsic", + Arguments = new() {"$VKSTRUCTUREDTYPE", sTypeField.DefaultAssignment ?? string.Empty} + } + ); + } + + ret.Add(s.Name, @struct); } - + foreach (var h in spec.Handles) { ret.Add @@ -103,7 +118,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 +129,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 +161,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 +178,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 +188,7 @@ private IEnumerable GetFields(StructureDefinition union, BindTask task) }; } } - } + } private int GetTypeSize(string type, IEnumerable> maps) { @@ -237,7 +260,7 @@ public IEnumerable ReadFunctions(object obj, BindTask task) } } } - + foreach (var extension in spec.Extensions) { foreach (var name in extension.CommandNames) @@ -273,14 +296,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 +346,7 @@ public IEnumerable ReadEnums(object obj, BindTask task) }; } } - + task.InjectTypeMap(tm); } @@ -342,7 +366,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 +387,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 +421,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 +436,7 @@ private static FlowDirection ConvertFlow(ParameterModifier mod) _ => FlowDirection.In }; } - + private Dictionary ConvertEnums(VulkanSpecification spec, BindTask task) { var ret = new Dictionary(); @@ -440,8 +468,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 +486,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..fd329abd36 --- /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..ab15057480 --- /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..91c91d0aeb --- /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..33a512a15a --- /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.sln b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.sln new file mode 100644 index 0000000000..5ffbdc6a72 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrototypeStructChaining", "PrototypeStructChaining\PrototypeStructChaining.csproj", "{6EF16790-8E4E-44F1-87D6-272A85B4ACA5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PrototypeStructChaining.Test", "PrototypeStructChaining.Test\PrototypeStructChaining.Test.csproj", "{29BBBD86-81DD-4A28-BABD-0B2BD37F928B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6EF16790-8E4E-44F1-87D6-272A85B4ACA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6EF16790-8E4E-44F1-87D6-272A85B4ACA5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6EF16790-8E4E-44F1-87D6-272A85B4ACA5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6EF16790-8E4E-44F1-87D6-272A85B4ACA5}.Release|Any CPU.Build.0 = Release|Any CPU + {29BBBD86-81DD-4A28-BABD-0B2BD37F928B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {29BBBD86-81DD-4A28-BABD-0B2BD37F928B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29BBBD86-81DD-4A28-BABD-0B2BD37F928B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {29BBBD86-81DD-4A28-BABD-0B2BD37F928B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/BaseInStructure.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/BaseInStructure.cs new file mode 100644 index 0000000000..5e71dd6f11 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/BaseInStructure.cs @@ -0,0 +1,37 @@ +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 BaseInStructure : 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; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } +} diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/Buffer.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/Buffer.cs new file mode 100644 index 0000000000..37044ff381 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/Buffer.cs @@ -0,0 +1,12 @@ +// 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; + +/// +/// PlaceHolder - to ensure disambiguation works. +/// +[Obsolete("This class is here to indicate the the real Silk.NET.Vulkan contains a `Buffer` class.")] +public class Buffer +{ +} diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/Chain.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/Chain.cs new file mode 100644 index 0000000000..3e03c003e7 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/Chain.cs @@ -0,0 +1,571 @@ +using System.Runtime.CompilerServices; + +namespace Silk.NET.Vulkan; + +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; + } + + /// + /// 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/DeviceCreateInfo.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/DeviceCreateInfo.cs new file mode 100644 index 0000000000..a0e6f61c27 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/DeviceCreateInfo.cs @@ -0,0 +1,72 @@ +namespace Silk.NET.Vulkan; + +public struct DeviceCreateInfo : IChainStart +{ + /// + public StructureType SType; + + /// + public unsafe void* PNext; + + /// + public uint Flags; + + // NOTE Truncated for example + + + public unsafe DeviceCreateInfo + ( + StructureType? sType = StructureType.DeviceCreateInfo, + void* pNext = null, + uint? flags = null + ) + : this() + { + if (sType.HasValue) + { + SType = sType.Value; + } + + if ((IntPtr) pNext != IntPtr.Zero) + { + PNext = pNext; + } + + if (flags.HasValue) + { + Flags = flags.Value; + } + // NOTE Truncated for example + } + + #region Chaining Support + + /// + /// 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; + } + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceCreateInfo; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + #endregion +} diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/IChainStart.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/IChainStart.cs new file mode 100644 index 0000000000..9ac897e448 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/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/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/IChainable.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/IChainable.cs new file mode 100644 index 0000000000..1680728d74 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/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/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/IExtendsChain.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/IExtendsChain.cs new file mode 100644 index 0000000000..306e008327 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/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/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/IStructuredType.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/IStructuredType.cs new file mode 100644 index 0000000000..960038fac0 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/IStructuredType.cs @@ -0,0 +1,16 @@ +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. + /// + StructureType StructureType(); +} diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/ManagedChain.gen.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/ManagedChain.gen.cs new file mode 100644 index 0000000000..f7dc2b43b7 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/ManagedChain.gen.cs @@ -0,0 +1,20496 @@ +// ReSharper disable StaticMemberInGenericType +#pragma warning disable CS0659, CS0660, CS0661 +using System.Collections; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +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/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/ManagedChain.gen.tt b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/ManagedChain.gen.tt new file mode 100644 index 0000000000..2b24298029 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/ManagedChain.gen.tt @@ -0,0 +1,944 @@ +<#@ 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, CS0661 +using System.Collections; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; + +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/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PhysicalDeviceAccelerationStructureFeaturesKhr.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PhysicalDeviceAccelerationStructureFeaturesKhr.cs new file mode 100644 index 0000000000..ea33002ba1 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PhysicalDeviceAccelerationStructureFeaturesKhr.cs @@ -0,0 +1,50 @@ +namespace Silk.NET.Vulkan; + +public struct PhysicalDeviceAccelerationStructureFeaturesKhr : + IExtendsChain, + IExtendsChain +{ + /// + public StructureType SType; + + /// + public unsafe void* PNext; + + /// + public bool AccelerationStructure; + + // NOTE Truncated for example + + public unsafe PhysicalDeviceAccelerationStructureFeaturesKhr( + StructureType? sType = StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr, + void* pNext = null, + bool? accelerationStructure = null) + : this() + { + if (sType.HasValue) + SType = sType.Value; + if ((IntPtr) pNext != IntPtr.Zero) + PNext = pNext; + if (accelerationStructure.HasValue) + AccelerationStructure = accelerationStructure.Value; + + // NOTE Truncated for example + } + + #region Chaining Support + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + #endregion +} \ No newline at end of file diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PhysicalDeviceDescriptorIndexingFeatures.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PhysicalDeviceDescriptorIndexingFeatures.cs new file mode 100644 index 0000000000..baaf642e87 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PhysicalDeviceDescriptorIndexingFeatures.cs @@ -0,0 +1,50 @@ +namespace Silk.NET.Vulkan; + +public struct PhysicalDeviceDescriptorIndexingFeatures : + IExtendsChain, + IExtendsChain +{ + /// + public StructureType SType; + + /// + public unsafe void* PNext; + + /// + public bool ShaderInputAttachmentArrayDynamicIndexing; + + // NOTE Truncated for example + + public unsafe PhysicalDeviceDescriptorIndexingFeatures( + StructureType? sType = StructureType.PhysicalDeviceDescriptorIndexingFeaturesExt, + void* pNext = null, + bool? shaderInputAttachmentArrayDynamicIndexing = null) + : this() + { + if (sType.HasValue) + SType = sType.Value; + if ((IntPtr) pNext != IntPtr.Zero) + PNext = pNext; + if (shaderInputAttachmentArrayDynamicIndexing.HasValue) + ShaderInputAttachmentArrayDynamicIndexing = shaderInputAttachmentArrayDynamicIndexing.Value; + + // NOTE Truncated for example + } + + #region Chaining Support + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDescriptorIndexingFeaturesExt; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + #endregion +} \ No newline at end of file diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PhysicalDeviceFeatures.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PhysicalDeviceFeatures.cs new file mode 100644 index 0000000000..cecb0b3267 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PhysicalDeviceFeatures.cs @@ -0,0 +1,19 @@ +namespace Silk.NET.Vulkan; + +public struct PhysicalDeviceFeatures +{ + /// + public bool RobustBufferAccess; + + // NOTE Truncated for example + + public PhysicalDeviceFeatures( + bool? robustBufferAccess = null) + : this() + { + if (robustBufferAccess.HasValue) + RobustBufferAccess = robustBufferAccess.Value; + + // NOTE Truncated for example + } +} \ No newline at end of file diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PhysicalDeviceFeatures2.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PhysicalDeviceFeatures2.cs new file mode 100644 index 0000000000..b5fe21e56e --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PhysicalDeviceFeatures2.cs @@ -0,0 +1,54 @@ +namespace Silk.NET.Vulkan; + +public struct PhysicalDeviceFeatures2 : + IChainStart, + IExtendsChain +{ + public StructureType SType; + public unsafe void* PNext; + public PhysicalDeviceFeatures Features; + + public unsafe PhysicalDeviceFeatures2( + StructureType? sType = StructureType.PhysicalDeviceFeatures2, + void* pNext = null, + PhysicalDeviceFeatures? features = null) + : this() + { + if (sType.HasValue) + SType = sType.Value; + if ((IntPtr) pNext != IntPtr.Zero) + PNext = pNext; + if (!features.HasValue) + return; + Features = features.Value; + } + + #region Chaining Support + + /// + /// 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; + } + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFeatures2; + } + + /// + unsafe BaseInStructure* IChainable.PNext + { + get => (BaseInStructure*) PNext; + set => PNext = value; + } + + #endregion +} \ No newline at end of file diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PrototypeStructChaining.csproj b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PrototypeStructChaining.csproj new file mode 100644 index 0000000000..9762caf80c --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/PrototypeStructChaining.csproj @@ -0,0 +1,36 @@ + + + + netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0 + 10 + enable + true + Silk.NET.Vulkan + + + + + + + + + + + + + + + TextTemplatingFileGenerator + ManagedChain.gen.cs + + + + + + True + True + ManagedChain.gen.tt + + + + diff --git a/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/StructureType.cs b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/StructureType.cs new file mode 100644 index 0000000000..f56cee31b8 --- /dev/null +++ b/src/Lab/Experiments/PrototypeStructChaining/PrototypeStructChaining/StructureType.cs @@ -0,0 +1,704 @@ +namespace Silk.NET.Vulkan; + +public enum StructureType +{ + ApplicationInfo = 0, + InstanceCreateInfo = 1, + DeviceQueueCreateInfo = 2, + DeviceCreateInfo = 3, + SubmitInfo = 4, + MemoryAllocateInfo = 5, + MappedMemoryRange = 6, + BindSparseInfo = 7, + FenceCreateInfo = 8, + SemaphoreCreateInfo = 9, + EventCreateInfo = 10, // 0x0000000A + QueryPoolCreateInfo = 11, // 0x0000000B + BufferCreateInfo = 12, // 0x0000000C + BufferViewCreateInfo = 13, // 0x0000000D + ImageCreateInfo = 14, // 0x0000000E + ImageViewCreateInfo = 15, // 0x0000000F + ShaderModuleCreateInfo = 16, // 0x00000010 + PipelineCacheCreateInfo = 17, // 0x00000011 + PipelineShaderStageCreateInfo = 18, // 0x00000012 + PipelineVertexInputStateCreateInfo = 19, // 0x00000013 + PipelineInputAssemblyStateCreateInfo = 20, // 0x00000014 + PipelineTessellationStateCreateInfo = 21, // 0x00000015 + PipelineViewportStateCreateInfo = 22, // 0x00000016 + PipelineRasterizationStateCreateInfo = 23, // 0x00000017 + PipelineMultisampleStateCreateInfo = 24, // 0x00000018 + PipelineDepthStencilStateCreateInfo = 25, // 0x00000019 + PipelineColorBlendStateCreateInfo = 26, // 0x0000001A + PipelineDynamicStateCreateInfo = 27, // 0x0000001B + GraphicsPipelineCreateInfo = 28, // 0x0000001C + ComputePipelineCreateInfo = 29, // 0x0000001D + PipelineLayoutCreateInfo = 30, // 0x0000001E + SamplerCreateInfo = 31, // 0x0000001F + DescriptorSetLayoutCreateInfo = 32, // 0x00000020 + DescriptorPoolCreateInfo = 33, // 0x00000021 + DescriptorSetAllocateInfo = 34, // 0x00000022 + WriteDescriptorSet = 35, // 0x00000023 + CopyDescriptorSet = 36, // 0x00000024 + FramebufferCreateInfo = 37, // 0x00000025 + RenderPassCreateInfo = 38, // 0x00000026 + CommandPoolCreateInfo = 39, // 0x00000027 + CommandBufferAllocateInfo = 40, // 0x00000028 + CommandBufferInheritanceInfo = 41, // 0x00000029 + CommandBufferBeginInfo = 42, // 0x0000002A + RenderPassBeginInfo = 43, // 0x0000002B + BufferMemoryBarrier = 44, // 0x0000002C + ImageMemoryBarrier = 45, // 0x0000002D + MemoryBarrier = 46, // 0x0000002E + LoaderInstanceCreateInfo = 47, // 0x0000002F + LoaderDeviceCreateInfo = 48, // 0x00000030 + PhysicalDeviceVulkan11Features = 49, // 0x00000031 + PhysicalDeviceVulkan11Properties = 50, // 0x00000032 + PhysicalDeviceVulkan12Features = 51, // 0x00000033 + PhysicalDeviceVulkan12Properties = 52, // 0x00000034 + SwapchainCreateInfoKhr = 1000001000, // 0x3B9ACDE8 + PresentInfoKhr = 1000001001, // 0x3B9ACDE9 + DisplayModeCreateInfoKhr = 1000002000, // 0x3B9AD1D0 + DisplaySurfaceCreateInfoKhr = 1000002001, // 0x3B9AD1D1 + DisplayPresentInfoKhr = 1000003000, // 0x3B9AD5B8 + XlibSurfaceCreateInfoKhr = 1000004000, // 0x3B9AD9A0 + XcbSurfaceCreateInfoKhr = 1000005000, // 0x3B9ADD88 + WaylandSurfaceCreateInfoKhr = 1000006000, // 0x3B9AE170 + AndroidSurfaceCreateInfoKhr = 1000008000, // 0x3B9AE940 + Win32SurfaceCreateInfoKhr = 1000009000, // 0x3B9AED28 + NativeBufferAndroid = 1000010000, // 0x3B9AF110 + SwapchainImageCreateInfoAndroid = 1000010001, // 0x3B9AF111 + PhysicalDevicePresentationPropertiesAndroid = 1000010002, // 0x3B9AF112 + DebugReportCallbackCreateInfoExt = 1000011000, // 0x3B9AF4F8 + DebugReportCreateInfoExt = 1000011000, // 0x3B9AF4F8 + PipelineRasterizationStateRasterizationOrderAmd = 1000018000, // 0x3B9B1050 + DebugMarkerObjectNameInfoExt = 1000022000, // 0x3B9B1FF0 + DebugMarkerObjectTagInfoExt = 1000022001, // 0x3B9B1FF1 + DebugMarkerMarkerInfoExt = 1000022002, // 0x3B9B1FF2 + VideoProfileKhr = 1000023000, // 0x3B9B23D8 + VideoCapabilitiesKhr = 1000023001, // 0x3B9B23D9 + VideoPictureResourceKhr = 1000023002, // 0x3B9B23DA + VideoGetMemoryPropertiesKhr = 1000023003, // 0x3B9B23DB + VideoBindMemoryKhr = 1000023004, // 0x3B9B23DC + VideoSessionCreateInfoKhr = 1000023005, // 0x3B9B23DD + VideoSessionParametersCreateInfoKhr = 1000023006, // 0x3B9B23DE + VideoSessionParametersUpdateInfoKhr = 1000023007, // 0x3B9B23DF + VideoBeginCodingInfoKhr = 1000023008, // 0x3B9B23E0 + VideoEndCodingInfoKhr = 1000023009, // 0x3B9B23E1 + VideoCodingControlInfoKhr = 1000023010, // 0x3B9B23E2 + VideoReferenceSlotKhr = 1000023011, // 0x3B9B23E3 + VideoQueueFamilyProperties2Khr = 1000023012, // 0x3B9B23E4 + VideoProfilesKhr = 1000023013, // 0x3B9B23E5 + PhysicalDeviceVideoFormatInfoKhr = 1000023014, // 0x3B9B23E6 + VideoFormatPropertiesKhr = 1000023015, // 0x3B9B23E7 + VideoDecodeInfoKhr = 1000024000, // 0x3B9B27C0 + DedicatedAllocationImageCreateInfoNV = 1000026000, // 0x3B9B2F90 + DedicatedAllocationBufferCreateInfoNV = 1000026001, // 0x3B9B2F91 + DedicatedAllocationMemoryAllocateInfoNV = 1000026002, // 0x3B9B2F92 + PhysicalDeviceTransformFeedbackFeaturesExt = 1000028000, // 0x3B9B3760 + PhysicalDeviceTransformFeedbackPropertiesExt = 1000028001, // 0x3B9B3761 + PipelineRasterizationStateStreamCreateInfoExt = 1000028002, // 0x3B9B3762 + CUModuleCreateInfoNvx = 1000029000, // 0x3B9B3B48 + CUFunctionCreateInfoNvx = 1000029001, // 0x3B9B3B49 + CULaunchInfoNvx = 1000029002, // 0x3B9B3B4A + ImageViewHandleInfoNvx = 1000030000, // 0x3B9B3F30 + ImageViewAddressPropertiesNvx = 1000030001, // 0x3B9B3F31 + VideoEncodeH264CapabilitiesExt = 1000038000, // 0x3B9B5E70 + VideoEncodeH264SessionCreateInfoExt = 1000038001, // 0x3B9B5E71 + VideoEncodeH264SessionParametersCreateInfoExt = 1000038002, // 0x3B9B5E72 + VideoEncodeH264SessionParametersAddInfoExt = 1000038003, // 0x3B9B5E73 + VideoEncodeH264VclFrameInfoExt = 1000038004, // 0x3B9B5E74 + VideoEncodeH264DpbSlotInfoExt = 1000038005, // 0x3B9B5E75 + VideoEncodeH264NaluSliceExt = 1000038006, // 0x3B9B5E76 + VideoEncodeH264EmitPictureParametersExt = 1000038007, // 0x3B9B5E77 + VideoEncodeH264ProfileExt = 1000038008, // 0x3B9B5E78 + VideoDecodeH264CapabilitiesExt = 1000040000, // 0x3B9B6640 + VideoDecodeH264SessionCreateInfoExt = 1000040001, // 0x3B9B6641 + VideoDecodeH264PictureInfoExt = 1000040002, // 0x3B9B6642 + VideoDecodeH264MvcExt = 1000040003, // 0x3B9B6643 + VideoDecodeH264ProfileExt = 1000040004, // 0x3B9B6644 + VideoDecodeH264SessionParametersCreateInfoExt = 1000040005, // 0x3B9B6645 + VideoDecodeH264SessionParametersAddInfoExt = 1000040006, // 0x3B9B6646 + VideoDecodeH264DpbSlotInfoExt = 1000040007, // 0x3B9B6647 + TextureLodGatherFormatPropertiesAmd = 1000041000, // 0x3B9B6A28 + StreamDescriptorSurfaceCreateInfoGgp = 1000049000, // 0x3B9B8968 + PhysicalDeviceCornerSampledImageFeaturesNV = 1000050000, // 0x3B9B8D50 + RenderPassMultiviewCreateInfo = 1000053000, // 0x3B9B9908 + RenderPassMultiviewCreateInfoKhr = 1000053000, // 0x3B9B9908 + PhysicalDeviceMultiviewFeatures = 1000053001, // 0x3B9B9909 + PhysicalDeviceMultiviewFeaturesKhr = 1000053001, // 0x3B9B9909 + PhysicalDeviceMultiviewProperties = 1000053002, // 0x3B9B990A + PhysicalDeviceMultiviewPropertiesKhr = 1000053002, // 0x3B9B990A + ExternalMemoryImageCreateInfoNV = 1000056000, // 0x3B9BA4C0 + ExportMemoryAllocateInfoNV = 1000056001, // 0x3B9BA4C1 + ImportMemoryWin32HandleInfoNV = 1000057000, // 0x3B9BA8A8 + ExportMemoryWin32HandleInfoNV = 1000057001, // 0x3B9BA8A9 + Win32KeyedMutexAcquireReleaseInfoNV = 1000058000, // 0x3B9BAC90 + PhysicalDeviceFeatures2 = 1000059000, // 0x3B9BB078 + PhysicalDeviceFeatures2Khr = 1000059000, // 0x3B9BB078 + PhysicalDeviceProperties2 = 1000059001, // 0x3B9BB079 + PhysicalDeviceProperties2Khr = 1000059001, // 0x3B9BB079 + FormatProperties2 = 1000059002, // 0x3B9BB07A + FormatProperties2Khr = 1000059002, // 0x3B9BB07A + ImageFormatProperties2 = 1000059003, // 0x3B9BB07B + ImageFormatProperties2Khr = 1000059003, // 0x3B9BB07B + PhysicalDeviceImageFormatInfo2 = 1000059004, // 0x3B9BB07C + PhysicalDeviceImageFormatInfo2Khr = 1000059004, // 0x3B9BB07C + QueueFamilyProperties2 = 1000059005, // 0x3B9BB07D + QueueFamilyProperties2Khr = 1000059005, // 0x3B9BB07D + PhysicalDeviceMemoryProperties2 = 1000059006, // 0x3B9BB07E + PhysicalDeviceMemoryProperties2Khr = 1000059006, // 0x3B9BB07E + SparseImageFormatProperties2 = 1000059007, // 0x3B9BB07F + SparseImageFormatProperties2Khr = 1000059007, // 0x3B9BB07F + PhysicalDeviceSparseImageFormatInfo2 = 1000059008, // 0x3B9BB080 + PhysicalDeviceSparseImageFormatInfo2Khr = 1000059008, // 0x3B9BB080 + MemoryAllocateFlagsInfo = 1000060000, // 0x3B9BB460 + MemoryAllocateFlagsInfoKhr = 1000060000, // 0x3B9BB460 + DeviceGroupRenderPassBeginInfo = 1000060003, // 0x3B9BB463 + DeviceGroupRenderPassBeginInfoKhr = 1000060003, // 0x3B9BB463 + DeviceGroupCommandBufferBeginInfo = 1000060004, // 0x3B9BB464 + DeviceGroupCommandBufferBeginInfoKhr = 1000060004, // 0x3B9BB464 + DeviceGroupSubmitInfo = 1000060005, // 0x3B9BB465 + DeviceGroupSubmitInfoKhr = 1000060005, // 0x3B9BB465 + DeviceGroupBindSparseInfo = 1000060006, // 0x3B9BB466 + DeviceGroupBindSparseInfoKhr = 1000060006, // 0x3B9BB466 + DeviceGroupPresentCapabilitiesKhr = 1000060007, // 0x3B9BB467 + ImageSwapchainCreateInfoKhr = 1000060008, // 0x3B9BB468 + BindImageMemorySwapchainInfoKhr = 1000060009, // 0x3B9BB469 + AcquireNextImageInfoKhr = 1000060010, // 0x3B9BB46A + DeviceGroupPresentInfoKhr = 1000060011, // 0x3B9BB46B + DeviceGroupSwapchainCreateInfoKhr = 1000060012, // 0x3B9BB46C + BindBufferMemoryDeviceGroupInfo = 1000060013, // 0x3B9BB46D + BindBufferMemoryDeviceGroupInfoKhr = 1000060013, // 0x3B9BB46D + BindImageMemoryDeviceGroupInfo = 1000060014, // 0x3B9BB46E + BindImageMemoryDeviceGroupInfoKhr = 1000060014, // 0x3B9BB46E + ValidationFlagsExt = 1000061000, // 0x3B9BB848 + VISurfaceCreateInfoNN = 1000062000, // 0x3B9BBC30 + PhysicalDeviceShaderDrawParameterFeatures = 1000063000, // 0x3B9BC018 + PhysicalDeviceShaderDrawParametersFeatures = 1000063000, // 0x3B9BC018 + PhysicalDeviceTextureCompressionAstcHdrFeaturesExt = 1000066000, // 0x3B9BCBD0 + ImageViewAstcDecodeModeExt = 1000067000, // 0x3B9BCFB8 + PhysicalDeviceAstcDecodeFeaturesExt = 1000067001, // 0x3B9BCFB9 + PhysicalDeviceGroupProperties = 1000070000, // 0x3B9BDB70 + PhysicalDeviceGroupPropertiesKhr = 1000070000, // 0x3B9BDB70 + DeviceGroupDeviceCreateInfo = 1000070001, // 0x3B9BDB71 + DeviceGroupDeviceCreateInfoKhr = 1000070001, // 0x3B9BDB71 + PhysicalDeviceExternalImageFormatInfo = 1000071000, // 0x3B9BDF58 + PhysicalDeviceExternalImageFormatInfoKhr = 1000071000, // 0x3B9BDF58 + ExternalImageFormatProperties = 1000071001, // 0x3B9BDF59 + ExternalImageFormatPropertiesKhr = 1000071001, // 0x3B9BDF59 + PhysicalDeviceExternalBufferInfo = 1000071002, // 0x3B9BDF5A + PhysicalDeviceExternalBufferInfoKhr = 1000071002, // 0x3B9BDF5A + ExternalBufferProperties = 1000071003, // 0x3B9BDF5B + ExternalBufferPropertiesKhr = 1000071003, // 0x3B9BDF5B + PhysicalDeviceIDProperties = 1000071004, // 0x3B9BDF5C + PhysicalDeviceIDPropertiesKhr = 1000071004, // 0x3B9BDF5C + ExternalMemoryBufferCreateInfo = 1000072000, // 0x3B9BE340 + ExternalMemoryBufferCreateInfoKhr = 1000072000, // 0x3B9BE340 + ExternalMemoryImageCreateInfo = 1000072001, // 0x3B9BE341 + ExternalMemoryImageCreateInfoKhr = 1000072001, // 0x3B9BE341 + ExportMemoryAllocateInfo = 1000072002, // 0x3B9BE342 + ExportMemoryAllocateInfoKhr = 1000072002, // 0x3B9BE342 + ImportMemoryWin32HandleInfoKhr = 1000073000, // 0x3B9BE728 + ExportMemoryWin32HandleInfoKhr = 1000073001, // 0x3B9BE729 + MemoryWin32HandlePropertiesKhr = 1000073002, // 0x3B9BE72A + MemoryGetWin32HandleInfoKhr = 1000073003, // 0x3B9BE72B + ImportMemoryFDInfoKhr = 1000074000, // 0x3B9BEB10 + MemoryFDPropertiesKhr = 1000074001, // 0x3B9BEB11 + MemoryGetFDInfoKhr = 1000074002, // 0x3B9BEB12 + Win32KeyedMutexAcquireReleaseInfoKhr = 1000075000, // 0x3B9BEEF8 + PhysicalDeviceExternalSemaphoreInfo = 1000076000, // 0x3B9BF2E0 + PhysicalDeviceExternalSemaphoreInfoKhr = 1000076000, // 0x3B9BF2E0 + ExternalSemaphoreProperties = 1000076001, // 0x3B9BF2E1 + ExternalSemaphorePropertiesKhr = 1000076001, // 0x3B9BF2E1 + ExportSemaphoreCreateInfo = 1000077000, // 0x3B9BF6C8 + ExportSemaphoreCreateInfoKhr = 1000077000, // 0x3B9BF6C8 + ImportSemaphoreWin32HandleInfoKhr = 1000078000, // 0x3B9BFAB0 + ExportSemaphoreWin32HandleInfoKhr = 1000078001, // 0x3B9BFAB1 + D3D12FenceSubmitInfoKhr = 1000078002, // 0x3B9BFAB2 + SemaphoreGetWin32HandleInfoKhr = 1000078003, // 0x3B9BFAB3 + ImportSemaphoreFDInfoKhr = 1000079000, // 0x3B9BFE98 + SemaphoreGetFDInfoKhr = 1000079001, // 0x3B9BFE99 + PhysicalDevicePushDescriptorPropertiesKhr = 1000080000, // 0x3B9C0280 + CommandBufferInheritanceConditionalRenderingInfoExt = 1000081000, // 0x3B9C0668 + PhysicalDeviceConditionalRenderingFeaturesExt = 1000081001, // 0x3B9C0669 + ConditionalRenderingBeginInfoExt = 1000081002, // 0x3B9C066A + PhysicalDeviceFloat16Int8FeaturesKhr = 1000082000, // 0x3B9C0A50 + PhysicalDeviceShaderFloat16Int8Features = 1000082000, // 0x3B9C0A50 + PhysicalDeviceShaderFloat16Int8FeaturesKhr = 1000082000, // 0x3B9C0A50 + PhysicalDevice16BitStorageFeatures = 1000083000, // 0x3B9C0E38 + PhysicalDevice16BitStorageFeaturesKhr = 1000083000, // 0x3B9C0E38 + PresentRegionsKhr = 1000084000, // 0x3B9C1220 + DescriptorUpdateTemplateCreateInfo = 1000085000, // 0x3B9C1608 + DescriptorUpdateTemplateCreateInfoKhr = 1000085000, // 0x3B9C1608 + PipelineViewportWScalingStateCreateInfoNV = 1000087000, // 0x3B9C1DD8 + SurfaceCapabilities2Ext = 1000090000, // 0x3B9C2990 + DisplayPowerInfoExt = 1000091000, // 0x3B9C2D78 + DeviceEventInfoExt = 1000091001, // 0x3B9C2D79 + DisplayEventInfoExt = 1000091002, // 0x3B9C2D7A + SwapchainCounterCreateInfoExt = 1000091003, // 0x3B9C2D7B + PresentTimesInfoGoogle = 1000092000, // 0x3B9C3160 + PhysicalDeviceSubgroupProperties = 1000094000, // 0x3B9C3930 + PhysicalDeviceMultiviewPerViewAttributesPropertiesNvx = 1000097000, // 0x3B9C44E8 + PipelineViewportSwizzleStateCreateInfoNV = 1000098000, // 0x3B9C48D0 + PhysicalDeviceDiscardRectanglePropertiesExt = 1000099000, // 0x3B9C4CB8 + PipelineDiscardRectangleStateCreateInfoExt = 1000099001, // 0x3B9C4CB9 + PhysicalDeviceConservativeRasterizationPropertiesExt = 1000101000, // 0x3B9C5488 + PipelineRasterizationConservativeStateCreateInfoExt = 1000101001, // 0x3B9C5489 + PhysicalDeviceDepthClipEnableFeaturesExt = 1000102000, // 0x3B9C5870 + PipelineRasterizationDepthClipStateCreateInfoExt = 1000102001, // 0x3B9C5871 + HdrMetadataExt = 1000105000, // 0x3B9C6428 + PhysicalDeviceImagelessFramebufferFeatures = 1000108000, // 0x3B9C6FE0 + PhysicalDeviceImagelessFramebufferFeaturesKhr = 1000108000, // 0x3B9C6FE0 + FramebufferAttachmentsCreateInfo = 1000108001, // 0x3B9C6FE1 + FramebufferAttachmentsCreateInfoKhr = 1000108001, // 0x3B9C6FE1 + FramebufferAttachmentImageInfo = 1000108002, // 0x3B9C6FE2 + FramebufferAttachmentImageInfoKhr = 1000108002, // 0x3B9C6FE2 + RenderPassAttachmentBeginInfo = 1000108003, // 0x3B9C6FE3 + RenderPassAttachmentBeginInfoKhr = 1000108003, // 0x3B9C6FE3 + AttachmentDescription2 = 1000109000, // 0x3B9C73C8 + AttachmentDescription2Khr = 1000109000, // 0x3B9C73C8 + AttachmentReference2 = 1000109001, // 0x3B9C73C9 + AttachmentReference2Khr = 1000109001, // 0x3B9C73C9 + SubpassDescription2 = 1000109002, // 0x3B9C73CA + SubpassDescription2Khr = 1000109002, // 0x3B9C73CA + SubpassDependency2 = 1000109003, // 0x3B9C73CB + SubpassDependency2Khr = 1000109003, // 0x3B9C73CB + RenderPassCreateInfo2 = 1000109004, // 0x3B9C73CC + RenderPassCreateInfo2Khr = 1000109004, // 0x3B9C73CC + SubpassBeginInfo = 1000109005, // 0x3B9C73CD + SubpassBeginInfoKhr = 1000109005, // 0x3B9C73CD + SubpassEndInfo = 1000109006, // 0x3B9C73CE + SubpassEndInfoKhr = 1000109006, // 0x3B9C73CE + SharedPresentSurfaceCapabilitiesKhr = 1000111000, // 0x3B9C7B98 + PhysicalDeviceExternalFenceInfo = 1000112000, // 0x3B9C7F80 + PhysicalDeviceExternalFenceInfoKhr = 1000112000, // 0x3B9C7F80 + ExternalFenceProperties = 1000112001, // 0x3B9C7F81 + ExternalFencePropertiesKhr = 1000112001, // 0x3B9C7F81 + ExportFenceCreateInfo = 1000113000, // 0x3B9C8368 + ExportFenceCreateInfoKhr = 1000113000, // 0x3B9C8368 + ImportFenceWin32HandleInfoKhr = 1000114000, // 0x3B9C8750 + ExportFenceWin32HandleInfoKhr = 1000114001, // 0x3B9C8751 + FenceGetWin32HandleInfoKhr = 1000114002, // 0x3B9C8752 + ImportFenceFDInfoKhr = 1000115000, // 0x3B9C8B38 + FenceGetFDInfoKhr = 1000115001, // 0x3B9C8B39 + PhysicalDevicePerformanceQueryFeaturesKhr = 1000116000, // 0x3B9C8F20 + PhysicalDevicePerformanceQueryPropertiesKhr = 1000116001, // 0x3B9C8F21 + QueryPoolPerformanceCreateInfoKhr = 1000116002, // 0x3B9C8F22 + PerformanceQuerySubmitInfoKhr = 1000116003, // 0x3B9C8F23 + AcquireProfilingLockInfoKhr = 1000116004, // 0x3B9C8F24 + PerformanceCounterKhr = 1000116005, // 0x3B9C8F25 + PerformanceCounterDescriptionKhr = 1000116006, // 0x3B9C8F26 + PhysicalDevicePointClippingProperties = 1000117000, // 0x3B9C9308 + PhysicalDevicePointClippingPropertiesKhr = 1000117000, // 0x3B9C9308 + RenderPassInputAttachmentAspectCreateInfo = 1000117001, // 0x3B9C9309 + RenderPassInputAttachmentAspectCreateInfoKhr = 1000117001, // 0x3B9C9309 + ImageViewUsageCreateInfo = 1000117002, // 0x3B9C930A + ImageViewUsageCreateInfoKhr = 1000117002, // 0x3B9C930A + PipelineTessellationDomainOriginStateCreateInfo = 1000117003, // 0x3B9C930B + PipelineTessellationDomainOriginStateCreateInfoKhr = 1000117003, // 0x3B9C930B + PhysicalDeviceSurfaceInfo2Khr = 1000119000, // 0x3B9C9AD8 + SurfaceCapabilities2Khr = 1000119001, // 0x3B9C9AD9 + SurfaceFormat2Khr = 1000119002, // 0x3B9C9ADA + PhysicalDeviceVariablePointerFeatures = 1000120000, // 0x3B9C9EC0 + PhysicalDeviceVariablePointerFeaturesKhr = 1000120000, // 0x3B9C9EC0 + PhysicalDeviceVariablePointersFeatures = 1000120000, // 0x3B9C9EC0 + PhysicalDeviceVariablePointersFeaturesKhr = 1000120000, // 0x3B9C9EC0 + DisplayProperties2Khr = 1000121000, // 0x3B9CA2A8 + DisplayPlaneProperties2Khr = 1000121001, // 0x3B9CA2A9 + DisplayModeProperties2Khr = 1000121002, // 0x3B9CA2AA + DisplayPlaneInfo2Khr = 1000121003, // 0x3B9CA2AB + DisplayPlaneCapabilities2Khr = 1000121004, // 0x3B9CA2AC + IosSurfaceCreateInfoMvk = 1000122000, // 0x3B9CA690 + MacosSurfaceCreateInfoMvk = 1000123000, // 0x3B9CAA78 + MemoryDedicatedRequirements = 1000127000, // 0x3B9CBA18 + MemoryDedicatedRequirementsKhr = 1000127000, // 0x3B9CBA18 + MemoryDedicatedAllocateInfo = 1000127001, // 0x3B9CBA19 + MemoryDedicatedAllocateInfoKhr = 1000127001, // 0x3B9CBA19 + DebugUtilsObjectNameInfoExt = 1000128000, // 0x3B9CBE00 + DebugUtilsObjectTagInfoExt = 1000128001, // 0x3B9CBE01 + DebugUtilsLabelExt = 1000128002, // 0x3B9CBE02 + DebugUtilsMessengerCallbackDataExt = 1000128003, // 0x3B9CBE03 + DebugUtilsMessengerCreateInfoExt = 1000128004, // 0x3B9CBE04 + AndroidHardwareBufferUsageAndroid = 1000129000, // 0x3B9CC1E8 + AndroidHardwareBufferPropertiesAndroid = 1000129001, // 0x3B9CC1E9 + AndroidHardwareBufferFormatPropertiesAndroid = 1000129002, // 0x3B9CC1EA + ImportAndroidHardwareBufferInfoAndroid = 1000129003, // 0x3B9CC1EB + MemoryGetAndroidHardwareBufferInfoAndroid = 1000129004, // 0x3B9CC1EC + ExternalFormatAndroid = 1000129005, // 0x3B9CC1ED + PhysicalDeviceSamplerFilterMinmaxProperties = 1000130000, // 0x3B9CC5D0 + PhysicalDeviceSamplerFilterMinmaxPropertiesExt = 1000130000, // 0x3B9CC5D0 + SamplerReductionModeCreateInfo = 1000130001, // 0x3B9CC5D1 + SamplerReductionModeCreateInfoExt = 1000130001, // 0x3B9CC5D1 + PhysicalDeviceInlineUniformBlockFeaturesExt = 1000138000, // 0x3B9CE510 + PhysicalDeviceInlineUniformBlockPropertiesExt = 1000138001, // 0x3B9CE511 + WriteDescriptorSetInlineUniformBlockExt = 1000138002, // 0x3B9CE512 + DescriptorPoolInlineUniformBlockCreateInfoExt = 1000138003, // 0x3B9CE513 + SampleLocationsInfoExt = 1000143000, // 0x3B9CF898 + RenderPassSampleLocationsBeginInfoExt = 1000143001, // 0x3B9CF899 + PipelineSampleLocationsStateCreateInfoExt = 1000143002, // 0x3B9CF89A + PhysicalDeviceSampleLocationsPropertiesExt = 1000143003, // 0x3B9CF89B + MultisamplePropertiesExt = 1000143004, // 0x3B9CF89C + ProtectedSubmitInfo = 1000145000, // 0x3B9D0068 + PhysicalDeviceProtectedMemoryFeatures = 1000145001, // 0x3B9D0069 + PhysicalDeviceProtectedMemoryProperties = 1000145002, // 0x3B9D006A + DeviceQueueInfo2 = 1000145003, // 0x3B9D006B + BufferMemoryRequirementsInfo2 = 1000146000, // 0x3B9D0450 + BufferMemoryRequirementsInfo2Khr = 1000146000, // 0x3B9D0450 + ImageMemoryRequirementsInfo2 = 1000146001, // 0x3B9D0451 + ImageMemoryRequirementsInfo2Khr = 1000146001, // 0x3B9D0451 + ImageSparseMemoryRequirementsInfo2 = 1000146002, // 0x3B9D0452 + ImageSparseMemoryRequirementsInfo2Khr = 1000146002, // 0x3B9D0452 + MemoryRequirements2 = 1000146003, // 0x3B9D0453 + MemoryRequirements2Khr = 1000146003, // 0x3B9D0453 + SparseImageMemoryRequirements2 = 1000146004, // 0x3B9D0454 + SparseImageMemoryRequirements2Khr = 1000146004, // 0x3B9D0454 + ImageFormatListCreateInfo = 1000147000, // 0x3B9D0838 + ImageFormatListCreateInfoKhr = 1000147000, // 0x3B9D0838 + PhysicalDeviceBlendOperationAdvancedFeaturesExt = 1000148000, // 0x3B9D0C20 + PhysicalDeviceBlendOperationAdvancedPropertiesExt = 1000148001, // 0x3B9D0C21 + PipelineColorBlendAdvancedStateCreateInfoExt = 1000148002, // 0x3B9D0C22 + PipelineCoverageToColorStateCreateInfoNV = 1000149000, // 0x3B9D1008 + AccelerationStructureBuildGeometryInfoKhr = 1000150000, // 0x3B9D13F0 + AccelerationStructureDeviceAddressInfoKhr = 1000150002, // 0x3B9D13F2 + AccelerationStructureGeometryAabbsDataKhr = 1000150003, // 0x3B9D13F3 + AccelerationStructureGeometryInstancesDataKhr = 1000150004, // 0x3B9D13F4 + AccelerationStructureGeometryTrianglesDataKhr = 1000150005, // 0x3B9D13F5 + AccelerationStructureGeometryKhr = 1000150006, // 0x3B9D13F6 + WriteDescriptorSetAccelerationStructureKhr = 1000150007, // 0x3B9D13F7 + AccelerationStructureVersionInfoKhr = 1000150009, // 0x3B9D13F9 + CopyAccelerationStructureInfoKhr = 1000150010, // 0x3B9D13FA + CopyAccelerationStructureToMemoryInfoKhr = 1000150011, // 0x3B9D13FB + CopyMemoryToAccelerationStructureInfoKhr = 1000150012, // 0x3B9D13FC + PhysicalDeviceAccelerationStructureFeaturesKhr = 1000150013, // 0x3B9D13FD + PhysicalDeviceAccelerationStructurePropertiesKhr = 1000150014, // 0x3B9D13FE + RayTracingPipelineCreateInfoKhr = 1000150015, // 0x3B9D13FF + RayTracingShaderGroupCreateInfoKhr = 1000150016, // 0x3B9D1400 + AccelerationStructureCreateInfoKhr = 1000150017, // 0x3B9D1401 + RayTracingPipelineInterfaceCreateInfoKhr = 1000150018, // 0x3B9D1402 + AccelerationStructureBuildSizesInfoKhr = 1000150020, // 0x3B9D1404 + PipelineCoverageModulationStateCreateInfoNV = 1000152000, // 0x3B9D1BC0 + PhysicalDeviceShaderSMBuiltinsFeaturesNV = 1000154000, // 0x3B9D2390 + PhysicalDeviceShaderSMBuiltinsPropertiesNV = 1000154001, // 0x3B9D2391 + SamplerYcbcrConversionCreateInfo = 1000156000, // 0x3B9D2B60 + SamplerYcbcrConversionCreateInfoKhr = 1000156000, // 0x3B9D2B60 + SamplerYcbcrConversionInfo = 1000156001, // 0x3B9D2B61 + SamplerYcbcrConversionInfoKhr = 1000156001, // 0x3B9D2B61 + BindImagePlaneMemoryInfo = 1000156002, // 0x3B9D2B62 + BindImagePlaneMemoryInfoKhr = 1000156002, // 0x3B9D2B62 + ImagePlaneMemoryRequirementsInfo = 1000156003, // 0x3B9D2B63 + ImagePlaneMemoryRequirementsInfoKhr = 1000156003, // 0x3B9D2B63 + PhysicalDeviceSamplerYcbcrConversionFeatures = 1000156004, // 0x3B9D2B64 + PhysicalDeviceSamplerYcbcrConversionFeaturesKhr = 1000156004, // 0x3B9D2B64 + SamplerYcbcrConversionImageFormatProperties = 1000156005, // 0x3B9D2B65 + SamplerYcbcrConversionImageFormatPropertiesKhr = 1000156005, // 0x3B9D2B65 + BindBufferMemoryInfo = 1000157000, // 0x3B9D2F48 + BindBufferMemoryInfoKhr = 1000157000, // 0x3B9D2F48 + BindImageMemoryInfo = 1000157001, // 0x3B9D2F49 + BindImageMemoryInfoKhr = 1000157001, // 0x3B9D2F49 + DrmFormatModifierPropertiesListExt = 1000158000, // 0x3B9D3330 + PhysicalDeviceImageDrmFormatModifierInfoExt = 1000158002, // 0x3B9D3332 + ImageDrmFormatModifierListCreateInfoExt = 1000158003, // 0x3B9D3333 + ImageDrmFormatModifierExplicitCreateInfoExt = 1000158004, // 0x3B9D3334 + ImageDrmFormatModifierPropertiesExt = 1000158005, // 0x3B9D3335 + ValidationCacheCreateInfoExt = 1000160000, // 0x3B9D3B00 + ShaderModuleValidationCacheCreateInfoExt = 1000160001, // 0x3B9D3B01 + DescriptorSetLayoutBindingFlagsCreateInfo = 1000161000, // 0x3B9D3EE8 + DescriptorSetLayoutBindingFlagsCreateInfoExt = 1000161000, // 0x3B9D3EE8 + PhysicalDeviceDescriptorIndexingFeatures = 1000161001, // 0x3B9D3EE9 + PhysicalDeviceDescriptorIndexingFeaturesExt = 1000161001, // 0x3B9D3EE9 + PhysicalDeviceDescriptorIndexingProperties = 1000161002, // 0x3B9D3EEA + PhysicalDeviceDescriptorIndexingPropertiesExt = 1000161002, // 0x3B9D3EEA + DescriptorSetVariableDescriptorCountAllocateInfo = 1000161003, // 0x3B9D3EEB + DescriptorSetVariableDescriptorCountAllocateInfoExt = 1000161003, // 0x3B9D3EEB + DescriptorSetVariableDescriptorCountLayoutSupport = 1000161004, // 0x3B9D3EEC + DescriptorSetVariableDescriptorCountLayoutSupportExt = 1000161004, // 0x3B9D3EEC + PhysicalDevicePortabilitySubsetFeaturesKhr = 1000163000, // 0x3B9D46B8 + PhysicalDevicePortabilitySubsetPropertiesKhr = 1000163001, // 0x3B9D46B9 + PipelineViewportShadingRateImageStateCreateInfoNV = 1000164000, // 0x3B9D4AA0 + PhysicalDeviceShadingRateImageFeaturesNV = 1000164001, // 0x3B9D4AA1 + PhysicalDeviceShadingRateImagePropertiesNV = 1000164002, // 0x3B9D4AA2 + PipelineViewportCoarseSampleOrderStateCreateInfoNV = 1000164005, // 0x3B9D4AA5 + RayTracingPipelineCreateInfoNV = 1000165000, // 0x3B9D4E88 + AccelerationStructureCreateInfoNV = 1000165001, // 0x3B9D4E89 + GeometryNV = 1000165003, // 0x3B9D4E8B + GeometryTrianglesNV = 1000165004, // 0x3B9D4E8C + GeometryAabbNV = 1000165005, // 0x3B9D4E8D + BindAccelerationStructureMemoryInfoNV = 1000165006, // 0x3B9D4E8E + WriteDescriptorSetAccelerationStructureNV = 1000165007, // 0x3B9D4E8F + AccelerationStructureMemoryRequirementsInfoNV = 1000165008, // 0x3B9D4E90 + PhysicalDeviceRayTracingPropertiesNV = 1000165009, // 0x3B9D4E91 + RayTracingShaderGroupCreateInfoNV = 1000165011, // 0x3B9D4E93 + AccelerationStructureInfoNV = 1000165012, // 0x3B9D4E94 + PhysicalDeviceRepresentativeFragmentTestFeaturesNV = 1000166000, // 0x3B9D5270 + PipelineRepresentativeFragmentTestStateCreateInfoNV = 1000166001, // 0x3B9D5271 + PhysicalDeviceMaintenance3Properties = 1000168000, // 0x3B9D5A40 + PhysicalDeviceMaintenance3PropertiesKhr = 1000168000, // 0x3B9D5A40 + DescriptorSetLayoutSupport = 1000168001, // 0x3B9D5A41 + DescriptorSetLayoutSupportKhr = 1000168001, // 0x3B9D5A41 + PhysicalDeviceImageViewImageFormatInfoExt = 1000170000, // 0x3B9D6210 + FilterCubicImageViewImageFormatPropertiesExt = 1000170001, // 0x3B9D6211 + DeviceQueueGlobalPriorityCreateInfoExt = 1000174000, // 0x3B9D71B0 + PhysicalDeviceShaderSubgroupExtendedTypesFeatures = 1000175000, // 0x3B9D7598 + PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKhr = 1000175000, // 0x3B9D7598 + PhysicalDevice8BitStorageFeatures = 1000177000, // 0x3B9D7D68 + PhysicalDevice8BitStorageFeaturesKhr = 1000177000, // 0x3B9D7D68 + ImportMemoryHostPointerInfoExt = 1000178000, // 0x3B9D8150 + MemoryHostPointerPropertiesExt = 1000178001, // 0x3B9D8151 + PhysicalDeviceExternalMemoryHostPropertiesExt = 1000178002, // 0x3B9D8152 + PhysicalDeviceShaderAtomicInt64Features = 1000180000, // 0x3B9D8920 + PhysicalDeviceShaderAtomicInt64FeaturesKhr = 1000180000, // 0x3B9D8920 + PhysicalDeviceShaderClockFeaturesKhr = 1000181000, // 0x3B9D8D08 + PipelineCompilerControlCreateInfoAmd = 1000183000, // 0x3B9D94D8 + CalibratedTimestampInfoExt = 1000184000, // 0x3B9D98C0 + PhysicalDeviceShaderCorePropertiesAmd = 1000185000, // 0x3B9D9CA8 + VideoDecodeH265CapabilitiesExt = 1000187000, // 0x3B9DA478 + VideoDecodeH265SessionCreateInfoExt = 1000187001, // 0x3B9DA479 + VideoDecodeH265SessionParametersCreateInfoExt = 1000187002, // 0x3B9DA47A + VideoDecodeH265SessionParametersAddInfoExt = 1000187003, // 0x3B9DA47B + VideoDecodeH265ProfileExt = 1000187004, // 0x3B9DA47C + VideoDecodeH265PictureInfoExt = 1000187005, // 0x3B9DA47D + VideoDecodeH265DpbSlotInfoExt = 1000187006, // 0x3B9DA47E + DeviceMemoryOverallocationCreateInfoAmd = 1000189000, // 0x3B9DAC48 + PhysicalDeviceVertexAttributeDivisorPropertiesExt = 1000190000, // 0x3B9DB030 + PipelineVertexInputDivisorStateCreateInfoExt = 1000190001, // 0x3B9DB031 + PhysicalDeviceVertexAttributeDivisorFeaturesExt = 1000190002, // 0x3B9DB032 + PresentFrameTokenGgp = 1000191000, // 0x3B9DB418 + PipelineCreationFeedbackCreateInfoExt = 1000192000, // 0x3B9DB800 + PhysicalDeviceDriverProperties = 1000196000, // 0x3B9DC7A0 + PhysicalDeviceDriverPropertiesKhr = 1000196000, // 0x3B9DC7A0 + PhysicalDeviceFloatControlsProperties = 1000197000, // 0x3B9DCB88 + PhysicalDeviceFloatControlsPropertiesKhr = 1000197000, // 0x3B9DCB88 + PhysicalDeviceDepthStencilResolveProperties = 1000199000, // 0x3B9DD358 + PhysicalDeviceDepthStencilResolvePropertiesKhr = 1000199000, // 0x3B9DD358 + SubpassDescriptionDepthStencilResolve = 1000199001, // 0x3B9DD359 + SubpassDescriptionDepthStencilResolveKhr = 1000199001, // 0x3B9DD359 + PhysicalDeviceComputeShaderDerivativesFeaturesNV = 1000201000, // 0x3B9DDB28 + PhysicalDeviceMeshShaderFeaturesNV = 1000202000, // 0x3B9DDF10 + PhysicalDeviceMeshShaderPropertiesNV = 1000202001, // 0x3B9DDF11 + PhysicalDeviceFragmentShaderBarycentricFeaturesNV = 1000203000, // 0x3B9DE2F8 + PhysicalDeviceShaderImageFootprintFeaturesNV = 1000204000, // 0x3B9DE6E0 + PipelineViewportExclusiveScissorStateCreateInfoNV = 1000205000, // 0x3B9DEAC8 + PhysicalDeviceExclusiveScissorFeaturesNV = 1000205002, // 0x3B9DEACA + CheckpointDataNV = 1000206000, // 0x3B9DEEB0 + QueueFamilyCheckpointPropertiesNV = 1000206001, // 0x3B9DEEB1 + PhysicalDeviceTimelineSemaphoreFeatures = 1000207000, // 0x3B9DF298 + PhysicalDeviceTimelineSemaphoreFeaturesKhr = 1000207000, // 0x3B9DF298 + PhysicalDeviceTimelineSemaphoreProperties = 1000207001, // 0x3B9DF299 + PhysicalDeviceTimelineSemaphorePropertiesKhr = 1000207001, // 0x3B9DF299 + SemaphoreTypeCreateInfo = 1000207002, // 0x3B9DF29A + SemaphoreTypeCreateInfoKhr = 1000207002, // 0x3B9DF29A + TimelineSemaphoreSubmitInfo = 1000207003, // 0x3B9DF29B + TimelineSemaphoreSubmitInfoKhr = 1000207003, // 0x3B9DF29B + SemaphoreWaitInfo = 1000207004, // 0x3B9DF29C + SemaphoreWaitInfoKhr = 1000207004, // 0x3B9DF29C + SemaphoreSignalInfo = 1000207005, // 0x3B9DF29D + SemaphoreSignalInfoKhr = 1000207005, // 0x3B9DF29D + PhysicalDeviceShaderIntegerFunctions2FeaturesIntel = 1000209000, // 0x3B9DFA68 + QueryPoolCreateInfoIntel = 1000210000, // 0x3B9DFE50 + QueryPoolPerformanceQueryCreateInfoIntel = 1000210000, // 0x3B9DFE50 + InitializePerformanceApiInfoIntel = 1000210001, // 0x3B9DFE51 + PerformanceMarkerInfoIntel = 1000210002, // 0x3B9DFE52 + PerformanceStreamMarkerInfoIntel = 1000210003, // 0x3B9DFE53 + PerformanceOverrideInfoIntel = 1000210004, // 0x3B9DFE54 + PerformanceConfigurationAcquireInfoIntel = 1000210005, // 0x3B9DFE55 + PhysicalDeviceVulkanMemoryModelFeatures = 1000211000, // 0x3B9E0238 + PhysicalDeviceVulkanMemoryModelFeaturesKhr = 1000211000, // 0x3B9E0238 + PhysicalDevicePciBusInfoPropertiesExt = 1000212000, // 0x3B9E0620 + DisplayNativeHdrSurfaceCapabilitiesAmd = 1000213000, // 0x3B9E0A08 + SwapchainDisplayNativeHdrCreateInfoAmd = 1000213001, // 0x3B9E0A09 + ImagepipeSurfaceCreateInfoFuchsia = 1000214000, // 0x3B9E0DF0 + PhysicalDeviceShaderTerminateInvocationFeaturesKhr = 1000215000, // 0x3B9E11D8 + MetalSurfaceCreateInfoExt = 1000217000, // 0x3B9E19A8 + PhysicalDeviceFragmentDensityMapFeaturesExt = 1000218000, // 0x3B9E1D90 + PhysicalDeviceFragmentDensityMapPropertiesExt = 1000218001, // 0x3B9E1D91 + RenderPassFragmentDensityMapCreateInfoExt = 1000218002, // 0x3B9E1D92 + PhysicalDeviceScalarBlockLayoutFeatures = 1000221000, // 0x3B9E2948 + PhysicalDeviceScalarBlockLayoutFeaturesExt = 1000221000, // 0x3B9E2948 + PhysicalDeviceSubgroupSizeControlPropertiesExt = 1000225000, // 0x3B9E38E8 + PipelineShaderStageRequiredSubgroupSizeCreateInfoExt = 1000225001, // 0x3B9E38E9 + PhysicalDeviceSubgroupSizeControlFeaturesExt = 1000225002, // 0x3B9E38EA + FragmentShadingRateAttachmentInfoKhr = 1000226000, // 0x3B9E3CD0 + PipelineFragmentShadingRateStateCreateInfoKhr = 1000226001, // 0x3B9E3CD1 + PhysicalDeviceFragmentShadingRatePropertiesKhr = 1000226002, // 0x3B9E3CD2 + PhysicalDeviceFragmentShadingRateFeaturesKhr = 1000226003, // 0x3B9E3CD3 + PhysicalDeviceFragmentShadingRateKhr = 1000226004, // 0x3B9E3CD4 + PhysicalDeviceShaderCoreProperties2Amd = 1000227000, // 0x3B9E40B8 + PhysicalDeviceCoherentMemoryFeaturesAmd = 1000229000, // 0x3B9E4888 + PhysicalDeviceShaderImageAtomicInt64FeaturesExt = 1000234000, // 0x3B9E5C10 + PhysicalDeviceMemoryBudgetPropertiesExt = 1000237000, // 0x3B9E67C8 + PhysicalDeviceMemoryPriorityFeaturesExt = 1000238000, // 0x3B9E6BB0 + MemoryPriorityAllocateInfoExt = 1000238001, // 0x3B9E6BB1 + SurfaceProtectedCapabilitiesKhr = 1000239000, // 0x3B9E6F98 + PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV = 1000240000, // 0x3B9E7380 + PhysicalDeviceSeparateDepthStencilLayoutsFeatures = 1000241000, // 0x3B9E7768 + PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKhr = 1000241000, // 0x3B9E7768 + AttachmentReferenceStencilLayout = 1000241001, // 0x3B9E7769 + AttachmentReferenceStencilLayoutKhr = 1000241001, // 0x3B9E7769 + AttachmentDescriptionStencilLayout = 1000241002, // 0x3B9E776A + AttachmentDescriptionStencilLayoutKhr = 1000241002, // 0x3B9E776A + PhysicalDeviceBufferAddressFeaturesExt = 1000244000, // 0x3B9E8320 + PhysicalDeviceBufferDeviceAddressFeaturesExt = 1000244000, // 0x3B9E8320 + BufferDeviceAddressInfo = 1000244001, // 0x3B9E8321 + BufferDeviceAddressInfoExt = 1000244001, // 0x3B9E8321 + BufferDeviceAddressInfoKhr = 1000244001, // 0x3B9E8321 + BufferDeviceAddressCreateInfoExt = 1000244002, // 0x3B9E8322 + PhysicalDeviceToolPropertiesExt = 1000245000, // 0x3B9E8708 + ImageStencilUsageCreateInfo = 1000246000, // 0x3B9E8AF0 + ImageStencilUsageCreateInfoExt = 1000246000, // 0x3B9E8AF0 + ValidationFeaturesExt = 1000247000, // 0x3B9E8ED8 + PhysicalDevicePresentWaitFeaturesKhr = 1000248000, // 0x3B9E92C0 + PhysicalDeviceCooperativeMatrixFeaturesNV = 1000249000, // 0x3B9E96A8 + CooperativeMatrixPropertiesNV = 1000249001, // 0x3B9E96A9 + PhysicalDeviceCooperativeMatrixPropertiesNV = 1000249002, // 0x3B9E96AA + PhysicalDeviceCoverageReductionModeFeaturesNV = 1000250000, // 0x3B9E9A90 + PipelineCoverageReductionStateCreateInfoNV = 1000250001, // 0x3B9E9A91 + FramebufferMixedSamplesCombinationNV = 1000250002, // 0x3B9E9A92 + PhysicalDeviceFragmentShaderInterlockFeaturesExt = 1000251000, // 0x3B9E9E78 + PhysicalDeviceYcbcrImageArraysFeaturesExt = 1000252000, // 0x3B9EA260 + PhysicalDeviceUniformBufferStandardLayoutFeatures = 1000253000, // 0x3B9EA648 + PhysicalDeviceUniformBufferStandardLayoutFeaturesKhr = 1000253000, // 0x3B9EA648 + PhysicalDeviceProvokingVertexFeaturesExt = 1000254000, // 0x3B9EAA30 + PipelineRasterizationProvokingVertexStateCreateInfoExt = 1000254001, // 0x3B9EAA31 + PhysicalDeviceProvokingVertexPropertiesExt = 1000254002, // 0x3B9EAA32 + SurfaceFullScreenExclusiveInfoExt = 1000255000, // 0x3B9EAE18 + SurfaceFullScreenExclusiveWin32InfoExt = 1000255001, // 0x3B9EAE19 + SurfaceCapabilitiesFullScreenExclusiveExt = 1000255002, // 0x3B9EAE1A + HeadlessSurfaceCreateInfoExt = 1000256000, // 0x3B9EB200 + PhysicalDeviceBufferDeviceAddressFeatures = 1000257000, // 0x3B9EB5E8 + PhysicalDeviceBufferDeviceAddressFeaturesKhr = 1000257000, // 0x3B9EB5E8 + BufferOpaqueCaptureAddressCreateInfo = 1000257002, // 0x3B9EB5EA + BufferOpaqueCaptureAddressCreateInfoKhr = 1000257002, // 0x3B9EB5EA + MemoryOpaqueCaptureAddressAllocateInfo = 1000257003, // 0x3B9EB5EB + MemoryOpaqueCaptureAddressAllocateInfoKhr = 1000257003, // 0x3B9EB5EB + DeviceMemoryOpaqueCaptureAddressInfo = 1000257004, // 0x3B9EB5EC + DeviceMemoryOpaqueCaptureAddressInfoKhr = 1000257004, // 0x3B9EB5EC + PhysicalDeviceLineRasterizationFeaturesExt = 1000259000, // 0x3B9EBDB8 + PipelineRasterizationLineStateCreateInfoExt = 1000259001, // 0x3B9EBDB9 + PhysicalDeviceLineRasterizationPropertiesExt = 1000259002, // 0x3B9EBDBA + PhysicalDeviceShaderAtomicFloatFeaturesExt = 1000260000, // 0x3B9EC1A0 + PhysicalDeviceHostQueryResetFeatures = 1000261000, // 0x3B9EC588 + PhysicalDeviceHostQueryResetFeaturesExt = 1000261000, // 0x3B9EC588 + PhysicalDeviceIndexTypeUint8FeaturesExt = 1000265000, // 0x3B9ED528 + PhysicalDeviceExtendedDynamicStateFeaturesExt = 1000267000, // 0x3B9EDCF8 + PhysicalDevicePipelineExecutablePropertiesFeaturesKhr = 1000269000, // 0x3B9EE4C8 + PipelineInfoKhr = 1000269001, // 0x3B9EE4C9 + PipelineExecutablePropertiesKhr = 1000269002, // 0x3B9EE4CA + PipelineExecutableInfoKhr = 1000269003, // 0x3B9EE4CB + PipelineExecutableStatisticKhr = 1000269004, // 0x3B9EE4CC + PipelineExecutableInternalRepresentationKhr = 1000269005, // 0x3B9EE4CD + PhysicalDeviceShaderAtomicFloat2FeaturesExt = 1000273000, // 0x3B9EF468 + PhysicalDeviceShaderDemoteToHelperInvocationFeaturesExt = 1000276000, // 0x3B9F0020 + PhysicalDeviceDeviceGeneratedCommandsPropertiesNV = 1000277000, // 0x3B9F0408 + GraphicsShaderGroupCreateInfoNV = 1000277001, // 0x3B9F0409 + GraphicsPipelineShaderGroupsCreateInfoNV = 1000277002, // 0x3B9F040A + IndirectCommandsLayoutTokenNV = 1000277003, // 0x3B9F040B + IndirectCommandsLayoutCreateInfoNV = 1000277004, // 0x3B9F040C + GeneratedCommandsInfoNV = 1000277005, // 0x3B9F040D + GeneratedCommandsMemoryRequirementsInfoNV = 1000277006, // 0x3B9F040E + PhysicalDeviceDeviceGeneratedCommandsFeaturesNV = 1000277007, // 0x3B9F040F + PhysicalDeviceInheritedViewportScissorFeaturesNV = 1000278000, // 0x3B9F07F0 + CommandBufferInheritanceViewportScissorInfoNV = 1000278001, // 0x3B9F07F1 + PhysicalDeviceShaderIntegerDotProductFeaturesKhr = 1000280000, // 0x3B9F0FC0 + PhysicalDeviceShaderIntegerDotProductPropertiesKhr = 1000280001, // 0x3B9F0FC1 + PhysicalDeviceTexelBufferAlignmentFeaturesExt = 1000281000, // 0x3B9F13A8 + PhysicalDeviceTexelBufferAlignmentPropertiesExt = 1000281001, // 0x3B9F13A9 + CommandBufferInheritanceRenderPassTransformInfoQCom = 1000282000, // 0x3B9F1790 + RenderPassTransformBeginInfoQCom = 1000282001, // 0x3B9F1791 + PhysicalDeviceDeviceMemoryReportFeaturesExt = 1000284000, // 0x3B9F1F60 + DeviceDeviceMemoryReportCreateInfoExt = 1000284001, // 0x3B9F1F61 + DeviceMemoryReportCallbackDataExt = 1000284002, // 0x3B9F1F62 + PhysicalDeviceRobustness2FeaturesExt = 1000286000, // 0x3B9F2730 + PhysicalDeviceRobustness2PropertiesExt = 1000286001, // 0x3B9F2731 + SamplerCustomBorderColorCreateInfoExt = 1000287000, // 0x3B9F2B18 + PhysicalDeviceCustomBorderColorPropertiesExt = 1000287001, // 0x3B9F2B19 + PhysicalDeviceCustomBorderColorFeaturesExt = 1000287002, // 0x3B9F2B1A + PipelineLibraryCreateInfoKhr = 1000290000, // 0x3B9F36D0 + PresentIDKhr = 1000294000, // 0x3B9F4670 + PhysicalDevicePresentIDFeaturesKhr = 1000294001, // 0x3B9F4671 + PhysicalDevicePrivateDataFeaturesExt = 1000295000, // 0x3B9F4A58 + DevicePrivateDataCreateInfoExt = 1000295001, // 0x3B9F4A59 + PrivateDataSlotCreateInfoExt = 1000295002, // 0x3B9F4A5A + PhysicalDevicePipelineCreationCacheControlFeaturesExt = 1000297000, // 0x3B9F5228 + VideoEncodeInfoKhr = 1000299000, // 0x3B9F59F8 + VideoEncodeRateControlInfoKhr = 1000299001, // 0x3B9F59F9 + PhysicalDeviceDiagnosticsConfigFeaturesNV = 1000300000, // 0x3B9F5DE0 + DeviceDiagnosticsConfigCreateInfoNV = 1000300001, // 0x3B9F5DE1 + ReservedQCom = 1000309000, // 0x3B9F8108 + MemoryBarrier2Khr = 1000314000, // 0x3B9F9490 + BufferMemoryBarrier2Khr = 1000314001, // 0x3B9F9491 + ImageMemoryBarrier2Khr = 1000314002, // 0x3B9F9492 + DependencyInfoKhr = 1000314003, // 0x3B9F9493 + SubmitInfo2Khr = 1000314004, // 0x3B9F9494 + SemaphoreSubmitInfoKhr = 1000314005, // 0x3B9F9495 + CommandBufferSubmitInfoKhr = 1000314006, // 0x3B9F9496 + PhysicalDeviceSynchronization2FeaturesKhr = 1000314007, // 0x3B9F9497 + QueueFamilyCheckpointProperties2NV = 1000314008, // 0x3B9F9498 + CheckpointData2NV = 1000314009, // 0x3B9F9499 + PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKhr = 1000323000, // 0x3B9FB7B8 + PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKhr = 1000325000, // 0x3B9FBF88 + PhysicalDeviceFragmentShadingRateEnumsPropertiesNV = 1000326000, // 0x3B9FC370 + PhysicalDeviceFragmentShadingRateEnumsFeaturesNV = 1000326001, // 0x3B9FC371 + PipelineFragmentShadingRateEnumStateCreateInfoNV = 1000326002, // 0x3B9FC372 + AccelerationStructureGeometryMotionTrianglesDataNV = 1000327000, // 0x3B9FC758 + PhysicalDeviceRayTracingMotionBlurFeaturesNV = 1000327001, // 0x3B9FC759 + AccelerationStructureMotionInfoNV = 1000327002, // 0x3B9FC75A + PhysicalDeviceYcbcr2Plane444FormatsFeaturesExt = 1000330000, // 0x3B9FD310 + PhysicalDeviceFragmentDensityMap2FeaturesExt = 1000332000, // 0x3B9FDAE0 + PhysicalDeviceFragmentDensityMap2PropertiesExt = 1000332001, // 0x3B9FDAE1 + CopyCommandTransformInfoQCom = 1000333000, // 0x3B9FDEC8 + PhysicalDeviceImageRobustnessFeaturesExt = 1000335000, // 0x3B9FE698 + PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKhr = 1000336000, // 0x3B9FEA80 + CopyBufferInfo2Khr = 1000337000, // 0x3B9FEE68 + CopyImageInfo2Khr = 1000337001, // 0x3B9FEE69 + CopyBufferToImageInfo2Khr = 1000337002, // 0x3B9FEE6A + CopyImageToBufferInfo2Khr = 1000337003, // 0x3B9FEE6B + BlitImageInfo2Khr = 1000337004, // 0x3B9FEE6C + ResolveImageInfo2Khr = 1000337005, // 0x3B9FEE6D + BufferCopy2Khr = 1000337006, // 0x3B9FEE6E + ImageCopy2Khr = 1000337007, // 0x3B9FEE6F + ImageBlit2Khr = 1000337008, // 0x3B9FEE70 + BufferImageCopy2Khr = 1000337009, // 0x3B9FEE71 + ImageResolve2Khr = 1000337010, // 0x3B9FEE72 + PhysicalDevice4444FormatsFeaturesExt = 1000340000, // 0x3B9FFA20 + DirectfbSurfaceCreateInfoExt = 1000346000, // 0x3BA01190 + PhysicalDeviceRayTracingPipelineFeaturesKhr = 1000347000, // 0x3BA01578 + PhysicalDeviceRayTracingPipelinePropertiesKhr = 1000347001, // 0x3BA01579 + PhysicalDeviceRayQueryFeaturesKhr = 1000348013, // 0x3BA0196D + PhysicalDeviceMutableDescriptorTypeFeaturesValve = 1000351000, // 0x3BA02518 + MutableDescriptorTypeCreateInfoValve = 1000351002, // 0x3BA0251A + PhysicalDeviceVertexInputDynamicStateFeaturesExt = 1000352000, // 0x3BA02900 + VertexInputBindingDescription2Ext = 1000352001, // 0x3BA02901 + VertexInputAttributeDescription2Ext = 1000352002, // 0x3BA02902 + PhysicalDeviceDrmPropertiesExt = 1000353000, // 0x3BA02CE8 + PhysicalDevicePrimitiveTopologyListRestartFeaturesExt = 1000356000, // 0x3BA038A0 + ImportMemoryZirconHandleInfoFuchsia = 1000364000, // 0x3BA057E0 + MemoryZirconHandlePropertiesFuchsia = 1000364001, // 0x3BA057E1 + MemoryGetZirconHandleInfoFuchsia = 1000364002, // 0x3BA057E2 + ImportSemaphoreZirconHandleInfoFuchsia = 1000365000, // 0x3BA05BC8 + SemaphoreGetZirconHandleInfoFuchsia = 1000365001, // 0x3BA05BC9 + BufferCollectionCreateInfoFuchsia = 1000366000, // 0x3BA05FB0 + ImportMemoryBufferCollectionFuchsia = 1000366001, // 0x3BA05FB1 + BufferCollectionImageCreateInfoFuchsia = 1000366002, // 0x3BA05FB2 + BufferCollectionPropertiesFuchsia = 1000366003, // 0x3BA05FB3 + BufferConstraintsInfoFuchsia = 1000366004, // 0x3BA05FB4 + BufferCollectionBufferCreateInfoFuchsia = 1000366005, // 0x3BA05FB5 + ImageConstraintsInfoFuchsia = 1000366006, // 0x3BA05FB6 + ImageFormatConstraintsInfoFuchsia = 1000366007, // 0x3BA05FB7 + SysmemColorSpaceFuchsia = 1000366008, // 0x3BA05FB8 + BufferCollectionConstraintsInfoFuchsia = 1000366009, // 0x3BA05FB9 + SubpassShadingPipelineCreateInfoHuawei = 1000369000, // 0x3BA06B68 + PhysicalDeviceSubpassShadingFeaturesHuawei = 1000369001, // 0x3BA06B69 + PhysicalDeviceSubpassShadingPropertiesHuawei = 1000369002, // 0x3BA06B6A + PhysicalDeviceInvocationMaskFeaturesHuawei = 1000370000, // 0x3BA06F50 + MemoryGetRemoteAddressInfoNV = 1000371000, // 0x3BA07338 + PhysicalDeviceExternalMemoryRdmaFeaturesNV = 1000371001, // 0x3BA07339 + PhysicalDeviceExtendedDynamicState2FeaturesExt = 1000377000, // 0x3BA08AA8 + ScreenSurfaceCreateInfoQnx = 1000378000, // 0x3BA08E90 + PhysicalDeviceColorWriteEnableFeaturesExt = 1000381000, // 0x3BA09A48 + PipelineColorWriteCreateInfoExt = 1000381001, // 0x3BA09A49 + PhysicalDeviceGlobalPriorityQueryFeaturesExt = 1000388000, // 0x3BA0B5A0 + QueueFamilyGlobalPriorityPropertiesExt = 1000388001, // 0x3BA0B5A1 + PhysicalDeviceMultiDrawFeaturesExt = 1000392000, // 0x3BA0C540 + PhysicalDeviceMultiDrawPropertiesExt = 1000392001, // 0x3BA0C541 + PhysicalDevicePageableDeviceLocalMemoryFeaturesExt = 1000412000 // 0x3BA11360 +} \ No newline at end of file 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/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/Structs/AccelerationStructureBuildGeometryInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureBuildGeometryInfoKHR.gen.cs index 12b90a78bf..9f5c6b4dad 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 : IStructuredType { public AccelerationStructureBuildGeometryInfoKHR ( @@ -145,5 +145,11 @@ public AccelerationStructureBuildGeometryInfoKHR [NativeName("Type.Name", "VkDeviceOrHostAddressKHR")] [NativeName("Name", "scratchData")] public DeviceOrHostAddressKHR ScratchData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureBuildGeometryInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureBuildSizesInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureBuildSizesInfoKHR.gen.cs index 95a13831f2..23531a9d36 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 : IStructuredType { public AccelerationStructureBuildSizesInfoKHR ( @@ -79,5 +79,11 @@ public AccelerationStructureBuildSizesInfoKHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "buildScratchSize")] public ulong BuildScratchSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureBuildSizesInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureCreateInfoKHR.gen.cs index f7e7016001..8bf202c6c6 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 : IStructuredType { public AccelerationStructureCreateInfoKHR ( @@ -112,5 +112,11 @@ public AccelerationStructureCreateInfoKHR [NativeName("Type.Name", "VkDeviceAddress")] [NativeName("Name", "deviceAddress")] public ulong DeviceAddress; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureCreateInfoNV.gen.cs index 8835e4deea..22222a3a69 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 : IStructuredType { public AccelerationStructureCreateInfoNV ( @@ -68,5 +68,11 @@ public AccelerationStructureCreateInfoNV [NativeName("Type.Name", "VkAccelerationStructureInfoNV")] [NativeName("Name", "info")] public AccelerationStructureInfoNV Info; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureDeviceAddressInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureDeviceAddressInfoKHR.gen.cs index ac00ff95de..ebbff97e7c 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 : IStructuredType { public AccelerationStructureDeviceAddressInfoKHR ( @@ -57,5 +57,11 @@ public AccelerationStructureDeviceAddressInfoKHR [NativeName("Type.Name", "VkAccelerationStructureKHR")] [NativeName("Name", "accelerationStructure")] public AccelerationStructureKHR AccelerationStructure; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureDeviceAddressInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryAabbsDataKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryAabbsDataKHR.gen.cs index 9e967adae5..0b802df2f1 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 : IStructuredType { public AccelerationStructureGeometryAabbsDataKHR ( @@ -68,5 +68,11 @@ public AccelerationStructureGeometryAabbsDataKHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "stride")] public ulong Stride; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureGeometryAabbsDataKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryInstancesDataKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryInstancesDataKHR.gen.cs index bf35b61fab..5ae2414117 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 : IStructuredType { public AccelerationStructureGeometryInstancesDataKHR ( @@ -68,5 +68,11 @@ public AccelerationStructureGeometryInstancesDataKHR [NativeName("Type.Name", "VkDeviceOrHostAddressConstKHR")] [NativeName("Name", "data")] public DeviceOrHostAddressConstKHR Data; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureGeometryInstancesDataKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryKHR.gen.cs index 7aaf6f8bab..33a1c5e632 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 : IStructuredType { public AccelerationStructureGeometryKHR ( @@ -79,5 +79,11 @@ public AccelerationStructureGeometryKHR [NativeName("Type.Name", "VkGeometryFlagsKHR")] [NativeName("Name", "flags")] public GeometryFlagsKHR Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureGeometryKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryMotionTrianglesDataNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryMotionTrianglesDataNV.gen.cs index 2845abd7d2..035b8f9a1a 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 : IStructuredType { public AccelerationStructureGeometryMotionTrianglesDataNV ( @@ -57,5 +57,11 @@ public AccelerationStructureGeometryMotionTrianglesDataNV [NativeName("Type.Name", "VkDeviceOrHostAddressConstKHR")] [NativeName("Name", "vertexData")] public DeviceOrHostAddressConstKHR VertexData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureGeometryMotionTrianglesDataNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryTrianglesDataKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureGeometryTrianglesDataKHR.gen.cs index d4372cca71..4c2f9357f2 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 : IStructuredType { public AccelerationStructureGeometryTrianglesDataKHR ( @@ -123,5 +123,11 @@ public AccelerationStructureGeometryTrianglesDataKHR [NativeName("Type.Name", "VkDeviceOrHostAddressConstKHR")] [NativeName("Name", "transformData")] public DeviceOrHostAddressConstKHR TransformData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureGeometryTrianglesDataKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureInfoNV.gen.cs index 2ad4f001ba..1b850db80f 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 : IStructuredType { public AccelerationStructureInfoNV ( @@ -101,5 +101,11 @@ public AccelerationStructureInfoNV [NativeName("Type.Name", "VkGeometryNV")] [NativeName("Name", "pGeometries")] public GeometryNV* PGeometries; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureMemoryRequirementsInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureMemoryRequirementsInfoNV.gen.cs index 3b597c4d5f..7cced3d302 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 : IStructuredType { public AccelerationStructureMemoryRequirementsInfoNV ( @@ -68,5 +68,11 @@ public AccelerationStructureMemoryRequirementsInfoNV [NativeName("Type.Name", "VkAccelerationStructureNV")] [NativeName("Name", "accelerationStructure")] public AccelerationStructureNV AccelerationStructure; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureMemoryRequirementsInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureMotionInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureMotionInfoNV.gen.cs index cea6cc8378..d5b6aa34ca 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 : IStructuredType { public AccelerationStructureMotionInfoNV ( @@ -68,5 +68,11 @@ public AccelerationStructureMotionInfoNV [NativeName("Type.Name", "VkAccelerationStructureMotionInfoFlagsNV")] [NativeName("Name", "flags")] public uint Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureMotionInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureVersionInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AccelerationStructureVersionInfoKHR.gen.cs index c8d44f0f9b..41c96a1368 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 : IStructuredType { public AccelerationStructureVersionInfoKHR ( @@ -57,5 +57,11 @@ public AccelerationStructureVersionInfoKHR [NativeName("Type.Name", "uint8_t")] [NativeName("Name", "pVersionData")] public byte* PVersionData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AccelerationStructureVersionInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AcquireNextImageInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AcquireNextImageInfoKHR.gen.cs index b34ad6b20b..df643d3f90 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 : IStructuredType { public AcquireNextImageInfoKHR ( @@ -101,5 +101,11 @@ public AcquireNextImageInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "deviceMask")] public uint DeviceMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AcquireNextImageInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AcquireProfilingLockInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AcquireProfilingLockInfoKHR.gen.cs index 87c7e03350..dccdfde16a 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 : IStructuredType { public AcquireProfilingLockInfoKHR ( @@ -68,5 +68,11 @@ public AcquireProfilingLockInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "timeout")] public ulong Timeout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AcquireProfilingLockInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferFormatProperties2ANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferFormatProperties2ANDROID.gen.cs index 31ca7380b5..8d33250ac7 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 : IStructuredType { public AndroidHardwareBufferFormatProperties2ANDROID ( @@ -134,5 +134,11 @@ public AndroidHardwareBufferFormatProperties2ANDROID [NativeName("Type.Name", "VkChromaLocation")] [NativeName("Name", "suggestedYChromaOffset")] public ChromaLocation SuggestedYChromaOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AndroidHardwareBufferFormatProperties2Android; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferFormatPropertiesANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferFormatPropertiesANDROID.gen.cs index 9eb6649d87..3eb4e077d9 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 : IStructuredType { public AndroidHardwareBufferFormatPropertiesANDROID ( @@ -134,5 +134,11 @@ public AndroidHardwareBufferFormatPropertiesANDROID [NativeName("Type.Name", "VkChromaLocation")] [NativeName("Name", "suggestedYChromaOffset")] public ChromaLocation SuggestedYChromaOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AndroidHardwareBufferFormatPropertiesAndroid; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferPropertiesANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferPropertiesANDROID.gen.cs index 3b1ba26afd..97ee72708d 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 : IStructuredType { public AndroidHardwareBufferPropertiesANDROID ( @@ -68,5 +68,11 @@ public AndroidHardwareBufferPropertiesANDROID [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryTypeBits")] public uint MemoryTypeBits; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AndroidHardwareBufferPropertiesAndroid; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferUsageANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidHardwareBufferUsageANDROID.gen.cs index aba41e04b1..9ff1f87355 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 : IStructuredType { public AndroidHardwareBufferUsageANDROID ( @@ -57,5 +57,11 @@ public AndroidHardwareBufferUsageANDROID [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "androidHardwareBufferUsage")] public ulong AndroidHardwareBufferUsage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AndroidHardwareBufferUsageAndroid; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidSurfaceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AndroidSurfaceCreateInfoKHR.gen.cs index df24ec9705..1715ee95b6 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 : IStructuredType { public AndroidSurfaceCreateInfoKHR ( @@ -68,5 +68,11 @@ public AndroidSurfaceCreateInfoKHR [NativeName("Type.Name", "ANativeWindow")] [NativeName("Name", "window")] public nint* Window; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AndroidSurfaceCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ApplicationInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ApplicationInfo.gen.cs index 239cda566e..7d1a792f29 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 : IStructuredType { public ApplicationInfo ( @@ -101,5 +101,11 @@ public ApplicationInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "apiVersion")] public uint ApiVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ApplicationInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2.gen.cs index 6ea1723170..063910ebb6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentDescription2")] - public unsafe partial struct AttachmentDescription2 + public unsafe partial struct AttachmentDescription2 : IStructuredType { public AttachmentDescription2 ( @@ -145,5 +145,11 @@ public AttachmentDescription2 [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "finalLayout")] public ImageLayout FinalLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentDescription2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2KHR.gen.cs index a07f77a9e1..6cb0050d40 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescription2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentDescription2KHR")] - public unsafe partial struct AttachmentDescription2KHR + public unsafe partial struct AttachmentDescription2KHR : IStructuredType { public AttachmentDescription2KHR ( @@ -145,5 +145,11 @@ public AttachmentDescription2KHR [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "finalLayout")] public ImageLayout FinalLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentDescription2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayout.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayout.gen.cs index b0b93cff9f..b3e2871c7a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayout.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayout.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentDescriptionStencilLayout")] - public unsafe partial struct AttachmentDescriptionStencilLayout + public unsafe partial struct AttachmentDescriptionStencilLayout : IStructuredType { public AttachmentDescriptionStencilLayout ( @@ -68,5 +68,11 @@ public AttachmentDescriptionStencilLayout [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "stencilFinalLayout")] public ImageLayout StencilFinalLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentDescriptionStencilLayout; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayoutKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayoutKHR.gen.cs index 70bf2e2c11..db39063d32 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayoutKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentDescriptionStencilLayoutKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentDescriptionStencilLayoutKHR")] - public unsafe partial struct AttachmentDescriptionStencilLayoutKHR + public unsafe partial struct AttachmentDescriptionStencilLayoutKHR : IStructuredType { public AttachmentDescriptionStencilLayoutKHR ( @@ -68,5 +68,11 @@ public AttachmentDescriptionStencilLayoutKHR [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "stencilFinalLayout")] public ImageLayout StencilFinalLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentDescriptionStencilLayout; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2.gen.cs index c2ef53327c..43ff853905 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentReference2")] - public unsafe partial struct AttachmentReference2 + public unsafe partial struct AttachmentReference2 : IStructuredType { public AttachmentReference2 ( @@ -79,5 +79,11 @@ public AttachmentReference2 [NativeName("Type.Name", "VkImageAspectFlags")] [NativeName("Name", "aspectMask")] public ImageAspectFlags AspectMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentReference2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2KHR.gen.cs index 3b6bffe7cd..dccdf86a1b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReference2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentReference2KHR")] - public unsafe partial struct AttachmentReference2KHR + public unsafe partial struct AttachmentReference2KHR : IStructuredType { public AttachmentReference2KHR ( @@ -79,5 +79,11 @@ public AttachmentReference2KHR [NativeName("Type.Name", "VkImageAspectFlags")] [NativeName("Name", "aspectMask")] public ImageAspectFlags AspectMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentReference2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayout.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayout.gen.cs index 81f1952c68..a5ed805ee2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayout.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayout.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentReferenceStencilLayout")] - public unsafe partial struct AttachmentReferenceStencilLayout + public unsafe partial struct AttachmentReferenceStencilLayout : IStructuredType { public AttachmentReferenceStencilLayout ( @@ -57,5 +57,11 @@ public AttachmentReferenceStencilLayout [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "stencilLayout")] public ImageLayout StencilLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentReferenceStencilLayout; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayoutKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayoutKHR.gen.cs index 903f6b72ec..da45d23170 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayoutKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentReferenceStencilLayoutKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentReferenceStencilLayoutKHR")] - public unsafe partial struct AttachmentReferenceStencilLayoutKHR + public unsafe partial struct AttachmentReferenceStencilLayoutKHR : IStructuredType { public AttachmentReferenceStencilLayoutKHR ( @@ -57,5 +57,11 @@ public AttachmentReferenceStencilLayoutKHR [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "stencilLayout")] public ImageLayout StencilLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentReferenceStencilLayout; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoAMD.gen.cs index 8d83eda8f7..462f2005dd 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoAMD.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoAMD.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentSampleCountInfoAMD")] - public unsafe partial struct AttachmentSampleCountInfoAMD + public unsafe partial struct AttachmentSampleCountInfoAMD : IStructuredType { public AttachmentSampleCountInfoAMD ( @@ -79,5 +79,11 @@ public AttachmentSampleCountInfoAMD [NativeName("Type.Name", "VkSampleCountFlagBits")] [NativeName("Name", "depthStencilAttachmentSamples")] public SampleCountFlags DepthStencilAttachmentSamples; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentSampleCountInfoAmd; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoNV.gen.cs index b39f193fe5..7cf8049dc7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoNV.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/AttachmentSampleCountInfoNV.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkAttachmentSampleCountInfoNV")] - public unsafe partial struct AttachmentSampleCountInfoNV + public unsafe partial struct AttachmentSampleCountInfoNV : IStructuredType { public AttachmentSampleCountInfoNV ( @@ -79,5 +79,11 @@ public AttachmentSampleCountInfoNV [NativeName("Type.Name", "VkSampleCountFlagBits")] [NativeName("Name", "depthStencilAttachmentSamples")] public SampleCountFlags DepthStencilAttachmentSamples; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.AttachmentSampleCountInfoAmd; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BaseInStructure.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BaseInStructure.gen.cs index 3081af1381..3ee5fe7e18 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 : IStructuredType { public BaseInStructure ( @@ -46,5 +46,12 @@ 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; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BaseOutStructure.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BaseOutStructure.gen.cs index 1280c81c6c..3606a04f3e 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 : IStructuredType { public BaseOutStructure ( @@ -46,5 +46,12 @@ 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; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindAccelerationStructureMemoryInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindAccelerationStructureMemoryInfoNV.gen.cs index dbf7bff946..d90126fd7e 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 : IStructuredType { public BindAccelerationStructureMemoryInfoNV ( @@ -101,5 +101,11 @@ public BindAccelerationStructureMemoryInfoNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pDeviceIndices")] public uint* PDeviceIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindAccelerationStructureMemoryInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfo.gen.cs index 92bd72aa56..d3238749a2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindBufferMemoryDeviceGroupInfo")] - public unsafe partial struct BindBufferMemoryDeviceGroupInfo + public unsafe partial struct BindBufferMemoryDeviceGroupInfo : IStructuredType { public BindBufferMemoryDeviceGroupInfo ( @@ -68,5 +68,11 @@ public BindBufferMemoryDeviceGroupInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pDeviceIndices")] public uint* PDeviceIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindBufferMemoryDeviceGroupInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfoKHR.gen.cs index 50d996847a..41e7116608 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryDeviceGroupInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindBufferMemoryDeviceGroupInfoKHR")] - public unsafe partial struct BindBufferMemoryDeviceGroupInfoKHR + public unsafe partial struct BindBufferMemoryDeviceGroupInfoKHR : IStructuredType { public BindBufferMemoryDeviceGroupInfoKHR ( @@ -68,5 +68,11 @@ public BindBufferMemoryDeviceGroupInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pDeviceIndices")] public uint* PDeviceIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindBufferMemoryDeviceGroupInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfo.gen.cs index f495a0b5e3..310bdf0494 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindBufferMemoryInfo")] - public unsafe partial struct BindBufferMemoryInfo + public unsafe partial struct BindBufferMemoryInfo : IStructuredType { public BindBufferMemoryInfo ( @@ -79,5 +79,11 @@ public BindBufferMemoryInfo [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "memoryOffset")] public ulong MemoryOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindBufferMemoryInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfoKHR.gen.cs index 3b2d32aaf7..16a96e1bfe 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindBufferMemoryInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindBufferMemoryInfoKHR")] - public unsafe partial struct BindBufferMemoryInfoKHR + public unsafe partial struct BindBufferMemoryInfoKHR : IStructuredType { public BindBufferMemoryInfoKHR ( @@ -79,5 +79,11 @@ public BindBufferMemoryInfoKHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "memoryOffset")] public ulong MemoryOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindBufferMemoryInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfo.gen.cs index 050b4df12e..8f5ed82ddb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindImageMemoryDeviceGroupInfo")] - public unsafe partial struct BindImageMemoryDeviceGroupInfo + public unsafe partial struct BindImageMemoryDeviceGroupInfo : IStructuredType { public BindImageMemoryDeviceGroupInfo ( @@ -90,5 +90,11 @@ public BindImageMemoryDeviceGroupInfo [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "pSplitInstanceBindRegions")] public Rect2D* PSplitInstanceBindRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindImageMemoryDeviceGroupInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfoKHR.gen.cs index 60c8f7f09c..28602e2cab 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryDeviceGroupInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindImageMemoryDeviceGroupInfoKHR")] - public unsafe partial struct BindImageMemoryDeviceGroupInfoKHR + public unsafe partial struct BindImageMemoryDeviceGroupInfoKHR : IStructuredType { public BindImageMemoryDeviceGroupInfoKHR ( @@ -90,5 +90,11 @@ public BindImageMemoryDeviceGroupInfoKHR [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "pSplitInstanceBindRegions")] public Rect2D* PSplitInstanceBindRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindImageMemoryDeviceGroupInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfo.gen.cs index 16ffbab1e8..c4e5d4317c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindImageMemoryInfo")] - public unsafe partial struct BindImageMemoryInfo + public unsafe partial struct BindImageMemoryInfo : IStructuredType { public BindImageMemoryInfo ( @@ -79,5 +79,11 @@ public BindImageMemoryInfo [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "memoryOffset")] public ulong MemoryOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindImageMemoryInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfoKHR.gen.cs index 717f544584..f7fc97577b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemoryInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindImageMemoryInfoKHR")] - public unsafe partial struct BindImageMemoryInfoKHR + public unsafe partial struct BindImageMemoryInfoKHR : IStructuredType { public BindImageMemoryInfoKHR ( @@ -79,5 +79,11 @@ public BindImageMemoryInfoKHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "memoryOffset")] public ulong MemoryOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindImageMemoryInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemorySwapchainInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImageMemorySwapchainInfoKHR.gen.cs index 7177548469..8b9b277708 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 : IStructuredType { public BindImageMemorySwapchainInfoKHR ( @@ -68,5 +68,11 @@ public BindImageMemorySwapchainInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "imageIndex")] public uint ImageIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindImageMemorySwapchainInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfo.gen.cs index 8a49eb4d3e..08821b21ac 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindImagePlaneMemoryInfo")] - public unsafe partial struct BindImagePlaneMemoryInfo + public unsafe partial struct BindImagePlaneMemoryInfo : IStructuredType { public BindImagePlaneMemoryInfo ( @@ -57,5 +57,11 @@ public BindImagePlaneMemoryInfo [NativeName("Type.Name", "VkImageAspectFlagBits")] [NativeName("Name", "planeAspect")] public ImageAspectFlags PlaneAspect; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindImagePlaneMemoryInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfoKHR.gen.cs index 22a7f29c0e..7421eb72c5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BindImagePlaneMemoryInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBindImagePlaneMemoryInfoKHR")] - public unsafe partial struct BindImagePlaneMemoryInfoKHR + public unsafe partial struct BindImagePlaneMemoryInfoKHR : IStructuredType { public BindImagePlaneMemoryInfoKHR ( @@ -57,5 +57,11 @@ public BindImagePlaneMemoryInfoKHR [NativeName("Type.Name", "VkImageAspectFlagBits")] [NativeName("Name", "planeAspect")] public ImageAspectFlags PlaneAspect; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindImagePlaneMemoryInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BindSparseInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BindSparseInfo.gen.cs index 96182b369e..66596a1e78 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 : IStructuredType { public BindSparseInfo ( @@ -156,5 +156,11 @@ public BindSparseInfo [NativeName("Type.Name", "VkSemaphore")] [NativeName("Name", "pSignalSemaphores")] public Semaphore* PSignalSemaphores; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BindSparseInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BlitImageInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BlitImageInfo2KHR.gen.cs index 58693d0f62..e28272ffb3 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 : IStructuredType { public BlitImageInfo2KHR ( @@ -123,5 +123,11 @@ public BlitImageInfo2KHR [NativeName("Type.Name", "VkFilter")] [NativeName("Name", "filter")] public Filter Filter; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BlitImageInfo2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionBufferCreateInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionBufferCreateInfoFUCHSIA.gen.cs index a471940476..6111ac03a3 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 : IStructuredType { public BufferCollectionBufferCreateInfoFUCHSIA ( @@ -68,5 +68,11 @@ public BufferCollectionBufferCreateInfoFUCHSIA [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "index")] public uint Index; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferCollectionBufferCreateInfoFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionConstraintsInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionConstraintsInfoFUCHSIA.gen.cs index 3548b1b20d..c1a9ff1655 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 : IStructuredType { public BufferCollectionConstraintsInfoFUCHSIA ( @@ -101,5 +101,11 @@ public BufferCollectionConstraintsInfoFUCHSIA [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "minBufferCountForSharedSlack")] public uint MinBufferCountForSharedSlack; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferCollectionConstraintsInfoFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionCreateInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionCreateInfoFUCHSIA.gen.cs index e6b133d299..1fe7b01676 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 : IStructuredType { public BufferCollectionCreateInfoFUCHSIA ( @@ -57,5 +57,11 @@ public BufferCollectionCreateInfoFUCHSIA [NativeName("Type.Name", "zx_handle_t")] [NativeName("Name", "collectionToken")] public nint CollectionToken; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferCollectionCreateInfoFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionImageCreateInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionImageCreateInfoFUCHSIA.gen.cs index bb0662871c..76355da39c 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 : IStructuredType { public BufferCollectionImageCreateInfoFUCHSIA ( @@ -68,5 +68,11 @@ public BufferCollectionImageCreateInfoFUCHSIA [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "index")] public uint Index; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferCollectionImageCreateInfoFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionPropertiesFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCollectionPropertiesFUCHSIA.gen.cs index 39f694dce6..49d7b0f13d 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 : IStructuredType { public BufferCollectionPropertiesFUCHSIA ( @@ -167,5 +167,11 @@ public BufferCollectionPropertiesFUCHSIA [NativeName("Type.Name", "VkChromaLocation")] [NativeName("Name", "suggestedYChromaOffset")] public ChromaLocation SuggestedYChromaOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferCollectionPropertiesFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferConstraintsInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferConstraintsInfoFUCHSIA.gen.cs index 45b53c3441..875f604350 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 : IStructuredType { public BufferConstraintsInfoFUCHSIA ( @@ -79,5 +79,11 @@ public BufferConstraintsInfoFUCHSIA [NativeName("Type.Name", "VkBufferCollectionConstraintsInfoFUCHSIA")] [NativeName("Name", "bufferCollectionConstraints")] public BufferCollectionConstraintsInfoFUCHSIA BufferCollectionConstraints; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferConstraintsInfoFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCopy2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCopy2KHR.gen.cs index 7f9d443110..7a1bb6a2fd 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 : IStructuredType { public BufferCopy2KHR ( @@ -79,5 +79,11 @@ public BufferCopy2KHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "size")] public ulong Size; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferCopy2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferCreateInfo.gen.cs index b47963e280..620bffeb7d 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 : IStructuredType { public BufferCreateInfo ( @@ -112,5 +112,11 @@ public BufferCreateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pQueueFamilyIndices")] public uint* PQueueFamilyIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressCreateInfoEXT.gen.cs index 74e8486479..0241cfce00 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 : IStructuredType { public BufferDeviceAddressCreateInfoEXT ( @@ -57,5 +57,11 @@ public BufferDeviceAddressCreateInfoEXT [NativeName("Type.Name", "VkDeviceAddress")] [NativeName("Name", "deviceAddress")] public ulong DeviceAddress; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferDeviceAddressCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfo.gen.cs index 30d8c1dd29..1aa3733b03 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferDeviceAddressInfo")] - public unsafe partial struct BufferDeviceAddressInfo + public unsafe partial struct BufferDeviceAddressInfo : IStructuredType { public BufferDeviceAddressInfo ( @@ -57,5 +57,11 @@ public BufferDeviceAddressInfo [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferDeviceAddressInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoEXT.gen.cs index 4d45c89428..28b009e642 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferDeviceAddressInfoEXT")] - public unsafe partial struct BufferDeviceAddressInfoEXT + public unsafe partial struct BufferDeviceAddressInfoEXT : IStructuredType { public BufferDeviceAddressInfoEXT ( @@ -57,5 +57,11 @@ public BufferDeviceAddressInfoEXT [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferDeviceAddressInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoKHR.gen.cs index f0b2bb0446..ce1d3b841d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferDeviceAddressInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferDeviceAddressInfoKHR")] - public unsafe partial struct BufferDeviceAddressInfoKHR + public unsafe partial struct BufferDeviceAddressInfoKHR : IStructuredType { public BufferDeviceAddressInfoKHR ( @@ -57,5 +57,11 @@ public BufferDeviceAddressInfoKHR [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferDeviceAddressInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferImageCopy2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferImageCopy2KHR.gen.cs index 748c5cd857..ecaf4b3ba7 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 : IStructuredType { public BufferImageCopy2KHR ( @@ -112,5 +112,11 @@ public BufferImageCopy2KHR [NativeName("Type.Name", "VkExtent3D")] [NativeName("Name", "imageExtent")] public Extent3D ImageExtent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferImageCopy2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryBarrier.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryBarrier.gen.cs index 1f35d5b86a..455f04d295 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 : IStructuredType { public BufferMemoryBarrier ( @@ -123,5 +123,11 @@ public BufferMemoryBarrier [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "size")] public ulong Size; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferMemoryBarrier; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryBarrier2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryBarrier2KHR.gen.cs index 14a46390d8..8684363192 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 : IStructuredType { public BufferMemoryBarrier2KHR ( @@ -145,5 +145,11 @@ public BufferMemoryBarrier2KHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "size")] public ulong Size; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferMemoryBarrier2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2.gen.cs index f9d70a6876..5b1e416492 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferMemoryRequirementsInfo2")] - public unsafe partial struct BufferMemoryRequirementsInfo2 + public unsafe partial struct BufferMemoryRequirementsInfo2 : IStructuredType { public BufferMemoryRequirementsInfo2 ( @@ -57,5 +57,11 @@ public BufferMemoryRequirementsInfo2 [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferMemoryRequirementsInfo2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2KHR.gen.cs index aa20d10541..98fb577b17 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferMemoryRequirementsInfo2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferMemoryRequirementsInfo2KHR")] - public unsafe partial struct BufferMemoryRequirementsInfo2KHR + public unsafe partial struct BufferMemoryRequirementsInfo2KHR : IStructuredType { public BufferMemoryRequirementsInfo2KHR ( @@ -57,5 +57,11 @@ public BufferMemoryRequirementsInfo2KHR [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferMemoryRequirementsInfo2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfo.gen.cs index ee44d8b400..e382cf7352 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferOpaqueCaptureAddressCreateInfo")] - public unsafe partial struct BufferOpaqueCaptureAddressCreateInfo + public unsafe partial struct BufferOpaqueCaptureAddressCreateInfo : IStructuredType { public BufferOpaqueCaptureAddressCreateInfo ( @@ -57,5 +57,11 @@ public BufferOpaqueCaptureAddressCreateInfo [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "opaqueCaptureAddress")] public ulong OpaqueCaptureAddress; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferOpaqueCaptureAddressCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfoKHR.gen.cs index 1c90079609..44d075233f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferOpaqueCaptureAddressCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkBufferOpaqueCaptureAddressCreateInfoKHR")] - public unsafe partial struct BufferOpaqueCaptureAddressCreateInfoKHR + public unsafe partial struct BufferOpaqueCaptureAddressCreateInfoKHR : IStructuredType { public BufferOpaqueCaptureAddressCreateInfoKHR ( @@ -57,5 +57,11 @@ public BufferOpaqueCaptureAddressCreateInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "opaqueCaptureAddress")] public ulong OpaqueCaptureAddress; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferOpaqueCaptureAddressCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/BufferViewCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/BufferViewCreateInfo.gen.cs index 6ca904b2fb..fbf8022c7b 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 : IStructuredType { public BufferViewCreateInfo ( @@ -101,5 +101,11 @@ public BufferViewCreateInfo [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "range")] public ulong Range; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.BufferViewCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CalibratedTimestampInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CalibratedTimestampInfoEXT.gen.cs index 766a08d04c..e2c9cace4c 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 : IStructuredType { public CalibratedTimestampInfoEXT ( @@ -57,5 +57,11 @@ public CalibratedTimestampInfoEXT [NativeName("Type.Name", "VkTimeDomainEXT")] [NativeName("Name", "timeDomain")] public TimeDomainEXT TimeDomain; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CalibratedTimestampInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CheckpointData2NV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CheckpointData2NV.gen.cs index a4341792c5..c64d8d448f 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 : IStructuredType { public CheckpointData2NV ( @@ -68,5 +68,11 @@ public CheckpointData2NV [NativeName("Type.Name", "void")] [NativeName("Name", "pCheckpointMarker")] public void* PCheckpointMarker; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CheckpointData2NV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CheckpointDataNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CheckpointDataNV.gen.cs index fcedd9d29e..041210ebed 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 : IStructuredType { public CheckpointDataNV ( @@ -68,5 +68,11 @@ public CheckpointDataNV [NativeName("Type.Name", "void")] [NativeName("Name", "pCheckpointMarker")] public void* PCheckpointMarker; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CheckpointDataNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferAllocateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferAllocateInfo.gen.cs index 8b6aedc1e3..ef4b0ded37 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 : IStructuredType { public CommandBufferAllocateInfo ( @@ -79,5 +79,11 @@ public CommandBufferAllocateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "commandBufferCount")] public uint CommandBufferCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferAllocateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferBeginInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferBeginInfo.gen.cs index 42ba975c6f..0b2472c22a 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 : IStructuredType { public CommandBufferBeginInfo ( @@ -68,5 +68,11 @@ public CommandBufferBeginInfo [NativeName("Type.Name", "VkCommandBufferInheritanceInfo")] [NativeName("Name", "pInheritanceInfo")] public CommandBufferInheritanceInfo* PInheritanceInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferBeginInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceConditionalRenderingInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceConditionalRenderingInfoEXT.gen.cs index 8b4da9d925..6c1d62b11c 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 : IStructuredType { public CommandBufferInheritanceConditionalRenderingInfoEXT ( @@ -57,5 +57,11 @@ public CommandBufferInheritanceConditionalRenderingInfoEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "conditionalRenderingEnable")] public Bool32 ConditionalRenderingEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferInheritanceConditionalRenderingInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceInfo.gen.cs index 683489a159..1be5678943 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 : IStructuredType { public CommandBufferInheritanceInfo ( @@ -112,5 +112,11 @@ public CommandBufferInheritanceInfo [NativeName("Type.Name", "VkQueryPipelineStatisticFlags")] [NativeName("Name", "pipelineStatistics")] public QueryPipelineStatisticFlags PipelineStatistics; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferInheritanceInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceRenderPassTransformInfoQCOM.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceRenderPassTransformInfoQCOM.gen.cs index 38403fc2a6..249d1e4877 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 : IStructuredType { public CommandBufferInheritanceRenderPassTransformInfoQCOM ( @@ -68,5 +68,11 @@ public CommandBufferInheritanceRenderPassTransformInfoQCOM [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "renderArea")] public Rect2D RenderArea; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferInheritanceRenderPassTransformInfoQCom; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceRenderingInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceRenderingInfoKHR.gen.cs index e7ded3878e..8b512d7156 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 : IStructuredType { public CommandBufferInheritanceRenderingInfoKHR ( @@ -123,5 +123,11 @@ public CommandBufferInheritanceRenderingInfoKHR [NativeName("Type.Name", "VkSampleCountFlagBits")] [NativeName("Name", "rasterizationSamples")] public SampleCountFlags RasterizationSamples; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferInheritanceRenderingInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceViewportScissorInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferInheritanceViewportScissorInfoNV.gen.cs index 0682b2ab07..4909be1448 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 : IStructuredType { public CommandBufferInheritanceViewportScissorInfoNV ( @@ -79,5 +79,11 @@ public CommandBufferInheritanceViewportScissorInfoNV [NativeName("Type.Name", "VkViewport")] [NativeName("Name", "pViewportDepths")] public Viewport* PViewportDepths; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferInheritanceViewportScissorInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferSubmitInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandBufferSubmitInfoKHR.gen.cs index fbc518f865..c49eedcf1c 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 : IStructuredType { public CommandBufferSubmitInfoKHR ( @@ -68,5 +68,11 @@ public CommandBufferSubmitInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "deviceMask")] public uint DeviceMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandBufferSubmitInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CommandPoolCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CommandPoolCreateInfo.gen.cs index a4c690828b..06c39d6a34 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 : IStructuredType { public CommandPoolCreateInfo ( @@ -68,5 +68,11 @@ public CommandPoolCreateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "queueFamilyIndex")] public uint QueueFamilyIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CommandPoolCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ComputePipelineCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ComputePipelineCreateInfo.gen.cs index abe21d16ca..2f753ea301 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 : IStructuredType { public ComputePipelineCreateInfo ( @@ -101,5 +101,11 @@ public ComputePipelineCreateInfo [NativeName("Type.Name", "int32_t")] [NativeName("Name", "basePipelineIndex")] public int BasePipelineIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ComputePipelineCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ConditionalRenderingBeginInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ConditionalRenderingBeginInfoEXT.gen.cs index 32140f05b0..c7501e77b2 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 : IStructuredType { public ConditionalRenderingBeginInfoEXT ( @@ -79,5 +79,11 @@ public ConditionalRenderingBeginInfoEXT [NativeName("Type.Name", "VkConditionalRenderingFlagsEXT")] [NativeName("Name", "flags")] public ConditionalRenderingFlagsEXT Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ConditionalRenderingBeginInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CooperativeMatrixPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CooperativeMatrixPropertiesNV.gen.cs index a7cd5adbfe..2c6b289703 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 : IStructuredType { public CooperativeMatrixPropertiesNV ( @@ -134,5 +134,11 @@ public CooperativeMatrixPropertiesNV [NativeName("Type.Name", "VkScopeNV")] [NativeName("Name", "scope")] public ScopeNV Scope; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CooperativeMatrixPropertiesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyAccelerationStructureInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyAccelerationStructureInfoKHR.gen.cs index 9bf4e42f4e..e45a7b368d 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 : IStructuredType { public CopyAccelerationStructureInfoKHR ( @@ -79,5 +79,11 @@ public CopyAccelerationStructureInfoKHR [NativeName("Type.Name", "VkCopyAccelerationStructureModeKHR")] [NativeName("Name", "mode")] public CopyAccelerationStructureModeKHR Mode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyAccelerationStructureInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyAccelerationStructureToMemoryInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyAccelerationStructureToMemoryInfoKHR.gen.cs index 8dbae43af0..1fe1441ccd 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 : IStructuredType { public CopyAccelerationStructureToMemoryInfoKHR ( @@ -79,5 +79,11 @@ public CopyAccelerationStructureToMemoryInfoKHR [NativeName("Type.Name", "VkCopyAccelerationStructureModeKHR")] [NativeName("Name", "mode")] public CopyAccelerationStructureModeKHR Mode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyAccelerationStructureToMemoryInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyBufferInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyBufferInfo2KHR.gen.cs index 6250679329..9f8334fce9 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 : IStructuredType { public CopyBufferInfo2KHR ( @@ -90,5 +90,11 @@ public CopyBufferInfo2KHR [NativeName("Type.Name", "VkBufferCopy2KHR")] [NativeName("Name", "pRegions")] public BufferCopy2KHR* PRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyBufferInfo2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyBufferToImageInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyBufferToImageInfo2KHR.gen.cs index cb5b82a858..68ed5b8223 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 : IStructuredType { public CopyBufferToImageInfo2KHR ( @@ -101,5 +101,11 @@ public CopyBufferToImageInfo2KHR [NativeName("Type.Name", "VkBufferImageCopy2KHR")] [NativeName("Name", "pRegions")] public BufferImageCopy2KHR* PRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyBufferToImageInfo2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyCommandTransformInfoQCOM.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyCommandTransformInfoQCOM.gen.cs index f6f7e3fcc7..541eb88f7c 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 : IStructuredType { public CopyCommandTransformInfoQCOM ( @@ -57,5 +57,11 @@ public CopyCommandTransformInfoQCOM [NativeName("Type.Name", "VkSurfaceTransformFlagBitsKHR")] [NativeName("Name", "transform")] public SurfaceTransformFlagsKHR Transform; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyCommandTransformInfoQCom; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyDescriptorSet.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyDescriptorSet.gen.cs index 864a3d55fe..01a9e290fe 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 : IStructuredType { public CopyDescriptorSet ( @@ -123,5 +123,11 @@ public CopyDescriptorSet [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "descriptorCount")] public uint DescriptorCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyDescriptorSet; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyImageInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyImageInfo2KHR.gen.cs index 81f492848f..094b0e4ecd 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 : IStructuredType { public CopyImageInfo2KHR ( @@ -112,5 +112,11 @@ public CopyImageInfo2KHR [NativeName("Type.Name", "VkImageCopy2KHR")] [NativeName("Name", "pRegions")] public ImageCopy2KHR* PRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyImageInfo2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyImageToBufferInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyImageToBufferInfo2KHR.gen.cs index 82ef762892..3a6511756e 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 : IStructuredType { public CopyImageToBufferInfo2KHR ( @@ -101,5 +101,11 @@ public CopyImageToBufferInfo2KHR [NativeName("Type.Name", "VkBufferImageCopy2KHR")] [NativeName("Name", "pRegions")] public BufferImageCopy2KHR* PRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyImageToBufferInfo2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CopyMemoryToAccelerationStructureInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CopyMemoryToAccelerationStructureInfoKHR.gen.cs index 0d585a5313..b10445fce3 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 : IStructuredType { public CopyMemoryToAccelerationStructureInfoKHR ( @@ -79,5 +79,11 @@ public CopyMemoryToAccelerationStructureInfoKHR [NativeName("Type.Name", "VkCopyAccelerationStructureModeKHR")] [NativeName("Name", "mode")] public CopyAccelerationStructureModeKHR Mode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CopyMemoryToAccelerationStructureInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CuFunctionCreateInfoNVX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CuFunctionCreateInfoNVX.gen.cs index 8e56e46f55..37e7b142a3 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 : IStructuredType { public CuFunctionCreateInfoNVX ( @@ -68,5 +68,11 @@ public CuFunctionCreateInfoNVX [NativeName("Type.Name", "char")] [NativeName("Name", "pName")] public byte* PName; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CUFunctionCreateInfoNvx; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CuLaunchInfoNVX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CuLaunchInfoNVX.gen.cs index c62828123e..674ba2bd0a 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 : IStructuredType { public CuLaunchInfoNVX ( @@ -178,5 +178,11 @@ public CuLaunchInfoNVX [NativeName("Type.Name", "void")] [NativeName("Name", "pExtras")] public void* PExtras; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CULaunchInfoNvx; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/CuModuleCreateInfoNVX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/CuModuleCreateInfoNVX.gen.cs index 8fced1ee39..7ae74cd36f 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 : IStructuredType { public CuModuleCreateInfoNVX ( @@ -68,5 +68,11 @@ public CuModuleCreateInfoNVX [NativeName("Type.Name", "void")] [NativeName("Name", "pData")] public void* PData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.CUModuleCreateInfoNvx; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/D3D12FenceSubmitInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/D3D12FenceSubmitInfoKHR.gen.cs index 866e1edc91..4a63ceaf7d 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 : IStructuredType { public D3D12FenceSubmitInfoKHR ( @@ -90,5 +90,11 @@ public D3D12FenceSubmitInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pSignalSemaphoreValues")] public ulong* PSignalSemaphoreValues; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.D3D12FenceSubmitInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerMarkerInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerMarkerInfoEXT.gen.cs index 4cb107a54c..b1f7bd8ade 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 : IStructuredType { public DebugMarkerMarkerInfoEXT ( @@ -62,5 +62,11 @@ public DebugMarkerMarkerInfoEXT [NativeName("Type.Name", "float")] [NativeName("Name", "color")] public fixed float Color[4]; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugMarkerMarkerInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerObjectNameInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerObjectNameInfoEXT.gen.cs index 52c002d723..0e84eee9e3 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 : IStructuredType { public DebugMarkerObjectNameInfoEXT ( @@ -79,5 +79,11 @@ public DebugMarkerObjectNameInfoEXT [NativeName("Type.Name", "char")] [NativeName("Name", "pObjectName")] public byte* PObjectName; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugMarkerObjectNameInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerObjectTagInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugMarkerObjectTagInfoEXT.gen.cs index 081505dee9..e797c168cf 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 : IStructuredType { public DebugMarkerObjectTagInfoEXT ( @@ -101,5 +101,11 @@ public DebugMarkerObjectTagInfoEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pTag")] public void* PTag; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugMarkerObjectTagInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugReportCallbackCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugReportCallbackCreateInfoEXT.gen.cs index 04c99582b1..5111b48974 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 : IStructuredType { public DebugReportCallbackCreateInfoEXT ( @@ -79,5 +79,11 @@ public DebugReportCallbackCreateInfoEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pUserData")] public void* PUserData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugReportCallbackCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsLabelEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsLabelEXT.gen.cs index ebb4ad1328..2a8f4c608e 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 : IStructuredType { public DebugUtilsLabelEXT ( @@ -62,5 +62,11 @@ public DebugUtilsLabelEXT [NativeName("Type.Name", "float")] [NativeName("Name", "color")] public fixed float Color[4]; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugUtilsLabelExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsMessengerCallbackDataEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsMessengerCallbackDataEXT.gen.cs index f4f5e0e756..c53840406b 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 : IStructuredType { public DebugUtilsMessengerCallbackDataEXT ( @@ -156,5 +156,11 @@ public DebugUtilsMessengerCallbackDataEXT [NativeName("Type.Name", "VkDebugUtilsObjectNameInfoEXT")] [NativeName("Name", "pObjects")] public DebugUtilsObjectNameInfoEXT* PObjects; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugUtilsMessengerCallbackDataExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsMessengerCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsMessengerCreateInfoEXT.gen.cs index 63c7244638..6d1cffdd1f 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 : IStructuredType { public DebugUtilsMessengerCreateInfoEXT ( @@ -101,5 +101,11 @@ public DebugUtilsMessengerCreateInfoEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pUserData")] public void* PUserData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugUtilsMessengerCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsObjectNameInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsObjectNameInfoEXT.gen.cs index c0faf9595a..37da585358 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 : IStructuredType { public DebugUtilsObjectNameInfoEXT ( @@ -79,5 +79,11 @@ public DebugUtilsObjectNameInfoEXT [NativeName("Type.Name", "char")] [NativeName("Name", "pObjectName")] public byte* PObjectName; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugUtilsObjectNameInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsObjectTagInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DebugUtilsObjectTagInfoEXT.gen.cs index 3144818f6f..a7653a1573 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 : IStructuredType { public DebugUtilsObjectTagInfoEXT ( @@ -101,5 +101,11 @@ public DebugUtilsObjectTagInfoEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pTag")] public void* PTag; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DebugUtilsObjectTagInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationBufferCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationBufferCreateInfoNV.gen.cs index b18583d711..9a521f4f0d 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 : IStructuredType { public DedicatedAllocationBufferCreateInfoNV ( @@ -57,5 +57,11 @@ public DedicatedAllocationBufferCreateInfoNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "dedicatedAllocation")] public Bool32 DedicatedAllocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DedicatedAllocationBufferCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationImageCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationImageCreateInfoNV.gen.cs index f3c70dd674..39f24998fd 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 : IStructuredType { public DedicatedAllocationImageCreateInfoNV ( @@ -57,5 +57,11 @@ public DedicatedAllocationImageCreateInfoNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "dedicatedAllocation")] public Bool32 DedicatedAllocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DedicatedAllocationImageCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationMemoryAllocateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DedicatedAllocationMemoryAllocateInfoNV.gen.cs index c5d2855dc7..edd889b7fe 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 : IStructuredType { public DedicatedAllocationMemoryAllocateInfoNV ( @@ -68,5 +68,11 @@ public DedicatedAllocationMemoryAllocateInfoNV [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DedicatedAllocationMemoryAllocateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DependencyInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DependencyInfoKHR.gen.cs index 6ef7eae1e0..3ea601900b 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 : IStructuredType { public DependencyInfoKHR ( @@ -123,5 +123,11 @@ public DependencyInfoKHR [NativeName("Type.Name", "VkImageMemoryBarrier2KHR")] [NativeName("Name", "pImageMemoryBarriers")] public ImageMemoryBarrier2KHR* PImageMemoryBarriers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DependencyInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorPoolCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorPoolCreateInfo.gen.cs index b7ac59b9bb..1b4af4209f 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 : IStructuredType { public DescriptorPoolCreateInfo ( @@ -90,5 +90,11 @@ public DescriptorPoolCreateInfo [NativeName("Type.Name", "VkDescriptorPoolSize")] [NativeName("Name", "pPoolSizes")] public DescriptorPoolSize* PPoolSizes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorPoolCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorPoolInlineUniformBlockCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorPoolInlineUniformBlockCreateInfoEXT.gen.cs index a42a2f277e..797d87cb34 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 : IStructuredType { public DescriptorPoolInlineUniformBlockCreateInfoEXT ( @@ -57,5 +57,11 @@ public DescriptorPoolInlineUniformBlockCreateInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxInlineUniformBlockBindings")] public uint MaxInlineUniformBlockBindings; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorPoolInlineUniformBlockCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetAllocateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetAllocateInfo.gen.cs index e56c39db3e..cbcc15e1e2 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 : IStructuredType { public DescriptorSetAllocateInfo ( @@ -79,5 +79,11 @@ public DescriptorSetAllocateInfo [NativeName("Type.Name", "VkDescriptorSetLayout")] [NativeName("Name", "pSetLayouts")] public DescriptorSetLayout* PSetLayouts; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetAllocateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfo.gen.cs index c1a973580f..cc2daea791 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetLayoutBindingFlagsCreateInfo")] - public unsafe partial struct DescriptorSetLayoutBindingFlagsCreateInfo + public unsafe partial struct DescriptorSetLayoutBindingFlagsCreateInfo : IStructuredType { public DescriptorSetLayoutBindingFlagsCreateInfo ( @@ -68,5 +68,11 @@ public DescriptorSetLayoutBindingFlagsCreateInfo [NativeName("Type.Name", "VkDescriptorBindingFlags")] [NativeName("Name", "pBindingFlags")] public DescriptorBindingFlags* PBindingFlags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetLayoutBindingFlagsCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfoEXT.gen.cs index 8785c01ffd..5ce235f224 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutBindingFlagsCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetLayoutBindingFlagsCreateInfoEXT")] - public unsafe partial struct DescriptorSetLayoutBindingFlagsCreateInfoEXT + public unsafe partial struct DescriptorSetLayoutBindingFlagsCreateInfoEXT : IStructuredType { public DescriptorSetLayoutBindingFlagsCreateInfoEXT ( @@ -68,5 +68,11 @@ public DescriptorSetLayoutBindingFlagsCreateInfoEXT [NativeName("Type.Name", "VkDescriptorBindingFlags")] [NativeName("Name", "pBindingFlags")] public DescriptorBindingFlags* PBindingFlags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetLayoutBindingFlagsCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutCreateInfo.gen.cs index 44c2c25343..87ba88504c 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 : IStructuredType { public DescriptorSetLayoutCreateInfo ( @@ -79,5 +79,11 @@ public DescriptorSetLayoutCreateInfo [NativeName("Type.Name", "VkDescriptorSetLayoutBinding")] [NativeName("Name", "pBindings")] public DescriptorSetLayoutBinding* PBindings; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetLayoutCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupport.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupport.gen.cs index aff486ce38..3012b7035a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupport.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupport.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetLayoutSupport")] - public unsafe partial struct DescriptorSetLayoutSupport + public unsafe partial struct DescriptorSetLayoutSupport : IStructuredType { public DescriptorSetLayoutSupport ( @@ -57,5 +57,11 @@ public DescriptorSetLayoutSupport [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "supported")] public Bool32 Supported; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetLayoutSupport; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupportKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupportKHR.gen.cs index f2078864cb..f099eefcc1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupportKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetLayoutSupportKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetLayoutSupportKHR")] - public unsafe partial struct DescriptorSetLayoutSupportKHR + public unsafe partial struct DescriptorSetLayoutSupportKHR : IStructuredType { public DescriptorSetLayoutSupportKHR ( @@ -57,5 +57,11 @@ public DescriptorSetLayoutSupportKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "supported")] public Bool32 Supported; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetLayoutSupport; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfo.gen.cs index c6d04b5760..74ab1965aa 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetVariableDescriptorCountAllocateInfo")] - public unsafe partial struct DescriptorSetVariableDescriptorCountAllocateInfo + public unsafe partial struct DescriptorSetVariableDescriptorCountAllocateInfo : IStructuredType { public DescriptorSetVariableDescriptorCountAllocateInfo ( @@ -68,5 +68,11 @@ public DescriptorSetVariableDescriptorCountAllocateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pDescriptorCounts")] public uint* PDescriptorCounts; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetVariableDescriptorCountAllocateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfoEXT.gen.cs index f40c87ed2e..37bf89dd70 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountAllocateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetVariableDescriptorCountAllocateInfoEXT")] - public unsafe partial struct DescriptorSetVariableDescriptorCountAllocateInfoEXT + public unsafe partial struct DescriptorSetVariableDescriptorCountAllocateInfoEXT : IStructuredType { public DescriptorSetVariableDescriptorCountAllocateInfoEXT ( @@ -68,5 +68,11 @@ public DescriptorSetVariableDescriptorCountAllocateInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pDescriptorCounts")] public uint* PDescriptorCounts; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetVariableDescriptorCountAllocateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupport.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupport.gen.cs index bd4d204d04..2eaedb875f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupport.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupport.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetVariableDescriptorCountLayoutSupport")] - public unsafe partial struct DescriptorSetVariableDescriptorCountLayoutSupport + public unsafe partial struct DescriptorSetVariableDescriptorCountLayoutSupport : IStructuredType { public DescriptorSetVariableDescriptorCountLayoutSupport ( @@ -57,5 +57,11 @@ public DescriptorSetVariableDescriptorCountLayoutSupport [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxVariableDescriptorCount")] public uint MaxVariableDescriptorCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetVariableDescriptorCountLayoutSupport; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupportEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupportEXT.gen.cs index e0fd5f9ae6..2ffd6155b3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupportEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorSetVariableDescriptorCountLayoutSupportEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorSetVariableDescriptorCountLayoutSupportEXT")] - public unsafe partial struct DescriptorSetVariableDescriptorCountLayoutSupportEXT + public unsafe partial struct DescriptorSetVariableDescriptorCountLayoutSupportEXT : IStructuredType { public DescriptorSetVariableDescriptorCountLayoutSupportEXT ( @@ -57,5 +57,11 @@ public DescriptorSetVariableDescriptorCountLayoutSupportEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxVariableDescriptorCount")] public uint MaxVariableDescriptorCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorSetVariableDescriptorCountLayoutSupport; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfo.gen.cs index 514657ae97..4731848715 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorUpdateTemplateCreateInfo")] - public unsafe partial struct DescriptorUpdateTemplateCreateInfo + public unsafe partial struct DescriptorUpdateTemplateCreateInfo : IStructuredType { public DescriptorUpdateTemplateCreateInfo ( @@ -134,5 +134,11 @@ public DescriptorUpdateTemplateCreateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "set")] public uint Set; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorUpdateTemplateCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfoKHR.gen.cs index 416fbea6d4..876db9a45e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DescriptorUpdateTemplateCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDescriptorUpdateTemplateCreateInfoKHR")] - public unsafe partial struct DescriptorUpdateTemplateCreateInfoKHR + public unsafe partial struct DescriptorUpdateTemplateCreateInfoKHR : IStructuredType { public DescriptorUpdateTemplateCreateInfoKHR ( @@ -134,5 +134,11 @@ public DescriptorUpdateTemplateCreateInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "set")] public uint Set; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DescriptorUpdateTemplateCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceBufferMemoryRequirementsKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceBufferMemoryRequirementsKHR.gen.cs index 9cb47ba0f0..91c5f6b521 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 : IStructuredType { public DeviceBufferMemoryRequirementsKHR ( @@ -57,5 +57,11 @@ public DeviceBufferMemoryRequirementsKHR [NativeName("Type.Name", "VkBufferCreateInfo")] [NativeName("Name", "pCreateInfo")] public BufferCreateInfo* PCreateInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceBufferMemoryRequirementsKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceCreateInfo.gen.cs index 3310a31fb4..a45ce23282 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 : IStructuredType { public DeviceCreateInfo ( @@ -134,5 +134,11 @@ public DeviceCreateInfo [NativeName("Type.Name", "VkPhysicalDeviceFeatures")] [NativeName("Name", "pEnabledFeatures")] public PhysicalDeviceFeatures* PEnabledFeatures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceDeviceMemoryReportCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceDeviceMemoryReportCreateInfoEXT.gen.cs index 00eb7571b9..517a0d20b7 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 : IStructuredType { public DeviceDeviceMemoryReportCreateInfoEXT ( @@ -79,5 +79,11 @@ public DeviceDeviceMemoryReportCreateInfoEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pUserData")] public void* PUserData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceDeviceMemoryReportCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceDiagnosticsConfigCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceDiagnosticsConfigCreateInfoNV.gen.cs index 0c1045b866..d7bad36f2d 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 : IStructuredType { public DeviceDiagnosticsConfigCreateInfoNV ( @@ -57,5 +57,11 @@ public DeviceDiagnosticsConfigCreateInfoNV [NativeName("Type.Name", "VkDeviceDiagnosticsConfigFlagsNV")] [NativeName("Name", "flags")] public DeviceDiagnosticsConfigFlagsNV Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceDiagnosticsConfigCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceEventInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceEventInfoEXT.gen.cs index 9b999ca658..3fef4bce44 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 : IStructuredType { public DeviceEventInfoEXT ( @@ -57,5 +57,11 @@ public DeviceEventInfoEXT [NativeName("Type.Name", "VkDeviceEventTypeEXT")] [NativeName("Name", "deviceEvent")] public DeviceEventTypeEXT DeviceEvent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceEventInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfo.gen.cs index ff4daa66a2..f39eade066 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupBindSparseInfo")] - public unsafe partial struct DeviceGroupBindSparseInfo + public unsafe partial struct DeviceGroupBindSparseInfo : IStructuredType { public DeviceGroupBindSparseInfo ( @@ -68,5 +68,11 @@ public DeviceGroupBindSparseInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryDeviceIndex")] public uint MemoryDeviceIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupBindSparseInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfoKHR.gen.cs index 05c3f46006..c7baa62265 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupBindSparseInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupBindSparseInfoKHR")] - public unsafe partial struct DeviceGroupBindSparseInfoKHR + public unsafe partial struct DeviceGroupBindSparseInfoKHR : IStructuredType { public DeviceGroupBindSparseInfoKHR ( @@ -68,5 +68,11 @@ public DeviceGroupBindSparseInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryDeviceIndex")] public uint MemoryDeviceIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupBindSparseInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfo.gen.cs index 5a705b8847..16b9be0e00 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupCommandBufferBeginInfo")] - public unsafe partial struct DeviceGroupCommandBufferBeginInfo + public unsafe partial struct DeviceGroupCommandBufferBeginInfo : IStructuredType { public DeviceGroupCommandBufferBeginInfo ( @@ -57,5 +57,11 @@ public DeviceGroupCommandBufferBeginInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "deviceMask")] public uint DeviceMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupCommandBufferBeginInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfoKHR.gen.cs index 919187368b..021bd01103 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupCommandBufferBeginInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupCommandBufferBeginInfoKHR")] - public unsafe partial struct DeviceGroupCommandBufferBeginInfoKHR + public unsafe partial struct DeviceGroupCommandBufferBeginInfoKHR : IStructuredType { public DeviceGroupCommandBufferBeginInfoKHR ( @@ -57,5 +57,11 @@ public DeviceGroupCommandBufferBeginInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "deviceMask")] public uint DeviceMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupCommandBufferBeginInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfo.gen.cs index d678acf328..9463c390cd 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupDeviceCreateInfo")] - public unsafe partial struct DeviceGroupDeviceCreateInfo + public unsafe partial struct DeviceGroupDeviceCreateInfo : IStructuredType { public DeviceGroupDeviceCreateInfo ( @@ -68,5 +68,11 @@ public DeviceGroupDeviceCreateInfo [NativeName("Type.Name", "VkPhysicalDevice")] [NativeName("Name", "pPhysicalDevices")] public PhysicalDevice* PPhysicalDevices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupDeviceCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfoKHR.gen.cs index 52103ac0e2..91184270ad 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupDeviceCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupDeviceCreateInfoKHR")] - public unsafe partial struct DeviceGroupDeviceCreateInfoKHR + public unsafe partial struct DeviceGroupDeviceCreateInfoKHR : IStructuredType { public DeviceGroupDeviceCreateInfoKHR ( @@ -68,5 +68,11 @@ public DeviceGroupDeviceCreateInfoKHR [NativeName("Type.Name", "VkPhysicalDevice")] [NativeName("Name", "pPhysicalDevices")] public PhysicalDevice* PPhysicalDevices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupDeviceCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupPresentCapabilitiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupPresentCapabilitiesKHR.gen.cs index 609ea5d256..d7afc34c6b 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 : IStructuredType { public DeviceGroupPresentCapabilitiesKHR ( @@ -62,5 +62,11 @@ public DeviceGroupPresentCapabilitiesKHR [NativeName("Type.Name", "VkDeviceGroupPresentModeFlagsKHR")] [NativeName("Name", "modes")] public DeviceGroupPresentModeFlagsKHR Modes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupPresentCapabilitiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupPresentInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupPresentInfoKHR.gen.cs index 7dcf359914..fc17c18b74 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 : IStructuredType { public DeviceGroupPresentInfoKHR ( @@ -79,5 +79,11 @@ public DeviceGroupPresentInfoKHR [NativeName("Type.Name", "VkDeviceGroupPresentModeFlagBitsKHR")] [NativeName("Name", "mode")] public DeviceGroupPresentModeFlagsKHR Mode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupPresentInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfo.gen.cs index 739866371d..1f4fe52f44 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupRenderPassBeginInfo")] - public unsafe partial struct DeviceGroupRenderPassBeginInfo + public unsafe partial struct DeviceGroupRenderPassBeginInfo : IStructuredType { public DeviceGroupRenderPassBeginInfo ( @@ -79,5 +79,11 @@ public DeviceGroupRenderPassBeginInfo [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "pDeviceRenderAreas")] public Rect2D* PDeviceRenderAreas; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupRenderPassBeginInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfoKHR.gen.cs index e23ce7ff95..7739ce3f8e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupRenderPassBeginInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupRenderPassBeginInfoKHR")] - public unsafe partial struct DeviceGroupRenderPassBeginInfoKHR + public unsafe partial struct DeviceGroupRenderPassBeginInfoKHR : IStructuredType { public DeviceGroupRenderPassBeginInfoKHR ( @@ -79,5 +79,11 @@ public DeviceGroupRenderPassBeginInfoKHR [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "pDeviceRenderAreas")] public Rect2D* PDeviceRenderAreas; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupRenderPassBeginInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfo.gen.cs index 713c3bda01..a6af28bb69 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupSubmitInfo")] - public unsafe partial struct DeviceGroupSubmitInfo + public unsafe partial struct DeviceGroupSubmitInfo : IStructuredType { public DeviceGroupSubmitInfo ( @@ -112,5 +112,11 @@ public DeviceGroupSubmitInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pSignalSemaphoreDeviceIndices")] public uint* PSignalSemaphoreDeviceIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupSubmitInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfoKHR.gen.cs index 44bbc3e4d8..21da7826ff 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSubmitInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceGroupSubmitInfoKHR")] - public unsafe partial struct DeviceGroupSubmitInfoKHR + public unsafe partial struct DeviceGroupSubmitInfoKHR : IStructuredType { public DeviceGroupSubmitInfoKHR ( @@ -112,5 +112,11 @@ public DeviceGroupSubmitInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pSignalSemaphoreDeviceIndices")] public uint* PSignalSemaphoreDeviceIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupSubmitInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSwapchainCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceGroupSwapchainCreateInfoKHR.gen.cs index 06e676a452..99717ec378 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 : IStructuredType { public DeviceGroupSwapchainCreateInfoKHR ( @@ -57,5 +57,11 @@ public DeviceGroupSwapchainCreateInfoKHR [NativeName("Type.Name", "VkDeviceGroupPresentModeFlagsKHR")] [NativeName("Name", "modes")] public DeviceGroupPresentModeFlagsKHR Modes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceGroupSwapchainCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceImageMemoryRequirementsKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceImageMemoryRequirementsKHR.gen.cs index 13965ead42..e0d90ce398 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 : IStructuredType { public DeviceImageMemoryRequirementsKHR ( @@ -68,5 +68,11 @@ public DeviceImageMemoryRequirementsKHR [NativeName("Type.Name", "VkImageAspectFlagBits")] [NativeName("Name", "planeAspect")] public ImageAspectFlags PlaneAspect; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceImageMemoryRequirementsKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfo.gen.cs index 1b191c29fa..856b4a9ec8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceMemoryOpaqueCaptureAddressInfo")] - public unsafe partial struct DeviceMemoryOpaqueCaptureAddressInfo + public unsafe partial struct DeviceMemoryOpaqueCaptureAddressInfo : IStructuredType { public DeviceMemoryOpaqueCaptureAddressInfo ( @@ -57,5 +57,11 @@ public DeviceMemoryOpaqueCaptureAddressInfo [NativeName("Type.Name", "VkDeviceMemory")] [NativeName("Name", "memory")] public DeviceMemory Memory; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceMemoryOpaqueCaptureAddressInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfoKHR.gen.cs index 9c031ab7c9..337475de0b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOpaqueCaptureAddressInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkDeviceMemoryOpaqueCaptureAddressInfoKHR")] - public unsafe partial struct DeviceMemoryOpaqueCaptureAddressInfoKHR + public unsafe partial struct DeviceMemoryOpaqueCaptureAddressInfoKHR : IStructuredType { public DeviceMemoryOpaqueCaptureAddressInfoKHR ( @@ -57,5 +57,11 @@ public DeviceMemoryOpaqueCaptureAddressInfoKHR [NativeName("Type.Name", "VkDeviceMemory")] [NativeName("Name", "memory")] public DeviceMemory Memory; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceMemoryOpaqueCaptureAddressInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOverallocationCreateInfoAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryOverallocationCreateInfoAMD.gen.cs index 3b1cb07ead..1a611d3110 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 : IStructuredType { public DeviceMemoryOverallocationCreateInfoAMD ( @@ -57,5 +57,11 @@ public DeviceMemoryOverallocationCreateInfoAMD [NativeName("Type.Name", "VkMemoryOverallocationBehaviorAMD")] [NativeName("Name", "overallocationBehavior")] public MemoryOverallocationBehaviorAMD OverallocationBehavior; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceMemoryOverallocationCreateInfoAmd; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryReportCallbackDataEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceMemoryReportCallbackDataEXT.gen.cs index 3a5c7318ce..0bd3911fdf 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 : IStructuredType { public DeviceMemoryReportCallbackDataEXT ( @@ -123,5 +123,11 @@ public DeviceMemoryReportCallbackDataEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "heapIndex")] public uint HeapIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceMemoryReportCallbackDataExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DevicePrivateDataCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DevicePrivateDataCreateInfoEXT.gen.cs index 88e3416cbc..8ba97324e0 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 : IStructuredType { public DevicePrivateDataCreateInfoEXT ( @@ -57,5 +57,11 @@ public DevicePrivateDataCreateInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "privateDataSlotRequestCount")] public uint PrivateDataSlotRequestCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DevicePrivateDataCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueCreateInfo.gen.cs index b4cdf43bf8..19e09761c3 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 : IStructuredType { public DeviceQueueCreateInfo ( @@ -90,5 +90,11 @@ public DeviceQueueCreateInfo [NativeName("Type.Name", "float")] [NativeName("Name", "pQueuePriorities")] public float* PQueuePriorities; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceQueueCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueGlobalPriorityCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueGlobalPriorityCreateInfoEXT.gen.cs index ed5a83b240..5e04e5ced9 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 : IStructuredType { public DeviceQueueGlobalPriorityCreateInfoEXT ( @@ -57,5 +57,11 @@ public DeviceQueueGlobalPriorityCreateInfoEXT [NativeName("Type.Name", "VkQueueGlobalPriorityEXT")] [NativeName("Name", "globalPriority")] public QueueGlobalPriorityEXT GlobalPriority; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceQueueGlobalPriorityCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueInfo2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DeviceQueueInfo2.gen.cs index 830f6cf6f6..65befac25f 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 : IStructuredType { public DeviceQueueInfo2 ( @@ -79,5 +79,11 @@ public DeviceQueueInfo2 [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "queueIndex")] public uint QueueIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DeviceQueueInfo2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DirectFBSurfaceCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DirectFBSurfaceCreateInfoEXT.gen.cs index 687cc0f0e7..c024c0e558 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 : IStructuredType { public DirectFBSurfaceCreateInfoEXT ( @@ -79,5 +79,11 @@ public DirectFBSurfaceCreateInfoEXT [NativeName("Type.Name", "IDirectFBSurface")] [NativeName("Name", "surface")] public nint Surface; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DirectfbSurfaceCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayEventInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayEventInfoEXT.gen.cs index ce61acafa7..e04e6e3a75 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 : IStructuredType { public DisplayEventInfoEXT ( @@ -57,5 +57,11 @@ public DisplayEventInfoEXT [NativeName("Type.Name", "VkDisplayEventTypeEXT")] [NativeName("Name", "displayEvent")] public DisplayEventTypeEXT DisplayEvent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayEventInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayModeCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayModeCreateInfoKHR.gen.cs index 987e6c38be..170aef6da4 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 : IStructuredType { public DisplayModeCreateInfoKHR ( @@ -68,5 +68,11 @@ public DisplayModeCreateInfoKHR [NativeName("Type.Name", "VkDisplayModeParametersKHR")] [NativeName("Name", "parameters")] public DisplayModeParametersKHR Parameters; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayModeCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayModeProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayModeProperties2KHR.gen.cs index 6a618c1eef..6a05c6213c 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 : IStructuredType { public DisplayModeProperties2KHR ( @@ -57,5 +57,11 @@ public DisplayModeProperties2KHR [NativeName("Type.Name", "VkDisplayModePropertiesKHR")] [NativeName("Name", "displayModeProperties")] public DisplayModePropertiesKHR DisplayModeProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayModeProperties2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayNativeHdrSurfaceCapabilitiesAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayNativeHdrSurfaceCapabilitiesAMD.gen.cs index e9add12380..186d43b541 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 : IStructuredType { public DisplayNativeHdrSurfaceCapabilitiesAMD ( @@ -57,5 +57,11 @@ public DisplayNativeHdrSurfaceCapabilitiesAMD [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "localDimmingSupport")] public Bool32 LocalDimmingSupport; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayNativeHdrSurfaceCapabilitiesAmd; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneCapabilities2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneCapabilities2KHR.gen.cs index 52c24fec5d..e7616eb301 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 : IStructuredType { public DisplayPlaneCapabilities2KHR ( @@ -57,5 +57,11 @@ public DisplayPlaneCapabilities2KHR [NativeName("Type.Name", "VkDisplayPlaneCapabilitiesKHR")] [NativeName("Name", "capabilities")] public DisplayPlaneCapabilitiesKHR Capabilities; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayPlaneCapabilities2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneInfo2KHR.gen.cs index dba6c81d82..d92784bf9f 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 : IStructuredType { public DisplayPlaneInfo2KHR ( @@ -68,5 +68,11 @@ public DisplayPlaneInfo2KHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "planeIndex")] public uint PlaneIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayPlaneInfo2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPlaneProperties2KHR.gen.cs index e227b32d89..08dcaead08 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 : IStructuredType { public DisplayPlaneProperties2KHR ( @@ -57,5 +57,11 @@ public DisplayPlaneProperties2KHR [NativeName("Type.Name", "VkDisplayPlanePropertiesKHR")] [NativeName("Name", "displayPlaneProperties")] public DisplayPlanePropertiesKHR DisplayPlaneProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayPlaneProperties2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPowerInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPowerInfoEXT.gen.cs index 18faa54b1d..afb807d81c 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 : IStructuredType { public DisplayPowerInfoEXT ( @@ -57,5 +57,11 @@ public DisplayPowerInfoEXT [NativeName("Type.Name", "VkDisplayPowerStateEXT")] [NativeName("Name", "powerState")] public DisplayPowerStateEXT PowerState; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayPowerInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPresentInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayPresentInfoKHR.gen.cs index 1419fd0b27..44601495b5 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 : IStructuredType { public DisplayPresentInfoKHR ( @@ -79,5 +79,11 @@ public DisplayPresentInfoKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "persistent")] public Bool32 Persistent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayPresentInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplayProperties2KHR.gen.cs index 8ab2def3e0..91bfde46b0 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 : IStructuredType { public DisplayProperties2KHR ( @@ -57,5 +57,11 @@ public DisplayProperties2KHR [NativeName("Type.Name", "VkDisplayPropertiesKHR")] [NativeName("Name", "displayProperties")] public DisplayPropertiesKHR DisplayProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplayProperties2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DisplaySurfaceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DisplaySurfaceCreateInfoKHR.gen.cs index 180a0878c1..050fdc4476 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 : IStructuredType { public DisplaySurfaceCreateInfoKHR ( @@ -134,5 +134,11 @@ public DisplaySurfaceCreateInfoKHR [NativeName("Type.Name", "VkExtent2D")] [NativeName("Name", "imageExtent")] public Extent2D ImageExtent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DisplaySurfaceCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DrmFormatModifierPropertiesList2EXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DrmFormatModifierPropertiesList2EXT.gen.cs index a03ec09869..c4ab795ea4 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 : IStructuredType { public DrmFormatModifierPropertiesList2EXT ( @@ -68,5 +68,11 @@ public DrmFormatModifierPropertiesList2EXT [NativeName("Type.Name", "VkDrmFormatModifierProperties2EXT")] [NativeName("Name", "pDrmFormatModifierProperties")] public DrmFormatModifierProperties2EXT* PDrmFormatModifierProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DrmFormatModifierPropertiesList2Ext; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/DrmFormatModifierPropertiesListEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/DrmFormatModifierPropertiesListEXT.gen.cs index d78370a026..4faa1a0c90 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 : IStructuredType { public DrmFormatModifierPropertiesListEXT ( @@ -68,5 +68,11 @@ public DrmFormatModifierPropertiesListEXT [NativeName("Type.Name", "VkDrmFormatModifierPropertiesEXT")] [NativeName("Name", "pDrmFormatModifierProperties")] public DrmFormatModifierPropertiesEXT* PDrmFormatModifierProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.DrmFormatModifierPropertiesListExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/EventCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/EventCreateInfo.gen.cs index 577afba1eb..237369e99b 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 : IStructuredType { public EventCreateInfo ( @@ -57,5 +57,11 @@ public EventCreateInfo [NativeName("Type.Name", "VkEventCreateFlags")] [NativeName("Name", "flags")] public EventCreateFlags Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.EventCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfo.gen.cs index 71b8504487..539c7b7761 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportFenceCreateInfo")] - public unsafe partial struct ExportFenceCreateInfo + public unsafe partial struct ExportFenceCreateInfo : IStructuredType { public ExportFenceCreateInfo ( @@ -57,5 +57,11 @@ public ExportFenceCreateInfo [NativeName("Type.Name", "VkExternalFenceHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalFenceHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportFenceCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfoKHR.gen.cs index 85e4e86682..d9771c7ebd 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportFenceCreateInfoKHR")] - public unsafe partial struct ExportFenceCreateInfoKHR + public unsafe partial struct ExportFenceCreateInfoKHR : IStructuredType { public ExportFenceCreateInfoKHR ( @@ -57,5 +57,11 @@ public ExportFenceCreateInfoKHR [NativeName("Type.Name", "VkExternalFenceHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalFenceHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportFenceCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportFenceWin32HandleInfoKHR.gen.cs index d3c475a240..ca1a8acd93 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 : IStructuredType { public ExportFenceWin32HandleInfoKHR ( @@ -79,5 +79,11 @@ public ExportFenceWin32HandleInfoKHR [NativeName("Type.Name", "LPCWSTR")] [NativeName("Name", "name")] public nint Name; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportFenceWin32HandleInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfo.gen.cs index 02c46dd224..d526cdca89 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportMemoryAllocateInfo")] - public unsafe partial struct ExportMemoryAllocateInfo + public unsafe partial struct ExportMemoryAllocateInfo : IStructuredType { public ExportMemoryAllocateInfo ( @@ -57,5 +57,11 @@ public ExportMemoryAllocateInfo [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportMemoryAllocateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfoKHR.gen.cs index 846acfd3fd..bc0d101b8b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportMemoryAllocateInfoKHR")] - public unsafe partial struct ExportMemoryAllocateInfoKHR + public unsafe partial struct ExportMemoryAllocateInfoKHR : IStructuredType { public ExportMemoryAllocateInfoKHR ( @@ -57,5 +57,11 @@ public ExportMemoryAllocateInfoKHR [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportMemoryAllocateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryAllocateInfoNV.gen.cs index 742af2b449..c35c95aeb4 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 : IStructuredType { public ExportMemoryAllocateInfoNV ( @@ -57,5 +57,11 @@ public ExportMemoryAllocateInfoNV [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagsNV")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlagsNV HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportMemoryAllocateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryWin32HandleInfoKHR.gen.cs index 4fb153ddc3..3496bd33af 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 : IStructuredType { public ExportMemoryWin32HandleInfoKHR ( @@ -79,5 +79,11 @@ public ExportMemoryWin32HandleInfoKHR [NativeName("Type.Name", "LPCWSTR")] [NativeName("Name", "name")] public nint Name; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportMemoryWin32HandleInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryWin32HandleInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportMemoryWin32HandleInfoNV.gen.cs index e9db8326b1..cf4884c606 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 : IStructuredType { public ExportMemoryWin32HandleInfoNV ( @@ -68,5 +68,11 @@ public ExportMemoryWin32HandleInfoNV [NativeName("Type.Name", "DWORD")] [NativeName("Name", "dwAccess")] public int DwAccess; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportMemoryWin32HandleInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfo.gen.cs index d7300de420..c3123d360c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportSemaphoreCreateInfo")] - public unsafe partial struct ExportSemaphoreCreateInfo + public unsafe partial struct ExportSemaphoreCreateInfo : IStructuredType { public ExportSemaphoreCreateInfo ( @@ -57,5 +57,11 @@ public ExportSemaphoreCreateInfo [NativeName("Type.Name", "VkExternalSemaphoreHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalSemaphoreHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportSemaphoreCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfoKHR.gen.cs index 5d7a958bdf..53e2e7e0c7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExportSemaphoreCreateInfoKHR")] - public unsafe partial struct ExportSemaphoreCreateInfoKHR + public unsafe partial struct ExportSemaphoreCreateInfoKHR : IStructuredType { public ExportSemaphoreCreateInfoKHR ( @@ -57,5 +57,11 @@ public ExportSemaphoreCreateInfoKHR [NativeName("Type.Name", "VkExternalSemaphoreHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalSemaphoreHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportSemaphoreCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExportSemaphoreWin32HandleInfoKHR.gen.cs index 1d22e118b3..533721fe71 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 : IStructuredType { public ExportSemaphoreWin32HandleInfoKHR ( @@ -79,5 +79,11 @@ public ExportSemaphoreWin32HandleInfoKHR [NativeName("Type.Name", "LPCWSTR")] [NativeName("Name", "name")] public nint Name; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExportSemaphoreWin32HandleInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferProperties.gen.cs index 08f408a93b..0d34beeea3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalBufferProperties")] - public unsafe partial struct ExternalBufferProperties + public unsafe partial struct ExternalBufferProperties : IStructuredType { public ExternalBufferProperties ( @@ -57,5 +57,11 @@ public ExternalBufferProperties [NativeName("Type.Name", "VkExternalMemoryProperties")] [NativeName("Name", "externalMemoryProperties")] public ExternalMemoryProperties ExternalMemoryProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalBufferProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferPropertiesKHR.gen.cs index 6f2bc53f27..4cab0a5f1e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalBufferPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalBufferPropertiesKHR")] - public unsafe partial struct ExternalBufferPropertiesKHR + public unsafe partial struct ExternalBufferPropertiesKHR : IStructuredType { public ExternalBufferPropertiesKHR ( @@ -57,5 +57,11 @@ public ExternalBufferPropertiesKHR [NativeName("Type.Name", "VkExternalMemoryProperties")] [NativeName("Name", "externalMemoryProperties")] public ExternalMemoryProperties ExternalMemoryProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalBufferProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFenceProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFenceProperties.gen.cs index 30630ea319..38c85a5a4b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFenceProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFenceProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalFenceProperties")] - public unsafe partial struct ExternalFenceProperties + public unsafe partial struct ExternalFenceProperties : IStructuredType { public ExternalFenceProperties ( @@ -79,5 +79,11 @@ public ExternalFenceProperties [NativeName("Type.Name", "VkExternalFenceFeatureFlags")] [NativeName("Name", "externalFenceFeatures")] public ExternalFenceFeatureFlags ExternalFenceFeatures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalFenceProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFencePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFencePropertiesKHR.gen.cs index a280f62c33..0ef91dbc54 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFencePropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFencePropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalFencePropertiesKHR")] - public unsafe partial struct ExternalFencePropertiesKHR + public unsafe partial struct ExternalFencePropertiesKHR : IStructuredType { public ExternalFencePropertiesKHR ( @@ -79,5 +79,11 @@ public ExternalFencePropertiesKHR [NativeName("Type.Name", "VkExternalFenceFeatureFlags")] [NativeName("Name", "externalFenceFeatures")] public ExternalFenceFeatureFlags ExternalFenceFeatures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalFenceProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFormatANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalFormatANDROID.gen.cs index 6d9233b1ce..21c10e13a6 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 : IStructuredType { public ExternalFormatANDROID ( @@ -57,5 +57,11 @@ public ExternalFormatANDROID [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "externalFormat")] public ulong ExternalFormat; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalFormatAndroid; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatProperties.gen.cs index f233be1e4e..ccee07f599 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalImageFormatProperties")] - public unsafe partial struct ExternalImageFormatProperties + public unsafe partial struct ExternalImageFormatProperties : IStructuredType { public ExternalImageFormatProperties ( @@ -57,5 +57,11 @@ public ExternalImageFormatProperties [NativeName("Type.Name", "VkExternalMemoryProperties")] [NativeName("Name", "externalMemoryProperties")] public ExternalMemoryProperties ExternalMemoryProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalImageFormatProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatPropertiesKHR.gen.cs index 2251f6e608..ddf7c3a87a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalImageFormatPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalImageFormatPropertiesKHR")] - public unsafe partial struct ExternalImageFormatPropertiesKHR + public unsafe partial struct ExternalImageFormatPropertiesKHR : IStructuredType { public ExternalImageFormatPropertiesKHR ( @@ -57,5 +57,11 @@ public ExternalImageFormatPropertiesKHR [NativeName("Type.Name", "VkExternalMemoryProperties")] [NativeName("Name", "externalMemoryProperties")] public ExternalMemoryProperties ExternalMemoryProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalImageFormatProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfo.gen.cs index 28dc10a543..264744ce4f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalMemoryBufferCreateInfo")] - public unsafe partial struct ExternalMemoryBufferCreateInfo + public unsafe partial struct ExternalMemoryBufferCreateInfo : IStructuredType { public ExternalMemoryBufferCreateInfo ( @@ -57,5 +57,11 @@ public ExternalMemoryBufferCreateInfo [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalMemoryBufferCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfoKHR.gen.cs index f34751f1cd..bdb874fa32 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryBufferCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalMemoryBufferCreateInfoKHR")] - public unsafe partial struct ExternalMemoryBufferCreateInfoKHR + public unsafe partial struct ExternalMemoryBufferCreateInfoKHR : IStructuredType { public ExternalMemoryBufferCreateInfoKHR ( @@ -57,5 +57,11 @@ public ExternalMemoryBufferCreateInfoKHR [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalMemoryBufferCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfo.gen.cs index fccbcd9be8..4aa7897590 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalMemoryImageCreateInfo")] - public unsafe partial struct ExternalMemoryImageCreateInfo + public unsafe partial struct ExternalMemoryImageCreateInfo : IStructuredType { public ExternalMemoryImageCreateInfo ( @@ -57,5 +57,11 @@ public ExternalMemoryImageCreateInfo [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalMemoryImageCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfoKHR.gen.cs index a1ada3398f..73240d0ed9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalMemoryImageCreateInfoKHR")] - public unsafe partial struct ExternalMemoryImageCreateInfoKHR + public unsafe partial struct ExternalMemoryImageCreateInfoKHR : IStructuredType { public ExternalMemoryImageCreateInfoKHR ( @@ -57,5 +57,11 @@ public ExternalMemoryImageCreateInfoKHR [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlags")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlags HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalMemoryImageCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalMemoryImageCreateInfoNV.gen.cs index dc0830aaca..4fbb4540af 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 : IStructuredType { public ExternalMemoryImageCreateInfoNV ( @@ -57,5 +57,11 @@ public ExternalMemoryImageCreateInfoNV [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagsNV")] [NativeName("Name", "handleTypes")] public ExternalMemoryHandleTypeFlagsNV HandleTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalMemoryImageCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphoreProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphoreProperties.gen.cs index 16c4b27c17..30d9e5d4aa 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphoreProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphoreProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalSemaphoreProperties")] - public unsafe partial struct ExternalSemaphoreProperties + public unsafe partial struct ExternalSemaphoreProperties : IStructuredType { public ExternalSemaphoreProperties ( @@ -79,5 +79,11 @@ public ExternalSemaphoreProperties [NativeName("Type.Name", "VkExternalSemaphoreFeatureFlags")] [NativeName("Name", "externalSemaphoreFeatures")] public ExternalSemaphoreFeatureFlags ExternalSemaphoreFeatures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalSemaphoreProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphorePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphorePropertiesKHR.gen.cs index 07dbbc3b88..e013dde505 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphorePropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ExternalSemaphorePropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkExternalSemaphorePropertiesKHR")] - public unsafe partial struct ExternalSemaphorePropertiesKHR + public unsafe partial struct ExternalSemaphorePropertiesKHR : IStructuredType { public ExternalSemaphorePropertiesKHR ( @@ -79,5 +79,11 @@ public ExternalSemaphorePropertiesKHR [NativeName("Type.Name", "VkExternalSemaphoreFeatureFlags")] [NativeName("Name", "externalSemaphoreFeatures")] public ExternalSemaphoreFeatureFlags ExternalSemaphoreFeatures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ExternalSemaphoreProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FenceCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FenceCreateInfo.gen.cs index 653706b63e..faa4fbeb82 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 : IStructuredType { public FenceCreateInfo ( @@ -57,5 +57,11 @@ public FenceCreateInfo [NativeName("Type.Name", "VkFenceCreateFlags")] [NativeName("Name", "flags")] public FenceCreateFlags Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FenceCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FenceGetFdInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FenceGetFdInfoKHR.gen.cs index 124d64ccce..d13ab18867 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 : IStructuredType { public FenceGetFdInfoKHR ( @@ -68,5 +68,11 @@ public FenceGetFdInfoKHR [NativeName("Type.Name", "VkExternalFenceHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalFenceHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FenceGetFDInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FenceGetWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FenceGetWin32HandleInfoKHR.gen.cs index a3588a684e..a1fd8a0ae6 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 : IStructuredType { public FenceGetWin32HandleInfoKHR ( @@ -68,5 +68,11 @@ public FenceGetWin32HandleInfoKHR [NativeName("Type.Name", "VkExternalFenceHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalFenceHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FenceGetWin32HandleInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FilterCubicImageViewImageFormatPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FilterCubicImageViewImageFormatPropertiesEXT.gen.cs index 4c8b3e54c1..1732aeffce 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 : IStructuredType { public FilterCubicImageViewImageFormatPropertiesEXT ( @@ -68,5 +68,11 @@ public FilterCubicImageViewImageFormatPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "filterCubicMinmax")] public Bool32 FilterCubicMinmax; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FilterCubicImageViewImageFormatPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2.gen.cs index 36eb41121e..9d9cd0d0fd 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFormatProperties2")] - public unsafe partial struct FormatProperties2 + public unsafe partial struct FormatProperties2 : IStructuredType { public FormatProperties2 ( @@ -57,5 +57,11 @@ public FormatProperties2 [NativeName("Type.Name", "VkFormatProperties")] [NativeName("Name", "formatProperties")] public FormatProperties FormatProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FormatProperties2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2KHR.gen.cs index 91b942a809..9a6e276c05 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFormatProperties2KHR")] - public unsafe partial struct FormatProperties2KHR + public unsafe partial struct FormatProperties2KHR : IStructuredType { public FormatProperties2KHR ( @@ -57,5 +57,11 @@ public FormatProperties2KHR [NativeName("Type.Name", "VkFormatProperties")] [NativeName("Name", "formatProperties")] public FormatProperties FormatProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FormatProperties2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties3KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FormatProperties3KHR.gen.cs index 5a14cb6f36..558a424503 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 : IStructuredType { public FormatProperties3KHR ( @@ -79,5 +79,11 @@ public FormatProperties3KHR [NativeName("Type.Name", "VkFormatFeatureFlags2KHR")] [NativeName("Name", "bufferFeatures")] public FormatFeatureFlags2KHR BufferFeatures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FormatProperties3Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FragmentShadingRateAttachmentInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FragmentShadingRateAttachmentInfoKHR.gen.cs index 9079fddc00..d6495595ca 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 : IStructuredType { public FragmentShadingRateAttachmentInfoKHR ( @@ -68,5 +68,11 @@ public FragmentShadingRateAttachmentInfoKHR [NativeName("Type.Name", "VkExtent2D")] [NativeName("Name", "shadingRateAttachmentTexelSize")] public Extent2D ShadingRateAttachmentTexelSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FragmentShadingRateAttachmentInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfo.gen.cs index e4335223e8..8e7a02abdc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFramebufferAttachmentImageInfo")] - public unsafe partial struct FramebufferAttachmentImageInfo + public unsafe partial struct FramebufferAttachmentImageInfo : IStructuredType { public FramebufferAttachmentImageInfo ( @@ -123,5 +123,11 @@ public FramebufferAttachmentImageInfo [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "pViewFormats")] public Format* PViewFormats; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FramebufferAttachmentImageInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfoKHR.gen.cs index b6e72f3133..b439251b17 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentImageInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFramebufferAttachmentImageInfoKHR")] - public unsafe partial struct FramebufferAttachmentImageInfoKHR + public unsafe partial struct FramebufferAttachmentImageInfoKHR : IStructuredType { public FramebufferAttachmentImageInfoKHR ( @@ -123,5 +123,11 @@ public FramebufferAttachmentImageInfoKHR [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "pViewFormats")] public Format* PViewFormats; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FramebufferAttachmentImageInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfo.gen.cs index 8ee80a493c..fc46df2edc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFramebufferAttachmentsCreateInfo")] - public unsafe partial struct FramebufferAttachmentsCreateInfo + public unsafe partial struct FramebufferAttachmentsCreateInfo : IStructuredType { public FramebufferAttachmentsCreateInfo ( @@ -68,5 +68,11 @@ public FramebufferAttachmentsCreateInfo [NativeName("Type.Name", "VkFramebufferAttachmentImageInfo")] [NativeName("Name", "pAttachmentImageInfos")] public FramebufferAttachmentImageInfo* PAttachmentImageInfos; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FramebufferAttachmentsCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfoKHR.gen.cs index d563fe274e..ae02f5b67f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferAttachmentsCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkFramebufferAttachmentsCreateInfoKHR")] - public unsafe partial struct FramebufferAttachmentsCreateInfoKHR + public unsafe partial struct FramebufferAttachmentsCreateInfoKHR : IStructuredType { public FramebufferAttachmentsCreateInfoKHR ( @@ -68,5 +68,11 @@ public FramebufferAttachmentsCreateInfoKHR [NativeName("Type.Name", "VkFramebufferAttachmentImageInfo")] [NativeName("Name", "pAttachmentImageInfos")] public FramebufferAttachmentImageInfo* PAttachmentImageInfos; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FramebufferAttachmentsCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferCreateInfo.gen.cs index 35fc19220b..50df07b41d 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 : IStructuredType { public FramebufferCreateInfo ( @@ -123,5 +123,11 @@ public FramebufferCreateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "layers")] public uint Layers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FramebufferCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferMixedSamplesCombinationNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/FramebufferMixedSamplesCombinationNV.gen.cs index c8a9bce4da..d7a3d9134f 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 : IStructuredType { public FramebufferMixedSamplesCombinationNV ( @@ -90,5 +90,11 @@ public FramebufferMixedSamplesCombinationNV [NativeName("Type.Name", "VkSampleCountFlags")] [NativeName("Name", "colorSamples")] public SampleCountFlags ColorSamples; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.FramebufferMixedSamplesCombinationNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GeneratedCommandsInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GeneratedCommandsInfoNV.gen.cs index 3bfc6296c8..6f68889009 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 : IStructuredType { public GeneratedCommandsInfoNV ( @@ -189,5 +189,11 @@ public GeneratedCommandsInfoNV [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "sequencesIndexOffset")] public ulong SequencesIndexOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GeneratedCommandsInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GeneratedCommandsMemoryRequirementsInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GeneratedCommandsMemoryRequirementsInfoNV.gen.cs index 08407c19c7..524d793425 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 : IStructuredType { public GeneratedCommandsMemoryRequirementsInfoNV ( @@ -90,5 +90,11 @@ public GeneratedCommandsMemoryRequirementsInfoNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxSequencesCount")] public uint MaxSequencesCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GeneratedCommandsMemoryRequirementsInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryAABBNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryAABBNV.gen.cs index 4a83af145b..7c89e4f514 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 : IStructuredType { public GeometryAABBNV ( @@ -90,5 +90,11 @@ public GeometryAABBNV [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "offset")] public ulong Offset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GeometryAabbNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryNV.gen.cs index 1f6889102f..32993023d8 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 : IStructuredType { public GeometryNV ( @@ -79,5 +79,11 @@ public GeometryNV [NativeName("Type.Name", "VkGeometryFlagsKHR")] [NativeName("Name", "flags")] public GeometryFlagsKHR Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GeometryNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryTrianglesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GeometryTrianglesNV.gen.cs index d59d5a56c3..86e154db99 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 : IStructuredType { public GeometryTrianglesNV ( @@ -167,5 +167,11 @@ public GeometryTrianglesNV [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "transformOffset")] public ulong TransformOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GeometryTrianglesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsPipelineCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsPipelineCreateInfo.gen.cs index f97a24a86f..0ad7770200 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 : IStructuredType { public GraphicsPipelineCreateInfo ( @@ -233,5 +233,11 @@ public GraphicsPipelineCreateInfo [NativeName("Type.Name", "int32_t")] [NativeName("Name", "basePipelineIndex")] public int BasePipelineIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GraphicsPipelineCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsPipelineShaderGroupsCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsPipelineShaderGroupsCreateInfoNV.gen.cs index 1348ade6f5..1551d5b26c 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 : IStructuredType { public GraphicsPipelineShaderGroupsCreateInfoNV ( @@ -90,5 +90,11 @@ public GraphicsPipelineShaderGroupsCreateInfoNV [NativeName("Type.Name", "VkPipeline")] [NativeName("Name", "pPipelines")] public Pipeline* PPipelines; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GraphicsPipelineShaderGroupsCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsShaderGroupCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/GraphicsShaderGroupCreateInfoNV.gen.cs index c7d6b26c87..ea50a6f064 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 : IStructuredType { public GraphicsShaderGroupCreateInfoNV ( @@ -90,5 +90,11 @@ public GraphicsShaderGroupCreateInfoNV [NativeName("Type.Name", "VkPipelineTessellationStateCreateInfo")] [NativeName("Name", "pTessellationState")] public PipelineTessellationStateCreateInfo* PTessellationState; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.GraphicsShaderGroupCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/HdrMetadataEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/HdrMetadataEXT.gen.cs index bb02d2673d..048accdeae 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 : IStructuredType { public HdrMetadataEXT ( @@ -134,5 +134,11 @@ public HdrMetadataEXT [NativeName("Type.Name", "float")] [NativeName("Name", "maxFrameAverageLightLevel")] public float MaxFrameAverageLightLevel; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.HdrMetadataExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/HeadlessSurfaceCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/HeadlessSurfaceCreateInfoEXT.gen.cs index 7f571ad7ce..d7f4786aa4 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 : IStructuredType { public HeadlessSurfaceCreateInfoEXT ( @@ -57,5 +57,11 @@ public HeadlessSurfaceCreateInfoEXT [NativeName("Type.Name", "VkHeadlessSurfaceCreateFlagsEXT")] [NativeName("Name", "flags")] public uint Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.HeadlessSurfaceCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/IOSSurfaceCreateInfoMVK.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/IOSSurfaceCreateInfoMVK.gen.cs index c50183591e..08aca2cba3 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 : IStructuredType { public IOSSurfaceCreateInfoMVK ( @@ -68,5 +68,11 @@ public IOSSurfaceCreateInfoMVK [NativeName("Type.Name", "void")] [NativeName("Name", "pView")] public void* PView; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.IosSurfaceCreateInfoMvk; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageBlit2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageBlit2KHR.gen.cs index 8de70ae9ba..bfcc734a02 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 : IStructuredType { public ImageBlit2KHR ( @@ -132,5 +132,11 @@ public Span AsSpan() #endif } + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageBlit2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageConstraintsInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageConstraintsInfoFUCHSIA.gen.cs index cf485ba457..e1f8147677 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 : IStructuredType { public ImageConstraintsInfoFUCHSIA ( @@ -90,5 +90,11 @@ public ImageConstraintsInfoFUCHSIA [NativeName("Type.Name", "VkImageConstraintsInfoFlagsFUCHSIA")] [NativeName("Name", "flags")] public ImageConstraintsInfoFlagsFUCHSIA Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageConstraintsInfoFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageCopy2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageCopy2KHR.gen.cs index f27e5660d3..43d3e4e8ba 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 : IStructuredType { public ImageCopy2KHR ( @@ -101,5 +101,11 @@ public ImageCopy2KHR [NativeName("Type.Name", "VkExtent3D")] [NativeName("Name", "extent")] public Extent3D Extent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageCopy2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageCreateInfo.gen.cs index ba75174473..29c60d65ce 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 : IStructuredType { public ImageCreateInfo ( @@ -189,5 +189,11 @@ public ImageCreateInfo [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "initialLayout")] public ImageLayout InitialLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierExplicitCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierExplicitCreateInfoEXT.gen.cs index 5db9477040..a23316d218 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 : IStructuredType { public ImageDrmFormatModifierExplicitCreateInfoEXT ( @@ -79,5 +79,11 @@ public ImageDrmFormatModifierExplicitCreateInfoEXT [NativeName("Type.Name", "VkSubresourceLayout")] [NativeName("Name", "pPlaneLayouts")] public SubresourceLayout* PPlaneLayouts; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageDrmFormatModifierExplicitCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierListCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierListCreateInfoEXT.gen.cs index de075b7665..530e3322ad 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 : IStructuredType { public ImageDrmFormatModifierListCreateInfoEXT ( @@ -68,5 +68,11 @@ public ImageDrmFormatModifierListCreateInfoEXT [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pDrmFormatModifiers")] public ulong* PDrmFormatModifiers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageDrmFormatModifierListCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageDrmFormatModifierPropertiesEXT.gen.cs index 80b459b479..5ec4113f3b 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 : IStructuredType { public ImageDrmFormatModifierPropertiesEXT ( @@ -57,5 +57,11 @@ public ImageDrmFormatModifierPropertiesEXT [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "drmFormatModifier")] public ulong DrmFormatModifier; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageDrmFormatModifierPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatConstraintsInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatConstraintsInfoFUCHSIA.gen.cs index 331fe6e664..b91b097793 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 : IStructuredType { public ImageFormatConstraintsInfoFUCHSIA ( @@ -112,5 +112,11 @@ public ImageFormatConstraintsInfoFUCHSIA [NativeName("Type.Name", "VkSysmemColorSpaceFUCHSIA")] [NativeName("Name", "pColorSpaces")] public SysmemColorSpaceFUCHSIA* PColorSpaces; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageFormatConstraintsInfoFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfo.gen.cs index e78df4a6aa..0c663ce8db 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageFormatListCreateInfo")] - public unsafe partial struct ImageFormatListCreateInfo + public unsafe partial struct ImageFormatListCreateInfo : IStructuredType { public ImageFormatListCreateInfo ( @@ -68,5 +68,11 @@ public ImageFormatListCreateInfo [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "pViewFormats")] public Format* PViewFormats; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageFormatListCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfoKHR.gen.cs index 33d4830815..caf642efbc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatListCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageFormatListCreateInfoKHR")] - public unsafe partial struct ImageFormatListCreateInfoKHR + public unsafe partial struct ImageFormatListCreateInfoKHR : IStructuredType { public ImageFormatListCreateInfoKHR ( @@ -68,5 +68,11 @@ public ImageFormatListCreateInfoKHR [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "pViewFormats")] public Format* PViewFormats; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageFormatListCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2.gen.cs index f8cc35c162..b7bce57b6f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageFormatProperties2")] - public unsafe partial struct ImageFormatProperties2 + public unsafe partial struct ImageFormatProperties2 : IStructuredType { public ImageFormatProperties2 ( @@ -57,5 +57,11 @@ public ImageFormatProperties2 [NativeName("Type.Name", "VkImageFormatProperties")] [NativeName("Name", "imageFormatProperties")] public ImageFormatProperties ImageFormatProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageFormatProperties2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2KHR.gen.cs index 3e1f61fb22..737db07ac7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageFormatProperties2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageFormatProperties2KHR")] - public unsafe partial struct ImageFormatProperties2KHR + public unsafe partial struct ImageFormatProperties2KHR : IStructuredType { public ImageFormatProperties2KHR ( @@ -57,5 +57,11 @@ public ImageFormatProperties2KHR [NativeName("Type.Name", "VkImageFormatProperties")] [NativeName("Name", "imageFormatProperties")] public ImageFormatProperties ImageFormatProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageFormatProperties2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryBarrier.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryBarrier.gen.cs index 474748752e..292c451d63 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 : IStructuredType { public ImageMemoryBarrier ( @@ -134,5 +134,11 @@ public ImageMemoryBarrier [NativeName("Type.Name", "VkImageSubresourceRange")] [NativeName("Name", "subresourceRange")] public ImageSubresourceRange SubresourceRange; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageMemoryBarrier; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryBarrier2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryBarrier2KHR.gen.cs index aa9a8b6a64..ae6f7f621e 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 : IStructuredType { public ImageMemoryBarrier2KHR ( @@ -156,5 +156,11 @@ public ImageMemoryBarrier2KHR [NativeName("Type.Name", "VkImageSubresourceRange")] [NativeName("Name", "subresourceRange")] public ImageSubresourceRange SubresourceRange; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageMemoryBarrier2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2.gen.cs index 19fa8973a5..2491eebec5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageMemoryRequirementsInfo2")] - public unsafe partial struct ImageMemoryRequirementsInfo2 + public unsafe partial struct ImageMemoryRequirementsInfo2 : IStructuredType { public ImageMemoryRequirementsInfo2 ( @@ -57,5 +57,11 @@ public ImageMemoryRequirementsInfo2 [NativeName("Type.Name", "VkImage")] [NativeName("Name", "image")] public Image Image; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageMemoryRequirementsInfo2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2KHR.gen.cs index 2fcb389b2b..0bfd7edac0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageMemoryRequirementsInfo2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageMemoryRequirementsInfo2KHR")] - public unsafe partial struct ImageMemoryRequirementsInfo2KHR + public unsafe partial struct ImageMemoryRequirementsInfo2KHR : IStructuredType { public ImageMemoryRequirementsInfo2KHR ( @@ -57,5 +57,11 @@ public ImageMemoryRequirementsInfo2KHR [NativeName("Type.Name", "VkImage")] [NativeName("Name", "image")] public Image Image; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageMemoryRequirementsInfo2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePipeSurfaceCreateInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePipeSurfaceCreateInfoFUCHSIA.gen.cs index f1bf048ab9..d68ea72320 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 : IStructuredType { public ImagePipeSurfaceCreateInfoFUCHSIA ( @@ -68,5 +68,11 @@ public ImagePipeSurfaceCreateInfoFUCHSIA [NativeName("Type.Name", "zx_handle_t")] [NativeName("Name", "imagePipeHandle")] public nint ImagePipeHandle; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImagepipeSurfaceCreateInfoFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfo.gen.cs index 53cb3e63e8..8033aa109b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImagePlaneMemoryRequirementsInfo")] - public unsafe partial struct ImagePlaneMemoryRequirementsInfo + public unsafe partial struct ImagePlaneMemoryRequirementsInfo : IStructuredType { public ImagePlaneMemoryRequirementsInfo ( @@ -57,5 +57,11 @@ public ImagePlaneMemoryRequirementsInfo [NativeName("Type.Name", "VkImageAspectFlagBits")] [NativeName("Name", "planeAspect")] public ImageAspectFlags PlaneAspect; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImagePlaneMemoryRequirementsInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfoKHR.gen.cs index 323b65a094..3f99929336 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImagePlaneMemoryRequirementsInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImagePlaneMemoryRequirementsInfoKHR")] - public unsafe partial struct ImagePlaneMemoryRequirementsInfoKHR + public unsafe partial struct ImagePlaneMemoryRequirementsInfoKHR : IStructuredType { public ImagePlaneMemoryRequirementsInfoKHR ( @@ -57,5 +57,11 @@ public ImagePlaneMemoryRequirementsInfoKHR [NativeName("Type.Name", "VkImageAspectFlagBits")] [NativeName("Name", "planeAspect")] public ImageAspectFlags PlaneAspect; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImagePlaneMemoryRequirementsInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageResolve2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageResolve2KHR.gen.cs index 4f3428d35a..6adb871a6e 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 : IStructuredType { public ImageResolve2KHR ( @@ -101,5 +101,11 @@ public ImageResolve2KHR [NativeName("Type.Name", "VkExtent3D")] [NativeName("Name", "extent")] public Extent3D Extent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageResolve2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2.gen.cs index 8466befee8..0eb85c8b15 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageSparseMemoryRequirementsInfo2")] - public unsafe partial struct ImageSparseMemoryRequirementsInfo2 + public unsafe partial struct ImageSparseMemoryRequirementsInfo2 : IStructuredType { public ImageSparseMemoryRequirementsInfo2 ( @@ -57,5 +57,11 @@ public ImageSparseMemoryRequirementsInfo2 [NativeName("Type.Name", "VkImage")] [NativeName("Name", "image")] public Image Image; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageSparseMemoryRequirementsInfo2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2KHR.gen.cs index cc6a00b967..16b7f624c9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSparseMemoryRequirementsInfo2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageSparseMemoryRequirementsInfo2KHR")] - public unsafe partial struct ImageSparseMemoryRequirementsInfo2KHR + public unsafe partial struct ImageSparseMemoryRequirementsInfo2KHR : IStructuredType { public ImageSparseMemoryRequirementsInfo2KHR ( @@ -57,5 +57,11 @@ public ImageSparseMemoryRequirementsInfo2KHR [NativeName("Type.Name", "VkImage")] [NativeName("Name", "image")] public Image Image; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageSparseMemoryRequirementsInfo2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfo.gen.cs index 2feaa37566..b70d8ef20a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageStencilUsageCreateInfo")] - public unsafe partial struct ImageStencilUsageCreateInfo + public unsafe partial struct ImageStencilUsageCreateInfo : IStructuredType { public ImageStencilUsageCreateInfo ( @@ -57,5 +57,11 @@ public ImageStencilUsageCreateInfo [NativeName("Type.Name", "VkImageUsageFlags")] [NativeName("Name", "stencilUsage")] public ImageUsageFlags StencilUsage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageStencilUsageCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfoEXT.gen.cs index 72a4cf1bb8..449fddbebc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageStencilUsageCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageStencilUsageCreateInfoEXT")] - public unsafe partial struct ImageStencilUsageCreateInfoEXT + public unsafe partial struct ImageStencilUsageCreateInfoEXT : IStructuredType { public ImageStencilUsageCreateInfoEXT ( @@ -57,5 +57,11 @@ public ImageStencilUsageCreateInfoEXT [NativeName("Type.Name", "VkImageUsageFlags")] [NativeName("Name", "stencilUsage")] public ImageUsageFlags StencilUsage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageStencilUsageCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSwapchainCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageSwapchainCreateInfoKHR.gen.cs index 397b597807..c51cd29a50 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 : IStructuredType { public ImageSwapchainCreateInfoKHR ( @@ -57,5 +57,11 @@ public ImageSwapchainCreateInfoKHR [NativeName("Type.Name", "VkSwapchainKHR")] [NativeName("Name", "swapchain")] public SwapchainKHR Swapchain; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageSwapchainCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewASTCDecodeModeEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewASTCDecodeModeEXT.gen.cs index aa72a8087e..7d8515e41d 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 : IStructuredType { public ImageViewASTCDecodeModeEXT ( @@ -57,5 +57,11 @@ public ImageViewASTCDecodeModeEXT [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "decodeMode")] public Format DecodeMode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageViewAstcDecodeModeExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewAddressPropertiesNVX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewAddressPropertiesNVX.gen.cs index 71e577e151..188411ff05 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 : IStructuredType { public ImageViewAddressPropertiesNVX ( @@ -68,5 +68,11 @@ public ImageViewAddressPropertiesNVX [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "size")] public ulong Size; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageViewAddressPropertiesNvx; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewCreateInfo.gen.cs index 858283299f..1dfc2b0726 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 : IStructuredType { public ImageViewCreateInfo ( @@ -112,5 +112,11 @@ public ImageViewCreateInfo [NativeName("Type.Name", "VkImageSubresourceRange")] [NativeName("Name", "subresourceRange")] public ImageSubresourceRange SubresourceRange; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageViewCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewHandleInfoNVX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewHandleInfoNVX.gen.cs index 91dc4eb119..9bd62f9333 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 : IStructuredType { public ImageViewHandleInfoNVX ( @@ -79,5 +79,11 @@ public ImageViewHandleInfoNVX [NativeName("Type.Name", "VkSampler")] [NativeName("Name", "sampler")] public Sampler Sampler; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageViewHandleInfoNvx; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfo.gen.cs index 14f155b444..a3dd0ac294 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageViewUsageCreateInfo")] - public unsafe partial struct ImageViewUsageCreateInfo + public unsafe partial struct ImageViewUsageCreateInfo : IStructuredType { public ImageViewUsageCreateInfo ( @@ -57,5 +57,11 @@ public ImageViewUsageCreateInfo [NativeName("Type.Name", "VkImageUsageFlags")] [NativeName("Name", "usage")] public ImageUsageFlags Usage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageViewUsageCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfoKHR.gen.cs index c556a2e35b..2b7e3e93f3 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/ImageViewUsageCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkImageViewUsageCreateInfoKHR")] - public unsafe partial struct ImageViewUsageCreateInfoKHR + public unsafe partial struct ImageViewUsageCreateInfoKHR : IStructuredType { public ImageViewUsageCreateInfoKHR ( @@ -57,5 +57,11 @@ public ImageViewUsageCreateInfoKHR [NativeName("Type.Name", "VkImageUsageFlags")] [NativeName("Name", "usage")] public ImageUsageFlags Usage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImageViewUsageCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportAndroidHardwareBufferInfoANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportAndroidHardwareBufferInfoANDROID.gen.cs index d8f6aa12e8..85b4cd21b1 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 : IStructuredType { public ImportAndroidHardwareBufferInfoANDROID ( @@ -57,5 +57,11 @@ public ImportAndroidHardwareBufferInfoANDROID [NativeName("Type.Name", "AHardwareBuffer")] [NativeName("Name", "buffer")] public nint* Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportAndroidHardwareBufferInfoAndroid; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportFenceFdInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportFenceFdInfoKHR.gen.cs index 7e6789e497..04bdda066a 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 : IStructuredType { public ImportFenceFdInfoKHR ( @@ -90,5 +90,11 @@ public ImportFenceFdInfoKHR [NativeName("Type.Name", "int")] [NativeName("Name", "fd")] public int Fd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportFenceFDInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportFenceWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportFenceWin32HandleInfoKHR.gen.cs index 0339e4fa24..f730c0d3f2 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 : IStructuredType { public ImportFenceWin32HandleInfoKHR ( @@ -101,5 +101,11 @@ public ImportFenceWin32HandleInfoKHR [NativeName("Type.Name", "LPCWSTR")] [NativeName("Name", "name")] public nint Name; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportFenceWin32HandleInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryBufferCollectionFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryBufferCollectionFUCHSIA.gen.cs index 80a2d135ab..78b6776548 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 : IStructuredType { public ImportMemoryBufferCollectionFUCHSIA ( @@ -68,5 +68,11 @@ public ImportMemoryBufferCollectionFUCHSIA [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "index")] public uint Index; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportMemoryBufferCollectionFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryFdInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryFdInfoKHR.gen.cs index def0ab1985..2d08965aa0 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 : IStructuredType { public ImportMemoryFdInfoKHR ( @@ -68,5 +68,11 @@ public ImportMemoryFdInfoKHR [NativeName("Type.Name", "int")] [NativeName("Name", "fd")] public int Fd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportMemoryFDInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryHostPointerInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryHostPointerInfoEXT.gen.cs index 0255955dea..f33e9b66a8 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 : IStructuredType { public ImportMemoryHostPointerInfoEXT ( @@ -68,5 +68,11 @@ public ImportMemoryHostPointerInfoEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pHostPointer")] public void* PHostPointer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportMemoryHostPointerInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryWin32HandleInfoKHR.gen.cs index 801296c564..eb66f18e80 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 : IStructuredType { public ImportMemoryWin32HandleInfoKHR ( @@ -79,5 +79,11 @@ public ImportMemoryWin32HandleInfoKHR [NativeName("Type.Name", "LPCWSTR")] [NativeName("Name", "name")] public nint Name; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportMemoryWin32HandleInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryWin32HandleInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryWin32HandleInfoNV.gen.cs index 37338c2efd..22fb605f4a 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 : IStructuredType { public ImportMemoryWin32HandleInfoNV ( @@ -68,5 +68,11 @@ public ImportMemoryWin32HandleInfoNV [NativeName("Type.Name", "HANDLE")] [NativeName("Name", "handle")] public nint Handle; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportMemoryWin32HandleInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryZirconHandleInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportMemoryZirconHandleInfoFUCHSIA.gen.cs index d976a49740..94fb320f56 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 : IStructuredType { public ImportMemoryZirconHandleInfoFUCHSIA ( @@ -68,5 +68,11 @@ public ImportMemoryZirconHandleInfoFUCHSIA [NativeName("Type.Name", "zx_handle_t")] [NativeName("Name", "handle")] public nint Handle; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportMemoryZirconHandleInfoFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreFdInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreFdInfoKHR.gen.cs index 71d8b56932..63bc003152 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 : IStructuredType { public ImportSemaphoreFdInfoKHR ( @@ -90,5 +90,11 @@ public ImportSemaphoreFdInfoKHR [NativeName("Type.Name", "int")] [NativeName("Name", "fd")] public int Fd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportSemaphoreFDInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreWin32HandleInfoKHR.gen.cs index bfdf714ef5..ef3591a6b6 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 : IStructuredType { public ImportSemaphoreWin32HandleInfoKHR ( @@ -101,5 +101,11 @@ public ImportSemaphoreWin32HandleInfoKHR [NativeName("Type.Name", "LPCWSTR")] [NativeName("Name", "name")] public nint Name; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportSemaphoreWin32HandleInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreZirconHandleInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ImportSemaphoreZirconHandleInfoFUCHSIA.gen.cs index b5614c1119..cfdeebadf7 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 : IStructuredType { public ImportSemaphoreZirconHandleInfoFUCHSIA ( @@ -90,5 +90,11 @@ public ImportSemaphoreZirconHandleInfoFUCHSIA [NativeName("Type.Name", "zx_handle_t")] [NativeName("Name", "zirconHandle")] public nint ZirconHandle; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ImportSemaphoreZirconHandleInfoFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/IndirectCommandsLayoutCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/IndirectCommandsLayoutCreateInfoNV.gen.cs index 3ed04b5431..dea1b4e56d 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 : IStructuredType { public IndirectCommandsLayoutCreateInfoNV ( @@ -112,5 +112,11 @@ public IndirectCommandsLayoutCreateInfoNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pStreamStrides")] public uint* PStreamStrides; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.IndirectCommandsLayoutCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/IndirectCommandsLayoutTokenNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/IndirectCommandsLayoutTokenNV.gen.cs index 79c0aad4af..d877eb546c 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 : IStructuredType { public IndirectCommandsLayoutTokenNV ( @@ -189,5 +189,11 @@ public IndirectCommandsLayoutTokenNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pIndexTypeValues")] public uint* PIndexTypeValues; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.IndirectCommandsLayoutTokenNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/InitializePerformanceApiInfoINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/InitializePerformanceApiInfoINTEL.gen.cs index d67ffda0b2..f172a9cf56 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 : IStructuredType { public InitializePerformanceApiInfoINTEL ( @@ -57,5 +57,11 @@ public InitializePerformanceApiInfoINTEL [NativeName("Type.Name", "void")] [NativeName("Name", "pUserData")] public void* PUserData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.InitializePerformanceApiInfoIntel; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/InstanceCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/InstanceCreateInfo.gen.cs index 3764310cca..57492e135c 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 : IStructuredType { public InstanceCreateInfo ( @@ -112,5 +112,11 @@ public InstanceCreateInfo [NativeName("Type.Name", "char")] [NativeName("Name", "ppEnabledExtensionNames")] public byte** PpEnabledExtensionNames; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.InstanceCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MacOSSurfaceCreateInfoMVK.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MacOSSurfaceCreateInfoMVK.gen.cs index 8ee06b1482..97c2766cce 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 : IStructuredType { public MacOSSurfaceCreateInfoMVK ( @@ -68,5 +68,11 @@ public MacOSSurfaceCreateInfoMVK [NativeName("Type.Name", "void")] [NativeName("Name", "pView")] public void* PView; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MacosSurfaceCreateInfoMvk; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MappedMemoryRange.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MappedMemoryRange.gen.cs index 77a5f8a49b..8213fc4749 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 : IStructuredType { public MappedMemoryRange ( @@ -79,5 +79,11 @@ public MappedMemoryRange [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "size")] public ulong Size; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MappedMemoryRange; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfo.gen.cs index e94f86c417..05a665ad17 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryAllocateFlagsInfo")] - public unsafe partial struct MemoryAllocateFlagsInfo + public unsafe partial struct MemoryAllocateFlagsInfo : IStructuredType { public MemoryAllocateFlagsInfo ( @@ -68,5 +68,11 @@ public MemoryAllocateFlagsInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "deviceMask")] public uint DeviceMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryAllocateFlagsInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfoKHR.gen.cs index 349215fbab..0e0e043a91 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateFlagsInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryAllocateFlagsInfoKHR")] - public unsafe partial struct MemoryAllocateFlagsInfoKHR + public unsafe partial struct MemoryAllocateFlagsInfoKHR : IStructuredType { public MemoryAllocateFlagsInfoKHR ( @@ -68,5 +68,11 @@ public MemoryAllocateFlagsInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "deviceMask")] public uint DeviceMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryAllocateFlagsInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryAllocateInfo.gen.cs index 578e86d502..32641aa11b 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 : IStructuredType { public MemoryAllocateInfo ( @@ -68,5 +68,11 @@ public MemoryAllocateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryTypeIndex")] public uint MemoryTypeIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryAllocateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryBarrier.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryBarrier.gen.cs index 5eb1bccc30..8a081b669a 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 : IStructuredType { public MemoryBarrier ( @@ -68,5 +68,11 @@ public MemoryBarrier [NativeName("Type.Name", "VkAccessFlags")] [NativeName("Name", "dstAccessMask")] public AccessFlags DstAccessMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryBarrier; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryBarrier2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryBarrier2KHR.gen.cs index daee4a7a4e..ec182469f5 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 : IStructuredType { public MemoryBarrier2KHR ( @@ -90,5 +90,11 @@ public MemoryBarrier2KHR [NativeName("Type.Name", "VkAccessFlags2KHR")] [NativeName("Name", "dstAccessMask")] public AccessFlags2KHR DstAccessMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryBarrier2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfo.gen.cs index ee5f5fe6e8..e32d25f6d9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryDedicatedAllocateInfo")] - public unsafe partial struct MemoryDedicatedAllocateInfo + public unsafe partial struct MemoryDedicatedAllocateInfo : IStructuredType { public MemoryDedicatedAllocateInfo ( @@ -68,5 +68,11 @@ public MemoryDedicatedAllocateInfo [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryDedicatedAllocateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfoKHR.gen.cs index 604a6eb9e7..a419054ba4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedAllocateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryDedicatedAllocateInfoKHR")] - public unsafe partial struct MemoryDedicatedAllocateInfoKHR + public unsafe partial struct MemoryDedicatedAllocateInfoKHR : IStructuredType { public MemoryDedicatedAllocateInfoKHR ( @@ -68,5 +68,11 @@ public MemoryDedicatedAllocateInfoKHR [NativeName("Type.Name", "VkBuffer")] [NativeName("Name", "buffer")] public Buffer Buffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryDedicatedAllocateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirements.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirements.gen.cs index aa07e862df..270a5f4a0f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirements.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirements.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryDedicatedRequirements")] - public unsafe partial struct MemoryDedicatedRequirements + public unsafe partial struct MemoryDedicatedRequirements : IStructuredType { public MemoryDedicatedRequirements ( @@ -68,5 +68,11 @@ public MemoryDedicatedRequirements [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "requiresDedicatedAllocation")] public Bool32 RequiresDedicatedAllocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryDedicatedRequirements; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirementsKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirementsKHR.gen.cs index 59c07f803d..cf26dac9b5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirementsKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryDedicatedRequirementsKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryDedicatedRequirementsKHR")] - public unsafe partial struct MemoryDedicatedRequirementsKHR + public unsafe partial struct MemoryDedicatedRequirementsKHR : IStructuredType { public MemoryDedicatedRequirementsKHR ( @@ -68,5 +68,11 @@ public MemoryDedicatedRequirementsKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "requiresDedicatedAllocation")] public Bool32 RequiresDedicatedAllocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryDedicatedRequirements; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryFdPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryFdPropertiesKHR.gen.cs index fb33bbf2a6..d2870b7c63 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 : IStructuredType { public MemoryFdPropertiesKHR ( @@ -57,5 +57,11 @@ public MemoryFdPropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryTypeBits")] public uint MemoryTypeBits; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryFDPropertiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetAndroidHardwareBufferInfoANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetAndroidHardwareBufferInfoANDROID.gen.cs index c5a997815e..2c4390be8d 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 : IStructuredType { public MemoryGetAndroidHardwareBufferInfoANDROID ( @@ -57,5 +57,11 @@ public MemoryGetAndroidHardwareBufferInfoANDROID [NativeName("Type.Name", "VkDeviceMemory")] [NativeName("Name", "memory")] public DeviceMemory Memory; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryGetAndroidHardwareBufferInfoAndroid; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetFdInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetFdInfoKHR.gen.cs index 411ebdd9da..948876235c 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 : IStructuredType { public MemoryGetFdInfoKHR ( @@ -68,5 +68,11 @@ public MemoryGetFdInfoKHR [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryGetFDInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetRemoteAddressInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetRemoteAddressInfoNV.gen.cs index 766774d587..fd088f6783 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 : IStructuredType { public MemoryGetRemoteAddressInfoNV ( @@ -68,5 +68,11 @@ public MemoryGetRemoteAddressInfoNV [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryGetRemoteAddressInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetWin32HandleInfoKHR.gen.cs index b94b305a7e..85e2baa723 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 : IStructuredType { public MemoryGetWin32HandleInfoKHR ( @@ -68,5 +68,11 @@ public MemoryGetWin32HandleInfoKHR [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryGetWin32HandleInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetZirconHandleInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryGetZirconHandleInfoFUCHSIA.gen.cs index 734d2f25bb..92bb737a0d 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 : IStructuredType { public MemoryGetZirconHandleInfoFUCHSIA ( @@ -68,5 +68,11 @@ public MemoryGetZirconHandleInfoFUCHSIA [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryGetZirconHandleInfoFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryHostPointerPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryHostPointerPropertiesEXT.gen.cs index 3644bb884d..835250d523 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 : IStructuredType { public MemoryHostPointerPropertiesEXT ( @@ -57,5 +57,11 @@ public MemoryHostPointerPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryTypeBits")] public uint MemoryTypeBits; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryHostPointerPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfo.gen.cs index 9398144d9a..4f8b5d7068 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryOpaqueCaptureAddressAllocateInfo")] - public unsafe partial struct MemoryOpaqueCaptureAddressAllocateInfo + public unsafe partial struct MemoryOpaqueCaptureAddressAllocateInfo : IStructuredType { public MemoryOpaqueCaptureAddressAllocateInfo ( @@ -57,5 +57,11 @@ public MemoryOpaqueCaptureAddressAllocateInfo [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "opaqueCaptureAddress")] public ulong OpaqueCaptureAddress; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryOpaqueCaptureAddressAllocateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfoKHR.gen.cs index 9ac9530346..42253d3372 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryOpaqueCaptureAddressAllocateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryOpaqueCaptureAddressAllocateInfoKHR")] - public unsafe partial struct MemoryOpaqueCaptureAddressAllocateInfoKHR + public unsafe partial struct MemoryOpaqueCaptureAddressAllocateInfoKHR : IStructuredType { public MemoryOpaqueCaptureAddressAllocateInfoKHR ( @@ -57,5 +57,11 @@ public MemoryOpaqueCaptureAddressAllocateInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "opaqueCaptureAddress")] public ulong OpaqueCaptureAddress; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryOpaqueCaptureAddressAllocateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryPriorityAllocateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryPriorityAllocateInfoEXT.gen.cs index 935c0bb355..469f8b22a8 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 : IStructuredType { public MemoryPriorityAllocateInfoEXT ( @@ -57,5 +57,11 @@ public MemoryPriorityAllocateInfoEXT [NativeName("Type.Name", "float")] [NativeName("Name", "priority")] public float Priority; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryPriorityAllocateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2.gen.cs index 434d557288..2a911cb912 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryRequirements2")] - public unsafe partial struct MemoryRequirements2 + public unsafe partial struct MemoryRequirements2 : IStructuredType { public MemoryRequirements2 ( @@ -57,5 +57,11 @@ public MemoryRequirements2 [NativeName("Type.Name", "VkMemoryRequirements")] [NativeName("Name", "memoryRequirements")] public MemoryRequirements MemoryRequirements; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryRequirements2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2KHR.gen.cs index 5fb7a35b40..a93d516d47 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryRequirements2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkMemoryRequirements2KHR")] - public unsafe partial struct MemoryRequirements2KHR + public unsafe partial struct MemoryRequirements2KHR : IStructuredType { public MemoryRequirements2KHR ( @@ -57,5 +57,11 @@ public MemoryRequirements2KHR [NativeName("Type.Name", "VkMemoryRequirements")] [NativeName("Name", "memoryRequirements")] public MemoryRequirements MemoryRequirements; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryRequirements2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryWin32HandlePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryWin32HandlePropertiesKHR.gen.cs index e3f148fa46..cef120c0a7 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 : IStructuredType { public MemoryWin32HandlePropertiesKHR ( @@ -57,5 +57,11 @@ public MemoryWin32HandlePropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryTypeBits")] public uint MemoryTypeBits; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryWin32HandlePropertiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryZirconHandlePropertiesFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MemoryZirconHandlePropertiesFUCHSIA.gen.cs index b742347e72..29c8c58058 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 : IStructuredType { public MemoryZirconHandlePropertiesFUCHSIA ( @@ -57,5 +57,11 @@ public MemoryZirconHandlePropertiesFUCHSIA [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "memoryTypeBits")] public uint MemoryTypeBits; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MemoryZirconHandlePropertiesFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MetalSurfaceCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MetalSurfaceCreateInfoEXT.gen.cs index 4fcaa07245..28649a21ca 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 : IStructuredType { public MetalSurfaceCreateInfoEXT ( @@ -68,5 +68,11 @@ public MetalSurfaceCreateInfoEXT [NativeName("Type.Name", "CAMetalLayer")] [NativeName("Name", "pLayer")] public nint* PLayer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MetalSurfaceCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MultisamplePropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MultisamplePropertiesEXT.gen.cs index 2192632d17..596f134ff5 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 : IStructuredType { public MultisamplePropertiesEXT ( @@ -57,5 +57,11 @@ public MultisamplePropertiesEXT [NativeName("Type.Name", "VkExtent2D")] [NativeName("Name", "maxSampleLocationGridSize")] public Extent2D MaxSampleLocationGridSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MultisamplePropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MultiviewPerViewAttributesInfoNVX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MultiviewPerViewAttributesInfoNVX.gen.cs index 9b1309d727..1c55eebcd3 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 : IStructuredType { public MultiviewPerViewAttributesInfoNVX ( @@ -68,5 +68,11 @@ public MultiviewPerViewAttributesInfoNVX [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "perViewAttributesPositionXOnly")] public Bool32 PerViewAttributesPositionXOnly; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MultiviewPerViewAttributesInfoNvx; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/MutableDescriptorTypeCreateInfoVALVE.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/MutableDescriptorTypeCreateInfoVALVE.gen.cs index 6dfd9f7d0b..2ada2d394b 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 : IStructuredType { public MutableDescriptorTypeCreateInfoVALVE ( @@ -68,5 +68,11 @@ public MutableDescriptorTypeCreateInfoVALVE [NativeName("Type.Name", "VkMutableDescriptorTypeListVALVE")] [NativeName("Name", "pMutableDescriptorTypeLists")] public MutableDescriptorTypeListVALVE* PMutableDescriptorTypeLists; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.MutableDescriptorTypeCreateInfoValve; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/NativeBufferANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/NativeBufferANDROID.gen.cs index a871356874..c8c1bcad2e 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 : IStructuredType { public NativeBufferANDROID ( @@ -101,5 +101,11 @@ public NativeBufferANDROID [NativeName("Type.Name", "VkNativeBufferUsage2ANDROID")] [NativeName("Name", "usage2")] public NativeBufferUsage2ANDROID Usage2; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.NativeBufferAndroid; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceConfigurationAcquireInfoINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceConfigurationAcquireInfoINTEL.gen.cs index 643e6bd7fb..22ba22520f 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 : IStructuredType { public PerformanceConfigurationAcquireInfoINTEL ( @@ -57,5 +57,11 @@ public PerformanceConfigurationAcquireInfoINTEL [NativeName("Type.Name", "VkPerformanceConfigurationTypeINTEL")] [NativeName("Name", "type")] public PerformanceConfigurationTypeINTEL Type; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PerformanceConfigurationAcquireInfoIntel; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceCounterDescriptionKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceCounterDescriptionKHR.gen.cs index d0af0f6b46..5c187ead43 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 : IStructuredType { public PerformanceCounterDescriptionKHR ( @@ -72,5 +72,11 @@ public PerformanceCounterDescriptionKHR [NativeName("Type.Name", "char")] [NativeName("Name", "description")] public fixed byte Description[256]; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PerformanceCounterDescriptionKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceCounterKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceCounterKHR.gen.cs index 02ae97c977..c63758be75 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 : IStructuredType { public PerformanceCounterKHR ( @@ -84,5 +84,11 @@ public PerformanceCounterKHR [NativeName("Type.Name", "uint8_t")] [NativeName("Name", "uuid")] public fixed byte Uuid[16]; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PerformanceCounterKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceMarkerInfoINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceMarkerInfoINTEL.gen.cs index 865b97a089..6d46131002 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 : IStructuredType { public PerformanceMarkerInfoINTEL ( @@ -57,5 +57,11 @@ public PerformanceMarkerInfoINTEL [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "marker")] public ulong Marker; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PerformanceMarkerInfoIntel; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceOverrideInfoINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceOverrideInfoINTEL.gen.cs index 49f4c17597..70cd90fe8d 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 : IStructuredType { public PerformanceOverrideInfoINTEL ( @@ -79,5 +79,11 @@ public PerformanceOverrideInfoINTEL [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "parameter")] public ulong Parameter; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PerformanceOverrideInfoIntel; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceQuerySubmitInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceQuerySubmitInfoKHR.gen.cs index 7db26dfc9c..106abed712 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 : IStructuredType { public PerformanceQuerySubmitInfoKHR ( @@ -57,5 +57,11 @@ public PerformanceQuerySubmitInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "counterPassIndex")] public uint CounterPassIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PerformanceQuerySubmitInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceStreamMarkerInfoINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PerformanceStreamMarkerInfoINTEL.gen.cs index a46295bf88..e6b2006a46 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 : IStructuredType { public PerformanceStreamMarkerInfoINTEL ( @@ -57,5 +57,11 @@ public PerformanceStreamMarkerInfoINTEL [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "marker")] public uint Marker; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PerformanceStreamMarkerInfoIntel; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeatures.gen.cs index 3ffdaae961..906fe6a0aa 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevice16BitStorageFeatures")] - public unsafe partial struct PhysicalDevice16BitStorageFeatures + public unsafe partial struct PhysicalDevice16BitStorageFeatures : IStructuredType { public PhysicalDevice16BitStorageFeatures ( @@ -90,5 +90,11 @@ public PhysicalDevice16BitStorageFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "storageInputOutput16")] public Bool32 StorageInputOutput16; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevice16BitStorageFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeaturesKHR.gen.cs index dc7f82fc2c..140d0d1630 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice16BitStorageFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevice16BitStorageFeaturesKHR")] - public unsafe partial struct PhysicalDevice16BitStorageFeaturesKHR + public unsafe partial struct PhysicalDevice16BitStorageFeaturesKHR : IStructuredType { public PhysicalDevice16BitStorageFeaturesKHR ( @@ -90,5 +90,11 @@ public PhysicalDevice16BitStorageFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "storageInputOutput16")] public Bool32 StorageInputOutput16; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevice16BitStorageFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice4444FormatsFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice4444FormatsFeaturesEXT.gen.cs index b0bfaff10c..313913bf43 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 : IStructuredType { public PhysicalDevice4444FormatsFeaturesEXT ( @@ -68,5 +68,11 @@ public PhysicalDevice4444FormatsFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "formatA4B4G4R4")] public Bool32 FormatA4B4G4R4; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevice4444FormatsFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeatures.gen.cs index ad813e3e3d..7d7d8d42de 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevice8BitStorageFeatures")] - public unsafe partial struct PhysicalDevice8BitStorageFeatures + public unsafe partial struct PhysicalDevice8BitStorageFeatures : IStructuredType { public PhysicalDevice8BitStorageFeatures ( @@ -79,5 +79,11 @@ public PhysicalDevice8BitStorageFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "storagePushConstant8")] public Bool32 StoragePushConstant8; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevice8BitStorageFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeaturesKHR.gen.cs index 8f39a66a6c..133f6814f8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevice8BitStorageFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevice8BitStorageFeaturesKHR")] - public unsafe partial struct PhysicalDevice8BitStorageFeaturesKHR + public unsafe partial struct PhysicalDevice8BitStorageFeaturesKHR : IStructuredType { public PhysicalDevice8BitStorageFeaturesKHR ( @@ -79,5 +79,11 @@ public PhysicalDevice8BitStorageFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "storagePushConstant8")] public Bool32 StoragePushConstant8; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevice8BitStorageFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceASTCDecodeFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceASTCDecodeFeaturesEXT.gen.cs index a488347e44..536e75cf77 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 : IStructuredType { public PhysicalDeviceASTCDecodeFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceASTCDecodeFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "decodeModeSharedExponent")] public Bool32 DecodeModeSharedExponent; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceAstcDecodeFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceAccelerationStructureFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceAccelerationStructureFeaturesKHR.gen.cs index 944257597c..b92c8e78af 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 : IStructuredType { public PhysicalDeviceAccelerationStructureFeaturesKHR ( @@ -101,5 +101,11 @@ public PhysicalDeviceAccelerationStructureFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "descriptorBindingAccelerationStructureUpdateAfterBind")] public Bool32 DescriptorBindingAccelerationStructureUpdateAfterBind; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceAccelerationStructureFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceAccelerationStructurePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceAccelerationStructurePropertiesKHR.gen.cs index 2d5f0cdfd0..4774a28bc3 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 : IStructuredType { public PhysicalDeviceAccelerationStructurePropertiesKHR ( @@ -134,5 +134,11 @@ public PhysicalDeviceAccelerationStructurePropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "minAccelerationStructureScratchOffsetAlignment")] public uint MinAccelerationStructureScratchOffsetAlignment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceAccelerationStructurePropertiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBlendOperationAdvancedFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBlendOperationAdvancedFeaturesEXT.gen.cs index 74126f7509..66c53ef0d1 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 : IStructuredType { public PhysicalDeviceBlendOperationAdvancedFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceBlendOperationAdvancedFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "advancedBlendCoherentOperations")] public Bool32 AdvancedBlendCoherentOperations; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceBlendOperationAdvancedFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBlendOperationAdvancedPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBlendOperationAdvancedPropertiesEXT.gen.cs index 1c4c0dca21..ba6d1b32d6 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 : IStructuredType { public PhysicalDeviceBlendOperationAdvancedPropertiesEXT ( @@ -112,5 +112,11 @@ public PhysicalDeviceBlendOperationAdvancedPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "advancedBlendAllOperations")] public Bool32 AdvancedBlendAllOperations; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceBlendOperationAdvancedPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBorderColorSwizzleFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBorderColorSwizzleFeaturesEXT.gen.cs index 92b8806436..d4baaa9651 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 : IStructuredType { public PhysicalDeviceBorderColorSwizzleFeaturesEXT ( @@ -68,5 +68,11 @@ public PhysicalDeviceBorderColorSwizzleFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "borderColorSwizzleFromImage")] public Bool32 BorderColorSwizzleFromImage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceBorderColorSwizzleFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferAddressFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferAddressFeaturesEXT.gen.cs index 4a63786968..ca5b3b8d9f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferAddressFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferAddressFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceBufferAddressFeaturesEXT")] - public unsafe partial struct PhysicalDeviceBufferAddressFeaturesEXT + public unsafe partial struct PhysicalDeviceBufferAddressFeaturesEXT : IStructuredType { public PhysicalDeviceBufferAddressFeaturesEXT ( @@ -79,5 +79,11 @@ public PhysicalDeviceBufferAddressFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "bufferDeviceAddressMultiDevice")] public Bool32 BufferDeviceAddressMultiDevice; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceBufferDeviceAddressFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeatures.gen.cs index 72694ea1ad..de87068cf4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceBufferDeviceAddressFeatures")] - public unsafe partial struct PhysicalDeviceBufferDeviceAddressFeatures + public unsafe partial struct PhysicalDeviceBufferDeviceAddressFeatures : IStructuredType { public PhysicalDeviceBufferDeviceAddressFeatures ( @@ -79,5 +79,11 @@ public PhysicalDeviceBufferDeviceAddressFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "bufferDeviceAddressMultiDevice")] public Bool32 BufferDeviceAddressMultiDevice; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceBufferDeviceAddressFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesEXT.gen.cs index 3651804522..b01b9b45f8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceBufferDeviceAddressFeaturesEXT")] - public unsafe partial struct PhysicalDeviceBufferDeviceAddressFeaturesEXT + public unsafe partial struct PhysicalDeviceBufferDeviceAddressFeaturesEXT : IStructuredType { public PhysicalDeviceBufferDeviceAddressFeaturesEXT ( @@ -79,5 +79,11 @@ public PhysicalDeviceBufferDeviceAddressFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "bufferDeviceAddressMultiDevice")] public Bool32 BufferDeviceAddressMultiDevice; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceBufferDeviceAddressFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesKHR.gen.cs index a033f6998e..8c60bd7970 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceBufferDeviceAddressFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceBufferDeviceAddressFeaturesKHR")] - public unsafe partial struct PhysicalDeviceBufferDeviceAddressFeaturesKHR + public unsafe partial struct PhysicalDeviceBufferDeviceAddressFeaturesKHR : IStructuredType { public PhysicalDeviceBufferDeviceAddressFeaturesKHR ( @@ -79,5 +79,11 @@ public PhysicalDeviceBufferDeviceAddressFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "bufferDeviceAddressMultiDevice")] public Bool32 BufferDeviceAddressMultiDevice; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceBufferDeviceAddressFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCoherentMemoryFeaturesAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCoherentMemoryFeaturesAMD.gen.cs index 5b9bb6aedb..e611384787 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 : IStructuredType { public PhysicalDeviceCoherentMemoryFeaturesAMD ( @@ -57,5 +57,11 @@ public PhysicalDeviceCoherentMemoryFeaturesAMD [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "deviceCoherentMemory")] public Bool32 DeviceCoherentMemory; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceCoherentMemoryFeaturesAmd; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceColorWriteEnableFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceColorWriteEnableFeaturesEXT.gen.cs index 1de3edc91b..8c0de08813 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 : IStructuredType { public PhysicalDeviceColorWriteEnableFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceColorWriteEnableFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "colorWriteEnable")] public Bool32 ColorWriteEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceColorWriteEnableFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceComputeShaderDerivativesFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceComputeShaderDerivativesFeaturesNV.gen.cs index e870ce4077..bad29ff616 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 : IStructuredType { public PhysicalDeviceComputeShaderDerivativesFeaturesNV ( @@ -68,5 +68,11 @@ public PhysicalDeviceComputeShaderDerivativesFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "computeDerivativeGroupLinear")] public Bool32 ComputeDerivativeGroupLinear; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceComputeShaderDerivativesFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceConditionalRenderingFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceConditionalRenderingFeaturesEXT.gen.cs index bd68973d19..16152959cb 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 : IStructuredType { public PhysicalDeviceConditionalRenderingFeaturesEXT ( @@ -68,5 +68,11 @@ public PhysicalDeviceConditionalRenderingFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "inheritedConditionalRendering")] public Bool32 InheritedConditionalRendering; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceConditionalRenderingFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceConservativeRasterizationPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceConservativeRasterizationPropertiesEXT.gen.cs index 80dfb183ac..bd8729e216 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 : IStructuredType { public PhysicalDeviceConservativeRasterizationPropertiesEXT ( @@ -145,5 +145,11 @@ public PhysicalDeviceConservativeRasterizationPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "conservativeRasterizationPostDepthCoverage")] public Bool32 ConservativeRasterizationPostDepthCoverage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceConservativeRasterizationPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCooperativeMatrixFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCooperativeMatrixFeaturesNV.gen.cs index 28c3ba756f..b96f9b0b88 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 : IStructuredType { public PhysicalDeviceCooperativeMatrixFeaturesNV ( @@ -68,5 +68,11 @@ public PhysicalDeviceCooperativeMatrixFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "cooperativeMatrixRobustBufferAccess")] public Bool32 CooperativeMatrixRobustBufferAccess; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceCooperativeMatrixFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCooperativeMatrixPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCooperativeMatrixPropertiesNV.gen.cs index e5b0ebcdee..56dfd47271 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 : IStructuredType { public PhysicalDeviceCooperativeMatrixPropertiesNV ( @@ -57,5 +57,11 @@ public PhysicalDeviceCooperativeMatrixPropertiesNV [NativeName("Type.Name", "VkShaderStageFlags")] [NativeName("Name", "cooperativeMatrixSupportedStages")] public ShaderStageFlags CooperativeMatrixSupportedStages; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceCooperativeMatrixPropertiesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCornerSampledImageFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCornerSampledImageFeaturesNV.gen.cs index 85cfe29d4c..77698258ca 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 : IStructuredType { public PhysicalDeviceCornerSampledImageFeaturesNV ( @@ -57,5 +57,11 @@ public PhysicalDeviceCornerSampledImageFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "cornerSampledImage")] public Bool32 CornerSampledImage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceCornerSampledImageFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCoverageReductionModeFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCoverageReductionModeFeaturesNV.gen.cs index 1f2f02e01a..8f023f094e 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 : IStructuredType { public PhysicalDeviceCoverageReductionModeFeaturesNV ( @@ -57,5 +57,11 @@ public PhysicalDeviceCoverageReductionModeFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "coverageReductionMode")] public Bool32 CoverageReductionMode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceCoverageReductionModeFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCustomBorderColorFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCustomBorderColorFeaturesEXT.gen.cs index f51c857928..25f6949d57 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 : IStructuredType { public PhysicalDeviceCustomBorderColorFeaturesEXT ( @@ -68,5 +68,11 @@ public PhysicalDeviceCustomBorderColorFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "customBorderColorWithoutFormat")] public Bool32 CustomBorderColorWithoutFormat; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceCustomBorderColorFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCustomBorderColorPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceCustomBorderColorPropertiesEXT.gen.cs index 6960df45e8..b1e11427fb 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 : IStructuredType { public PhysicalDeviceCustomBorderColorPropertiesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceCustomBorderColorPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxCustomBorderColorSamplers")] public uint MaxCustomBorderColorSamplers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceCustomBorderColorPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV.gen.cs index a6632ba7bd..f18be92a8d 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 : IStructuredType { public PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV ( @@ -57,5 +57,11 @@ public PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "dedicatedAllocationImageAliasing")] public Bool32 DedicatedAllocationImageAliasing; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDedicatedAllocationImageAliasingFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthClipEnableFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthClipEnableFeaturesEXT.gen.cs index 7d4127d32f..a41a97fc3d 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 : IStructuredType { public PhysicalDeviceDepthClipEnableFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceDepthClipEnableFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "depthClipEnable")] public Bool32 DepthClipEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDepthClipEnableFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolveProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolveProperties.gen.cs index 5d40ccc428..0cf48d5642 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolveProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolveProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDepthStencilResolveProperties")] - public unsafe partial struct PhysicalDeviceDepthStencilResolveProperties + public unsafe partial struct PhysicalDeviceDepthStencilResolveProperties : IStructuredType { public PhysicalDeviceDepthStencilResolveProperties ( @@ -90,5 +90,11 @@ public PhysicalDeviceDepthStencilResolveProperties [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "independentResolve")] public Bool32 IndependentResolve; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDepthStencilResolveProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolvePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolvePropertiesKHR.gen.cs index d90b2dc7cd..7765cdc09a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolvePropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDepthStencilResolvePropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDepthStencilResolvePropertiesKHR")] - public unsafe partial struct PhysicalDeviceDepthStencilResolvePropertiesKHR + public unsafe partial struct PhysicalDeviceDepthStencilResolvePropertiesKHR : IStructuredType { public PhysicalDeviceDepthStencilResolvePropertiesKHR ( @@ -90,5 +90,11 @@ public PhysicalDeviceDepthStencilResolvePropertiesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "independentResolve")] public Bool32 IndependentResolve; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDepthStencilResolveProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeatures.gen.cs index e54ebcdc73..da7550b54b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDescriptorIndexingFeatures")] - public unsafe partial struct PhysicalDeviceDescriptorIndexingFeatures + public unsafe partial struct PhysicalDeviceDescriptorIndexingFeatures : IStructuredType { public PhysicalDeviceDescriptorIndexingFeatures ( @@ -266,5 +266,11 @@ public PhysicalDeviceDescriptorIndexingFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "runtimeDescriptorArray")] public Bool32 RuntimeDescriptorArray; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDescriptorIndexingFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeaturesEXT.gen.cs index 4ab18527b5..9cc2214006 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDescriptorIndexingFeaturesEXT")] - public unsafe partial struct PhysicalDeviceDescriptorIndexingFeaturesEXT + public unsafe partial struct PhysicalDeviceDescriptorIndexingFeaturesEXT : IStructuredType { public PhysicalDeviceDescriptorIndexingFeaturesEXT ( @@ -266,5 +266,11 @@ public PhysicalDeviceDescriptorIndexingFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "runtimeDescriptorArray")] public Bool32 RuntimeDescriptorArray; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDescriptorIndexingFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingProperties.gen.cs index 21f90850bd..cc68572727 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDescriptorIndexingProperties")] - public unsafe partial struct PhysicalDeviceDescriptorIndexingProperties + public unsafe partial struct PhysicalDeviceDescriptorIndexingProperties : IStructuredType { public PhysicalDeviceDescriptorIndexingProperties ( @@ -299,5 +299,11 @@ public PhysicalDeviceDescriptorIndexingProperties [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxDescriptorSetUpdateAfterBindInputAttachments")] public uint MaxDescriptorSetUpdateAfterBindInputAttachments; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDescriptorIndexingProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingPropertiesEXT.gen.cs index 5b645661f5..e51d4292a0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDescriptorIndexingPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDescriptorIndexingPropertiesEXT")] - public unsafe partial struct PhysicalDeviceDescriptorIndexingPropertiesEXT + public unsafe partial struct PhysicalDeviceDescriptorIndexingPropertiesEXT : IStructuredType { public PhysicalDeviceDescriptorIndexingPropertiesEXT ( @@ -299,5 +299,11 @@ public PhysicalDeviceDescriptorIndexingPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxDescriptorSetUpdateAfterBindInputAttachments")] public uint MaxDescriptorSetUpdateAfterBindInputAttachments; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDescriptorIndexingProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceGeneratedCommandsFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceGeneratedCommandsFeaturesNV.gen.cs index 1a9e1f6f37..11ec074639 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 : IStructuredType { public PhysicalDeviceDeviceGeneratedCommandsFeaturesNV ( @@ -57,5 +57,11 @@ public PhysicalDeviceDeviceGeneratedCommandsFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "deviceGeneratedCommands")] public Bool32 DeviceGeneratedCommands; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDeviceGeneratedCommandsFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceGeneratedCommandsPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceGeneratedCommandsPropertiesNV.gen.cs index d8292d1263..2351e0f0b5 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 : IStructuredType { public PhysicalDeviceDeviceGeneratedCommandsPropertiesNV ( @@ -145,5 +145,11 @@ public PhysicalDeviceDeviceGeneratedCommandsPropertiesNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "minIndirectCommandsBufferOffsetAlignment")] public uint MinIndirectCommandsBufferOffsetAlignment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDeviceGeneratedCommandsPropertiesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceMemoryReportFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDeviceMemoryReportFeaturesEXT.gen.cs index 3b6cc4a601..99fe04a72a 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 : IStructuredType { public PhysicalDeviceDeviceMemoryReportFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceDeviceMemoryReportFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "deviceMemoryReport")] public Bool32 DeviceMemoryReport; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDeviceMemoryReportFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDiagnosticsConfigFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDiagnosticsConfigFeaturesNV.gen.cs index 0efdc51b48..6d9d418577 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 : IStructuredType { public PhysicalDeviceDiagnosticsConfigFeaturesNV ( @@ -57,5 +57,11 @@ public PhysicalDeviceDiagnosticsConfigFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "diagnosticsConfig")] public Bool32 DiagnosticsConfig; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDiagnosticsConfigFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDiscardRectanglePropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDiscardRectanglePropertiesEXT.gen.cs index 038b44de8e..1407f4de99 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 : IStructuredType { public PhysicalDeviceDiscardRectanglePropertiesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceDiscardRectanglePropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxDiscardRectangles")] public uint MaxDiscardRectangles; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDiscardRectanglePropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverProperties.gen.cs index da964dd1f9..c4d50423bb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDriverProperties")] - public unsafe partial struct PhysicalDeviceDriverProperties + public unsafe partial struct PhysicalDeviceDriverProperties : IStructuredType { public PhysicalDeviceDriverProperties ( @@ -78,5 +78,11 @@ public PhysicalDeviceDriverProperties [NativeName("Type.Name", "VkConformanceVersion")] [NativeName("Name", "conformanceVersion")] public ConformanceVersion ConformanceVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDriverProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverPropertiesKHR.gen.cs index 7e1301dd45..6a4bf68086 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDriverPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceDriverPropertiesKHR")] - public unsafe partial struct PhysicalDeviceDriverPropertiesKHR + public unsafe partial struct PhysicalDeviceDriverPropertiesKHR : IStructuredType { public PhysicalDeviceDriverPropertiesKHR ( @@ -78,5 +78,11 @@ public PhysicalDeviceDriverPropertiesKHR [NativeName("Type.Name", "VkConformanceVersion")] [NativeName("Name", "conformanceVersion")] public ConformanceVersion ConformanceVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDriverProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDrmPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDrmPropertiesEXT.gen.cs index b3c9f8bb23..09b299c2da 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 : IStructuredType { public PhysicalDeviceDrmPropertiesEXT ( @@ -112,5 +112,11 @@ public PhysicalDeviceDrmPropertiesEXT [NativeName("Type.Name", "int64_t")] [NativeName("Name", "renderMinor")] public long RenderMinor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDrmPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDynamicRenderingFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceDynamicRenderingFeaturesKHR.gen.cs index e2702a9cf8..a4dc03bed3 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 : IStructuredType { public PhysicalDeviceDynamicRenderingFeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceDynamicRenderingFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "dynamicRendering")] public Bool32 DynamicRendering; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceDynamicRenderingFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExclusiveScissorFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExclusiveScissorFeaturesNV.gen.cs index d60eee12dd..f94deea93b 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 : IStructuredType { public PhysicalDeviceExclusiveScissorFeaturesNV ( @@ -57,5 +57,11 @@ public PhysicalDeviceExclusiveScissorFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "exclusiveScissor")] public Bool32 ExclusiveScissor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExclusiveScissorFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExtendedDynamicState2FeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExtendedDynamicState2FeaturesEXT.gen.cs index 436ede350a..284a3d3364 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 : IStructuredType { public PhysicalDeviceExtendedDynamicState2FeaturesEXT ( @@ -79,5 +79,11 @@ public PhysicalDeviceExtendedDynamicState2FeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "extendedDynamicState2PatchControlPoints")] public Bool32 ExtendedDynamicState2PatchControlPoints; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExtendedDynamicState2FeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExtendedDynamicStateFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExtendedDynamicStateFeaturesEXT.gen.cs index 095369c306..52f12fead2 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 : IStructuredType { public PhysicalDeviceExtendedDynamicStateFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceExtendedDynamicStateFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "extendedDynamicState")] public Bool32 ExtendedDynamicState; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExtendedDynamicStateFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfo.gen.cs index ead84c4e20..55b8eb2373 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalBufferInfo")] - public unsafe partial struct PhysicalDeviceExternalBufferInfo + public unsafe partial struct PhysicalDeviceExternalBufferInfo : IStructuredType { public PhysicalDeviceExternalBufferInfo ( @@ -79,5 +79,11 @@ public PhysicalDeviceExternalBufferInfo [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalBufferInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfoKHR.gen.cs index 0ea403be72..c5adac3db6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalBufferInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalBufferInfoKHR")] - public unsafe partial struct PhysicalDeviceExternalBufferInfoKHR + public unsafe partial struct PhysicalDeviceExternalBufferInfoKHR : IStructuredType { public PhysicalDeviceExternalBufferInfoKHR ( @@ -79,5 +79,11 @@ public PhysicalDeviceExternalBufferInfoKHR [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalBufferInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfo.gen.cs index 0e39013aee..cdac0fad52 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalFenceInfo")] - public unsafe partial struct PhysicalDeviceExternalFenceInfo + public unsafe partial struct PhysicalDeviceExternalFenceInfo : IStructuredType { public PhysicalDeviceExternalFenceInfo ( @@ -57,5 +57,11 @@ public PhysicalDeviceExternalFenceInfo [NativeName("Type.Name", "VkExternalFenceHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalFenceHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalFenceInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfoKHR.gen.cs index bff095483a..42035e9142 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalFenceInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalFenceInfoKHR")] - public unsafe partial struct PhysicalDeviceExternalFenceInfoKHR + public unsafe partial struct PhysicalDeviceExternalFenceInfoKHR : IStructuredType { public PhysicalDeviceExternalFenceInfoKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceExternalFenceInfoKHR [NativeName("Type.Name", "VkExternalFenceHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalFenceHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalFenceInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfo.gen.cs index 40a110c063..e2076c6221 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalImageFormatInfo")] - public unsafe partial struct PhysicalDeviceExternalImageFormatInfo + public unsafe partial struct PhysicalDeviceExternalImageFormatInfo : IStructuredType { public PhysicalDeviceExternalImageFormatInfo ( @@ -57,5 +57,11 @@ public PhysicalDeviceExternalImageFormatInfo [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalImageFormatInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfoKHR.gen.cs index 8149a5bebd..95c93f4234 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalImageFormatInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalImageFormatInfoKHR")] - public unsafe partial struct PhysicalDeviceExternalImageFormatInfoKHR + public unsafe partial struct PhysicalDeviceExternalImageFormatInfoKHR : IStructuredType { public PhysicalDeviceExternalImageFormatInfoKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceExternalImageFormatInfoKHR [NativeName("Type.Name", "VkExternalMemoryHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalMemoryHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalImageFormatInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalMemoryHostPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalMemoryHostPropertiesEXT.gen.cs index 754af5e798..0e855946d0 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 : IStructuredType { public PhysicalDeviceExternalMemoryHostPropertiesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceExternalMemoryHostPropertiesEXT [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "minImportedHostPointerAlignment")] public ulong MinImportedHostPointerAlignment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalMemoryHostPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalMemoryRDMAFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalMemoryRDMAFeaturesNV.gen.cs index 88cb7ace3f..fac627303e 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 : IStructuredType { public PhysicalDeviceExternalMemoryRDMAFeaturesNV ( @@ -57,5 +57,11 @@ public PhysicalDeviceExternalMemoryRDMAFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "externalMemoryRDMA")] public Bool32 ExternalMemoryRdma; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalMemoryRdmaFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfo.gen.cs index 0dd995e60e..bbaae33036 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalSemaphoreInfo")] - public unsafe partial struct PhysicalDeviceExternalSemaphoreInfo + public unsafe partial struct PhysicalDeviceExternalSemaphoreInfo : IStructuredType { public PhysicalDeviceExternalSemaphoreInfo ( @@ -57,5 +57,11 @@ public PhysicalDeviceExternalSemaphoreInfo [NativeName("Type.Name", "VkExternalSemaphoreHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalSemaphoreHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalSemaphoreInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfoKHR.gen.cs index d5e07ed20e..3139dd2a17 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceExternalSemaphoreInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceExternalSemaphoreInfoKHR")] - public unsafe partial struct PhysicalDeviceExternalSemaphoreInfoKHR + public unsafe partial struct PhysicalDeviceExternalSemaphoreInfoKHR : IStructuredType { public PhysicalDeviceExternalSemaphoreInfoKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceExternalSemaphoreInfoKHR [NativeName("Type.Name", "VkExternalSemaphoreHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalSemaphoreHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceExternalSemaphoreInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2.gen.cs index f4e1773ec7..c6895c8970 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFeatures2")] - public unsafe partial struct PhysicalDeviceFeatures2 + public unsafe partial struct PhysicalDeviceFeatures2 : IStructuredType { public PhysicalDeviceFeatures2 ( @@ -57,5 +57,11 @@ public PhysicalDeviceFeatures2 [NativeName("Type.Name", "VkPhysicalDeviceFeatures")] [NativeName("Name", "features")] public PhysicalDeviceFeatures Features; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFeatures2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2KHR.gen.cs index 20b4e344fe..e9b533a8c6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFeatures2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFeatures2KHR")] - public unsafe partial struct PhysicalDeviceFeatures2KHR + public unsafe partial struct PhysicalDeviceFeatures2KHR : IStructuredType { public PhysicalDeviceFeatures2KHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceFeatures2KHR [NativeName("Type.Name", "VkPhysicalDeviceFeatures")] [NativeName("Name", "features")] public PhysicalDeviceFeatures Features; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFeatures2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloat16Int8FeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloat16Int8FeaturesKHR.gen.cs index acac75bd9f..5ec777c2a9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloat16Int8FeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloat16Int8FeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFloat16Int8FeaturesKHR")] - public unsafe partial struct PhysicalDeviceFloat16Int8FeaturesKHR + public unsafe partial struct PhysicalDeviceFloat16Int8FeaturesKHR : IStructuredType { public PhysicalDeviceFloat16Int8FeaturesKHR ( @@ -68,5 +68,11 @@ public PhysicalDeviceFloat16Int8FeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderInt8")] public Bool32 ShaderInt8; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderFloat16Int8Features; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsProperties.gen.cs index 5a56e03703..c47a13f5b0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFloatControlsProperties")] - public unsafe partial struct PhysicalDeviceFloatControlsProperties + public unsafe partial struct PhysicalDeviceFloatControlsProperties : IStructuredType { public PhysicalDeviceFloatControlsProperties ( @@ -233,5 +233,11 @@ public PhysicalDeviceFloatControlsProperties [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderRoundingModeRTZFloat64")] public Bool32 ShaderRoundingModeRtzfloat64; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFloatControlsProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsPropertiesKHR.gen.cs index 414ce966f6..f18918d405 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFloatControlsPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceFloatControlsPropertiesKHR")] - public unsafe partial struct PhysicalDeviceFloatControlsPropertiesKHR + public unsafe partial struct PhysicalDeviceFloatControlsPropertiesKHR : IStructuredType { public PhysicalDeviceFloatControlsPropertiesKHR ( @@ -233,5 +233,11 @@ public PhysicalDeviceFloatControlsPropertiesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderRoundingModeRTZFloat64")] public Bool32 ShaderRoundingModeRtzfloat64; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFloatControlsProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMap2FeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMap2FeaturesEXT.gen.cs index e376432c25..ba02f9bcd6 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 : IStructuredType { public PhysicalDeviceFragmentDensityMap2FeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceFragmentDensityMap2FeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "fragmentDensityMapDeferred")] public Bool32 FragmentDensityMapDeferred; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentDensityMap2FeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMap2PropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMap2PropertiesEXT.gen.cs index 0b097976b0..c5fb8d408f 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 : IStructuredType { public PhysicalDeviceFragmentDensityMap2PropertiesEXT ( @@ -90,5 +90,11 @@ public PhysicalDeviceFragmentDensityMap2PropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxDescriptorSetSubsampledSamplers")] public uint MaxDescriptorSetSubsampledSamplers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentDensityMap2PropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMapFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMapFeaturesEXT.gen.cs index 8724d9f3d8..a1ae607627 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 : IStructuredType { public PhysicalDeviceFragmentDensityMapFeaturesEXT ( @@ -79,5 +79,11 @@ public PhysicalDeviceFragmentDensityMapFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "fragmentDensityMapNonSubsampledImages")] public Bool32 FragmentDensityMapNonSubsampledImages; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentDensityMapFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMapPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentDensityMapPropertiesEXT.gen.cs index 9adfaed054..f0faa36b0a 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 : IStructuredType { public PhysicalDeviceFragmentDensityMapPropertiesEXT ( @@ -79,5 +79,11 @@ public PhysicalDeviceFragmentDensityMapPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "fragmentDensityInvocations")] public Bool32 FragmentDensityInvocations; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentDensityMapPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShaderBarycentricFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShaderBarycentricFeaturesNV.gen.cs index 4de881fe47..382a1558fc 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 : IStructuredType { public PhysicalDeviceFragmentShaderBarycentricFeaturesNV ( @@ -57,5 +57,11 @@ public PhysicalDeviceFragmentShaderBarycentricFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "fragmentShaderBarycentric")] public Bool32 FragmentShaderBarycentric; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentShaderBarycentricFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShaderInterlockFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShaderInterlockFeaturesEXT.gen.cs index 2453b85f62..75e9f7648e 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 : IStructuredType { public PhysicalDeviceFragmentShaderInterlockFeaturesEXT ( @@ -79,5 +79,11 @@ public PhysicalDeviceFragmentShaderInterlockFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "fragmentShaderShadingRateInterlock")] public Bool32 FragmentShaderShadingRateInterlock; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentShaderInterlockFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateEnumsFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateEnumsFeaturesNV.gen.cs index ba46090b4e..f5dbc107bf 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 : IStructuredType { public PhysicalDeviceFragmentShadingRateEnumsFeaturesNV ( @@ -79,5 +79,11 @@ public PhysicalDeviceFragmentShadingRateEnumsFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "noInvocationFragmentShadingRates")] public Bool32 NoInvocationFragmentShadingRates; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentShadingRateEnumsFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateEnumsPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateEnumsPropertiesNV.gen.cs index e8e18ea03b..3c3dd01a56 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 : IStructuredType { public PhysicalDeviceFragmentShadingRateEnumsPropertiesNV ( @@ -57,5 +57,11 @@ public PhysicalDeviceFragmentShadingRateEnumsPropertiesNV [NativeName("Type.Name", "VkSampleCountFlagBits")] [NativeName("Name", "maxFragmentShadingRateInvocationCount")] public SampleCountFlags MaxFragmentShadingRateInvocationCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentShadingRateEnumsPropertiesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateFeaturesKHR.gen.cs index 4e78097452..e737f96961 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 : IStructuredType { public PhysicalDeviceFragmentShadingRateFeaturesKHR ( @@ -79,5 +79,11 @@ public PhysicalDeviceFragmentShadingRateFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "attachmentFragmentShadingRate")] public Bool32 AttachmentFragmentShadingRate; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentShadingRateFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRateKHR.gen.cs index ecd249e727..eb7ce16026 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 : IStructuredType { public PhysicalDeviceFragmentShadingRateKHR ( @@ -68,5 +68,11 @@ public PhysicalDeviceFragmentShadingRateKHR [NativeName("Type.Name", "VkExtent2D")] [NativeName("Name", "fragmentSize")] public Extent2D FragmentSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentShadingRateKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRatePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceFragmentShadingRatePropertiesKHR.gen.cs index 6c4807d17e..6afe9ccee1 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 : IStructuredType { public PhysicalDeviceFragmentShadingRatePropertiesKHR ( @@ -233,5 +233,11 @@ public PhysicalDeviceFragmentShadingRatePropertiesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "fragmentShadingRateStrictMultiplyCombiner")] public Bool32 FragmentShadingRateStrictMultiplyCombiner; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceFragmentShadingRatePropertiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGlobalPriorityQueryFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGlobalPriorityQueryFeaturesEXT.gen.cs index 4eb645bca2..7ca2aa8191 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 : IStructuredType { public PhysicalDeviceGlobalPriorityQueryFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceGlobalPriorityQueryFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "globalPriorityQuery")] public Bool32 GlobalPriorityQuery; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceGlobalPriorityQueryFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupProperties.gen.cs index 6c4a90021e..48e6771e79 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceGroupProperties")] - public unsafe partial struct PhysicalDeviceGroupProperties + public unsafe partial struct PhysicalDeviceGroupProperties : IStructuredType { public PhysicalDeviceGroupProperties ( @@ -130,5 +130,11 @@ public Span AsSpan() [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "subsetAllocation")] public Bool32 SubsetAllocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceGroupProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupPropertiesKHR.gen.cs index a47145b20e..cde07ae165 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceGroupPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceGroupPropertiesKHR")] - public unsafe partial struct PhysicalDeviceGroupPropertiesKHR + public unsafe partial struct PhysicalDeviceGroupPropertiesKHR : IStructuredType { public PhysicalDeviceGroupPropertiesKHR ( @@ -130,5 +130,11 @@ public Span AsSpan() [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "subsetAllocation")] public Bool32 SubsetAllocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceGroupProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeatures.gen.cs index 90b4d2b957..3a67e01491 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceHostQueryResetFeatures")] - public unsafe partial struct PhysicalDeviceHostQueryResetFeatures + public unsafe partial struct PhysicalDeviceHostQueryResetFeatures : IStructuredType { public PhysicalDeviceHostQueryResetFeatures ( @@ -57,5 +57,11 @@ public PhysicalDeviceHostQueryResetFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "hostQueryReset")] public Bool32 HostQueryReset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceHostQueryResetFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeaturesEXT.gen.cs index 960759f908..6ed8435072 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceHostQueryResetFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceHostQueryResetFeaturesEXT")] - public unsafe partial struct PhysicalDeviceHostQueryResetFeaturesEXT + public unsafe partial struct PhysicalDeviceHostQueryResetFeaturesEXT : IStructuredType { public PhysicalDeviceHostQueryResetFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceHostQueryResetFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "hostQueryReset")] public Bool32 HostQueryReset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceHostQueryResetFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDProperties.gen.cs index f31f1d221c..113e0e526d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceIDProperties")] - public unsafe partial struct PhysicalDeviceIDProperties + public unsafe partial struct PhysicalDeviceIDProperties : IStructuredType { public PhysicalDeviceIDProperties ( @@ -83,5 +83,11 @@ public PhysicalDeviceIDProperties [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "deviceLUIDValid")] public Bool32 DeviceLuidvalid; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceIDProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDPropertiesKHR.gen.cs index 6361368c62..baa4c17ebc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIDPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceIDPropertiesKHR")] - public unsafe partial struct PhysicalDeviceIDPropertiesKHR + public unsafe partial struct PhysicalDeviceIDPropertiesKHR : IStructuredType { public PhysicalDeviceIDPropertiesKHR ( @@ -83,5 +83,11 @@ public PhysicalDeviceIDPropertiesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "deviceLUIDValid")] public Bool32 DeviceLuidvalid; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceIDProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageDrmFormatModifierInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageDrmFormatModifierInfoEXT.gen.cs index cd2f57ab1a..a10801860e 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 : IStructuredType { public PhysicalDeviceImageDrmFormatModifierInfoEXT ( @@ -90,5 +90,11 @@ public PhysicalDeviceImageDrmFormatModifierInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pQueueFamilyIndices")] public uint* PQueueFamilyIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceImageDrmFormatModifierInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2.gen.cs index 7712df5d2e..1e6843fc39 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceImageFormatInfo2")] - public unsafe partial struct PhysicalDeviceImageFormatInfo2 + public unsafe partial struct PhysicalDeviceImageFormatInfo2 : IStructuredType { public PhysicalDeviceImageFormatInfo2 ( @@ -101,5 +101,11 @@ public PhysicalDeviceImageFormatInfo2 [NativeName("Type.Name", "VkImageCreateFlags")] [NativeName("Name", "flags")] public ImageCreateFlags Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceImageFormatInfo2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2KHR.gen.cs index 848c64f026..57893d6c46 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageFormatInfo2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceImageFormatInfo2KHR")] - public unsafe partial struct PhysicalDeviceImageFormatInfo2KHR + public unsafe partial struct PhysicalDeviceImageFormatInfo2KHR : IStructuredType { public PhysicalDeviceImageFormatInfo2KHR ( @@ -101,5 +101,11 @@ public PhysicalDeviceImageFormatInfo2KHR [NativeName("Type.Name", "VkImageCreateFlags")] [NativeName("Name", "flags")] public ImageCreateFlags Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceImageFormatInfo2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageRobustnessFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageRobustnessFeaturesEXT.gen.cs index f80443a309..aa85d9a378 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 : IStructuredType { public PhysicalDeviceImageRobustnessFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceImageRobustnessFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "robustImageAccess")] public Bool32 RobustImageAccess; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceImageRobustnessFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageViewImageFormatInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImageViewImageFormatInfoEXT.gen.cs index 5f201cb781..c9be9e5a9e 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 : IStructuredType { public PhysicalDeviceImageViewImageFormatInfoEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceImageViewImageFormatInfoEXT [NativeName("Type.Name", "VkImageViewType")] [NativeName("Name", "imageViewType")] public ImageViewType ImageViewType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceImageViewImageFormatInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeatures.gen.cs index 7a2a0bfd3d..a57f5764cb 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceImagelessFramebufferFeatures")] - public unsafe partial struct PhysicalDeviceImagelessFramebufferFeatures + public unsafe partial struct PhysicalDeviceImagelessFramebufferFeatures : IStructuredType { public PhysicalDeviceImagelessFramebufferFeatures ( @@ -57,5 +57,11 @@ public PhysicalDeviceImagelessFramebufferFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "imagelessFramebuffer")] public Bool32 ImagelessFramebuffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceImagelessFramebufferFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeaturesKHR.gen.cs index d7587d883f..0363b7648c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceImagelessFramebufferFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceImagelessFramebufferFeaturesKHR")] - public unsafe partial struct PhysicalDeviceImagelessFramebufferFeaturesKHR + public unsafe partial struct PhysicalDeviceImagelessFramebufferFeaturesKHR : IStructuredType { public PhysicalDeviceImagelessFramebufferFeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceImagelessFramebufferFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "imagelessFramebuffer")] public Bool32 ImagelessFramebuffer; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceImagelessFramebufferFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIndexTypeUint8FeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceIndexTypeUint8FeaturesEXT.gen.cs index d44ebe10e8..6d80108f1b 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 : IStructuredType { public PhysicalDeviceIndexTypeUint8FeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceIndexTypeUint8FeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "indexTypeUint8")] public Bool32 IndexTypeUint8; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceIndexTypeUint8FeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInheritedViewportScissorFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInheritedViewportScissorFeaturesNV.gen.cs index ae1e766fab..6f58774867 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 : IStructuredType { public PhysicalDeviceInheritedViewportScissorFeaturesNV ( @@ -57,5 +57,11 @@ public PhysicalDeviceInheritedViewportScissorFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "inheritedViewportScissor2D")] public Bool32 InheritedViewportScissor2D; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceInheritedViewportScissorFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInlineUniformBlockFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInlineUniformBlockFeaturesEXT.gen.cs index 129b165694..0cde16f292 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 : IStructuredType { public PhysicalDeviceInlineUniformBlockFeaturesEXT ( @@ -68,5 +68,11 @@ public PhysicalDeviceInlineUniformBlockFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "descriptorBindingInlineUniformBlockUpdateAfterBind")] public Bool32 DescriptorBindingInlineUniformBlockUpdateAfterBind; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceInlineUniformBlockFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInlineUniformBlockPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInlineUniformBlockPropertiesEXT.gen.cs index 784c293632..293c21c6d1 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 : IStructuredType { public PhysicalDeviceInlineUniformBlockPropertiesEXT ( @@ -101,5 +101,11 @@ public PhysicalDeviceInlineUniformBlockPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxDescriptorSetUpdateAfterBindInlineUniformBlocks")] public uint MaxDescriptorSetUpdateAfterBindInlineUniformBlocks; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceInlineUniformBlockPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInvocationMaskFeaturesHUAWEI.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceInvocationMaskFeaturesHUAWEI.gen.cs index d76e32277b..b2cc56dfb3 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 : IStructuredType { public PhysicalDeviceInvocationMaskFeaturesHUAWEI ( @@ -57,5 +57,11 @@ public PhysicalDeviceInvocationMaskFeaturesHUAWEI [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "invocationMask")] public Bool32 InvocationMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceInvocationMaskFeaturesHuawei; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceLineRasterizationFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceLineRasterizationFeaturesEXT.gen.cs index 6c595aff75..a265078266 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 : IStructuredType { public PhysicalDeviceLineRasterizationFeaturesEXT ( @@ -112,5 +112,11 @@ public PhysicalDeviceLineRasterizationFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "stippledSmoothLines")] public Bool32 StippledSmoothLines; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceLineRasterizationFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceLineRasterizationPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceLineRasterizationPropertiesEXT.gen.cs index f0626eb715..906ec6b114 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 : IStructuredType { public PhysicalDeviceLineRasterizationPropertiesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceLineRasterizationPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "lineSubPixelPrecisionBits")] public uint LineSubPixelPrecisionBits; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceLineRasterizationPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3Properties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3Properties.gen.cs index d411527072..0e134f4b6e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3Properties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3Properties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMaintenance3Properties")] - public unsafe partial struct PhysicalDeviceMaintenance3Properties + public unsafe partial struct PhysicalDeviceMaintenance3Properties : IStructuredType { public PhysicalDeviceMaintenance3Properties ( @@ -68,5 +68,11 @@ public PhysicalDeviceMaintenance3Properties [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "maxMemoryAllocationSize")] public ulong MaxMemoryAllocationSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMaintenance3Properties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3PropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3PropertiesKHR.gen.cs index fe3bbf0c93..fcd00923ce 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3PropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance3PropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMaintenance3PropertiesKHR")] - public unsafe partial struct PhysicalDeviceMaintenance3PropertiesKHR + public unsafe partial struct PhysicalDeviceMaintenance3PropertiesKHR : IStructuredType { public PhysicalDeviceMaintenance3PropertiesKHR ( @@ -68,5 +68,11 @@ public PhysicalDeviceMaintenance3PropertiesKHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "maxMemoryAllocationSize")] public ulong MaxMemoryAllocationSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMaintenance3Properties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance4FeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance4FeaturesKHR.gen.cs index 87dbbfa2be..aa18d0ff4f 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 : IStructuredType { public PhysicalDeviceMaintenance4FeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceMaintenance4FeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "maintenance4")] public Bool32 Maintenance4; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMaintenance4FeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance4PropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMaintenance4PropertiesKHR.gen.cs index 846a2bab22..ae21ca3ea6 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 : IStructuredType { public PhysicalDeviceMaintenance4PropertiesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceMaintenance4PropertiesKHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "maxBufferSize")] public ulong MaxBufferSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMaintenance4PropertiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryBudgetPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryBudgetPropertiesEXT.gen.cs index ecdfc59030..6880f7abfd 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 : IStructuredType { public PhysicalDeviceMemoryBudgetPropertiesEXT ( @@ -56,5 +56,11 @@ public PhysicalDeviceMemoryBudgetPropertiesEXT [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "heapUsage")] public fixed ulong HeapUsage[16]; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMemoryBudgetPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryPriorityFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryPriorityFeaturesEXT.gen.cs index b0fbffe427..669b7d155d 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 : IStructuredType { public PhysicalDeviceMemoryPriorityFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceMemoryPriorityFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "memoryPriority")] public Bool32 MemoryPriority; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMemoryPriorityFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2.gen.cs index c3f6a378ce..b007956dc9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMemoryProperties2")] - public unsafe partial struct PhysicalDeviceMemoryProperties2 + public unsafe partial struct PhysicalDeviceMemoryProperties2 : IStructuredType { public PhysicalDeviceMemoryProperties2 ( @@ -57,5 +57,11 @@ public PhysicalDeviceMemoryProperties2 [NativeName("Type.Name", "VkPhysicalDeviceMemoryProperties")] [NativeName("Name", "memoryProperties")] public PhysicalDeviceMemoryProperties MemoryProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMemoryProperties2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2KHR.gen.cs index 6446da8fb8..82e137ea78 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMemoryProperties2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMemoryProperties2KHR")] - public unsafe partial struct PhysicalDeviceMemoryProperties2KHR + public unsafe partial struct PhysicalDeviceMemoryProperties2KHR : IStructuredType { public PhysicalDeviceMemoryProperties2KHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceMemoryProperties2KHR [NativeName("Type.Name", "VkPhysicalDeviceMemoryProperties")] [NativeName("Name", "memoryProperties")] public PhysicalDeviceMemoryProperties MemoryProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMemoryProperties2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMeshShaderFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMeshShaderFeaturesNV.gen.cs index 342a7f4294..89c5f330d1 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 : IStructuredType { public PhysicalDeviceMeshShaderFeaturesNV ( @@ -68,5 +68,11 @@ public PhysicalDeviceMeshShaderFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "meshShader")] public Bool32 MeshShader; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMeshShaderFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMeshShaderPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMeshShaderPropertiesNV.gen.cs index ffa88a1f73..5b28c3f134 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 : IStructuredType { public PhysicalDeviceMeshShaderPropertiesNV ( @@ -177,5 +177,11 @@ public PhysicalDeviceMeshShaderPropertiesNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "meshOutputPerPrimitiveGranularity")] public uint MeshOutputPerPrimitiveGranularity; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMeshShaderPropertiesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiDrawFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiDrawFeaturesEXT.gen.cs index 3169388c21..17db550569 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 : IStructuredType { public PhysicalDeviceMultiDrawFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceMultiDrawFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "multiDraw")] public Bool32 MultiDraw; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMultiDrawFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiDrawPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiDrawPropertiesEXT.gen.cs index 17c42d1b67..acc976fbc9 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 : IStructuredType { public PhysicalDeviceMultiDrawPropertiesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceMultiDrawPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxMultiDrawCount")] public uint MaxMultiDrawCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMultiDrawPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeatures.gen.cs index a5276091b6..3b03e978e1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMultiviewFeatures")] - public unsafe partial struct PhysicalDeviceMultiviewFeatures + public unsafe partial struct PhysicalDeviceMultiviewFeatures : IStructuredType { public PhysicalDeviceMultiviewFeatures ( @@ -79,5 +79,11 @@ public PhysicalDeviceMultiviewFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "multiviewTessellationShader")] public Bool32 MultiviewTessellationShader; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMultiviewFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeaturesKHR.gen.cs index 0f569628fd..3ee0e76707 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMultiviewFeaturesKHR")] - public unsafe partial struct PhysicalDeviceMultiviewFeaturesKHR + public unsafe partial struct PhysicalDeviceMultiviewFeaturesKHR : IStructuredType { public PhysicalDeviceMultiviewFeaturesKHR ( @@ -79,5 +79,11 @@ public PhysicalDeviceMultiviewFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "multiviewTessellationShader")] public Bool32 MultiviewTessellationShader; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMultiviewFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX.gen.cs index 13c3a70e2a..22bc883349 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 : IStructuredType { public PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX ( @@ -57,5 +57,11 @@ public PhysicalDeviceMultiviewPerViewAttributesPropertiesNVX [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "perViewPositionAllComponents")] public Bool32 PerViewPositionAllComponents; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMultiviewPerViewAttributesPropertiesNvx; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewProperties.gen.cs index ab2c7d3560..f6a58f7cd6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMultiviewProperties")] - public unsafe partial struct PhysicalDeviceMultiviewProperties + public unsafe partial struct PhysicalDeviceMultiviewProperties : IStructuredType { public PhysicalDeviceMultiviewProperties ( @@ -68,5 +68,11 @@ public PhysicalDeviceMultiviewProperties [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxMultiviewInstanceIndex")] public uint MaxMultiviewInstanceIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMultiviewProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewPropertiesKHR.gen.cs index 76fb088b5b..8f90b6616f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMultiviewPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceMultiviewPropertiesKHR")] - public unsafe partial struct PhysicalDeviceMultiviewPropertiesKHR + public unsafe partial struct PhysicalDeviceMultiviewPropertiesKHR : IStructuredType { public PhysicalDeviceMultiviewPropertiesKHR ( @@ -68,5 +68,11 @@ public PhysicalDeviceMultiviewPropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxMultiviewInstanceIndex")] public uint MaxMultiviewInstanceIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMultiviewProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMutableDescriptorTypeFeaturesVALVE.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceMutableDescriptorTypeFeaturesVALVE.gen.cs index ea53c0ba28..ad1cd9dbc9 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 : IStructuredType { public PhysicalDeviceMutableDescriptorTypeFeaturesVALVE ( @@ -57,5 +57,11 @@ public PhysicalDeviceMutableDescriptorTypeFeaturesVALVE [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "mutableDescriptorType")] public Bool32 MutableDescriptorType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceMutableDescriptorTypeFeaturesValve; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePCIBusInfoPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePCIBusInfoPropertiesEXT.gen.cs index 541026d0f9..a3823c1a2c 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 : IStructuredType { public PhysicalDevicePCIBusInfoPropertiesEXT ( @@ -90,5 +90,11 @@ public PhysicalDevicePCIBusInfoPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pciFunction")] public uint PciFunction; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePciBusInfoPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT.gen.cs index 83103d80e2..77cc037fd1 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 : IStructuredType { public PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDevicePageableDeviceLocalMemoryFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "pageableDeviceLocalMemory")] public Bool32 PageableDeviceLocalMemory; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePageableDeviceLocalMemoryFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePerformanceQueryFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePerformanceQueryFeaturesKHR.gen.cs index af502ea695..9467cc6d62 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 : IStructuredType { public PhysicalDevicePerformanceQueryFeaturesKHR ( @@ -68,5 +68,11 @@ public PhysicalDevicePerformanceQueryFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "performanceCounterMultipleQueryPools")] public Bool32 PerformanceCounterMultipleQueryPools; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePerformanceQueryFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePerformanceQueryPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePerformanceQueryPropertiesKHR.gen.cs index dc81ff8b19..d1b1d4633e 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 : IStructuredType { public PhysicalDevicePerformanceQueryPropertiesKHR ( @@ -57,5 +57,11 @@ public PhysicalDevicePerformanceQueryPropertiesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "allowCommandBufferQueryCopies")] public Bool32 AllowCommandBufferQueryCopies; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePerformanceQueryPropertiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePipelineCreationCacheControlFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePipelineCreationCacheControlFeaturesEXT.gen.cs index 51c1f5bbda..2b9feb4a19 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 : IStructuredType { public PhysicalDevicePipelineCreationCacheControlFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDevicePipelineCreationCacheControlFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "pipelineCreationCacheControl")] public Bool32 PipelineCreationCacheControl; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePipelineCreationCacheControlFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePipelineExecutablePropertiesFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePipelineExecutablePropertiesFeaturesKHR.gen.cs index 2c0c152b9c..d8587751b0 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 : IStructuredType { public PhysicalDevicePipelineExecutablePropertiesFeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDevicePipelineExecutablePropertiesFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "pipelineExecutableInfo")] public Bool32 PipelineExecutableInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePipelineExecutablePropertiesFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingProperties.gen.cs index af4432e044..21fe04b79e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePointClippingProperties")] - public unsafe partial struct PhysicalDevicePointClippingProperties + public unsafe partial struct PhysicalDevicePointClippingProperties : IStructuredType { public PhysicalDevicePointClippingProperties ( @@ -57,5 +57,11 @@ public PhysicalDevicePointClippingProperties [NativeName("Type.Name", "VkPointClippingBehavior")] [NativeName("Name", "pointClippingBehavior")] public PointClippingBehavior PointClippingBehavior; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePointClippingProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingPropertiesKHR.gen.cs index f5a57662b5..2f61d1d2dd 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePointClippingPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDevicePointClippingPropertiesKHR")] - public unsafe partial struct PhysicalDevicePointClippingPropertiesKHR + public unsafe partial struct PhysicalDevicePointClippingPropertiesKHR : IStructuredType { public PhysicalDevicePointClippingPropertiesKHR ( @@ -57,5 +57,11 @@ public PhysicalDevicePointClippingPropertiesKHR [NativeName("Type.Name", "VkPointClippingBehavior")] [NativeName("Name", "pointClippingBehavior")] public PointClippingBehavior PointClippingBehavior; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePointClippingProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePortabilitySubsetFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePortabilitySubsetFeaturesKHR.gen.cs index 670295a1e2..916436d42a 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 : IStructuredType { public PhysicalDevicePortabilitySubsetFeaturesKHR ( @@ -211,5 +211,11 @@ public PhysicalDevicePortabilitySubsetFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "vertexAttributeAccessBeyondStride")] public Bool32 VertexAttributeAccessBeyondStride; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePortabilitySubsetFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePortabilitySubsetPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePortabilitySubsetPropertiesKHR.gen.cs index 653a19b7e1..f33df74c2f 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 : IStructuredType { public PhysicalDevicePortabilitySubsetPropertiesKHR ( @@ -57,5 +57,11 @@ public PhysicalDevicePortabilitySubsetPropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "minVertexInputBindingStrideAlignment")] public uint MinVertexInputBindingStrideAlignment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePortabilitySubsetPropertiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentIdFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentIdFeaturesKHR.gen.cs index 7a313d2103..5f411dbb82 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 : IStructuredType { public PhysicalDevicePresentIdFeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDevicePresentIdFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "presentId")] public Bool32 PresentId; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePresentIDFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentWaitFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentWaitFeaturesKHR.gen.cs index 7c70bec94e..b0c4f9b833 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 : IStructuredType { public PhysicalDevicePresentWaitFeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDevicePresentWaitFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "presentWait")] public Bool32 PresentWait; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePresentWaitFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentationPropertiesANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePresentationPropertiesANDROID.gen.cs index 018ba3b19c..27999a343d 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 : IStructuredType { public PhysicalDevicePresentationPropertiesANDROID ( @@ -57,5 +57,11 @@ public PhysicalDevicePresentationPropertiesANDROID [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "sharedImage")] public Bool32 SharedImage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePresentationPropertiesAndroid; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT.gen.cs index cfc2a15a7e..a633de2d10 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 : IStructuredType { public PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT ( @@ -68,5 +68,11 @@ public PhysicalDevicePrimitiveTopologyListRestartFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "primitiveTopologyPatchListRestart")] public Bool32 PrimitiveTopologyPatchListRestart; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePrimitiveTopologyListRestartFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePrivateDataFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePrivateDataFeaturesEXT.gen.cs index 4cc9c2b120..c822834358 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 : IStructuredType { public PhysicalDevicePrivateDataFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDevicePrivateDataFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "privateData")] public Bool32 PrivateData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePrivateDataFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2.gen.cs index 3cb15e6234..15cd90eb44 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceProperties2")] - public unsafe partial struct PhysicalDeviceProperties2 + public unsafe partial struct PhysicalDeviceProperties2 : IStructuredType { public PhysicalDeviceProperties2 ( @@ -57,5 +57,11 @@ public PhysicalDeviceProperties2 [NativeName("Type.Name", "VkPhysicalDeviceProperties")] [NativeName("Name", "properties")] public PhysicalDeviceProperties Properties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceProperties2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2KHR.gen.cs index 18136a8ab4..57c85576bc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProperties2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceProperties2KHR")] - public unsafe partial struct PhysicalDeviceProperties2KHR + public unsafe partial struct PhysicalDeviceProperties2KHR : IStructuredType { public PhysicalDeviceProperties2KHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceProperties2KHR [NativeName("Type.Name", "VkPhysicalDeviceProperties")] [NativeName("Name", "properties")] public PhysicalDeviceProperties Properties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceProperties2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProtectedMemoryFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProtectedMemoryFeatures.gen.cs index 813c4ba1ed..b23d391e94 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 : IStructuredType { public PhysicalDeviceProtectedMemoryFeatures ( @@ -57,5 +57,11 @@ public PhysicalDeviceProtectedMemoryFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "protectedMemory")] public Bool32 ProtectedMemory; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceProtectedMemoryFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProtectedMemoryProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProtectedMemoryProperties.gen.cs index c7f18ffb3d..66d2cfccec 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 : IStructuredType { public PhysicalDeviceProtectedMemoryProperties ( @@ -57,5 +57,11 @@ public PhysicalDeviceProtectedMemoryProperties [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "protectedNoFault")] public Bool32 ProtectedNoFault; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceProtectedMemoryProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProvokingVertexFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProvokingVertexFeaturesEXT.gen.cs index 425cab6640..748453bed8 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 : IStructuredType { public PhysicalDeviceProvokingVertexFeaturesEXT ( @@ -68,5 +68,11 @@ public PhysicalDeviceProvokingVertexFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "transformFeedbackPreservesProvokingVertex")] public Bool32 TransformFeedbackPreservesProvokingVertex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceProvokingVertexFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProvokingVertexPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceProvokingVertexPropertiesEXT.gen.cs index 40b450791a..64c453018a 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 : IStructuredType { public PhysicalDeviceProvokingVertexPropertiesEXT ( @@ -68,5 +68,11 @@ public PhysicalDeviceProvokingVertexPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "transformFeedbackPreservesTriangleFanProvokingVertex")] public Bool32 TransformFeedbackPreservesTriangleFanProvokingVertex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceProvokingVertexPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePushDescriptorPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDevicePushDescriptorPropertiesKHR.gen.cs index 8dec550efd..d1cb21f1c6 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 : IStructuredType { public PhysicalDevicePushDescriptorPropertiesKHR ( @@ -57,5 +57,11 @@ public PhysicalDevicePushDescriptorPropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxPushDescriptors")] public uint MaxPushDescriptors; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDevicePushDescriptorPropertiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRGBA10X6FormatsFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRGBA10X6FormatsFeaturesEXT.gen.cs index 0b20691f99..0b12309b83 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 : IStructuredType { public PhysicalDeviceRGBA10X6FormatsFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceRGBA10X6FormatsFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "formatRgba10x6WithoutYCbCrSampler")] public Bool32 FormatRgba10x6WithoutYCbCrSampler; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRgba10X6FormatsFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayQueryFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayQueryFeaturesKHR.gen.cs index de7d0288e1..d3f82fce26 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 : IStructuredType { public PhysicalDeviceRayQueryFeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceRayQueryFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "rayQuery")] public Bool32 RayQuery; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRayQueryFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingMotionBlurFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingMotionBlurFeaturesNV.gen.cs index e078094f16..acdf09e149 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 : IStructuredType { public PhysicalDeviceRayTracingMotionBlurFeaturesNV ( @@ -68,5 +68,11 @@ public PhysicalDeviceRayTracingMotionBlurFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "rayTracingMotionBlurPipelineTraceRaysIndirect")] public Bool32 RayTracingMotionBlurPipelineTraceRaysIndirect; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRayTracingMotionBlurFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPipelineFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPipelineFeaturesKHR.gen.cs index f34205a06d..01bd6835d0 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 : IStructuredType { public PhysicalDeviceRayTracingPipelineFeaturesKHR ( @@ -101,5 +101,11 @@ public PhysicalDeviceRayTracingPipelineFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "rayTraversalPrimitiveCulling")] public Bool32 RayTraversalPrimitiveCulling; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRayTracingPipelineFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPipelinePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPipelinePropertiesKHR.gen.cs index f0c275d2de..8d3101e9f7 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 : IStructuredType { public PhysicalDeviceRayTracingPipelinePropertiesKHR ( @@ -134,5 +134,11 @@ public PhysicalDeviceRayTracingPipelinePropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxRayHitAttributeSize")] public uint MaxRayHitAttributeSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRayTracingPipelinePropertiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRayTracingPropertiesNV.gen.cs index be7b5e0f44..33b28eede3 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 : IStructuredType { public PhysicalDeviceRayTracingPropertiesNV ( @@ -134,5 +134,11 @@ public PhysicalDeviceRayTracingPropertiesNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxDescriptorSetAccelerationStructures")] public uint MaxDescriptorSetAccelerationStructures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRayTracingPropertiesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRepresentativeFragmentTestFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRepresentativeFragmentTestFeaturesNV.gen.cs index f32f19627d..4a78dbebe9 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 : IStructuredType { public PhysicalDeviceRepresentativeFragmentTestFeaturesNV ( @@ -57,5 +57,11 @@ public PhysicalDeviceRepresentativeFragmentTestFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "representativeFragmentTest")] public Bool32 RepresentativeFragmentTest; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRepresentativeFragmentTestFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRobustness2FeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRobustness2FeaturesEXT.gen.cs index 89b4613ec8..8f2cafd1eb 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 : IStructuredType { public PhysicalDeviceRobustness2FeaturesEXT ( @@ -79,5 +79,11 @@ public PhysicalDeviceRobustness2FeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "nullDescriptor")] public Bool32 NullDescriptor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRobustness2FeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRobustness2PropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceRobustness2PropertiesEXT.gen.cs index 62b18c6c47..c6046f7af9 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 : IStructuredType { public PhysicalDeviceRobustness2PropertiesEXT ( @@ -68,5 +68,11 @@ public PhysicalDeviceRobustness2PropertiesEXT [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "robustUniformBufferAccessSizeAlignment")] public ulong RobustUniformBufferAccessSizeAlignment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceRobustness2PropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSampleLocationsPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSampleLocationsPropertiesEXT.gen.cs index 5009a57cea..31b33f1060 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 : IStructuredType { public PhysicalDeviceSampleLocationsPropertiesEXT ( @@ -95,5 +95,11 @@ public PhysicalDeviceSampleLocationsPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "variableSampleLocations")] public Bool32 VariableSampleLocations; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSampleLocationsPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxProperties.gen.cs index 2152bc626d..cc320a2e08 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSamplerFilterMinmaxProperties")] - public unsafe partial struct PhysicalDeviceSamplerFilterMinmaxProperties + public unsafe partial struct PhysicalDeviceSamplerFilterMinmaxProperties : IStructuredType { public PhysicalDeviceSamplerFilterMinmaxProperties ( @@ -68,5 +68,11 @@ public PhysicalDeviceSamplerFilterMinmaxProperties [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "filterMinmaxImageComponentMapping")] public Bool32 FilterMinmaxImageComponentMapping; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSamplerFilterMinmaxProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxPropertiesEXT.gen.cs index 7d3aee1097..0b4146943d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxPropertiesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerFilterMinmaxPropertiesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSamplerFilterMinmaxPropertiesEXT")] - public unsafe partial struct PhysicalDeviceSamplerFilterMinmaxPropertiesEXT + public unsafe partial struct PhysicalDeviceSamplerFilterMinmaxPropertiesEXT : IStructuredType { public PhysicalDeviceSamplerFilterMinmaxPropertiesEXT ( @@ -68,5 +68,11 @@ public PhysicalDeviceSamplerFilterMinmaxPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "filterMinmaxImageComponentMapping")] public Bool32 FilterMinmaxImageComponentMapping; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSamplerFilterMinmaxProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeatures.gen.cs index 96a15c26b2..0e52ad4f8f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSamplerYcbcrConversionFeatures")] - public unsafe partial struct PhysicalDeviceSamplerYcbcrConversionFeatures + public unsafe partial struct PhysicalDeviceSamplerYcbcrConversionFeatures : IStructuredType { public PhysicalDeviceSamplerYcbcrConversionFeatures ( @@ -57,5 +57,11 @@ public PhysicalDeviceSamplerYcbcrConversionFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "samplerYcbcrConversion")] public Bool32 SamplerYcbcrConversion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSamplerYcbcrConversionFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeaturesKHR.gen.cs index b8ba9cb9dc..db7f9ac22c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSamplerYcbcrConversionFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR")] - public unsafe partial struct PhysicalDeviceSamplerYcbcrConversionFeaturesKHR + public unsafe partial struct PhysicalDeviceSamplerYcbcrConversionFeaturesKHR : IStructuredType { public PhysicalDeviceSamplerYcbcrConversionFeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceSamplerYcbcrConversionFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "samplerYcbcrConversion")] public Bool32 SamplerYcbcrConversion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSamplerYcbcrConversionFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeatures.gen.cs index 6ed8cb0809..9d2e71f673 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceScalarBlockLayoutFeatures")] - public unsafe partial struct PhysicalDeviceScalarBlockLayoutFeatures + public unsafe partial struct PhysicalDeviceScalarBlockLayoutFeatures : IStructuredType { public PhysicalDeviceScalarBlockLayoutFeatures ( @@ -57,5 +57,11 @@ public PhysicalDeviceScalarBlockLayoutFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "scalarBlockLayout")] public Bool32 ScalarBlockLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceScalarBlockLayoutFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeaturesEXT.gen.cs index 05c40b771e..3246d25044 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeaturesEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceScalarBlockLayoutFeaturesEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceScalarBlockLayoutFeaturesEXT")] - public unsafe partial struct PhysicalDeviceScalarBlockLayoutFeaturesEXT + public unsafe partial struct PhysicalDeviceScalarBlockLayoutFeaturesEXT : IStructuredType { public PhysicalDeviceScalarBlockLayoutFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceScalarBlockLayoutFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "scalarBlockLayout")] public Bool32 ScalarBlockLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceScalarBlockLayoutFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeatures.gen.cs index 0b8fb76dff..e571ddd82a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSeparateDepthStencilLayoutsFeatures")] - public unsafe partial struct PhysicalDeviceSeparateDepthStencilLayoutsFeatures + public unsafe partial struct PhysicalDeviceSeparateDepthStencilLayoutsFeatures : IStructuredType { public PhysicalDeviceSeparateDepthStencilLayoutsFeatures ( @@ -57,5 +57,11 @@ public PhysicalDeviceSeparateDepthStencilLayoutsFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "separateDepthStencilLayouts")] public Bool32 SeparateDepthStencilLayouts; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSeparateDepthStencilLayoutsFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR.gen.cs index 70883b2b8d..d2694f5c8a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR")] - public unsafe partial struct PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR + public unsafe partial struct PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR : IStructuredType { public PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceSeparateDepthStencilLayoutsFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "separateDepthStencilLayouts")] public Bool32 SeparateDepthStencilLayouts; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSeparateDepthStencilLayoutsFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicFloat2FeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicFloat2FeaturesEXT.gen.cs index e7edcb81ea..12cbf4cae2 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 : IStructuredType { public PhysicalDeviceShaderAtomicFloat2FeaturesEXT ( @@ -178,5 +178,11 @@ public PhysicalDeviceShaderAtomicFloat2FeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "sparseImageFloat32AtomicMinMax")] public Bool32 SparseImageFloat32AtomicMinMax; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderAtomicFloat2FeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicFloatFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicFloatFeaturesEXT.gen.cs index 7417b8baae..8d99c7433d 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 : IStructuredType { public PhysicalDeviceShaderAtomicFloatFeaturesEXT ( @@ -178,5 +178,11 @@ public PhysicalDeviceShaderAtomicFloatFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "sparseImageFloat32AtomicAdd")] public Bool32 SparseImageFloat32AtomicAdd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderAtomicFloatFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64Features.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64Features.gen.cs index 8622c16e5e..26d6453e3e 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64Features.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64Features.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderAtomicInt64Features")] - public unsafe partial struct PhysicalDeviceShaderAtomicInt64Features + public unsafe partial struct PhysicalDeviceShaderAtomicInt64Features : IStructuredType { public PhysicalDeviceShaderAtomicInt64Features ( @@ -68,5 +68,11 @@ public PhysicalDeviceShaderAtomicInt64Features [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderSharedInt64Atomics")] public Bool32 ShaderSharedInt64Atomics; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderAtomicInt64Features; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64FeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64FeaturesKHR.gen.cs index 57a49dcd8b..44c91c5524 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64FeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderAtomicInt64FeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderAtomicInt64FeaturesKHR")] - public unsafe partial struct PhysicalDeviceShaderAtomicInt64FeaturesKHR + public unsafe partial struct PhysicalDeviceShaderAtomicInt64FeaturesKHR : IStructuredType { public PhysicalDeviceShaderAtomicInt64FeaturesKHR ( @@ -68,5 +68,11 @@ public PhysicalDeviceShaderAtomicInt64FeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderSharedInt64Atomics")] public Bool32 ShaderSharedInt64Atomics; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderAtomicInt64Features; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderClockFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderClockFeaturesKHR.gen.cs index 15a1d53cf7..4f92e63b2b 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 : IStructuredType { public PhysicalDeviceShaderClockFeaturesKHR ( @@ -68,5 +68,11 @@ public PhysicalDeviceShaderClockFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderDeviceClock")] public Bool32 ShaderDeviceClock; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderClockFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderCoreProperties2AMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderCoreProperties2AMD.gen.cs index 56f03e9655..8d188d0d6a 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 : IStructuredType { public PhysicalDeviceShaderCoreProperties2AMD ( @@ -68,5 +68,11 @@ public PhysicalDeviceShaderCoreProperties2AMD [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "activeComputeUnitCount")] public uint ActiveComputeUnitCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderCoreProperties2Amd; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderCorePropertiesAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderCorePropertiesAMD.gen.cs index f36f0edc5e..15ed2960f2 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 : IStructuredType { public PhysicalDeviceShaderCorePropertiesAMD ( @@ -200,5 +200,11 @@ public PhysicalDeviceShaderCorePropertiesAMD [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "vgprAllocationGranularity")] public uint VgprAllocationGranularity; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderCorePropertiesAmd; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT.gen.cs index 9c39f62017..ecc2253404 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 : IStructuredType { public PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderDemoteToHelperInvocation")] public Bool32 ShaderDemoteToHelperInvocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderDemoteToHelperInvocationFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParameterFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParameterFeatures.gen.cs index b2846c7ad5..2766ed71d9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParameterFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParameterFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderDrawParameterFeatures")] - public unsafe partial struct PhysicalDeviceShaderDrawParameterFeatures + public unsafe partial struct PhysicalDeviceShaderDrawParameterFeatures : IStructuredType { public PhysicalDeviceShaderDrawParameterFeatures ( @@ -57,5 +57,11 @@ public PhysicalDeviceShaderDrawParameterFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderDrawParameters")] public Bool32 ShaderDrawParameters; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderDrawParametersFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParametersFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParametersFeatures.gen.cs index 9102fdafda..81c13df85b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParametersFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderDrawParametersFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderDrawParametersFeatures")] - public unsafe partial struct PhysicalDeviceShaderDrawParametersFeatures + public unsafe partial struct PhysicalDeviceShaderDrawParametersFeatures : IStructuredType { public PhysicalDeviceShaderDrawParametersFeatures ( @@ -57,5 +57,11 @@ public PhysicalDeviceShaderDrawParametersFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderDrawParameters")] public Bool32 ShaderDrawParameters; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderDrawParametersFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8Features.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8Features.gen.cs index 9273d0683b..90685d55fa 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8Features.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8Features.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderFloat16Int8Features")] - public unsafe partial struct PhysicalDeviceShaderFloat16Int8Features + public unsafe partial struct PhysicalDeviceShaderFloat16Int8Features : IStructuredType { public PhysicalDeviceShaderFloat16Int8Features ( @@ -68,5 +68,11 @@ public PhysicalDeviceShaderFloat16Int8Features [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderInt8")] public Bool32 ShaderInt8; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderFloat16Int8Features; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8FeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8FeaturesKHR.gen.cs index 891fc818f0..7e3714b6d8 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8FeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderFloat16Int8FeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderFloat16Int8FeaturesKHR")] - public unsafe partial struct PhysicalDeviceShaderFloat16Int8FeaturesKHR + public unsafe partial struct PhysicalDeviceShaderFloat16Int8FeaturesKHR : IStructuredType { public PhysicalDeviceShaderFloat16Int8FeaturesKHR ( @@ -68,5 +68,11 @@ public PhysicalDeviceShaderFloat16Int8FeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderInt8")] public Bool32 ShaderInt8; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderFloat16Int8Features; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderImageAtomicInt64FeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderImageAtomicInt64FeaturesEXT.gen.cs index 803dd639e9..58aee61c9e 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 : IStructuredType { public PhysicalDeviceShaderImageAtomicInt64FeaturesEXT ( @@ -68,5 +68,11 @@ public PhysicalDeviceShaderImageAtomicInt64FeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "sparseImageInt64Atomics")] public Bool32 SparseImageInt64Atomics; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderImageAtomicInt64FeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderImageFootprintFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderImageFootprintFeaturesNV.gen.cs index 5bd0041ea3..4b0970bc9e 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 : IStructuredType { public PhysicalDeviceShaderImageFootprintFeaturesNV ( @@ -57,5 +57,11 @@ public PhysicalDeviceShaderImageFootprintFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "imageFootprint")] public Bool32 ImageFootprint; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderImageFootprintFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerDotProductFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerDotProductFeaturesKHR.gen.cs index 2c3b0e3ccd..b3642a20fd 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 : IStructuredType { public PhysicalDeviceShaderIntegerDotProductFeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceShaderIntegerDotProductFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderIntegerDotProduct")] public Bool32 ShaderIntegerDotProduct; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderIntegerDotProductFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerDotProductPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerDotProductPropertiesKHR.gen.cs index 5c854ed0bf..5a62d7518e 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 : IStructuredType { public PhysicalDeviceShaderIntegerDotProductPropertiesKHR ( @@ -376,5 +376,11 @@ public PhysicalDeviceShaderIntegerDotProductPropertiesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated")] public Bool32 IntegerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderIntegerDotProductPropertiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL.gen.cs index b8408d7048..2e7bd91ae2 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 : IStructuredType { public PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL ( @@ -57,5 +57,11 @@ public PhysicalDeviceShaderIntegerFunctions2FeaturesINTEL [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderIntegerFunctions2")] public Bool32 ShaderIntegerFunctions2; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderIntegerFunctions2FeaturesIntel; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSMBuiltinsFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSMBuiltinsFeaturesNV.gen.cs index d9269716f2..46e9f6cf2b 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 : IStructuredType { public PhysicalDeviceShaderSMBuiltinsFeaturesNV ( @@ -57,5 +57,11 @@ public PhysicalDeviceShaderSMBuiltinsFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderSMBuiltins")] public Bool32 ShaderSmbuiltins; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderSMBuiltinsFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSMBuiltinsPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSMBuiltinsPropertiesNV.gen.cs index d68d45c909..0358bf6a6a 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 : IStructuredType { public PhysicalDeviceShaderSMBuiltinsPropertiesNV ( @@ -68,5 +68,11 @@ public PhysicalDeviceShaderSMBuiltinsPropertiesNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "shaderWarpsPerSM")] public uint ShaderWarpsPerSM; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderSMBuiltinsPropertiesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeatures.gen.cs index 853a3e5ba9..99933147a7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderSubgroupExtendedTypesFeatures")] - public unsafe partial struct PhysicalDeviceShaderSubgroupExtendedTypesFeatures + public unsafe partial struct PhysicalDeviceShaderSubgroupExtendedTypesFeatures : IStructuredType { public PhysicalDeviceShaderSubgroupExtendedTypesFeatures ( @@ -57,5 +57,11 @@ public PhysicalDeviceShaderSubgroupExtendedTypesFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderSubgroupExtendedTypes")] public Bool32 ShaderSubgroupExtendedTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderSubgroupExtendedTypesFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR.gen.cs index 65fa208eba..7c4e90cff5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR")] - public unsafe partial struct PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR + public unsafe partial struct PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR : IStructuredType { public PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceShaderSubgroupExtendedTypesFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderSubgroupExtendedTypes")] public Bool32 ShaderSubgroupExtendedTypes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderSubgroupExtendedTypesFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR.gen.cs index d47801bd4e..9e551bc12e 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 : IStructuredType { public PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderSubgroupUniformControlFlow")] public Bool32 ShaderSubgroupUniformControlFlow; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderTerminateInvocationFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShaderTerminateInvocationFeaturesKHR.gen.cs index 43188f1e24..7165154937 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 : IStructuredType { public PhysicalDeviceShaderTerminateInvocationFeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceShaderTerminateInvocationFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderTerminateInvocation")] public Bool32 ShaderTerminateInvocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShaderTerminateInvocationFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShadingRateImageFeaturesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShadingRateImageFeaturesNV.gen.cs index 912e84b0bd..95f5eada57 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 : IStructuredType { public PhysicalDeviceShadingRateImageFeaturesNV ( @@ -68,5 +68,11 @@ public PhysicalDeviceShadingRateImageFeaturesNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shadingRateCoarseSampleOrder")] public Bool32 ShadingRateCoarseSampleOrder; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShadingRateImageFeaturesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShadingRateImagePropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceShadingRateImagePropertiesNV.gen.cs index b42091b867..b19e969c09 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 : IStructuredType { public PhysicalDeviceShadingRateImagePropertiesNV ( @@ -79,5 +79,11 @@ public PhysicalDeviceShadingRateImagePropertiesNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "shadingRateMaxCoarseSamples")] public uint ShadingRateMaxCoarseSamples; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceShadingRateImagePropertiesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2.gen.cs index 5fab9ffc4f..19a57c3638 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSparseImageFormatInfo2")] - public unsafe partial struct PhysicalDeviceSparseImageFormatInfo2 + public unsafe partial struct PhysicalDeviceSparseImageFormatInfo2 : IStructuredType { public PhysicalDeviceSparseImageFormatInfo2 ( @@ -101,5 +101,11 @@ public PhysicalDeviceSparseImageFormatInfo2 [NativeName("Type.Name", "VkImageTiling")] [NativeName("Name", "tiling")] public ImageTiling Tiling; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSparseImageFormatInfo2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2KHR.gen.cs index e2f7ed656b..040689c8df 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSparseImageFormatInfo2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceSparseImageFormatInfo2KHR")] - public unsafe partial struct PhysicalDeviceSparseImageFormatInfo2KHR + public unsafe partial struct PhysicalDeviceSparseImageFormatInfo2KHR : IStructuredType { public PhysicalDeviceSparseImageFormatInfo2KHR ( @@ -101,5 +101,11 @@ public PhysicalDeviceSparseImageFormatInfo2KHR [NativeName("Type.Name", "VkImageTiling")] [NativeName("Name", "tiling")] public ImageTiling Tiling; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSparseImageFormatInfo2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupProperties.gen.cs index 31786c4382..e71b8394fb 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 : IStructuredType { public PhysicalDeviceSubgroupProperties ( @@ -90,5 +90,11 @@ public PhysicalDeviceSubgroupProperties [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "quadOperationsInAllStages")] public Bool32 QuadOperationsInAllStages; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSubgroupProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupSizeControlFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupSizeControlFeaturesEXT.gen.cs index 4247fba02a..db2ecffa50 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 : IStructuredType { public PhysicalDeviceSubgroupSizeControlFeaturesEXT ( @@ -68,5 +68,11 @@ public PhysicalDeviceSubgroupSizeControlFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "computeFullSubgroups")] public Bool32 ComputeFullSubgroups; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSubgroupSizeControlFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupSizeControlPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubgroupSizeControlPropertiesEXT.gen.cs index 7a70402d4d..37153faec3 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 : IStructuredType { public PhysicalDeviceSubgroupSizeControlPropertiesEXT ( @@ -90,5 +90,11 @@ public PhysicalDeviceSubgroupSizeControlPropertiesEXT [NativeName("Type.Name", "VkShaderStageFlags")] [NativeName("Name", "requiredSubgroupSizeStages")] public ShaderStageFlags RequiredSubgroupSizeStages; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSubgroupSizeControlPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubpassShadingFeaturesHUAWEI.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubpassShadingFeaturesHUAWEI.gen.cs index 1be8200327..7b0af7b6c8 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 : IStructuredType { public PhysicalDeviceSubpassShadingFeaturesHUAWEI ( @@ -57,5 +57,11 @@ public PhysicalDeviceSubpassShadingFeaturesHUAWEI [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "subpassShading")] public Bool32 SubpassShading; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSubpassShadingFeaturesHuawei; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubpassShadingPropertiesHUAWEI.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSubpassShadingPropertiesHUAWEI.gen.cs index 4233d50a11..fcbef6a93f 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 : IStructuredType { public PhysicalDeviceSubpassShadingPropertiesHUAWEI ( @@ -57,5 +57,11 @@ public PhysicalDeviceSubpassShadingPropertiesHUAWEI [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxSubpassShadingWorkgroupSizeAspectRatio")] public uint MaxSubpassShadingWorkgroupSizeAspectRatio; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSubpassShadingPropertiesHuawei; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSurfaceInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSurfaceInfo2KHR.gen.cs index 82e3f0c7bb..233a8b9f74 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 : IStructuredType { public PhysicalDeviceSurfaceInfo2KHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceSurfaceInfo2KHR [NativeName("Type.Name", "VkSurfaceKHR")] [NativeName("Name", "surface")] public SurfaceKHR Surface; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSurfaceInfo2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSynchronization2FeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceSynchronization2FeaturesKHR.gen.cs index 1579ad5f0c..49beea7f30 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 : IStructuredType { public PhysicalDeviceSynchronization2FeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceSynchronization2FeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "synchronization2")] public Bool32 Synchronization2; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceSynchronization2FeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTexelBufferAlignmentFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTexelBufferAlignmentFeaturesEXT.gen.cs index 9cf25135db..4bf5183b25 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 : IStructuredType { public PhysicalDeviceTexelBufferAlignmentFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceTexelBufferAlignmentFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "texelBufferAlignment")] public Bool32 TexelBufferAlignment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTexelBufferAlignmentFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTexelBufferAlignmentPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTexelBufferAlignmentPropertiesEXT.gen.cs index 2daeac205c..d8e5d8307c 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 : IStructuredType { public PhysicalDeviceTexelBufferAlignmentPropertiesEXT ( @@ -90,5 +90,11 @@ public PhysicalDeviceTexelBufferAlignmentPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "uniformTexelBufferOffsetSingleTexelAlignment")] public Bool32 UniformTexelBufferOffsetSingleTexelAlignment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTexelBufferAlignmentPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT.gen.cs index 227e8e122e..5e992f23e8 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 : IStructuredType { public PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceTextureCompressionASTCHDRFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "textureCompressionASTC_HDR")] public Bool32 TextureCompressionAstcHdr; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTextureCompressionAstcHdrFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeatures.gen.cs index 1287770909..0412a30fb7 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceTimelineSemaphoreFeatures")] - public unsafe partial struct PhysicalDeviceTimelineSemaphoreFeatures + public unsafe partial struct PhysicalDeviceTimelineSemaphoreFeatures : IStructuredType { public PhysicalDeviceTimelineSemaphoreFeatures ( @@ -57,5 +57,11 @@ public PhysicalDeviceTimelineSemaphoreFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "timelineSemaphore")] public Bool32 TimelineSemaphore; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTimelineSemaphoreFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeaturesKHR.gen.cs index fd70840a7e..4651b5429d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceTimelineSemaphoreFeaturesKHR")] - public unsafe partial struct PhysicalDeviceTimelineSemaphoreFeaturesKHR + public unsafe partial struct PhysicalDeviceTimelineSemaphoreFeaturesKHR : IStructuredType { public PhysicalDeviceTimelineSemaphoreFeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceTimelineSemaphoreFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "timelineSemaphore")] public Bool32 TimelineSemaphore; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTimelineSemaphoreFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreProperties.gen.cs index c4df2bbecc..1587b34f8b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphoreProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceTimelineSemaphoreProperties")] - public unsafe partial struct PhysicalDeviceTimelineSemaphoreProperties + public unsafe partial struct PhysicalDeviceTimelineSemaphoreProperties : IStructuredType { public PhysicalDeviceTimelineSemaphoreProperties ( @@ -57,5 +57,11 @@ public PhysicalDeviceTimelineSemaphoreProperties [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "maxTimelineSemaphoreValueDifference")] public ulong MaxTimelineSemaphoreValueDifference; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTimelineSemaphoreProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphorePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphorePropertiesKHR.gen.cs index 7e54c7f883..61f4903155 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphorePropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTimelineSemaphorePropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceTimelineSemaphorePropertiesKHR")] - public unsafe partial struct PhysicalDeviceTimelineSemaphorePropertiesKHR + public unsafe partial struct PhysicalDeviceTimelineSemaphorePropertiesKHR : IStructuredType { public PhysicalDeviceTimelineSemaphorePropertiesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceTimelineSemaphorePropertiesKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "maxTimelineSemaphoreValueDifference")] public ulong MaxTimelineSemaphoreValueDifference; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTimelineSemaphoreProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceToolPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceToolPropertiesEXT.gen.cs index 94cd10fbb5..b04a936235 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 : IStructuredType { public PhysicalDeviceToolPropertiesEXT ( @@ -77,5 +77,11 @@ public PhysicalDeviceToolPropertiesEXT [NativeName("Type.Name", "char")] [NativeName("Name", "layer")] public fixed byte Layer[256]; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceToolPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTransformFeedbackFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTransformFeedbackFeaturesEXT.gen.cs index 9f371e4c95..d0f44b11ab 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 : IStructuredType { public PhysicalDeviceTransformFeedbackFeaturesEXT ( @@ -68,5 +68,11 @@ public PhysicalDeviceTransformFeedbackFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "geometryStreams")] public Bool32 GeometryStreams; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTransformFeedbackFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTransformFeedbackPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceTransformFeedbackPropertiesEXT.gen.cs index dd0e900a7b..90711dfdfd 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 : IStructuredType { public PhysicalDeviceTransformFeedbackPropertiesEXT ( @@ -156,5 +156,11 @@ public PhysicalDeviceTransformFeedbackPropertiesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "transformFeedbackDraw")] public Bool32 TransformFeedbackDraw; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceTransformFeedbackPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeatures.gen.cs index 6274f055d2..3f5eafa046 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceUniformBufferStandardLayoutFeatures")] - public unsafe partial struct PhysicalDeviceUniformBufferStandardLayoutFeatures + public unsafe partial struct PhysicalDeviceUniformBufferStandardLayoutFeatures : IStructuredType { public PhysicalDeviceUniformBufferStandardLayoutFeatures ( @@ -57,5 +57,11 @@ public PhysicalDeviceUniformBufferStandardLayoutFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "uniformBufferStandardLayout")] public Bool32 UniformBufferStandardLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceUniformBufferStandardLayoutFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR.gen.cs index 007bab55de..b9d9bb16ea 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceUniformBufferStandardLayoutFeaturesKHR")] - public unsafe partial struct PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR + public unsafe partial struct PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR : IStructuredType { public PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceUniformBufferStandardLayoutFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "uniformBufferStandardLayout")] public Bool32 UniformBufferStandardLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceUniformBufferStandardLayoutFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeatures.gen.cs index ddeced77df..1813806f23 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVariablePointerFeatures")] - public unsafe partial struct PhysicalDeviceVariablePointerFeatures + public unsafe partial struct PhysicalDeviceVariablePointerFeatures : IStructuredType { public PhysicalDeviceVariablePointerFeatures ( @@ -68,5 +68,11 @@ public PhysicalDeviceVariablePointerFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "variablePointers")] public Bool32 VariablePointers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVariablePointersFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeaturesKHR.gen.cs index 9d47c69893..8a88b64808 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointerFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVariablePointerFeaturesKHR")] - public unsafe partial struct PhysicalDeviceVariablePointerFeaturesKHR + public unsafe partial struct PhysicalDeviceVariablePointerFeaturesKHR : IStructuredType { public PhysicalDeviceVariablePointerFeaturesKHR ( @@ -68,5 +68,11 @@ public PhysicalDeviceVariablePointerFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "variablePointers")] public Bool32 VariablePointers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVariablePointersFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeatures.gen.cs index a3d7e0284e..aa3a5a5bc9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVariablePointersFeatures")] - public unsafe partial struct PhysicalDeviceVariablePointersFeatures + public unsafe partial struct PhysicalDeviceVariablePointersFeatures : IStructuredType { public PhysicalDeviceVariablePointersFeatures ( @@ -68,5 +68,11 @@ public PhysicalDeviceVariablePointersFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "variablePointers")] public Bool32 VariablePointers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVariablePointersFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeaturesKHR.gen.cs index eda4cacf36..23890525b2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVariablePointersFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVariablePointersFeaturesKHR")] - public unsafe partial struct PhysicalDeviceVariablePointersFeaturesKHR + public unsafe partial struct PhysicalDeviceVariablePointersFeaturesKHR : IStructuredType { public PhysicalDeviceVariablePointersFeaturesKHR ( @@ -68,5 +68,11 @@ public PhysicalDeviceVariablePointersFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "variablePointers")] public Bool32 VariablePointers; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVariablePointersFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexAttributeDivisorFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexAttributeDivisorFeaturesEXT.gen.cs index be23fe3627..2b01da546d 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 : IStructuredType { public PhysicalDeviceVertexAttributeDivisorFeaturesEXT ( @@ -68,5 +68,11 @@ public PhysicalDeviceVertexAttributeDivisorFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "vertexAttributeInstanceRateZeroDivisor")] public Bool32 VertexAttributeInstanceRateZeroDivisor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVertexAttributeDivisorFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexAttributeDivisorPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexAttributeDivisorPropertiesEXT.gen.cs index 074f541486..2e20a6e21e 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 : IStructuredType { public PhysicalDeviceVertexAttributeDivisorPropertiesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceVertexAttributeDivisorPropertiesEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxVertexAttribDivisor")] public uint MaxVertexAttribDivisor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVertexAttributeDivisorPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexInputDynamicStateFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVertexInputDynamicStateFeaturesEXT.gen.cs index a03c67bb64..813b19ca3c 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 : IStructuredType { public PhysicalDeviceVertexInputDynamicStateFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceVertexInputDynamicStateFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "vertexInputDynamicState")] public Bool32 VertexInputDynamicState; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVertexInputDynamicStateFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVideoFormatInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVideoFormatInfoKHR.gen.cs index 8e6ebcac80..200438d3bf 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 : IStructuredType { public PhysicalDeviceVideoFormatInfoKHR ( @@ -68,5 +68,11 @@ public PhysicalDeviceVideoFormatInfoKHR [NativeName("Type.Name", "VkVideoProfilesKHR")] [NativeName("Name", "pVideoProfiles")] public VideoProfilesKHR* PVideoProfiles; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVideoFormatInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan11Features.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan11Features.gen.cs index 5b91d525b5..7717087b0b 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 : IStructuredType { public PhysicalDeviceVulkan11Features ( @@ -178,5 +178,11 @@ public PhysicalDeviceVulkan11Features [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderDrawParameters")] public Bool32 ShaderDrawParameters; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVulkan11Features; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan11Properties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan11Properties.gen.cs index 2f5715ed1a..36069f66c3 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 : IStructuredType { public PhysicalDeviceVulkan11Properties ( @@ -193,5 +193,11 @@ public PhysicalDeviceVulkan11Properties [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "maxMemoryAllocationSize")] public ulong MaxMemoryAllocationSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVulkan11Properties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan12Features.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan12Features.gen.cs index 2d104d2b8e..6acf37212b 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 : IStructuredType { public PhysicalDeviceVulkan12Features ( @@ -563,5 +563,11 @@ public PhysicalDeviceVulkan12Features [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "subgroupBroadcastDynamicId")] public Bool32 SubgroupBroadcastDynamicId; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVulkan12Features; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan12Properties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkan12Properties.gen.cs index 6edaee6722..969169133b 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 : IStructuredType { public PhysicalDeviceVulkan12Properties ( @@ -606,5 +606,11 @@ public PhysicalDeviceVulkan12Properties [NativeName("Type.Name", "VkSampleCountFlags")] [NativeName("Name", "framebufferIntegerColorSampleCounts")] public SampleCountFlags FramebufferIntegerColorSampleCounts; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVulkan12Properties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeatures.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeatures.gen.cs index 20f2697e09..6d8bd2d6b0 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeatures.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeatures.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVulkanMemoryModelFeatures")] - public unsafe partial struct PhysicalDeviceVulkanMemoryModelFeatures + public unsafe partial struct PhysicalDeviceVulkanMemoryModelFeatures : IStructuredType { public PhysicalDeviceVulkanMemoryModelFeatures ( @@ -79,5 +79,11 @@ public PhysicalDeviceVulkanMemoryModelFeatures [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "vulkanMemoryModelAvailabilityVisibilityChains")] public Bool32 VulkanMemoryModelAvailabilityVisibilityChains; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVulkanMemoryModelFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeaturesKHR.gen.cs index 3fc26e2710..6570f4bdde 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeaturesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceVulkanMemoryModelFeaturesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPhysicalDeviceVulkanMemoryModelFeaturesKHR")] - public unsafe partial struct PhysicalDeviceVulkanMemoryModelFeaturesKHR + public unsafe partial struct PhysicalDeviceVulkanMemoryModelFeaturesKHR : IStructuredType { public PhysicalDeviceVulkanMemoryModelFeaturesKHR ( @@ -79,5 +79,11 @@ public PhysicalDeviceVulkanMemoryModelFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "vulkanMemoryModelAvailabilityVisibilityChains")] public Bool32 VulkanMemoryModelAvailabilityVisibilityChains; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceVulkanMemoryModelFeatures; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR.gen.cs index 50ee55afe2..f64e865782 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 : IStructuredType { public PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR ( @@ -90,5 +90,11 @@ public PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "workgroupMemoryExplicitLayout16BitAccess")] public Bool32 WorkgroupMemoryExplicitLayout16BitAccess; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT.gen.cs index 40b4b7382e..b345d01d92 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 : IStructuredType { public PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceYcbcr2Plane444FormatsFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "ycbcr2plane444Formats")] public Bool32 Ycbcr2plane444formats; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceYcbcr2Plane444FormatsFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceYcbcrImageArraysFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceYcbcrImageArraysFeaturesEXT.gen.cs index 18e18452db..bc3f002e48 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 : IStructuredType { public PhysicalDeviceYcbcrImageArraysFeaturesEXT ( @@ -57,5 +57,11 @@ public PhysicalDeviceYcbcrImageArraysFeaturesEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "ycbcrImageArrays")] public Bool32 YcbcrImageArrays; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceYcbcrImageArraysFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR.gen.cs index 6325f69aa1..21262a53e8 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 : IStructuredType { public PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR ( @@ -57,5 +57,11 @@ public PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "shaderZeroInitializeWorkgroupMemory")] public Bool32 ShaderZeroInitializeWorkgroupMemory; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCacheCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCacheCreateInfo.gen.cs index 0402ab0707..aba51570ce 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 : IStructuredType { public PipelineCacheCreateInfo ( @@ -79,5 +79,11 @@ public PipelineCacheCreateInfo [NativeName("Type.Name", "void")] [NativeName("Name", "pInitialData")] public void* PInitialData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineCacheCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorBlendAdvancedStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorBlendAdvancedStateCreateInfoEXT.gen.cs index 01e04fb865..c285407f63 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 : IStructuredType { public PipelineColorBlendAdvancedStateCreateInfoEXT ( @@ -79,5 +79,11 @@ public PipelineColorBlendAdvancedStateCreateInfoEXT [NativeName("Type.Name", "VkBlendOverlapEXT")] [NativeName("Name", "blendOverlap")] public BlendOverlapEXT BlendOverlap; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineColorBlendAdvancedStateCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorBlendStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorBlendStateCreateInfo.gen.cs index d49f734d50..caadf66ea9 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 : IStructuredType { public PipelineColorBlendStateCreateInfo ( @@ -106,5 +106,11 @@ public PipelineColorBlendStateCreateInfo [NativeName("Type.Name", "float")] [NativeName("Name", "blendConstants")] public fixed float BlendConstants[4]; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineColorBlendStateCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorWriteCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineColorWriteCreateInfoEXT.gen.cs index 48c112a615..4f279eff88 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 : IStructuredType { public PipelineColorWriteCreateInfoEXT ( @@ -68,5 +68,11 @@ public PipelineColorWriteCreateInfoEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "pColorWriteEnables")] public Bool32* PColorWriteEnables; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineColorWriteCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCompilerControlCreateInfoAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCompilerControlCreateInfoAMD.gen.cs index ae67f41b37..5ad9ef19c5 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 : IStructuredType { public PipelineCompilerControlCreateInfoAMD ( @@ -57,5 +57,11 @@ public PipelineCompilerControlCreateInfoAMD [NativeName("Type.Name", "VkPipelineCompilerControlFlagsAMD")] [NativeName("Name", "compilerControlFlags")] public PipelineCompilerControlFlagsAMD CompilerControlFlags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineCompilerControlCreateInfoAmd; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageModulationStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageModulationStateCreateInfoNV.gen.cs index 84ab26cbbb..95b89a34bc 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 : IStructuredType { public PipelineCoverageModulationStateCreateInfoNV ( @@ -101,5 +101,11 @@ public PipelineCoverageModulationStateCreateInfoNV [NativeName("Type.Name", "float")] [NativeName("Name", "pCoverageModulationTable")] public float* PCoverageModulationTable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineCoverageModulationStateCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageReductionStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageReductionStateCreateInfoNV.gen.cs index 4a3c8a2c61..0d97c2acda 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 : IStructuredType { public PipelineCoverageReductionStateCreateInfoNV ( @@ -68,5 +68,11 @@ public PipelineCoverageReductionStateCreateInfoNV [NativeName("Type.Name", "VkCoverageReductionModeNV")] [NativeName("Name", "coverageReductionMode")] public CoverageReductionModeNV CoverageReductionMode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineCoverageReductionStateCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageToColorStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCoverageToColorStateCreateInfoNV.gen.cs index 922e52b172..542e3689d2 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 : IStructuredType { public PipelineCoverageToColorStateCreateInfoNV ( @@ -79,5 +79,11 @@ public PipelineCoverageToColorStateCreateInfoNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "coverageToColorLocation")] public uint CoverageToColorLocation; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineCoverageToColorStateCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCreationFeedbackCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineCreationFeedbackCreateInfoEXT.gen.cs index 494cc0b518..7c60c58d3b 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 : IStructuredType { public PipelineCreationFeedbackCreateInfoEXT ( @@ -79,5 +79,11 @@ public PipelineCreationFeedbackCreateInfoEXT [NativeName("Type.Name", "VkPipelineCreationFeedbackEXT")] [NativeName("Name", "pPipelineStageCreationFeedbacks")] public PipelineCreationFeedbackEXT* PPipelineStageCreationFeedbacks; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineCreationFeedbackCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDepthStencilStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDepthStencilStateCreateInfo.gen.cs index 2ef827c074..74a55c6db7 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 : IStructuredType { public PipelineDepthStencilStateCreateInfo ( @@ -156,5 +156,11 @@ public PipelineDepthStencilStateCreateInfo [NativeName("Type.Name", "float")] [NativeName("Name", "maxDepthBounds")] public float MaxDepthBounds; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineDepthStencilStateCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDiscardRectangleStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDiscardRectangleStateCreateInfoEXT.gen.cs index 492574c36d..d81de4abfb 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 : IStructuredType { public PipelineDiscardRectangleStateCreateInfoEXT ( @@ -90,5 +90,11 @@ public PipelineDiscardRectangleStateCreateInfoEXT [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "pDiscardRectangles")] public Rect2D* PDiscardRectangles; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineDiscardRectangleStateCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDynamicStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineDynamicStateCreateInfo.gen.cs index e8b1a84e9c..6149d255fe 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 : IStructuredType { public PipelineDynamicStateCreateInfo ( @@ -79,5 +79,11 @@ public PipelineDynamicStateCreateInfo [NativeName("Type.Name", "VkDynamicState")] [NativeName("Name", "pDynamicStates")] public DynamicState* PDynamicStates; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineDynamicStateCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableInfoKHR.gen.cs index 6b066aa83f..419ac64ebd 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 : IStructuredType { public PipelineExecutableInfoKHR ( @@ -68,5 +68,11 @@ public PipelineExecutableInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "executableIndex")] public uint ExecutableIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineExecutableInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableInternalRepresentationKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableInternalRepresentationKHR.gen.cs index 7de5cf19f4..a01b53bf2c 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 : IStructuredType { public PipelineExecutableInternalRepresentationKHR ( @@ -89,5 +89,11 @@ public PipelineExecutableInternalRepresentationKHR [NativeName("Type.Name", "void")] [NativeName("Name", "pData")] public void* PData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineExecutableInternalRepresentationKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutablePropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutablePropertiesKHR.gen.cs index 81191d37a0..687e0643a7 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 : IStructuredType { public PipelineExecutablePropertiesKHR ( @@ -78,5 +78,11 @@ public PipelineExecutablePropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "subgroupSize")] public uint SubgroupSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineExecutablePropertiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableStatisticKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineExecutableStatisticKHR.gen.cs index 4765b3e6a1..81d9679a7c 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 : IStructuredType { public PipelineExecutableStatisticKHR ( @@ -78,5 +78,11 @@ public PipelineExecutableStatisticKHR [NativeName("Type.Name", "VkPipelineExecutableStatisticValueKHR")] [NativeName("Name", "value")] public PipelineExecutableStatisticValueKHR Value; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineExecutableStatisticKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineFragmentShadingRateEnumStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineFragmentShadingRateEnumStateCreateInfoNV.gen.cs index 4beb07b185..1265a82cff 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 : IStructuredType { public PipelineFragmentShadingRateEnumStateCreateInfoNV ( @@ -100,5 +100,11 @@ public Span AsSpan() #endif } + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineFragmentShadingRateEnumStateCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineFragmentShadingRateStateCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineFragmentShadingRateStateCreateInfoKHR.gen.cs index e97767c30d..9ec62db19e 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 : IStructuredType { public PipelineFragmentShadingRateStateCreateInfoKHR ( @@ -89,5 +89,11 @@ public Span AsSpan() #endif } + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineFragmentShadingRateStateCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineInfoKHR.gen.cs index 5f36ace08c..351cec483f 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 : IStructuredType { public PipelineInfoKHR ( @@ -57,5 +57,11 @@ public PipelineInfoKHR [NativeName("Type.Name", "VkPipeline")] [NativeName("Name", "pipeline")] public Pipeline Pipeline; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineInputAssemblyStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineInputAssemblyStateCreateInfo.gen.cs index b82af0adbd..2887bbbc87 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 : IStructuredType { public PipelineInputAssemblyStateCreateInfo ( @@ -79,5 +79,11 @@ public PipelineInputAssemblyStateCreateInfo [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "primitiveRestartEnable")] public Bool32 PrimitiveRestartEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineInputAssemblyStateCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineLayoutCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineLayoutCreateInfo.gen.cs index d63fb5d3a6..69a0bef922 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 : IStructuredType { public PipelineLayoutCreateInfo ( @@ -101,5 +101,11 @@ public PipelineLayoutCreateInfo [NativeName("Type.Name", "VkPushConstantRange")] [NativeName("Name", "pPushConstantRanges")] public PushConstantRange* PPushConstantRanges; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineLayoutCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineLibraryCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineLibraryCreateInfoKHR.gen.cs index 07bb02bb40..9cba2709a8 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 : IStructuredType { public PipelineLibraryCreateInfoKHR ( @@ -68,5 +68,11 @@ public PipelineLibraryCreateInfoKHR [NativeName("Type.Name", "VkPipeline")] [NativeName("Name", "pLibraries")] public Pipeline* PLibraries; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineLibraryCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineMultisampleStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineMultisampleStateCreateInfo.gen.cs index 318cd5d511..030547d18c 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 : IStructuredType { public PipelineMultisampleStateCreateInfo ( @@ -123,5 +123,11 @@ public PipelineMultisampleStateCreateInfo [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "alphaToOneEnable")] public Bool32 AlphaToOneEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineMultisampleStateCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationConservativeStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationConservativeStateCreateInfoEXT.gen.cs index 5d241b4e73..31344e0692 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 : IStructuredType { public PipelineRasterizationConservativeStateCreateInfoEXT ( @@ -79,5 +79,11 @@ public PipelineRasterizationConservativeStateCreateInfoEXT [NativeName("Type.Name", "float")] [NativeName("Name", "extraPrimitiveOverestimationSize")] public float ExtraPrimitiveOverestimationSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRasterizationConservativeStateCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationDepthClipStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationDepthClipStateCreateInfoEXT.gen.cs index bab89d4847..a6b988d61c 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 : IStructuredType { public PipelineRasterizationDepthClipStateCreateInfoEXT ( @@ -68,5 +68,11 @@ public PipelineRasterizationDepthClipStateCreateInfoEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "depthClipEnable")] public Bool32 DepthClipEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRasterizationDepthClipStateCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationLineStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationLineStateCreateInfoEXT.gen.cs index 82d0c910f9..fb1b64f0f8 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 : IStructuredType { public PipelineRasterizationLineStateCreateInfoEXT ( @@ -90,5 +90,11 @@ public PipelineRasterizationLineStateCreateInfoEXT [NativeName("Type.Name", "uint16_t")] [NativeName("Name", "lineStipplePattern")] public ushort LineStipplePattern; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRasterizationLineStateCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationProvokingVertexStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationProvokingVertexStateCreateInfoEXT.gen.cs index f15039a0cf..706283907d 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 : IStructuredType { public PipelineRasterizationProvokingVertexStateCreateInfoEXT ( @@ -57,5 +57,11 @@ public PipelineRasterizationProvokingVertexStateCreateInfoEXT [NativeName("Type.Name", "VkProvokingVertexModeEXT")] [NativeName("Name", "provokingVertexMode")] public ProvokingVertexModeEXT ProvokingVertexMode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRasterizationProvokingVertexStateCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateCreateInfo.gen.cs index 3ce3258f4a..a560caeadd 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 : IStructuredType { public PipelineRasterizationStateCreateInfo ( @@ -167,5 +167,11 @@ public PipelineRasterizationStateCreateInfo [NativeName("Type.Name", "float")] [NativeName("Name", "lineWidth")] public float LineWidth; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRasterizationStateCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateRasterizationOrderAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateRasterizationOrderAMD.gen.cs index 6140ec8070..b7fe0f655e 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 : IStructuredType { public PipelineRasterizationStateRasterizationOrderAMD ( @@ -57,5 +57,11 @@ public PipelineRasterizationStateRasterizationOrderAMD [NativeName("Type.Name", "VkRasterizationOrderAMD")] [NativeName("Name", "rasterizationOrder")] public RasterizationOrderAMD RasterizationOrder; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRasterizationStateRasterizationOrderAmd; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateStreamCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRasterizationStateStreamCreateInfoEXT.gen.cs index 71bc58cfe3..097dde81f1 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 : IStructuredType { public PipelineRasterizationStateStreamCreateInfoEXT ( @@ -68,5 +68,11 @@ public PipelineRasterizationStateStreamCreateInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "rasterizationStream")] public uint RasterizationStream; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRasterizationStateStreamCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRenderingCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRenderingCreateInfoKHR.gen.cs index 7dfdb6e735..c6b75bf6af 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 : IStructuredType { public PipelineRenderingCreateInfoKHR ( @@ -101,5 +101,11 @@ public PipelineRenderingCreateInfoKHR [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "stencilAttachmentFormat")] public Format StencilAttachmentFormat; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRenderingCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRepresentativeFragmentTestStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineRepresentativeFragmentTestStateCreateInfoNV.gen.cs index 661020a823..930fd75826 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 : IStructuredType { public PipelineRepresentativeFragmentTestStateCreateInfoNV ( @@ -57,5 +57,11 @@ public PipelineRepresentativeFragmentTestStateCreateInfoNV [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "representativeFragmentTestEnable")] public Bool32 RepresentativeFragmentTestEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineRepresentativeFragmentTestStateCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineSampleLocationsStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineSampleLocationsStateCreateInfoEXT.gen.cs index a6d57e4415..43634444c8 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 : IStructuredType { public PipelineSampleLocationsStateCreateInfoEXT ( @@ -68,5 +68,11 @@ public PipelineSampleLocationsStateCreateInfoEXT [NativeName("Type.Name", "VkSampleLocationsInfoEXT")] [NativeName("Name", "sampleLocationsInfo")] public SampleLocationsInfoEXT SampleLocationsInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineSampleLocationsStateCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineShaderStageCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineShaderStageCreateInfo.gen.cs index 117230668e..746203f92c 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 : IStructuredType { public PipelineShaderStageCreateInfo ( @@ -101,5 +101,11 @@ public PipelineShaderStageCreateInfo [NativeName("Type.Name", "VkSpecializationInfo")] [NativeName("Name", "pSpecializationInfo")] public SpecializationInfo* PSpecializationInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineShaderStageCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT.gen.cs index 01d5dd31c2..3c5101680a 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 : IStructuredType { public PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT ( @@ -57,5 +57,11 @@ public PipelineShaderStageRequiredSubgroupSizeCreateInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "requiredSubgroupSize")] public uint RequiredSubgroupSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineShaderStageRequiredSubgroupSizeCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfo.gen.cs index ee73090b4a..63e9f30846 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineTessellationDomainOriginStateCreateInfo")] - public unsafe partial struct PipelineTessellationDomainOriginStateCreateInfo + public unsafe partial struct PipelineTessellationDomainOriginStateCreateInfo : IStructuredType { public PipelineTessellationDomainOriginStateCreateInfo ( @@ -57,5 +57,11 @@ public PipelineTessellationDomainOriginStateCreateInfo [NativeName("Type.Name", "VkTessellationDomainOrigin")] [NativeName("Name", "domainOrigin")] public TessellationDomainOrigin DomainOrigin; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineTessellationDomainOriginStateCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfoKHR.gen.cs index da8ba064ed..720a774a50 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationDomainOriginStateCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkPipelineTessellationDomainOriginStateCreateInfoKHR")] - public unsafe partial struct PipelineTessellationDomainOriginStateCreateInfoKHR + public unsafe partial struct PipelineTessellationDomainOriginStateCreateInfoKHR : IStructuredType { public PipelineTessellationDomainOriginStateCreateInfoKHR ( @@ -57,5 +57,11 @@ public PipelineTessellationDomainOriginStateCreateInfoKHR [NativeName("Type.Name", "VkTessellationDomainOrigin")] [NativeName("Name", "domainOrigin")] public TessellationDomainOrigin DomainOrigin; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineTessellationDomainOriginStateCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineTessellationStateCreateInfo.gen.cs index 18ece41ec7..89aa43c8df 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 : IStructuredType { public PipelineTessellationStateCreateInfo ( @@ -68,5 +68,11 @@ public PipelineTessellationStateCreateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "patchControlPoints")] public uint PatchControlPoints; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineTessellationStateCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineVertexInputDivisorStateCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineVertexInputDivisorStateCreateInfoEXT.gen.cs index 4060a03f7d..24d6035237 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 : IStructuredType { public PipelineVertexInputDivisorStateCreateInfoEXT ( @@ -68,5 +68,11 @@ public PipelineVertexInputDivisorStateCreateInfoEXT [NativeName("Type.Name", "VkVertexInputBindingDivisorDescriptionEXT")] [NativeName("Name", "pVertexBindingDivisors")] public VertexInputBindingDivisorDescriptionEXT* PVertexBindingDivisors; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineVertexInputDivisorStateCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineVertexInputStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineVertexInputStateCreateInfo.gen.cs index afcf90b6ae..781f4c47ef 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 : IStructuredType { public PipelineVertexInputStateCreateInfo ( @@ -101,5 +101,11 @@ public PipelineVertexInputStateCreateInfo [NativeName("Type.Name", "VkVertexInputAttributeDescription")] [NativeName("Name", "pVertexAttributeDescriptions")] public VertexInputAttributeDescription* PVertexAttributeDescriptions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineVertexInputStateCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportCoarseSampleOrderStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportCoarseSampleOrderStateCreateInfoNV.gen.cs index b2a36a8af0..6c0e845732 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 : IStructuredType { public PipelineViewportCoarseSampleOrderStateCreateInfoNV ( @@ -79,5 +79,11 @@ public PipelineViewportCoarseSampleOrderStateCreateInfoNV [NativeName("Type.Name", "VkCoarseSampleOrderCustomNV")] [NativeName("Name", "pCustomSampleOrders")] public CoarseSampleOrderCustomNV* PCustomSampleOrders; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineViewportCoarseSampleOrderStateCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportExclusiveScissorStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportExclusiveScissorStateCreateInfoNV.gen.cs index ea773767db..f12a828228 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 : IStructuredType { public PipelineViewportExclusiveScissorStateCreateInfoNV ( @@ -68,5 +68,11 @@ public PipelineViewportExclusiveScissorStateCreateInfoNV [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "pExclusiveScissors")] public Rect2D* PExclusiveScissors; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineViewportExclusiveScissorStateCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportShadingRateImageStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportShadingRateImageStateCreateInfoNV.gen.cs index 07706fa6de..903267342a 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 : IStructuredType { public PipelineViewportShadingRateImageStateCreateInfoNV ( @@ -79,5 +79,11 @@ public PipelineViewportShadingRateImageStateCreateInfoNV [NativeName("Type.Name", "VkShadingRatePaletteNV")] [NativeName("Name", "pShadingRatePalettes")] public ShadingRatePaletteNV* PShadingRatePalettes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineViewportShadingRateImageStateCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportStateCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportStateCreateInfo.gen.cs index eda9a78a40..b6a02b8f9b 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 : IStructuredType { public PipelineViewportStateCreateInfo ( @@ -101,5 +101,11 @@ public PipelineViewportStateCreateInfo [NativeName("Type.Name", "VkRect2D")] [NativeName("Name", "pScissors")] public Rect2D* PScissors; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineViewportStateCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportSwizzleStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportSwizzleStateCreateInfoNV.gen.cs index d1f7c59b63..b0c5590345 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 : IStructuredType { public PipelineViewportSwizzleStateCreateInfoNV ( @@ -79,5 +79,11 @@ public PipelineViewportSwizzleStateCreateInfoNV [NativeName("Type.Name", "VkViewportSwizzleNV")] [NativeName("Name", "pViewportSwizzles")] public ViewportSwizzleNV* PViewportSwizzles; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineViewportSwizzleStateCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportWScalingStateCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PipelineViewportWScalingStateCreateInfoNV.gen.cs index ccc7f9d365..c2ac6fbf62 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 : IStructuredType { public PipelineViewportWScalingStateCreateInfoNV ( @@ -79,5 +79,11 @@ public PipelineViewportWScalingStateCreateInfoNV [NativeName("Type.Name", "VkViewportWScalingNV")] [NativeName("Name", "pViewportWScalings")] public ViewportWScalingNV* PViewportWScalings; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PipelineViewportWScalingStateCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PresentFrameTokenGGP.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PresentFrameTokenGGP.gen.cs index 6bd22c0921..abd02ccf93 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 : IStructuredType { public PresentFrameTokenGGP ( @@ -57,5 +57,11 @@ public PresentFrameTokenGGP [NativeName("Type.Name", "GgpFrameToken")] [NativeName("Name", "frameToken")] public nint FrameToken; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PresentFrameTokenGgp; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PresentIdKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PresentIdKHR.gen.cs index 93930f6e55..f328d616a3 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 : IStructuredType { public PresentIdKHR ( @@ -68,5 +68,11 @@ public PresentIdKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pPresentIds")] public ulong* PPresentIds; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PresentIDKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PresentInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PresentInfoKHR.gen.cs index 82be4a197a..196259a188 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 : IStructuredType { public PresentInfoKHR ( @@ -112,5 +112,11 @@ public PresentInfoKHR [NativeName("Type.Name", "VkResult")] [NativeName("Name", "pResults")] public Result* PResults; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PresentInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PresentRegionsKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PresentRegionsKHR.gen.cs index 3c04317c95..a1a21578ff 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 : IStructuredType { public PresentRegionsKHR ( @@ -68,5 +68,11 @@ public PresentRegionsKHR [NativeName("Type.Name", "VkPresentRegionKHR")] [NativeName("Name", "pRegions")] public PresentRegionKHR* PRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PresentRegionsKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PresentTimesInfoGOOGLE.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PresentTimesInfoGOOGLE.gen.cs index 64906c33d1..2734781e90 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 : IStructuredType { public PresentTimesInfoGOOGLE ( @@ -68,5 +68,11 @@ public PresentTimesInfoGOOGLE [NativeName("Type.Name", "VkPresentTimeGOOGLE")] [NativeName("Name", "pTimes")] public PresentTimeGOOGLE* PTimes; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PresentTimesInfoGoogle; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/PrivateDataSlotCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/PrivateDataSlotCreateInfoEXT.gen.cs index f8dcce2115..991c2904d9 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 : IStructuredType { public PrivateDataSlotCreateInfoEXT ( @@ -57,5 +57,11 @@ public PrivateDataSlotCreateInfoEXT [NativeName("Type.Name", "VkPrivateDataSlotCreateFlagsEXT")] [NativeName("Name", "flags")] public PrivateDataSlotCreateFlagsEXT Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.PrivateDataSlotCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ProtectedSubmitInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ProtectedSubmitInfo.gen.cs index 2374c848d4..a809f13c10 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 : IStructuredType { public ProtectedSubmitInfo ( @@ -57,5 +57,11 @@ public ProtectedSubmitInfo [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "protectedSubmit")] public Bool32 ProtectedSubmit; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ProtectedSubmitInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolCreateInfo.gen.cs index d8189773c7..cf90b5fa32 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 : IStructuredType { public QueryPoolCreateInfo ( @@ -90,5 +90,11 @@ public QueryPoolCreateInfo [NativeName("Type.Name", "VkQueryPipelineStatisticFlags")] [NativeName("Name", "pipelineStatistics")] public QueryPipelineStatisticFlags PipelineStatistics; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueryPoolCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolCreateInfoINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolCreateInfoINTEL.gen.cs index 42d4d421f6..d6ece87c13 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolCreateInfoINTEL.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolCreateInfoINTEL.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkQueryPoolCreateInfoINTEL")] - public unsafe partial struct QueryPoolCreateInfoINTEL + public unsafe partial struct QueryPoolCreateInfoINTEL : IStructuredType { public QueryPoolCreateInfoINTEL ( @@ -57,5 +57,11 @@ public QueryPoolCreateInfoINTEL [NativeName("Type.Name", "VkQueryPoolSamplingModeINTEL")] [NativeName("Name", "performanceCountersSampling")] public QueryPoolSamplingModeINTEL PerformanceCountersSampling; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueryPoolPerformanceQueryCreateInfoIntel; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolPerformanceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolPerformanceCreateInfoKHR.gen.cs index bcb945e86c..4cf8bd0833 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 : IStructuredType { public QueryPoolPerformanceCreateInfoKHR ( @@ -79,5 +79,11 @@ public QueryPoolPerformanceCreateInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pCounterIndices")] public uint* PCounterIndices; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueryPoolPerformanceCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolPerformanceQueryCreateInfoINTEL.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolPerformanceQueryCreateInfoINTEL.gen.cs index 9962fec41c..55cac0b397 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolPerformanceQueryCreateInfoINTEL.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/QueryPoolPerformanceQueryCreateInfoINTEL.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkQueryPoolPerformanceQueryCreateInfoINTEL")] - public unsafe partial struct QueryPoolPerformanceQueryCreateInfoINTEL + public unsafe partial struct QueryPoolPerformanceQueryCreateInfoINTEL : IStructuredType { public QueryPoolPerformanceQueryCreateInfoINTEL ( @@ -57,5 +57,11 @@ public QueryPoolPerformanceQueryCreateInfoINTEL [NativeName("Type.Name", "VkQueryPoolSamplingModeINTEL")] [NativeName("Name", "performanceCountersSampling")] public QueryPoolSamplingModeINTEL PerformanceCountersSampling; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueryPoolPerformanceQueryCreateInfoIntel; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyCheckpointProperties2NV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyCheckpointProperties2NV.gen.cs index 8d451eab1b..9af3db33a6 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 : IStructuredType { public QueueFamilyCheckpointProperties2NV ( @@ -57,5 +57,11 @@ public QueueFamilyCheckpointProperties2NV [NativeName("Type.Name", "VkPipelineStageFlags2KHR")] [NativeName("Name", "checkpointExecutionStageMask")] public PipelineStageFlags2KHR CheckpointExecutionStageMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueueFamilyCheckpointProperties2NV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyCheckpointPropertiesNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyCheckpointPropertiesNV.gen.cs index fc34a3c18a..545c677c2e 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 : IStructuredType { public QueueFamilyCheckpointPropertiesNV ( @@ -57,5 +57,11 @@ public QueueFamilyCheckpointPropertiesNV [NativeName("Type.Name", "VkPipelineStageFlags")] [NativeName("Name", "checkpointExecutionStageMask")] public PipelineStageFlags CheckpointExecutionStageMask; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueueFamilyCheckpointPropertiesNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyGlobalPriorityPropertiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyGlobalPriorityPropertiesEXT.gen.cs index 3372bcc325..00acfd1cdb 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 : IStructuredType { public QueueFamilyGlobalPriorityPropertiesEXT ( @@ -103,5 +103,11 @@ public Span AsSpan() #endif } + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueueFamilyGlobalPriorityPropertiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2.gen.cs index 1b9a34e75f..687e43fd1f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkQueueFamilyProperties2")] - public unsafe partial struct QueueFamilyProperties2 + public unsafe partial struct QueueFamilyProperties2 : IStructuredType { public QueueFamilyProperties2 ( @@ -57,5 +57,11 @@ public QueueFamilyProperties2 [NativeName("Type.Name", "VkQueueFamilyProperties")] [NativeName("Name", "queueFamilyProperties")] public QueueFamilyProperties QueueFamilyProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueueFamilyProperties2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2KHR.gen.cs index c672fb2adc..be53281009 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/QueueFamilyProperties2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkQueueFamilyProperties2KHR")] - public unsafe partial struct QueueFamilyProperties2KHR + public unsafe partial struct QueueFamilyProperties2KHR : IStructuredType { public QueueFamilyProperties2KHR ( @@ -57,5 +57,11 @@ public QueueFamilyProperties2KHR [NativeName("Type.Name", "VkQueueFamilyProperties")] [NativeName("Name", "queueFamilyProperties")] public QueueFamilyProperties QueueFamilyProperties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.QueueFamilyProperties2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineCreateInfoKHR.gen.cs index 1605b519e7..7a7f415c9b 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 : IStructuredType { public RayTracingPipelineCreateInfoKHR ( @@ -178,5 +178,11 @@ public RayTracingPipelineCreateInfoKHR [NativeName("Type.Name", "int32_t")] [NativeName("Name", "basePipelineIndex")] public int BasePipelineIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RayTracingPipelineCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineCreateInfoNV.gen.cs index 7e63706b2f..1e133c8337 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 : IStructuredType { public RayTracingPipelineCreateInfoNV ( @@ -145,5 +145,11 @@ public RayTracingPipelineCreateInfoNV [NativeName("Type.Name", "int32_t")] [NativeName("Name", "basePipelineIndex")] public int BasePipelineIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RayTracingPipelineCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineInterfaceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingPipelineInterfaceCreateInfoKHR.gen.cs index 5ea369c8d3..16ba17ea90 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 : IStructuredType { public RayTracingPipelineInterfaceCreateInfoKHR ( @@ -68,5 +68,11 @@ public RayTracingPipelineInterfaceCreateInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxPipelineRayHitAttributeSize")] public uint MaxPipelineRayHitAttributeSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RayTracingPipelineInterfaceCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingShaderGroupCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingShaderGroupCreateInfoKHR.gen.cs index 247444d970..9d69a8d66d 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 : IStructuredType { public RayTracingShaderGroupCreateInfoKHR ( @@ -112,5 +112,11 @@ public RayTracingShaderGroupCreateInfoKHR [NativeName("Type.Name", "void")] [NativeName("Name", "pShaderGroupCaptureReplayHandle")] public void* PShaderGroupCaptureReplayHandle; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RayTracingShaderGroupCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingShaderGroupCreateInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RayTracingShaderGroupCreateInfoNV.gen.cs index 0d2b7aaba1..962f35f0ac 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 : IStructuredType { public RayTracingShaderGroupCreateInfoNV ( @@ -101,5 +101,11 @@ public RayTracingShaderGroupCreateInfoNV [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "intersectionShader")] public uint IntersectionShader; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RayTracingShaderGroupCreateInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfo.gen.cs index 071199ea38..4a88442de9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassAttachmentBeginInfo")] - public unsafe partial struct RenderPassAttachmentBeginInfo + public unsafe partial struct RenderPassAttachmentBeginInfo : IStructuredType { public RenderPassAttachmentBeginInfo ( @@ -68,5 +68,11 @@ public RenderPassAttachmentBeginInfo [NativeName("Type.Name", "VkImageView")] [NativeName("Name", "pAttachments")] public ImageView* PAttachments; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassAttachmentBeginInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfoKHR.gen.cs index 062082e015..bd65ebaee1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassAttachmentBeginInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassAttachmentBeginInfoKHR")] - public unsafe partial struct RenderPassAttachmentBeginInfoKHR + public unsafe partial struct RenderPassAttachmentBeginInfoKHR : IStructuredType { public RenderPassAttachmentBeginInfoKHR ( @@ -68,5 +68,11 @@ public RenderPassAttachmentBeginInfoKHR [NativeName("Type.Name", "VkImageView")] [NativeName("Name", "pAttachments")] public ImageView* PAttachments; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassAttachmentBeginInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassBeginInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassBeginInfo.gen.cs index 0c3e4e37e0..c2804af7c0 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 : IStructuredType { public RenderPassBeginInfo ( @@ -101,5 +101,11 @@ public RenderPassBeginInfo [NativeName("Type.Name", "VkClearValue")] [NativeName("Name", "pClearValues")] public ClearValue* PClearValues; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassBeginInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo.gen.cs index c280724ab3..024b99563a 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 : IStructuredType { public RenderPassCreateInfo ( @@ -123,5 +123,11 @@ public RenderPassCreateInfo [NativeName("Type.Name", "VkSubpassDependency")] [NativeName("Name", "pDependencies")] public SubpassDependency* PDependencies; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2.gen.cs index 8499729d63..36f7dda720 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassCreateInfo2")] - public unsafe partial struct RenderPassCreateInfo2 + public unsafe partial struct RenderPassCreateInfo2 : IStructuredType { public RenderPassCreateInfo2 ( @@ -145,5 +145,11 @@ public RenderPassCreateInfo2 [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pCorrelatedViewMasks")] public uint* PCorrelatedViewMasks; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassCreateInfo2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2KHR.gen.cs index d4aae52ac3..5824c9a535 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassCreateInfo2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassCreateInfo2KHR")] - public unsafe partial struct RenderPassCreateInfo2KHR + public unsafe partial struct RenderPassCreateInfo2KHR : IStructuredType { public RenderPassCreateInfo2KHR ( @@ -145,5 +145,11 @@ public RenderPassCreateInfo2KHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pCorrelatedViewMasks")] public uint* PCorrelatedViewMasks; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassCreateInfo2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassFragmentDensityMapCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassFragmentDensityMapCreateInfoEXT.gen.cs index 9d07fb74a8..6e5bf0d0bc 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 : IStructuredType { public RenderPassFragmentDensityMapCreateInfoEXT ( @@ -57,5 +57,11 @@ public RenderPassFragmentDensityMapCreateInfoEXT [NativeName("Type.Name", "VkAttachmentReference")] [NativeName("Name", "fragmentDensityMapAttachment")] public AttachmentReference FragmentDensityMapAttachment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassFragmentDensityMapCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfo.gen.cs index 668301b76b..481b1ed341 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassInputAttachmentAspectCreateInfo")] - public unsafe partial struct RenderPassInputAttachmentAspectCreateInfo + public unsafe partial struct RenderPassInputAttachmentAspectCreateInfo : IStructuredType { public RenderPassInputAttachmentAspectCreateInfo ( @@ -68,5 +68,11 @@ public RenderPassInputAttachmentAspectCreateInfo [NativeName("Type.Name", "VkInputAttachmentAspectReference")] [NativeName("Name", "pAspectReferences")] public InputAttachmentAspectReference* PAspectReferences; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassInputAttachmentAspectCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfoKHR.gen.cs index 6664956b0d..9b2094d128 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassInputAttachmentAspectCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassInputAttachmentAspectCreateInfoKHR")] - public unsafe partial struct RenderPassInputAttachmentAspectCreateInfoKHR + public unsafe partial struct RenderPassInputAttachmentAspectCreateInfoKHR : IStructuredType { public RenderPassInputAttachmentAspectCreateInfoKHR ( @@ -68,5 +68,11 @@ public RenderPassInputAttachmentAspectCreateInfoKHR [NativeName("Type.Name", "VkInputAttachmentAspectReference")] [NativeName("Name", "pAspectReferences")] public InputAttachmentAspectReference* PAspectReferences; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassInputAttachmentAspectCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfo.gen.cs index 6630255c68..a7170b2f8b 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassMultiviewCreateInfo")] - public unsafe partial struct RenderPassMultiviewCreateInfo + public unsafe partial struct RenderPassMultiviewCreateInfo : IStructuredType { public RenderPassMultiviewCreateInfo ( @@ -112,5 +112,11 @@ public RenderPassMultiviewCreateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pCorrelationMasks")] public uint* PCorrelationMasks; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassMultiviewCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfoKHR.gen.cs index 65194b6d9a..65f8e3b8c4 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassMultiviewCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkRenderPassMultiviewCreateInfoKHR")] - public unsafe partial struct RenderPassMultiviewCreateInfoKHR + public unsafe partial struct RenderPassMultiviewCreateInfoKHR : IStructuredType { public RenderPassMultiviewCreateInfoKHR ( @@ -112,5 +112,11 @@ public RenderPassMultiviewCreateInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pCorrelationMasks")] public uint* PCorrelationMasks; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassMultiviewCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassSampleLocationsBeginInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassSampleLocationsBeginInfoEXT.gen.cs index ddba77768c..1bb2557ad1 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 : IStructuredType { public RenderPassSampleLocationsBeginInfoEXT ( @@ -90,5 +90,11 @@ public RenderPassSampleLocationsBeginInfoEXT [NativeName("Type.Name", "VkSubpassSampleLocationsEXT")] [NativeName("Name", "pPostSubpassSampleLocations")] public SubpassSampleLocationsEXT* PPostSubpassSampleLocations; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassSampleLocationsBeginInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassTransformBeginInfoQCOM.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderPassTransformBeginInfoQCOM.gen.cs index 205e660fd8..ecaeaae533 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 : IStructuredType { public RenderPassTransformBeginInfoQCOM ( @@ -57,5 +57,11 @@ public RenderPassTransformBeginInfoQCOM [NativeName("Type.Name", "VkSurfaceTransformFlagBitsKHR")] [NativeName("Name", "transform")] public SurfaceTransformFlagsKHR Transform; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderPassTransformBeginInfoQCom; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingAttachmentInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingAttachmentInfoKHR.gen.cs index 5d89ffdf75..9fd228a6ef 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 : IStructuredType { public RenderingAttachmentInfoKHR ( @@ -134,5 +134,11 @@ public RenderingAttachmentInfoKHR [NativeName("Type.Name", "VkClearValue")] [NativeName("Name", "clearValue")] public ClearValue ClearValue; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderingAttachmentInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingFragmentDensityMapAttachmentInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingFragmentDensityMapAttachmentInfoEXT.gen.cs index 72c1e1d492..4e21637154 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 : IStructuredType { public RenderingFragmentDensityMapAttachmentInfoEXT ( @@ -68,5 +68,11 @@ public RenderingFragmentDensityMapAttachmentInfoEXT [NativeName("Type.Name", "VkImageLayout")] [NativeName("Name", "imageLayout")] public ImageLayout ImageLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderingFragmentDensityMapAttachmentInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingFragmentShadingRateAttachmentInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingFragmentShadingRateAttachmentInfoKHR.gen.cs index 6f29e02319..3a89f7eb6b 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 : IStructuredType { public RenderingFragmentShadingRateAttachmentInfoKHR ( @@ -79,5 +79,11 @@ public RenderingFragmentShadingRateAttachmentInfoKHR [NativeName("Type.Name", "VkExtent2D")] [NativeName("Name", "shadingRateAttachmentTexelSize")] public Extent2D ShadingRateAttachmentTexelSize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderingFragmentShadingRateAttachmentInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/RenderingInfoKHR.gen.cs index 31ad589b96..0ad44f3980 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 : IStructuredType { public RenderingInfoKHR ( @@ -134,5 +134,11 @@ public RenderingInfoKHR [NativeName("Type.Name", "VkRenderingAttachmentInfoKHR")] [NativeName("Name", "pStencilAttachment")] public RenderingAttachmentInfoKHR* PStencilAttachment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.RenderingInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ResolveImageInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ResolveImageInfo2KHR.gen.cs index dc5d59b0d4..eb265a442a 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 : IStructuredType { public ResolveImageInfo2KHR ( @@ -112,5 +112,11 @@ public ResolveImageInfo2KHR [NativeName("Type.Name", "VkImageResolve2KHR")] [NativeName("Name", "pRegions")] public ImageResolve2KHR* PRegions; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ResolveImageInfo2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SampleLocationsInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SampleLocationsInfoEXT.gen.cs index 39bf6f1a3e..c07066d726 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 : IStructuredType { public SampleLocationsInfoEXT ( @@ -90,5 +90,11 @@ public SampleLocationsInfoEXT [NativeName("Type.Name", "VkSampleLocationEXT")] [NativeName("Name", "pSampleLocations")] public SampleLocationEXT* PSampleLocations; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SampleLocationsInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerBorderColorComponentMappingCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerBorderColorComponentMappingCreateInfoEXT.gen.cs index b4daf5c649..73547377b3 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 : IStructuredType { public SamplerBorderColorComponentMappingCreateInfoEXT ( @@ -68,5 +68,11 @@ public SamplerBorderColorComponentMappingCreateInfoEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "srgb")] public Bool32 Srgb; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerBorderColorComponentMappingCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerCreateInfo.gen.cs index 6dab9a319f..0eae090cd2 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 : IStructuredType { public SamplerCreateInfo ( @@ -222,5 +222,11 @@ public SamplerCreateInfo [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "unnormalizedCoordinates")] public Bool32 UnnormalizedCoordinates; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerCustomBorderColorCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerCustomBorderColorCreateInfoEXT.gen.cs index 5d19e32103..f324be7877 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 : IStructuredType { public SamplerCustomBorderColorCreateInfoEXT ( @@ -68,5 +68,11 @@ public SamplerCustomBorderColorCreateInfoEXT [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "format")] public Format Format; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerCustomBorderColorCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfo.gen.cs index 8d20b05eca..bb25c01836 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerReductionModeCreateInfo")] - public unsafe partial struct SamplerReductionModeCreateInfo + public unsafe partial struct SamplerReductionModeCreateInfo : IStructuredType { public SamplerReductionModeCreateInfo ( @@ -57,5 +57,11 @@ public SamplerReductionModeCreateInfo [NativeName("Type.Name", "VkSamplerReductionMode")] [NativeName("Name", "reductionMode")] public SamplerReductionMode ReductionMode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerReductionModeCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfoEXT.gen.cs index e476417d36..81f71b7dfc 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfoEXT.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerReductionModeCreateInfoEXT.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerReductionModeCreateInfoEXT")] - public unsafe partial struct SamplerReductionModeCreateInfoEXT + public unsafe partial struct SamplerReductionModeCreateInfoEXT : IStructuredType { public SamplerReductionModeCreateInfoEXT ( @@ -57,5 +57,11 @@ public SamplerReductionModeCreateInfoEXT [NativeName("Type.Name", "VkSamplerReductionMode")] [NativeName("Name", "reductionMode")] public SamplerReductionMode ReductionMode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerReductionModeCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfo.gen.cs index 304c61bcba..c5db31038d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerYcbcrConversionCreateInfo")] - public unsafe partial struct SamplerYcbcrConversionCreateInfo + public unsafe partial struct SamplerYcbcrConversionCreateInfo : IStructuredType { public SamplerYcbcrConversionCreateInfo ( @@ -134,5 +134,11 @@ public SamplerYcbcrConversionCreateInfo [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "forceExplicitReconstruction")] public Bool32 ForceExplicitReconstruction; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerYcbcrConversionCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfoKHR.gen.cs index e248e865aa..d8f2cbaa02 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerYcbcrConversionCreateInfoKHR")] - public unsafe partial struct SamplerYcbcrConversionCreateInfoKHR + public unsafe partial struct SamplerYcbcrConversionCreateInfoKHR : IStructuredType { public SamplerYcbcrConversionCreateInfoKHR ( @@ -134,5 +134,11 @@ public SamplerYcbcrConversionCreateInfoKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "forceExplicitReconstruction")] public Bool32 ForceExplicitReconstruction; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerYcbcrConversionCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatProperties.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatProperties.gen.cs index 05d0e2137d..9fcbfc6d9c 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatProperties.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatProperties.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerYcbcrConversionImageFormatProperties")] - public unsafe partial struct SamplerYcbcrConversionImageFormatProperties + public unsafe partial struct SamplerYcbcrConversionImageFormatProperties : IStructuredType { public SamplerYcbcrConversionImageFormatProperties ( @@ -57,5 +57,11 @@ public SamplerYcbcrConversionImageFormatProperties [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "combinedImageSamplerDescriptorCount")] public uint CombinedImageSamplerDescriptorCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerYcbcrConversionImageFormatProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatPropertiesKHR.gen.cs index 0c21e4986f..bc749be1aa 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatPropertiesKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionImageFormatPropertiesKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerYcbcrConversionImageFormatPropertiesKHR")] - public unsafe partial struct SamplerYcbcrConversionImageFormatPropertiesKHR + public unsafe partial struct SamplerYcbcrConversionImageFormatPropertiesKHR : IStructuredType { public SamplerYcbcrConversionImageFormatPropertiesKHR ( @@ -57,5 +57,11 @@ public SamplerYcbcrConversionImageFormatPropertiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "combinedImageSamplerDescriptorCount")] public uint CombinedImageSamplerDescriptorCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerYcbcrConversionImageFormatProperties; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfo.gen.cs index 6af5edf275..7906d71b59 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerYcbcrConversionInfo")] - public unsafe partial struct SamplerYcbcrConversionInfo + public unsafe partial struct SamplerYcbcrConversionInfo : IStructuredType { public SamplerYcbcrConversionInfo ( @@ -57,5 +57,11 @@ public SamplerYcbcrConversionInfo [NativeName("Type.Name", "VkSamplerYcbcrConversion")] [NativeName("Name", "conversion")] public SamplerYcbcrConversion Conversion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerYcbcrConversionInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfoKHR.gen.cs index 88a8056674..d84eed4fce 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SamplerYcbcrConversionInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSamplerYcbcrConversionInfoKHR")] - public unsafe partial struct SamplerYcbcrConversionInfoKHR + public unsafe partial struct SamplerYcbcrConversionInfoKHR : IStructuredType { public SamplerYcbcrConversionInfoKHR ( @@ -57,5 +57,11 @@ public SamplerYcbcrConversionInfoKHR [NativeName("Type.Name", "VkSamplerYcbcrConversion")] [NativeName("Name", "conversion")] public SamplerYcbcrConversion Conversion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SamplerYcbcrConversionInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ScreenSurfaceCreateInfoQNX.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ScreenSurfaceCreateInfoQNX.gen.cs index f439d147f0..97ef52448e 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 : IStructuredType { public ScreenSurfaceCreateInfoQNX ( @@ -79,5 +79,11 @@ public ScreenSurfaceCreateInfoQNX [NativeName("Type.Name", "_screen_window")] [NativeName("Name", "window")] public void* Window; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ScreenSurfaceCreateInfoQnx; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreCreateInfo.gen.cs index 5865e6c45d..30feda27df 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 : IStructuredType { public SemaphoreCreateInfo ( @@ -57,5 +57,11 @@ public SemaphoreCreateInfo [NativeName("Type.Name", "VkSemaphoreCreateFlags")] [NativeName("Name", "flags")] public uint Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetFdInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetFdInfoKHR.gen.cs index 502a8caafa..7700a2e65f 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 : IStructuredType { public SemaphoreGetFdInfoKHR ( @@ -68,5 +68,11 @@ public SemaphoreGetFdInfoKHR [NativeName("Type.Name", "VkExternalSemaphoreHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalSemaphoreHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreGetFDInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetWin32HandleInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetWin32HandleInfoKHR.gen.cs index d588742132..8d46797d00 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 : IStructuredType { public SemaphoreGetWin32HandleInfoKHR ( @@ -68,5 +68,11 @@ public SemaphoreGetWin32HandleInfoKHR [NativeName("Type.Name", "VkExternalSemaphoreHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalSemaphoreHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreGetWin32HandleInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetZirconHandleInfoFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreGetZirconHandleInfoFUCHSIA.gen.cs index b1cff9174f..3ca91bb142 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 : IStructuredType { public SemaphoreGetZirconHandleInfoFUCHSIA ( @@ -68,5 +68,11 @@ public SemaphoreGetZirconHandleInfoFUCHSIA [NativeName("Type.Name", "VkExternalSemaphoreHandleTypeFlagBits")] [NativeName("Name", "handleType")] public ExternalSemaphoreHandleTypeFlags HandleType; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreGetZirconHandleInfoFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfo.gen.cs index 130fe8fec6..5171d288f9 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreSignalInfo")] - public unsafe partial struct SemaphoreSignalInfo + public unsafe partial struct SemaphoreSignalInfo : IStructuredType { public SemaphoreSignalInfo ( @@ -68,5 +68,11 @@ public SemaphoreSignalInfo [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "value")] public ulong Value; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreSignalInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfoKHR.gen.cs index 9c24dcff6a..8c52b3eb97 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSignalInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreSignalInfoKHR")] - public unsafe partial struct SemaphoreSignalInfoKHR + public unsafe partial struct SemaphoreSignalInfoKHR : IStructuredType { public SemaphoreSignalInfoKHR ( @@ -68,5 +68,11 @@ public SemaphoreSignalInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "value")] public ulong Value; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreSignalInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSubmitInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreSubmitInfoKHR.gen.cs index 31c189fa57..95c966bb04 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 : IStructuredType { public SemaphoreSubmitInfoKHR ( @@ -90,5 +90,11 @@ public SemaphoreSubmitInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "deviceIndex")] public uint DeviceIndex; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreSubmitInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfo.gen.cs index 9d3db84a7c..707a447458 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreTypeCreateInfo")] - public unsafe partial struct SemaphoreTypeCreateInfo + public unsafe partial struct SemaphoreTypeCreateInfo : IStructuredType { public SemaphoreTypeCreateInfo ( @@ -68,5 +68,11 @@ public SemaphoreTypeCreateInfo [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "initialValue")] public ulong InitialValue; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreTypeCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfoKHR.gen.cs index 203a962761..973434156a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreTypeCreateInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreTypeCreateInfoKHR")] - public unsafe partial struct SemaphoreTypeCreateInfoKHR + public unsafe partial struct SemaphoreTypeCreateInfoKHR : IStructuredType { public SemaphoreTypeCreateInfoKHR ( @@ -68,5 +68,11 @@ public SemaphoreTypeCreateInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "initialValue")] public ulong InitialValue; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreTypeCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfo.gen.cs index 1217904fa9..03053e78c2 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreWaitInfo")] - public unsafe partial struct SemaphoreWaitInfo + public unsafe partial struct SemaphoreWaitInfo : IStructuredType { public SemaphoreWaitInfo ( @@ -90,5 +90,11 @@ public SemaphoreWaitInfo [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pValues")] public ulong* PValues; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreWaitInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfoKHR.gen.cs index 364863905d..2c3c1de190 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SemaphoreWaitInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSemaphoreWaitInfoKHR")] - public unsafe partial struct SemaphoreWaitInfoKHR + public unsafe partial struct SemaphoreWaitInfoKHR : IStructuredType { public SemaphoreWaitInfoKHR ( @@ -90,5 +90,11 @@ public SemaphoreWaitInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pValues")] public ulong* PValues; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SemaphoreWaitInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ShaderModuleCreateInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ShaderModuleCreateInfo.gen.cs index 6a1e449e64..c7b304c5ae 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 : IStructuredType { public ShaderModuleCreateInfo ( @@ -79,5 +79,11 @@ public ShaderModuleCreateInfo [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pCode")] public uint* PCode; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ShaderModuleCreateInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ShaderModuleValidationCacheCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ShaderModuleValidationCacheCreateInfoEXT.gen.cs index 029c67a9ce..9212cc9669 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 : IStructuredType { public ShaderModuleValidationCacheCreateInfoEXT ( @@ -57,5 +57,11 @@ public ShaderModuleValidationCacheCreateInfoEXT [NativeName("Type.Name", "VkValidationCacheEXT")] [NativeName("Name", "validationCache")] public ValidationCacheEXT ValidationCache; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ShaderModuleValidationCacheCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SharedPresentSurfaceCapabilitiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SharedPresentSurfaceCapabilitiesKHR.gen.cs index caec89aecd..1a037ddef0 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 : IStructuredType { public SharedPresentSurfaceCapabilitiesKHR ( @@ -57,5 +57,11 @@ public SharedPresentSurfaceCapabilitiesKHR [NativeName("Type.Name", "VkImageUsageFlags")] [NativeName("Name", "sharedPresentSupportedUsageFlags")] public ImageUsageFlags SharedPresentSupportedUsageFlags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SharedPresentSurfaceCapabilitiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2.gen.cs index d05deb4c3e..1bd6db37fe 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSparseImageFormatProperties2")] - public unsafe partial struct SparseImageFormatProperties2 + public unsafe partial struct SparseImageFormatProperties2 : IStructuredType { public SparseImageFormatProperties2 ( @@ -57,5 +57,11 @@ public SparseImageFormatProperties2 [NativeName("Type.Name", "VkSparseImageFormatProperties")] [NativeName("Name", "properties")] public SparseImageFormatProperties Properties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SparseImageFormatProperties2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2KHR.gen.cs index 5f8f130730..c7fbbcb27d 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageFormatProperties2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSparseImageFormatProperties2KHR")] - public unsafe partial struct SparseImageFormatProperties2KHR + public unsafe partial struct SparseImageFormatProperties2KHR : IStructuredType { public SparseImageFormatProperties2KHR ( @@ -57,5 +57,11 @@ public SparseImageFormatProperties2KHR [NativeName("Type.Name", "VkSparseImageFormatProperties")] [NativeName("Name", "properties")] public SparseImageFormatProperties Properties; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SparseImageFormatProperties2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2.gen.cs index c9c89970eb..3fc08b08bd 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSparseImageMemoryRequirements2")] - public unsafe partial struct SparseImageMemoryRequirements2 + public unsafe partial struct SparseImageMemoryRequirements2 : IStructuredType { public SparseImageMemoryRequirements2 ( @@ -57,5 +57,11 @@ public SparseImageMemoryRequirements2 [NativeName("Type.Name", "VkSparseImageMemoryRequirements")] [NativeName("Name", "memoryRequirements")] public SparseImageMemoryRequirements MemoryRequirements; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SparseImageMemoryRequirements2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2KHR.gen.cs index e00ad53012..3a89d2aae1 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SparseImageMemoryRequirements2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSparseImageMemoryRequirements2KHR")] - public unsafe partial struct SparseImageMemoryRequirements2KHR + public unsafe partial struct SparseImageMemoryRequirements2KHR : IStructuredType { public SparseImageMemoryRequirements2KHR ( @@ -57,5 +57,11 @@ public SparseImageMemoryRequirements2KHR [NativeName("Type.Name", "VkSparseImageMemoryRequirements")] [NativeName("Name", "memoryRequirements")] public SparseImageMemoryRequirements MemoryRequirements; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SparseImageMemoryRequirements2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/StreamDescriptorSurfaceCreateInfoGGP.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/StreamDescriptorSurfaceCreateInfoGGP.gen.cs index f3468b7c73..8a2713f6e3 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 : IStructuredType { public StreamDescriptorSurfaceCreateInfoGGP ( @@ -68,5 +68,11 @@ public StreamDescriptorSurfaceCreateInfoGGP [NativeName("Type.Name", "GgpStreamDescriptor")] [NativeName("Name", "streamDescriptor")] public nint StreamDescriptor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.StreamDescriptorSurfaceCreateInfoGgp; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubmitInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubmitInfo.gen.cs index a157486bb5..68e488879e 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 : IStructuredType { public SubmitInfo ( @@ -123,5 +123,11 @@ public SubmitInfo [NativeName("Type.Name", "VkSemaphore")] [NativeName("Name", "pSignalSemaphores")] public Semaphore* PSignalSemaphores; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubmitInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubmitInfo2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubmitInfo2KHR.gen.cs index 67251e39b5..71b32b0df1 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 : IStructuredType { public SubmitInfo2KHR ( @@ -123,5 +123,11 @@ public SubmitInfo2KHR [NativeName("Type.Name", "VkSemaphoreSubmitInfoKHR")] [NativeName("Name", "pSignalSemaphoreInfos")] public SemaphoreSubmitInfoKHR* PSignalSemaphoreInfos; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubmitInfo2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfo.gen.cs index a5ca819c45..83039a8987 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassBeginInfo")] - public unsafe partial struct SubpassBeginInfo + public unsafe partial struct SubpassBeginInfo : IStructuredType { public SubpassBeginInfo ( @@ -57,5 +57,11 @@ public SubpassBeginInfo [NativeName("Type.Name", "VkSubpassContents")] [NativeName("Name", "contents")] public SubpassContents Contents; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassBeginInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfoKHR.gen.cs index 20a1eea2d3..2baa802783 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassBeginInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassBeginInfoKHR")] - public unsafe partial struct SubpassBeginInfoKHR + public unsafe partial struct SubpassBeginInfoKHR : IStructuredType { public SubpassBeginInfoKHR ( @@ -57,5 +57,11 @@ public SubpassBeginInfoKHR [NativeName("Type.Name", "VkSubpassContents")] [NativeName("Name", "contents")] public SubpassContents Contents; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassBeginInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2.gen.cs index 746615fba6..5d1791d665 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassDependency2")] - public unsafe partial struct SubpassDependency2 + public unsafe partial struct SubpassDependency2 : IStructuredType { public SubpassDependency2 ( @@ -134,5 +134,11 @@ public SubpassDependency2 [NativeName("Type.Name", "int32_t")] [NativeName("Name", "viewOffset")] public int ViewOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassDependency2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2KHR.gen.cs index d6737774bc..aa7b7ecb9a 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDependency2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassDependency2KHR")] - public unsafe partial struct SubpassDependency2KHR + public unsafe partial struct SubpassDependency2KHR : IStructuredType { public SubpassDependency2KHR ( @@ -134,5 +134,11 @@ public SubpassDependency2KHR [NativeName("Type.Name", "int32_t")] [NativeName("Name", "viewOffset")] public int ViewOffset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassDependency2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2.gen.cs index 77e30fe74b..8eab57185f 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassDescription2")] - public unsafe partial struct SubpassDescription2 + public unsafe partial struct SubpassDescription2 : IStructuredType { public SubpassDescription2 ( @@ -167,5 +167,11 @@ public SubpassDescription2 [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pPreserveAttachments")] public uint* PPreserveAttachments; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassDescription2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2KHR.gen.cs index c3aa14b16f..b418f57fb5 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2KHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescription2KHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassDescription2KHR")] - public unsafe partial struct SubpassDescription2KHR + public unsafe partial struct SubpassDescription2KHR : IStructuredType { public SubpassDescription2KHR ( @@ -167,5 +167,11 @@ public SubpassDescription2KHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pPreserveAttachments")] public uint* PPreserveAttachments; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassDescription2; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolve.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolve.gen.cs index 8083053c62..bdcb4fad11 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolve.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolve.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassDescriptionDepthStencilResolve")] - public unsafe partial struct SubpassDescriptionDepthStencilResolve + public unsafe partial struct SubpassDescriptionDepthStencilResolve : IStructuredType { public SubpassDescriptionDepthStencilResolve ( @@ -79,5 +79,11 @@ public SubpassDescriptionDepthStencilResolve [NativeName("Type.Name", "VkAttachmentReference2")] [NativeName("Name", "pDepthStencilResolveAttachment")] public AttachmentReference2* PDepthStencilResolveAttachment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassDescriptionDepthStencilResolve; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolveKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolveKHR.gen.cs index 1be093b3c3..853b0fd3c6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolveKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassDescriptionDepthStencilResolveKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassDescriptionDepthStencilResolveKHR")] - public unsafe partial struct SubpassDescriptionDepthStencilResolveKHR + public unsafe partial struct SubpassDescriptionDepthStencilResolveKHR : IStructuredType { public SubpassDescriptionDepthStencilResolveKHR ( @@ -79,5 +79,11 @@ public SubpassDescriptionDepthStencilResolveKHR [NativeName("Type.Name", "VkAttachmentReference2")] [NativeName("Name", "pDepthStencilResolveAttachment")] public AttachmentReference2* PDepthStencilResolveAttachment; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassDescriptionDepthStencilResolve; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfo.gen.cs index f02ccbc138..3fba369305 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassEndInfo")] - public unsafe partial struct SubpassEndInfo + public unsafe partial struct SubpassEndInfo : IStructuredType { public SubpassEndInfo ( @@ -46,5 +46,11 @@ public SubpassEndInfo [NativeName("Type.Name", "void")] [NativeName("Name", "pNext")] public void* PNext; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassEndInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfoKHR.gen.cs index 2776328fe2..54ac3444e6 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassEndInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkSubpassEndInfoKHR")] - public unsafe partial struct SubpassEndInfoKHR + public unsafe partial struct SubpassEndInfoKHR : IStructuredType { public SubpassEndInfoKHR ( @@ -46,5 +46,11 @@ public SubpassEndInfoKHR [NativeName("Type.Name", "void")] [NativeName("Name", "pNext")] public void* PNext; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassEndInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassShadingPipelineCreateInfoHUAWEI.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SubpassShadingPipelineCreateInfoHUAWEI.gen.cs index c4a2f7af0c..11312a27f4 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 : IStructuredType { public SubpassShadingPipelineCreateInfoHUAWEI ( @@ -68,5 +68,11 @@ public SubpassShadingPipelineCreateInfoHUAWEI [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "subpass")] public uint Subpass; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SubpassShadingPipelineCreateInfoHuawei; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilities2EXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilities2EXT.gen.cs index ded2d024b5..80d7ec357b 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 : IStructuredType { public SurfaceCapabilities2EXT ( @@ -167,5 +167,11 @@ public SurfaceCapabilities2EXT [NativeName("Type.Name", "VkSurfaceCounterFlagsEXT")] [NativeName("Name", "supportedSurfaceCounters")] public SurfaceCounterFlagsEXT SupportedSurfaceCounters; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SurfaceCapabilities2Ext; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilities2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilities2KHR.gen.cs index 2d010ea1d3..82fa02312f 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 : IStructuredType { public SurfaceCapabilities2KHR ( @@ -57,5 +57,11 @@ public SurfaceCapabilities2KHR [NativeName("Type.Name", "VkSurfaceCapabilitiesKHR")] [NativeName("Name", "surfaceCapabilities")] public SurfaceCapabilitiesKHR SurfaceCapabilities; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SurfaceCapabilities2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilitiesFullScreenExclusiveEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceCapabilitiesFullScreenExclusiveEXT.gen.cs index b98733f169..3c6745d7d5 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 : IStructuredType { public SurfaceCapabilitiesFullScreenExclusiveEXT ( @@ -57,5 +57,11 @@ public SurfaceCapabilitiesFullScreenExclusiveEXT [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "fullScreenExclusiveSupported")] public Bool32 FullScreenExclusiveSupported; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SurfaceCapabilitiesFullScreenExclusiveExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFormat2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFormat2KHR.gen.cs index 46a11663b6..2ef4db8434 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 : IStructuredType { public SurfaceFormat2KHR ( @@ -57,5 +57,11 @@ public SurfaceFormat2KHR [NativeName("Type.Name", "VkSurfaceFormatKHR")] [NativeName("Name", "surfaceFormat")] public SurfaceFormatKHR SurfaceFormat; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SurfaceFormat2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFullScreenExclusiveInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFullScreenExclusiveInfoEXT.gen.cs index 7cd2f3adc6..1078e7b6a0 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 : IStructuredType { public SurfaceFullScreenExclusiveInfoEXT ( @@ -57,5 +57,11 @@ public SurfaceFullScreenExclusiveInfoEXT [NativeName("Type.Name", "VkFullScreenExclusiveEXT")] [NativeName("Name", "fullScreenExclusive")] public FullScreenExclusiveEXT FullScreenExclusive; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SurfaceFullScreenExclusiveInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFullScreenExclusiveWin32InfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceFullScreenExclusiveWin32InfoEXT.gen.cs index 469fee9b83..82a871048f 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 : IStructuredType { public SurfaceFullScreenExclusiveWin32InfoEXT ( @@ -57,5 +57,11 @@ public SurfaceFullScreenExclusiveWin32InfoEXT [NativeName("Type.Name", "HMONITOR")] [NativeName("Name", "hmonitor")] public nint Hmonitor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SurfaceFullScreenExclusiveWin32InfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceProtectedCapabilitiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SurfaceProtectedCapabilitiesKHR.gen.cs index 67a3352024..3ba9d8b039 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 : IStructuredType { public SurfaceProtectedCapabilitiesKHR ( @@ -57,5 +57,11 @@ public SurfaceProtectedCapabilitiesKHR [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "supportsProtected")] public Bool32 SupportsProtected; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SurfaceProtectedCapabilitiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainCounterCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainCounterCreateInfoEXT.gen.cs index 4069dd2e77..afc3ae8bb8 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 : IStructuredType { public SwapchainCounterCreateInfoEXT ( @@ -57,5 +57,11 @@ public SwapchainCounterCreateInfoEXT [NativeName("Type.Name", "VkSurfaceCounterFlagsEXT")] [NativeName("Name", "surfaceCounters")] public SurfaceCounterFlagsEXT SurfaceCounters; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SwapchainCounterCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainCreateInfoKHR.gen.cs index 80338cbdf8..7cfbca5ce1 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 : IStructuredType { public SwapchainCreateInfoKHR ( @@ -222,5 +222,11 @@ public SwapchainCreateInfoKHR [NativeName("Type.Name", "VkSwapchainKHR")] [NativeName("Name", "oldSwapchain")] public SwapchainKHR OldSwapchain; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SwapchainCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainDisplayNativeHdrCreateInfoAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainDisplayNativeHdrCreateInfoAMD.gen.cs index 038669c69a..297d191705 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 : IStructuredType { public SwapchainDisplayNativeHdrCreateInfoAMD ( @@ -57,5 +57,11 @@ public SwapchainDisplayNativeHdrCreateInfoAMD [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "localDimmingEnable")] public Bool32 LocalDimmingEnable; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SwapchainDisplayNativeHdrCreateInfoAmd; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainImageCreateInfoANDROID.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SwapchainImageCreateInfoANDROID.gen.cs index 058a6b0a6f..696cbdd99a 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 : IStructuredType { public SwapchainImageCreateInfoANDROID ( @@ -57,5 +57,11 @@ public SwapchainImageCreateInfoANDROID [NativeName("Type.Name", "VkSwapchainImageUsageFlagsANDROID")] [NativeName("Name", "usage")] public SwapchainImageUsageFlagsANDROID Usage; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SwapchainImageCreateInfoAndroid; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/SysmemColorSpaceFUCHSIA.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/SysmemColorSpaceFUCHSIA.gen.cs index 39d0ac3f2a..f6ed40e56d 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 : IStructuredType { public SysmemColorSpaceFUCHSIA ( @@ -57,5 +57,11 @@ public SysmemColorSpaceFUCHSIA [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "colorSpace")] public uint ColorSpace; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.SysmemColorSpaceFuchsia; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/TextureLODGatherFormatPropertiesAMD.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/TextureLODGatherFormatPropertiesAMD.gen.cs index 1ebf41c071..8817a3a400 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 : IStructuredType { public TextureLODGatherFormatPropertiesAMD ( @@ -57,5 +57,11 @@ public TextureLODGatherFormatPropertiesAMD [NativeName("Type.Name", "VkBool32")] [NativeName("Name", "supportsTextureGatherLODBiasAMD")] public Bool32 SupportsTextureGatherLodbiasAmd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.TextureLodGatherFormatPropertiesAmd; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfo.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfo.gen.cs index 77da3ce58a..1f9a3db854 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfo.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfo.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkTimelineSemaphoreSubmitInfo")] - public unsafe partial struct TimelineSemaphoreSubmitInfo + public unsafe partial struct TimelineSemaphoreSubmitInfo : IStructuredType { public TimelineSemaphoreSubmitInfo ( @@ -90,5 +90,11 @@ public TimelineSemaphoreSubmitInfo [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pSignalSemaphoreValues")] public ulong* PSignalSemaphoreValues; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.TimelineSemaphoreSubmitInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfoKHR.gen.cs index aa1a2a7fba..342cb0ab36 100644 --- a/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfoKHR.gen.cs +++ b/src/Vulkan/Silk.NET.Vulkan/Structs/TimelineSemaphoreSubmitInfoKHR.gen.cs @@ -17,7 +17,7 @@ namespace Silk.NET.Vulkan { [NativeName("Name", "VkTimelineSemaphoreSubmitInfoKHR")] - public unsafe partial struct TimelineSemaphoreSubmitInfoKHR + public unsafe partial struct TimelineSemaphoreSubmitInfoKHR : IStructuredType { public TimelineSemaphoreSubmitInfoKHR ( @@ -90,5 +90,11 @@ public TimelineSemaphoreSubmitInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pSignalSemaphoreValues")] public ulong* PSignalSemaphoreValues; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.TimelineSemaphoreSubmitInfo; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationCacheCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationCacheCreateInfoEXT.gen.cs index 6307a7a559..fd17f79026 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 : IStructuredType { public ValidationCacheCreateInfoEXT ( @@ -79,5 +79,11 @@ public ValidationCacheCreateInfoEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pInitialData")] public void* PInitialData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ValidationCacheCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationFeaturesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationFeaturesEXT.gen.cs index 2323272ea6..092b46ee5f 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 : IStructuredType { public ValidationFeaturesEXT ( @@ -90,5 +90,11 @@ public ValidationFeaturesEXT [NativeName("Type.Name", "VkValidationFeatureDisableEXT")] [NativeName("Name", "pDisabledValidationFeatures")] public ValidationFeatureDisableEXT* PDisabledValidationFeatures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ValidationFeaturesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationFlagsEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ValidationFlagsEXT.gen.cs index 50427e37d7..e2adebbe95 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 : IStructuredType { public ValidationFlagsEXT ( @@ -68,5 +68,11 @@ public ValidationFlagsEXT [NativeName("Type.Name", "VkValidationCheckEXT")] [NativeName("Name", "pDisabledValidationChecks")] public ValidationCheckEXT* PDisabledValidationChecks; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.ValidationFlagsExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VertexInputAttributeDescription2EXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VertexInputAttributeDescription2EXT.gen.cs index efb345de94..1002e14dcf 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 : IStructuredType { public VertexInputAttributeDescription2EXT ( @@ -90,5 +90,11 @@ public VertexInputAttributeDescription2EXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "offset")] public uint Offset; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VertexInputAttributeDescription2Ext; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VertexInputBindingDescription2EXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VertexInputBindingDescription2EXT.gen.cs index 08e0a0eb8e..25213a7a14 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 : IStructuredType { public VertexInputBindingDescription2EXT ( @@ -90,5 +90,11 @@ public VertexInputBindingDescription2EXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "divisor")] public uint Divisor; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VertexInputBindingDescription2Ext; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/ViSurfaceCreateInfoNN.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/ViSurfaceCreateInfoNN.gen.cs index 1838713401..02306afc01 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 : IStructuredType { public ViSurfaceCreateInfoNN ( @@ -68,5 +68,11 @@ public ViSurfaceCreateInfoNN [NativeName("Type.Name", "void")] [NativeName("Name", "window")] public void* Window; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VISurfaceCreateInfoNN; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoBeginCodingInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoBeginCodingInfoKHR.gen.cs index e5e1915b17..ea3d6e00a4 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 : IStructuredType { public VideoBeginCodingInfoKHR ( @@ -112,5 +112,11 @@ public VideoBeginCodingInfoKHR [NativeName("Type.Name", "VkVideoReferenceSlotKHR")] [NativeName("Name", "pReferenceSlots")] public VideoReferenceSlotKHR* PReferenceSlots; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoBeginCodingInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoBindMemoryKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoBindMemoryKHR.gen.cs index f352b4fa81..dec99e331e 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 : IStructuredType { public VideoBindMemoryKHR ( @@ -90,5 +90,11 @@ public VideoBindMemoryKHR [NativeName("Type.Name", "VkDeviceSize")] [NativeName("Name", "memorySize")] public ulong MemorySize; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoBindMemoryKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoCapabilitiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoCapabilitiesKHR.gen.cs index 18b4f48228..44ba36306e 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 : IStructuredType { public VideoCapabilitiesKHR ( @@ -134,5 +134,11 @@ public VideoCapabilitiesKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxReferencePicturesActiveCount")] public uint MaxReferencePicturesActiveCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoCapabilitiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoCodingControlInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoCodingControlInfoKHR.gen.cs index 46bf44a872..57b2d24593 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 : IStructuredType { public VideoCodingControlInfoKHR ( @@ -57,5 +57,11 @@ public VideoCodingControlInfoKHR [NativeName("Type.Name", "VkVideoCodingControlFlagsKHR")] [NativeName("Name", "flags")] public VideoCodingControlFlagsKHR Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoCodingControlInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264CapabilitiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264CapabilitiesEXT.gen.cs index 121ab9106f..9a0c02c915 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 : IStructuredType { public VideoDecodeH264CapabilitiesEXT ( @@ -79,5 +79,11 @@ public VideoDecodeH264CapabilitiesEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "stdExtensionVersion")] public ExtensionProperties StdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264CapabilitiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264DpbSlotInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264DpbSlotInfoEXT.gen.cs index 1296ea86de..3031596f29 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 : IStructuredType { public VideoDecodeH264DpbSlotInfoEXT ( @@ -57,5 +57,11 @@ public VideoDecodeH264DpbSlotInfoEXT [NativeName("Type.Name", "StdVideoDecodeH264ReferenceInfo")] [NativeName("Name", "pStdReferenceInfo")] public Video.StdVideoDecodeH264ReferenceInfo* PStdReferenceInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264DpbSlotInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264MvcEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264MvcEXT.gen.cs index 7b14e7b638..7de6f50df8 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 : IStructuredType { public VideoDecodeH264MvcEXT ( @@ -57,5 +57,11 @@ public VideoDecodeH264MvcEXT [NativeName("Type.Name", "StdVideoDecodeH264Mvc")] [NativeName("Name", "pStdMvc")] public Video.StdVideoDecodeH264Mvc* PStdMvc; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264MvcExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264PictureInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264PictureInfoEXT.gen.cs index a5150cb305..4df8cbefd8 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 : IStructuredType { public VideoDecodeH264PictureInfoEXT ( @@ -79,5 +79,11 @@ public VideoDecodeH264PictureInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pSlicesDataOffsets")] public uint* PSlicesDataOffsets; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264PictureInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264ProfileEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264ProfileEXT.gen.cs index 9951b87fcf..71648ea1c0 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 : IStructuredType { public VideoDecodeH264ProfileEXT ( @@ -68,5 +68,11 @@ public VideoDecodeH264ProfileEXT [NativeName("Type.Name", "VkVideoDecodeH264PictureLayoutFlagsEXT")] [NativeName("Name", "pictureLayout")] public VideoDecodeH264PictureLayoutFlagsEXT PictureLayout; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264ProfileExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionCreateInfoEXT.gen.cs index fae1cc3e97..0ca7840de1 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 : IStructuredType { public VideoDecodeH264SessionCreateInfoEXT ( @@ -68,5 +68,11 @@ public VideoDecodeH264SessionCreateInfoEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "pStdExtensionVersion")] public ExtensionProperties* PStdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264SessionCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionParametersAddInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionParametersAddInfoEXT.gen.cs index 56deadf169..89392f653b 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 : IStructuredType { public VideoDecodeH264SessionParametersAddInfoEXT ( @@ -90,5 +90,11 @@ public VideoDecodeH264SessionParametersAddInfoEXT [NativeName("Type.Name", "StdVideoH264PictureParameterSet")] [NativeName("Name", "pPpsStd")] public Video.StdVideoH264PictureParameterSet* PPpsStd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264SessionParametersAddInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionParametersCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH264SessionParametersCreateInfoEXT.gen.cs index 1a5ae0da00..90238ae393 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 : IStructuredType { public VideoDecodeH264SessionParametersCreateInfoEXT ( @@ -79,5 +79,11 @@ public VideoDecodeH264SessionParametersCreateInfoEXT [NativeName("Type.Name", "VkVideoDecodeH264SessionParametersAddInfoEXT")] [NativeName("Name", "pParametersAddInfo")] public VideoDecodeH264SessionParametersAddInfoEXT* PParametersAddInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH264SessionParametersCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265CapabilitiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265CapabilitiesEXT.gen.cs index 72c8ef847b..685f45b345 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 : IStructuredType { public VideoDecodeH265CapabilitiesEXT ( @@ -68,5 +68,11 @@ public VideoDecodeH265CapabilitiesEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "stdExtensionVersion")] public ExtensionProperties StdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH265CapabilitiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265DpbSlotInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265DpbSlotInfoEXT.gen.cs index 67cc6de101..f862b08ffe 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 : IStructuredType { public VideoDecodeH265DpbSlotInfoEXT ( @@ -57,5 +57,11 @@ public VideoDecodeH265DpbSlotInfoEXT [NativeName("Type.Name", "StdVideoDecodeH265ReferenceInfo")] [NativeName("Name", "pStdReferenceInfo")] public Video.StdVideoDecodeH265ReferenceInfo* PStdReferenceInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH265DpbSlotInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265PictureInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265PictureInfoEXT.gen.cs index 61c6f7e0fe..04df6851c9 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 : IStructuredType { public VideoDecodeH265PictureInfoEXT ( @@ -79,5 +79,11 @@ public VideoDecodeH265PictureInfoEXT [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "pSlicesDataOffsets")] public uint* PSlicesDataOffsets; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH265PictureInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265ProfileEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265ProfileEXT.gen.cs index eef3d81712..d4062909a5 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 : IStructuredType { public VideoDecodeH265ProfileEXT ( @@ -57,5 +57,11 @@ public VideoDecodeH265ProfileEXT [NativeName("Type.Name", "StdVideoH265ProfileIdc")] [NativeName("Name", "stdProfileIdc")] public Video.StdVideoH265ProfileIdc StdProfileIdc; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH265ProfileExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionCreateInfoEXT.gen.cs index 8368d28e7e..2f567e913f 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 : IStructuredType { public VideoDecodeH265SessionCreateInfoEXT ( @@ -68,5 +68,11 @@ public VideoDecodeH265SessionCreateInfoEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "pStdExtensionVersion")] public ExtensionProperties* PStdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH265SessionCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionParametersAddInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionParametersAddInfoEXT.gen.cs index 452554677a..89eb02649d 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 : IStructuredType { public VideoDecodeH265SessionParametersAddInfoEXT ( @@ -90,5 +90,11 @@ public VideoDecodeH265SessionParametersAddInfoEXT [NativeName("Type.Name", "StdVideoH265PictureParameterSet")] [NativeName("Name", "pPpsStd")] public Video.StdVideoH265PictureParameterSet* PPpsStd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH265SessionParametersAddInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionParametersCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeH265SessionParametersCreateInfoEXT.gen.cs index 8b69608b3c..cf449621ed 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 : IStructuredType { public VideoDecodeH265SessionParametersCreateInfoEXT ( @@ -79,5 +79,11 @@ public VideoDecodeH265SessionParametersCreateInfoEXT [NativeName("Type.Name", "VkVideoDecodeH265SessionParametersAddInfoEXT")] [NativeName("Name", "pParametersAddInfo")] public VideoDecodeH265SessionParametersAddInfoEXT* PParametersAddInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeH265SessionParametersCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoDecodeInfoKHR.gen.cs index 2baaafe34a..79f011a98f 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 : IStructuredType { public VideoDecodeInfoKHR ( @@ -156,5 +156,11 @@ public VideoDecodeInfoKHR [NativeName("Type.Name", "VkVideoReferenceSlotKHR")] [NativeName("Name", "pReferenceSlots")] public VideoReferenceSlotKHR* PReferenceSlots; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoDecodeInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264CapabilitiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264CapabilitiesEXT.gen.cs index 33038d0288..b4a4c3626a 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 : IStructuredType { public VideoEncodeH264CapabilitiesEXT ( @@ -167,5 +167,11 @@ public VideoEncodeH264CapabilitiesEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "stdExtensionVersion")] public ExtensionProperties StdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264CapabilitiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264DpbSlotInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264DpbSlotInfoEXT.gen.cs index 20e3771f4c..87c1fb9832 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 : IStructuredType { public VideoEncodeH264DpbSlotInfoEXT ( @@ -68,5 +68,11 @@ public VideoEncodeH264DpbSlotInfoEXT [NativeName("Type.Name", "StdVideoEncodeH264PictureInfo")] [NativeName("Name", "pStdPictureInfo")] public Video.StdVideoEncodeH264PictureInfo* PStdPictureInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264DpbSlotInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264EmitPictureParametersEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264EmitPictureParametersEXT.gen.cs index b4c78804d6..b386491b53 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 : IStructuredType { public VideoEncodeH264EmitPictureParametersEXT ( @@ -90,5 +90,11 @@ public VideoEncodeH264EmitPictureParametersEXT [NativeName("Type.Name", "uint8_t")] [NativeName("Name", "ppsIdEntries")] public byte* PpsIdEntries; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264EmitPictureParametersExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264NaluSliceEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264NaluSliceEXT.gen.cs index adbdc19daf..7f95e7a687 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 : IStructuredType { public VideoEncodeH264NaluSliceEXT ( @@ -145,5 +145,11 @@ public VideoEncodeH264NaluSliceEXT [NativeName("Type.Name", "uint8_t")] [NativeName("Name", "maxQp")] public byte MaxQp; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264NaluSliceExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264ProfileEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264ProfileEXT.gen.cs index e51ce683c0..07dd472f36 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 : IStructuredType { public VideoEncodeH264ProfileEXT ( @@ -57,5 +57,11 @@ public VideoEncodeH264ProfileEXT [NativeName("Type.Name", "StdVideoH264ProfileIdc")] [NativeName("Name", "stdProfileIdc")] public Video.StdVideoH264ProfileIdc StdProfileIdc; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264ProfileExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionCreateInfoEXT.gen.cs index de619cb0d8..db78fc214f 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 : IStructuredType { public VideoEncodeH264SessionCreateInfoEXT ( @@ -79,5 +79,11 @@ public VideoEncodeH264SessionCreateInfoEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "pStdExtensionVersion")] public ExtensionProperties* PStdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264SessionCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionParametersAddInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionParametersAddInfoEXT.gen.cs index b45e0bb0b8..3657c1a78a 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 : IStructuredType { public VideoEncodeH264SessionParametersAddInfoEXT ( @@ -90,5 +90,11 @@ public VideoEncodeH264SessionParametersAddInfoEXT [NativeName("Type.Name", "StdVideoH264PictureParameterSet")] [NativeName("Name", "pPpsStd")] public Video.StdVideoH264PictureParameterSet* PPpsStd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264SessionParametersAddInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionParametersCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264SessionParametersCreateInfoEXT.gen.cs index 3639270d9c..335c42cd9e 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 : IStructuredType { public VideoEncodeH264SessionParametersCreateInfoEXT ( @@ -79,5 +79,11 @@ public VideoEncodeH264SessionParametersCreateInfoEXT [NativeName("Type.Name", "VkVideoEncodeH264SessionParametersAddInfoEXT")] [NativeName("Name", "pParametersAddInfo")] public VideoEncodeH264SessionParametersAddInfoEXT* PParametersAddInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264SessionParametersCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264VclFrameInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH264VclFrameInfoEXT.gen.cs index c3f06adf3a..6fdfc9e5b1 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 : IStructuredType { public VideoEncodeH264VclFrameInfoEXT ( @@ -123,5 +123,11 @@ public VideoEncodeH264VclFrameInfoEXT [NativeName("Type.Name", "VkVideoEncodeH264DpbSlotInfoEXT")] [NativeName("Name", "pCurrentPictureInfo")] public VideoEncodeH264DpbSlotInfoEXT* PCurrentPictureInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH264VclFrameInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265CapabilitiesEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265CapabilitiesEXT.gen.cs index d7e72d755f..19d41940ad 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 : IStructuredType { public VideoEncodeH265CapabilitiesEXT ( @@ -167,5 +167,11 @@ public VideoEncodeH265CapabilitiesEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "stdExtensionVersion")] public ExtensionProperties StdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265CapabilitiesExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265DpbSlotInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265DpbSlotInfoEXT.gen.cs index 56e940dec0..f55e50306e 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 : IStructuredType { public VideoEncodeH265DpbSlotInfoEXT ( @@ -68,5 +68,11 @@ public VideoEncodeH265DpbSlotInfoEXT [NativeName("Type.Name", "StdVideoEncodeH265ReferenceInfo")] [NativeName("Name", "pStdReferenceInfo")] public Video.StdVideoEncodeH265ReferenceInfo* PStdReferenceInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265DpbSlotInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265EmitPictureParametersEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265EmitPictureParametersEXT.gen.cs index 872afaeb5c..18861b5971 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 : IStructuredType { public VideoEncodeH265EmitPictureParametersEXT ( @@ -112,5 +112,11 @@ public VideoEncodeH265EmitPictureParametersEXT [NativeName("Type.Name", "uint8_t")] [NativeName("Name", "ppsIdEntries")] public byte* PpsIdEntries; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265EmitPictureParametersExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265NaluSliceEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265NaluSliceEXT.gen.cs index 5d3c7a0e31..98f492a309 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 : IStructuredType { public VideoEncodeH265NaluSliceEXT ( @@ -79,5 +79,11 @@ public VideoEncodeH265NaluSliceEXT [NativeName("Type.Name", "StdVideoEncodeH265SliceHeader")] [NativeName("Name", "pSliceHeaderStd")] public Video.StdVideoEncodeH265SliceHeader* PSliceHeaderStd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265NaluSliceExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265ProfileEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265ProfileEXT.gen.cs index 653c8289de..36f9cf6011 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 : IStructuredType { public VideoEncodeH265ProfileEXT ( @@ -57,5 +57,11 @@ public VideoEncodeH265ProfileEXT [NativeName("Type.Name", "StdVideoH265ProfileIdc")] [NativeName("Name", "stdProfileIdc")] public Video.StdVideoH265ProfileIdc StdProfileIdc; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265ProfileExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265ReferenceListsEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265ReferenceListsEXT.gen.cs index cddb17f77c..5af05e99ee 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 : IStructuredType { public VideoEncodeH265ReferenceListsEXT ( @@ -101,5 +101,11 @@ public VideoEncodeH265ReferenceListsEXT [NativeName("Type.Name", "StdVideoEncodeH265ReferenceModifications")] [NativeName("Name", "pReferenceModifications")] public Video.StdVideoEncodeH265ReferenceModifications* PReferenceModifications; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265ReferenceListsExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionCreateInfoEXT.gen.cs index 3f5ac731a4..48ba2dcaa0 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 : IStructuredType { public VideoEncodeH265SessionCreateInfoEXT ( @@ -68,5 +68,11 @@ public VideoEncodeH265SessionCreateInfoEXT [NativeName("Type.Name", "VkExtensionProperties")] [NativeName("Name", "pStdExtensionVersion")] public ExtensionProperties* PStdExtensionVersion; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265SessionCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionParametersAddInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionParametersAddInfoEXT.gen.cs index ea28c8a692..7997c3d7b4 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 : IStructuredType { public VideoEncodeH265SessionParametersAddInfoEXT ( @@ -112,5 +112,11 @@ public VideoEncodeH265SessionParametersAddInfoEXT [NativeName("Type.Name", "StdVideoH265PictureParameterSet")] [NativeName("Name", "pPpsStd")] public Video.StdVideoH265PictureParameterSet* PPpsStd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265SessionParametersAddInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionParametersCreateInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265SessionParametersCreateInfoEXT.gen.cs index 62a04b678f..207f93bb67 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 : IStructuredType { public VideoEncodeH265SessionParametersCreateInfoEXT ( @@ -90,5 +90,11 @@ public VideoEncodeH265SessionParametersCreateInfoEXT [NativeName("Type.Name", "VkVideoEncodeH265SessionParametersAddInfoEXT")] [NativeName("Name", "pParametersAddInfo")] public VideoEncodeH265SessionParametersAddInfoEXT* PParametersAddInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265SessionParametersCreateInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265VclFrameInfoEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeH265VclFrameInfoEXT.gen.cs index cf7c4fcffc..827ec8b2be 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 : IStructuredType { public VideoEncodeH265VclFrameInfoEXT ( @@ -90,5 +90,11 @@ public VideoEncodeH265VclFrameInfoEXT [NativeName("Type.Name", "StdVideoEncodeH265PictureInfo")] [NativeName("Name", "pCurrentPictureInfo")] public Video.StdVideoEncodeH265PictureInfo* PCurrentPictureInfo; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeH265VclFrameInfoExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeInfoKHR.gen.cs index ebd8319e71..b63c688f85 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 : IStructuredType { public VideoEncodeInfoKHR ( @@ -156,5 +156,11 @@ public VideoEncodeInfoKHR [NativeName("Type.Name", "VkVideoReferenceSlotKHR")] [NativeName("Name", "pReferenceSlots")] public VideoReferenceSlotKHR* PReferenceSlots; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeRateControlInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEncodeRateControlInfoKHR.gen.cs index 2dba36b355..cc172aade7 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 : IStructuredType { public VideoEncodeRateControlInfoKHR ( @@ -123,5 +123,11 @@ public VideoEncodeRateControlInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "virtualBufferSizeInMs")] public uint VirtualBufferSizeInMs; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEncodeRateControlInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEndCodingInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoEndCodingInfoKHR.gen.cs index d9347f7443..6fdb694d91 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 : IStructuredType { public VideoEndCodingInfoKHR ( @@ -57,5 +57,11 @@ public VideoEndCodingInfoKHR [NativeName("Type.Name", "VkVideoEndCodingFlagsKHR")] [NativeName("Name", "flags")] public uint Flags; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoEndCodingInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoFormatPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoFormatPropertiesKHR.gen.cs index 83b4031298..01aa615985 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 : IStructuredType { public VideoFormatPropertiesKHR ( @@ -57,5 +57,11 @@ public VideoFormatPropertiesKHR [NativeName("Type.Name", "VkFormat")] [NativeName("Name", "format")] public Format Format; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoFormatPropertiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoGetMemoryPropertiesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoGetMemoryPropertiesKHR.gen.cs index d16dbe3cb6..9830822156 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 : IStructuredType { public VideoGetMemoryPropertiesKHR ( @@ -68,5 +68,11 @@ public VideoGetMemoryPropertiesKHR [NativeName("Type.Name", "VkMemoryRequirements2")] [NativeName("Name", "pMemoryRequirements")] public MemoryRequirements2* PMemoryRequirements; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoGetMemoryPropertiesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoPictureResourceKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoPictureResourceKHR.gen.cs index d414e22715..0f45a76727 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 : IStructuredType { public VideoPictureResourceKHR ( @@ -90,5 +90,11 @@ public VideoPictureResourceKHR [NativeName("Type.Name", "VkImageView")] [NativeName("Name", "imageViewBinding")] public ImageView ImageViewBinding; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoPictureResourceKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoProfileKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoProfileKHR.gen.cs index e0aa5c2cfc..0c156a0858 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 : IStructuredType { public VideoProfileKHR ( @@ -90,5 +90,11 @@ public VideoProfileKHR [NativeName("Type.Name", "VkVideoComponentBitDepthFlagsKHR")] [NativeName("Name", "chromaBitDepth")] public VideoComponentBitDepthFlagsKHR ChromaBitDepth; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoProfileKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoProfilesKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoProfilesKHR.gen.cs index 32571501cc..f9cccbd746 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 : IStructuredType { public VideoProfilesKHR ( @@ -68,5 +68,11 @@ public VideoProfilesKHR [NativeName("Type.Name", "VkVideoProfileKHR")] [NativeName("Name", "pProfiles")] public VideoProfileKHR* PProfiles; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoProfilesKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoQueueFamilyProperties2KHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoQueueFamilyProperties2KHR.gen.cs index bac7505dd1..9562ea50c5 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 : IStructuredType { public VideoQueueFamilyProperties2KHR ( @@ -57,5 +57,11 @@ public VideoQueueFamilyProperties2KHR [NativeName("Type.Name", "VkVideoCodecOperationFlagsKHR")] [NativeName("Name", "videoCodecOperations")] public VideoCodecOperationFlagsKHR VideoCodecOperations; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoQueueFamilyProperties2Khr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoReferenceSlotKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoReferenceSlotKHR.gen.cs index d17e1eb207..0b375956a2 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 : IStructuredType { public VideoReferenceSlotKHR ( @@ -68,5 +68,11 @@ public VideoReferenceSlotKHR [NativeName("Type.Name", "VkVideoPictureResourceKHR")] [NativeName("Name", "pPictureResource")] public VideoPictureResourceKHR* PPictureResource; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoReferenceSlotKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionCreateInfoKHR.gen.cs index 75b9d3dd17..570c5e49b4 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 : IStructuredType { public VideoSessionCreateInfoKHR ( @@ -134,5 +134,11 @@ public VideoSessionCreateInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "maxReferencePicturesActiveCount")] public uint MaxReferencePicturesActiveCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoSessionCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionParametersCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionParametersCreateInfoKHR.gen.cs index ee866bc6a9..e07a2437a8 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 : IStructuredType { public VideoSessionParametersCreateInfoKHR ( @@ -68,5 +68,11 @@ public VideoSessionParametersCreateInfoKHR [NativeName("Type.Name", "VkVideoSessionKHR")] [NativeName("Name", "videoSession")] public VideoSessionKHR VideoSession; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoSessionParametersCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionParametersUpdateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/VideoSessionParametersUpdateInfoKHR.gen.cs index efb45c39b1..0b8b5dfacc 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 : IStructuredType { public VideoSessionParametersUpdateInfoKHR ( @@ -57,5 +57,11 @@ public VideoSessionParametersUpdateInfoKHR [NativeName("Type.Name", "uint32_t")] [NativeName("Name", "updateSequenceCount")] public uint UpdateSequenceCount; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.VideoSessionParametersUpdateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/WaylandSurfaceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/WaylandSurfaceCreateInfoKHR.gen.cs index a61d0fc406..24575480ea 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 : IStructuredType { public WaylandSurfaceCreateInfoKHR ( @@ -79,5 +79,11 @@ public WaylandSurfaceCreateInfoKHR [NativeName("Type.Name", "wl_surface")] [NativeName("Name", "surface")] public nint* Surface; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.WaylandSurfaceCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/Win32KeyedMutexAcquireReleaseInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/Win32KeyedMutexAcquireReleaseInfoKHR.gen.cs index 86f9e6a569..5e88526deb 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 : IStructuredType { public Win32KeyedMutexAcquireReleaseInfoKHR ( @@ -123,5 +123,11 @@ public Win32KeyedMutexAcquireReleaseInfoKHR [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pReleaseKeys")] public ulong* PReleaseKeys; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.Win32KeyedMutexAcquireReleaseInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/Win32KeyedMutexAcquireReleaseInfoNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/Win32KeyedMutexAcquireReleaseInfoNV.gen.cs index 19c515e137..dce1a6975f 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 : IStructuredType { public Win32KeyedMutexAcquireReleaseInfoNV ( @@ -123,5 +123,11 @@ public Win32KeyedMutexAcquireReleaseInfoNV [NativeName("Type.Name", "uint64_t")] [NativeName("Name", "pReleaseKeys")] public ulong* PReleaseKeys; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.Win32KeyedMutexAcquireReleaseInfoNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/Win32SurfaceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/Win32SurfaceCreateInfoKHR.gen.cs index 9cfabde2c7..9d088f4a7f 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 : IStructuredType { public Win32SurfaceCreateInfoKHR ( @@ -79,5 +79,11 @@ public Win32SurfaceCreateInfoKHR [NativeName("Type.Name", "HWND")] [NativeName("Name", "hwnd")] public nint Hwnd; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.Win32SurfaceCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSet.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSet.gen.cs index 84b99f16fd..02e1069d63 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 : IStructuredType { public WriteDescriptorSet ( @@ -134,5 +134,11 @@ public WriteDescriptorSet [NativeName("Type.Name", "VkBufferView")] [NativeName("Name", "pTexelBufferView")] public BufferView* PTexelBufferView; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.WriteDescriptorSet; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetAccelerationStructureKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetAccelerationStructureKHR.gen.cs index 687ddbeeea..bec1dbe016 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 : IStructuredType { public WriteDescriptorSetAccelerationStructureKHR ( @@ -68,5 +68,11 @@ public WriteDescriptorSetAccelerationStructureKHR [NativeName("Type.Name", "VkAccelerationStructureKHR")] [NativeName("Name", "pAccelerationStructures")] public AccelerationStructureKHR* PAccelerationStructures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.WriteDescriptorSetAccelerationStructureKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetAccelerationStructureNV.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetAccelerationStructureNV.gen.cs index a60422bca8..f881be59df 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 : IStructuredType { public WriteDescriptorSetAccelerationStructureNV ( @@ -68,5 +68,11 @@ public WriteDescriptorSetAccelerationStructureNV [NativeName("Type.Name", "VkAccelerationStructureNV")] [NativeName("Name", "pAccelerationStructures")] public AccelerationStructureNV* PAccelerationStructures; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.WriteDescriptorSetAccelerationStructureNV; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetInlineUniformBlockEXT.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/WriteDescriptorSetInlineUniformBlockEXT.gen.cs index 493dd06d7d..a87c66d433 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 : IStructuredType { public WriteDescriptorSetInlineUniformBlockEXT ( @@ -68,5 +68,11 @@ public WriteDescriptorSetInlineUniformBlockEXT [NativeName("Type.Name", "void")] [NativeName("Name", "pData")] public void* PData; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.WriteDescriptorSetInlineUniformBlockExt; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/XcbSurfaceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/XcbSurfaceCreateInfoKHR.gen.cs index 113870ecf3..d8e2cb7209 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 : IStructuredType { public XcbSurfaceCreateInfoKHR ( @@ -79,5 +79,11 @@ public XcbSurfaceCreateInfoKHR [NativeName("Type.Name", "xcb_window_t")] [NativeName("Name", "window")] public nint Window; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.XcbSurfaceCreateInfoKhr; + } } } diff --git a/src/Vulkan/Silk.NET.Vulkan/Structs/XlibSurfaceCreateInfoKHR.gen.cs b/src/Vulkan/Silk.NET.Vulkan/Structs/XlibSurfaceCreateInfoKHR.gen.cs index 40181f2a2f..c4f5578e11 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 : IStructuredType { public XlibSurfaceCreateInfoKHR ( @@ -79,5 +79,11 @@ public XlibSurfaceCreateInfoKHR [NativeName("Type.Name", "Window")] [NativeName("Name", "window")] public nint Window; + + /// + StructureType IStructuredType.StructureType() + { + return SType = StructureType.XlibSurfaceCreateInfoKhr; + } } }