@@ -557,6 +557,56 @@ struct DrawIndexedIndirectAttribs
557557typedef struct DrawIndexedIndirectAttribs DrawIndexedIndirectAttribs;
558558
559559
560+ // / Metal-specific mesh draw command attributes.
561+ struct DrawMeshAttribsMtl
562+ {
563+ // / Object thread group X size.
564+ Uint32 ObjectThreadGroupSizeX DEFAULT_INITIALIZER (0 );
565+
566+ // / Object thread group Y size.
567+ Uint32 ObjectThreadGroupSizeY DEFAULT_INITIALIZER (0 );
568+
569+ // / Object thread group Z size.
570+ Uint32 ObjectThreadGroupSizeZ DEFAULT_INITIALIZER (0 );
571+
572+ // / Mesh thread group X size.
573+ Uint32 MeshThreadGroupSizeX DEFAULT_INITIALIZER (0 );
574+
575+ // / Mesh thread group Y size.
576+ Uint32 MeshThreadGroupSizeY DEFAULT_INITIALIZER (0 );
577+
578+ // / Mesh thread group Z size.
579+ Uint32 MeshThreadGroupSizeZ DEFAULT_INITIALIZER (0 );
580+
581+ #if DILIGENT_CPP_INTERFACE
582+ constexpr DrawMeshAttribsMtl () noexcept {}
583+
584+ constexpr DrawMeshAttribsMtl (Uint32 _MeshThreadGroupSizeX,
585+ Uint32 _MeshThreadGroupSizeY,
586+ Uint32 _MeshThreadGroupSizeZ) noexcept :
587+ MeshThreadGroupSizeX{_MeshThreadGroupSizeX},
588+ MeshThreadGroupSizeY{_MeshThreadGroupSizeY},
589+ MeshThreadGroupSizeZ{_MeshThreadGroupSizeZ}
590+ {}
591+
592+ constexpr DrawMeshAttribsMtl (Uint32 _ObjectThreadGroupSizeX,
593+ Uint32 _ObjectThreadGroupSizeY,
594+ Uint32 _ObjectThreadGroupSizeZ,
595+ Uint32 _MeshThreadGroupSizeX,
596+ Uint32 _MeshThreadGroupSizeY,
597+ Uint32 _MeshThreadGroupSizeZ) noexcept :
598+ ObjectThreadGroupSizeX{_ObjectThreadGroupSizeX},
599+ ObjectThreadGroupSizeY{_ObjectThreadGroupSizeY},
600+ ObjectThreadGroupSizeZ{_ObjectThreadGroupSizeZ},
601+ MeshThreadGroupSizeX {_MeshThreadGroupSizeX },
602+ MeshThreadGroupSizeY {_MeshThreadGroupSizeY },
603+ MeshThreadGroupSizeZ {_MeshThreadGroupSizeZ }
604+ {}
605+ #endif
606+ };
607+ typedef struct DrawMeshAttribsMtl DrawMeshAttribsMtl;
608+
609+
560610// / Defines the mesh draw command attributes.
561611
562612// / This structure is used by IDeviceContext::DrawMesh().
@@ -574,32 +624,44 @@ struct DrawMeshAttribs
574624 // / Additional flags, see Diligent::DRAW_FLAGS.
575625 DRAW_FLAGS Flags DEFAULT_INITIALIZER (DRAW_FLAG_NONE);
576626
627+ // / Metal-specific mesh draw command attributes.
628+ // /
629+ // / \remarks
630+ // / This member is only used by Metal backend and is ignored by others.
631+ const DrawMeshAttribsMtl* pMtlAttribs DEFAULT_INITIALIZER (nullptr );
632+
577633#if DILIGENT_CPP_INTERFACE
578634 // / Initializes the structure members with default values.
579635 constexpr DrawMeshAttribs () noexcept {}
580636
581- explicit constexpr DrawMeshAttribs (Uint32 _ThreadGroupCountX,
582- DRAW_FLAGS _Flags = DRAW_FLAG_NONE) noexcept :
637+ explicit constexpr DrawMeshAttribs (Uint32 _ThreadGroupCountX,
638+ DRAW_FLAGS _Flags = DRAW_FLAG_NONE,
639+ const DrawMeshAttribsMtl* _pMtlAttribs = nullptr ) noexcept :
583640 ThreadGroupCountX{_ThreadGroupCountX},
584- Flags {_Flags}
641+ Flags {_Flags},
642+ pMtlAttribs {_pMtlAttribs}
585643 {}
586644
587- constexpr DrawMeshAttribs (Uint32 _ThreadGroupCountX,
588- Uint32 _ThreadGroupCountY,
589- DRAW_FLAGS _Flags = DRAW_FLAG_NONE) noexcept :
645+ constexpr DrawMeshAttribs (Uint32 _ThreadGroupCountX,
646+ Uint32 _ThreadGroupCountY,
647+ DRAW_FLAGS _Flags = DRAW_FLAG_NONE,
648+ const DrawMeshAttribsMtl* _pMtlAttribs = nullptr ) noexcept :
590649 ThreadGroupCountX{_ThreadGroupCountX},
591650 ThreadGroupCountY{_ThreadGroupCountY},
592- Flags {_Flags}
651+ Flags {_Flags},
652+ pMtlAttribs {_pMtlAttribs}
593653 {}
594654
595- constexpr DrawMeshAttribs (Uint32 _ThreadGroupCountX,
596- Uint32 _ThreadGroupCountY,
597- Uint32 _ThreadGroupCountZ,
598- DRAW_FLAGS _Flags = DRAW_FLAG_NONE) noexcept :
655+ constexpr DrawMeshAttribs (Uint32 _ThreadGroupCountX,
656+ Uint32 _ThreadGroupCountY,
657+ Uint32 _ThreadGroupCountZ,
658+ DRAW_FLAGS _Flags = DRAW_FLAG_NONE,
659+ const DrawMeshAttribsMtl* _pMtlAttribs = nullptr ) noexcept :
599660 ThreadGroupCountX{_ThreadGroupCountX},
600661 ThreadGroupCountY{_ThreadGroupCountY},
601662 ThreadGroupCountZ{_ThreadGroupCountZ},
602- Flags {_Flags}
663+ Flags {_Flags},
664+ pMtlAttribs {_pMtlAttribs}
603665 {}
604666#endif
605667};
0 commit comments