|
9 | 9 |
|
10 | 10 | #region Class declarations
|
11 | 11 |
|
| 12 | +using d3d_alloc_t = System.IntPtr; |
| 13 | +using d3d_d12_command_queue_t = System.IntPtr; |
| 14 | +using d3d_d12_device_t = System.IntPtr; |
| 15 | +using d3d_d12_resource_t = System.IntPtr; |
| 16 | +using d3d_dxgi_adapter_t = System.IntPtr; |
12 | 17 | using gr_backendrendertarget_t = System.IntPtr;
|
13 | 18 | using gr_backendtexture_t = System.IntPtr;
|
| 19 | +using gr_d3d_memory_allocator_t = System.IntPtr; |
14 | 20 | using gr_direct_context_t = System.IntPtr;
|
15 | 21 | using gr_glinterface_t = System.IntPtr;
|
16 | 22 | using gr_recording_context_t = System.IntPtr;
|
@@ -268,6 +274,25 @@ internal static bool gr_backendrendertarget_is_valid (gr_backendrendertarget_t r
|
268 | 274 | (gr_backendrendertarget_is_valid_delegate ??= GetSymbol<Delegates.gr_backendrendertarget_is_valid> ("gr_backendrendertarget_is_valid")).Invoke (rendertarget);
|
269 | 275 | #endif
|
270 | 276 |
|
| 277 | + // gr_backendrendertarget_t* gr_backendrendertarget_new_direct3d(int width, int height, const gr_d3d_textureresourceinfo_t* d3dInfo) |
| 278 | + #if !USE_DELEGATES |
| 279 | + #if USE_LIBRARY_IMPORT |
| 280 | + [LibraryImport (SKIA)] |
| 281 | + internal static partial gr_backendrendertarget_t gr_backendrendertarget_new_direct3d (Int32 width, Int32 height, GRD3DTextureResourceInfoNative* d3dInfo); |
| 282 | + #else // !USE_LIBRARY_IMPORT |
| 283 | + [DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)] |
| 284 | + internal static extern gr_backendrendertarget_t gr_backendrendertarget_new_direct3d (Int32 width, Int32 height, GRD3DTextureResourceInfoNative* d3dInfo); |
| 285 | + #endif |
| 286 | + #else |
| 287 | + private partial class Delegates { |
| 288 | + [UnmanagedFunctionPointer (CallingConvention.Cdecl)] |
| 289 | + internal delegate gr_backendrendertarget_t gr_backendrendertarget_new_direct3d (Int32 width, Int32 height, GRD3DTextureResourceInfoNative* d3dInfo); |
| 290 | + } |
| 291 | + private static Delegates.gr_backendrendertarget_new_direct3d gr_backendrendertarget_new_direct3d_delegate; |
| 292 | + internal static gr_backendrendertarget_t gr_backendrendertarget_new_direct3d (Int32 width, Int32 height, GRD3DTextureResourceInfoNative* d3dInfo) => |
| 293 | + (gr_backendrendertarget_new_direct3d_delegate ??= GetSymbol<Delegates.gr_backendrendertarget_new_direct3d> ("gr_backendrendertarget_new_direct3d")).Invoke (width, height, d3dInfo); |
| 294 | + #endif |
| 295 | + |
271 | 296 | // gr_backendrendertarget_t* gr_backendrendertarget_new_gl(int width, int height, int samples, int stencils, const gr_gl_framebufferinfo_t* glInfo)
|
272 | 297 | #if !USE_DELEGATES
|
273 | 298 | #if USE_LIBRARY_IMPORT
|
@@ -467,6 +492,25 @@ internal static bool gr_backendtexture_is_valid (gr_backendtexture_t texture) =>
|
467 | 492 | (gr_backendtexture_is_valid_delegate ??= GetSymbol<Delegates.gr_backendtexture_is_valid> ("gr_backendtexture_is_valid")).Invoke (texture);
|
468 | 493 | #endif
|
469 | 494 |
|
| 495 | + // gr_backendtexture_t* gr_backendtexture_new_direct3d(int width, int height, const gr_d3d_textureresourceinfo_t* d3dInfo) |
| 496 | + #if !USE_DELEGATES |
| 497 | + #if USE_LIBRARY_IMPORT |
| 498 | + [LibraryImport (SKIA)] |
| 499 | + internal static partial gr_backendtexture_t gr_backendtexture_new_direct3d (Int32 width, Int32 height, GRD3DTextureResourceInfoNative* d3dInfo); |
| 500 | + #else // !USE_LIBRARY_IMPORT |
| 501 | + [DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)] |
| 502 | + internal static extern gr_backendtexture_t gr_backendtexture_new_direct3d (Int32 width, Int32 height, GRD3DTextureResourceInfoNative* d3dInfo); |
| 503 | + #endif |
| 504 | + #else |
| 505 | + private partial class Delegates { |
| 506 | + [UnmanagedFunctionPointer (CallingConvention.Cdecl)] |
| 507 | + internal delegate gr_backendtexture_t gr_backendtexture_new_direct3d (Int32 width, Int32 height, GRD3DTextureResourceInfoNative* d3dInfo); |
| 508 | + } |
| 509 | + private static Delegates.gr_backendtexture_new_direct3d gr_backendtexture_new_direct3d_delegate; |
| 510 | + internal static gr_backendtexture_t gr_backendtexture_new_direct3d (Int32 width, Int32 height, GRD3DTextureResourceInfoNative* d3dInfo) => |
| 511 | + (gr_backendtexture_new_direct3d_delegate ??= GetSymbol<Delegates.gr_backendtexture_new_direct3d> ("gr_backendtexture_new_direct3d")).Invoke (width, height, d3dInfo); |
| 512 | + #endif |
| 513 | + |
470 | 514 | // gr_backendtexture_t* gr_backendtexture_new_gl(int width, int height, bool mipmapped, const gr_gl_textureinfo_t* glInfo)
|
471 | 515 | #if !USE_DELEGATES
|
472 | 516 | #if USE_LIBRARY_IMPORT
|
@@ -717,6 +761,44 @@ internal static bool gr_direct_context_is_abandoned (gr_direct_context_t context
|
717 | 761 | (gr_direct_context_is_abandoned_delegate ??= GetSymbol<Delegates.gr_direct_context_is_abandoned> ("gr_direct_context_is_abandoned")).Invoke (context);
|
718 | 762 | #endif
|
719 | 763 |
|
| 764 | + // gr_direct_context_t* gr_direct_context_make_direct3d(const gr_d3d_backendcontext_t d3dBackendContext) |
| 765 | + #if !USE_DELEGATES |
| 766 | + #if USE_LIBRARY_IMPORT |
| 767 | + [LibraryImport (SKIA)] |
| 768 | + internal static partial gr_direct_context_t gr_direct_context_make_direct3d (GRD3DBackendContextNative d3dBackendContext); |
| 769 | + #else // !USE_LIBRARY_IMPORT |
| 770 | + [DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)] |
| 771 | + internal static extern gr_direct_context_t gr_direct_context_make_direct3d (GRD3DBackendContextNative d3dBackendContext); |
| 772 | + #endif |
| 773 | + #else |
| 774 | + private partial class Delegates { |
| 775 | + [UnmanagedFunctionPointer (CallingConvention.Cdecl)] |
| 776 | + internal delegate gr_direct_context_t gr_direct_context_make_direct3d (GRD3DBackendContextNative d3dBackendContext); |
| 777 | + } |
| 778 | + private static Delegates.gr_direct_context_make_direct3d gr_direct_context_make_direct3d_delegate; |
| 779 | + internal static gr_direct_context_t gr_direct_context_make_direct3d (GRD3DBackendContextNative d3dBackendContext) => |
| 780 | + (gr_direct_context_make_direct3d_delegate ??= GetSymbol<Delegates.gr_direct_context_make_direct3d> ("gr_direct_context_make_direct3d")).Invoke (d3dBackendContext); |
| 781 | + #endif |
| 782 | + |
| 783 | + // gr_direct_context_t* gr_direct_context_make_direct3d_with_options(const gr_d3d_backendcontext_t d3dBackendContext, const gr_context_options_t* options) |
| 784 | + #if !USE_DELEGATES |
| 785 | + #if USE_LIBRARY_IMPORT |
| 786 | + [LibraryImport (SKIA)] |
| 787 | + internal static partial gr_direct_context_t gr_direct_context_make_direct3d_with_options (GRD3DBackendContextNative d3dBackendContext, GRContextOptionsNative* options); |
| 788 | + #else // !USE_LIBRARY_IMPORT |
| 789 | + [DllImport (SKIA, CallingConvention = CallingConvention.Cdecl)] |
| 790 | + internal static extern gr_direct_context_t gr_direct_context_make_direct3d_with_options (GRD3DBackendContextNative d3dBackendContext, GRContextOptionsNative* options); |
| 791 | + #endif |
| 792 | + #else |
| 793 | + private partial class Delegates { |
| 794 | + [UnmanagedFunctionPointer (CallingConvention.Cdecl)] |
| 795 | + internal delegate gr_direct_context_t gr_direct_context_make_direct3d_with_options (GRD3DBackendContextNative d3dBackendContext, GRContextOptionsNative* options); |
| 796 | + } |
| 797 | + private static Delegates.gr_direct_context_make_direct3d_with_options gr_direct_context_make_direct3d_with_options_delegate; |
| 798 | + internal static gr_direct_context_t gr_direct_context_make_direct3d_with_options (GRD3DBackendContextNative d3dBackendContext, GRContextOptionsNative* options) => |
| 799 | + (gr_direct_context_make_direct3d_with_options_delegate ??= GetSymbol<Delegates.gr_direct_context_make_direct3d_with_options> ("gr_direct_context_make_direct3d_with_options")).Invoke (d3dBackendContext, options); |
| 800 | + #endif |
| 801 | + |
720 | 802 | // gr_direct_context_t* gr_direct_context_make_gl(const gr_glinterface_t* glInterface)
|
721 | 803 | #if !USE_DELEGATES
|
722 | 804 | #if USE_LIBRARY_IMPORT
|
@@ -17504,6 +17586,108 @@ public readonly override int GetHashCode ()
|
17504 | 17586 |
|
17505 | 17587 | }
|
17506 | 17588 |
|
| 17589 | + // gr_d3d_backendcontext_t |
| 17590 | + [StructLayout (LayoutKind.Sequential)] |
| 17591 | + internal unsafe partial struct GRD3DBackendContextNative : IEquatable<GRD3DBackendContextNative> { |
| 17592 | + // public d3d_dxgi_adapter_t* fAdapter |
| 17593 | + public d3d_dxgi_adapter_t fAdapter; |
| 17594 | + |
| 17595 | + // public d3d_d12_device_t* fDevice |
| 17596 | + public d3d_d12_device_t fDevice; |
| 17597 | + |
| 17598 | + // public d3d_d12_command_queue_t* fQueue |
| 17599 | + public d3d_d12_command_queue_t fQueue; |
| 17600 | + |
| 17601 | + // public gr_d3d_memory_allocator_t* fMemoryAllocator |
| 17602 | + public gr_d3d_memory_allocator_t fMemoryAllocator; |
| 17603 | + |
| 17604 | + // public bool fProtectedContext |
| 17605 | + public Byte fProtectedContext; |
| 17606 | + |
| 17607 | + public readonly bool Equals (GRD3DBackendContextNative obj) => |
| 17608 | +#pragma warning disable CS8909 |
| 17609 | + fAdapter == obj.fAdapter && fDevice == obj.fDevice && fQueue == obj.fQueue && fMemoryAllocator == obj.fMemoryAllocator && fProtectedContext == obj.fProtectedContext; |
| 17610 | +#pragma warning restore CS8909 |
| 17611 | + |
| 17612 | + public readonly override bool Equals (object obj) => |
| 17613 | + obj is GRD3DBackendContextNative f && Equals (f); |
| 17614 | + |
| 17615 | + public static bool operator == (GRD3DBackendContextNative left, GRD3DBackendContextNative right) => |
| 17616 | + left.Equals (right); |
| 17617 | + |
| 17618 | + public static bool operator != (GRD3DBackendContextNative left, GRD3DBackendContextNative right) => |
| 17619 | + !left.Equals (right); |
| 17620 | + |
| 17621 | + public readonly override int GetHashCode () |
| 17622 | + { |
| 17623 | + var hash = new HashCode (); |
| 17624 | + hash.Add (fAdapter); |
| 17625 | + hash.Add (fDevice); |
| 17626 | + hash.Add (fQueue); |
| 17627 | + hash.Add (fMemoryAllocator); |
| 17628 | + hash.Add (fProtectedContext); |
| 17629 | + return hash.ToHashCode (); |
| 17630 | + } |
| 17631 | + |
| 17632 | + } |
| 17633 | + |
| 17634 | + // gr_d3d_textureresourceinfo_t |
| 17635 | + [StructLayout (LayoutKind.Sequential)] |
| 17636 | + internal unsafe partial struct GRD3DTextureResourceInfoNative : IEquatable<GRD3DTextureResourceInfoNative> { |
| 17637 | + // public d3d_d12_resource_t* fResource |
| 17638 | + public d3d_d12_resource_t fResource; |
| 17639 | + |
| 17640 | + // public d3d_alloc_t* fAlloc |
| 17641 | + public d3d_alloc_t fAlloc; |
| 17642 | + |
| 17643 | + // public uint32_t fResourceState |
| 17644 | + public UInt32 fResourceState; |
| 17645 | + |
| 17646 | + // public uint32_t fFormat |
| 17647 | + public UInt32 fFormat; |
| 17648 | + |
| 17649 | + // public uint32_t fSampleCount |
| 17650 | + public UInt32 fSampleCount; |
| 17651 | + |
| 17652 | + // public uint32_t fLevelCount |
| 17653 | + public UInt32 fLevelCount; |
| 17654 | + |
| 17655 | + // public unsigned int fSampleQualityPattern |
| 17656 | + public UInt32 fSampleQualityPattern; |
| 17657 | + |
| 17658 | + // public bool fProtected |
| 17659 | + public Byte fProtected; |
| 17660 | + |
| 17661 | + public readonly bool Equals (GRD3DTextureResourceInfoNative obj) => |
| 17662 | +#pragma warning disable CS8909 |
| 17663 | + fResource == obj.fResource && fAlloc == obj.fAlloc && fResourceState == obj.fResourceState && fFormat == obj.fFormat && fSampleCount == obj.fSampleCount && fLevelCount == obj.fLevelCount && fSampleQualityPattern == obj.fSampleQualityPattern && fProtected == obj.fProtected; |
| 17664 | +#pragma warning restore CS8909 |
| 17665 | + |
| 17666 | + public readonly override bool Equals (object obj) => |
| 17667 | + obj is GRD3DTextureResourceInfoNative f && Equals (f); |
| 17668 | + |
| 17669 | + public static bool operator == (GRD3DTextureResourceInfoNative left, GRD3DTextureResourceInfoNative right) => |
| 17670 | + left.Equals (right); |
| 17671 | + |
| 17672 | + public static bool operator != (GRD3DTextureResourceInfoNative left, GRD3DTextureResourceInfoNative right) => |
| 17673 | + !left.Equals (right); |
| 17674 | + |
| 17675 | + public readonly override int GetHashCode () |
| 17676 | + { |
| 17677 | + var hash = new HashCode (); |
| 17678 | + hash.Add (fResource); |
| 17679 | + hash.Add (fAlloc); |
| 17680 | + hash.Add (fResourceState); |
| 17681 | + hash.Add (fFormat); |
| 17682 | + hash.Add (fSampleCount); |
| 17683 | + hash.Add (fLevelCount); |
| 17684 | + hash.Add (fSampleQualityPattern); |
| 17685 | + hash.Add (fProtected); |
| 17686 | + return hash.ToHashCode (); |
| 17687 | + } |
| 17688 | + |
| 17689 | + } |
| 17690 | + |
17507 | 17691 | // gr_gl_framebufferinfo_t
|
17508 | 17692 | [StructLayout (LayoutKind.Sequential)]
|
17509 | 17693 | public unsafe partial struct GRGlFramebufferInfo : IEquatable<GRGlFramebufferInfo> {
|
|
0 commit comments