From 46189a898ab92de8d981b76aab0131bf11b3540f Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 11 Aug 2022 23:03:27 +0200 Subject: [PATCH] Add ResourceTextureManagerBuffer type --- ...aderEffect.ResourceTextureManagerBuffer.cs | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ResourceTextureManagerBuffer.cs diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ResourceTextureManagerBuffer.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ResourceTextureManagerBuffer.cs new file mode 100644 index 00000000..6d11ba20 --- /dev/null +++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ResourceTextureManagerBuffer.cs @@ -0,0 +1,123 @@ +using System; +using System.Runtime.CompilerServices; +using ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers; + +#pragma warning disable CS0649 + +namespace ComputeSharp.D2D1.Interop.Effects; + +/// +partial struct PixelShaderEffect +{ + /// + /// A buffer of 16 objects. + /// + private unsafe struct ResourceTextureManagerBuffer + { + /// + /// The pointer to the instance at index 0. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager0; + + /// + /// The pointer to the instance at index 1. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager1; + + /// + /// The pointer to the instance at index 2. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager2; + + /// + /// The pointer to the instance at index 3. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager3; + + /// + /// The pointer to the instance at index 4. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager4; + + /// + /// The pointer to the instance at index 5. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager5; + + /// + /// The pointer to the instance at index 6. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager6; + + /// + /// The pointer to the instance at index 7. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager7; + + /// + /// The pointer to the instance at index 8. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager8; + + /// + /// The pointer to the instance at index 9. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager9; + + /// + /// The pointer to the instance at index 10. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager10; + + /// + /// The pointer to the instance at index 11. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager11; + + /// + /// The pointer to the instance at index 12. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager12; + + /// + /// The pointer to the instance at index 13. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager13; + + /// + /// The pointer to the instance at index 14. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager14; + + /// + /// The pointer to the instance at index 15. + /// + public ID2D1ResourceTextureManager* ResourceTextureManager15; + + /// + /// Gets a to the pointer at a given index. + /// + /// The index of the instance to retrieve. + /// A to the pointer at a given index. + public ref ID2D1ResourceTextureManager* this[int index] + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + ID2D1ResourceTextureManager** @this = (ID2D1ResourceTextureManager**)Unsafe.AsPointer(ref this); + + return ref @this[index]; + } + } + + /// + /// Gets a with the items in the current instance. + /// + /// A with the items in the current instance. + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Span AsSpan() + { + return new((ID2D1ResourceTextureManager**)Unsafe.AsPointer(ref this), 16); + } + } +} \ No newline at end of file