From 9a97c51262e49515681762b2165663c26a6babc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 8 Dec 2021 16:06:21 +0100 Subject: [PATCH] Add a "placeholder" MeshPrimitive::Meshlets. Just so I can create custom Trade::MeshData instances with meshlet contents, nothing else. --- doc/changelog.dox | 3 +++ src/Magnum/GL/Mesh.cpp | 3 ++- src/Magnum/Implementation/meshPrimitiveMapping.hpp | 1 + src/Magnum/Mesh.h | 12 +++++++++++- src/Magnum/Vk/MeshLayout.cpp | 3 ++- 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index 26ca1c203..3a1bb8489 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -265,6 +265,9 @@ See also: @subsection changelog-latest-changes Changes and improvements +- Added @ref MeshPrimitive::Meshlets as a placeholder for future meshlet + support in @ref Trade::MeshData + @subsubsection changelog-latest-changes-debugtools DebugTools library - @ref DebugTools::CompareImage now supports comparing half-float pixel diff --git a/src/Magnum/GL/Mesh.cpp b/src/Magnum/GL/Mesh.cpp index 37a984488..ba20441c3 100644 --- a/src/Magnum/GL/Mesh.cpp +++ b/src/Magnum/GL/Mesh.cpp @@ -62,7 +62,8 @@ constexpr MeshPrimitive PrimitiveMapping[]{ MeshPrimitive::TriangleFan, MeshPrimitive(~UnsignedInt{}), /* Instances */ MeshPrimitive(~UnsignedInt{}), /* Faces */ - MeshPrimitive(~UnsignedInt{}) /* Edges */ + MeshPrimitive(~UnsignedInt{}), /* Edges */ + MeshPrimitive(~UnsignedInt{}) /* Meshlets */ }; constexpr MeshIndexType IndexTypeMapping[]{ diff --git a/src/Magnum/Implementation/meshPrimitiveMapping.hpp b/src/Magnum/Implementation/meshPrimitiveMapping.hpp index b16b8dd25..41b23033a 100644 --- a/src/Magnum/Implementation/meshPrimitiveMapping.hpp +++ b/src/Magnum/Implementation/meshPrimitiveMapping.hpp @@ -35,4 +35,5 @@ _c(TriangleFan) _c(Instances) _c(Faces) _c(Edges) +_c(Meshlets) #endif diff --git a/src/Magnum/Mesh.h b/src/Magnum/Mesh.h index 5ef337e51..5f1c3ceff 100644 --- a/src/Magnum/Mesh.h +++ b/src/Magnum/Mesh.h @@ -183,7 +183,17 @@ enum class MeshPrimitive: UnsignedInt { * half-edge mesh representation. * @see @ref Trade::meshAttributeCustom() */ - Edges + Edges, + + /** + * Meshlet data. + * @m_since_latest + * + * Can be used to annotate @ref Trade::MeshData containing meshlet chunks, + * i.e. groups of vertex references together with per-meshlet culling + * information such as a bounding sphere or visibility cone. + */ + Meshlets }; /** @debugoperatorenum{MeshPrimitive} */ diff --git a/src/Magnum/Vk/MeshLayout.cpp b/src/Magnum/Vk/MeshLayout.cpp index ac485c340..3b32ef298 100644 --- a/src/Magnum/Vk/MeshLayout.cpp +++ b/src/Magnum/Vk/MeshLayout.cpp @@ -45,7 +45,8 @@ constexpr MeshPrimitive MeshPrimitiveMapping[]{ MeshPrimitive::TriangleFan, MeshPrimitive(~Int{}), /* Instances */ MeshPrimitive(~Int{}), /* Faces */ - MeshPrimitive(~Int{}) /* Edges */ + MeshPrimitive(~Int{}), /* Edges */ + MeshPrimitive(~Int{}) /* Meshlets */ }; }