diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c7d9760a..6e525b61e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -172,10 +172,11 @@ jobs: ./gltfpack -test demo/pirate.obj -vp 16 -vt 16 -vn 16 -vc 16 ./gltfpack -test demo/pirate.obj -vpf -vtf -vnf ./gltfpack -test glTF-Sample-Assets/Models/ABeautifulGame/glTF/ABeautifulGame.gltf -mi -c + ./gltfpack -test glTF-Sample-Assets/Models/ABeautifulGame/glTF/ABeautifulGame.gltf -kn -km -ke ./gltfpack -test glTF-Sample-Assets/Models/BoxTextured/glTF/BoxTextured.gltf -vpf -vtf -c ./gltfpack -test glTF-Sample-Assets/Models/BoxTextured/glTF/BoxTextured.gltf -vpf -vtf -cc ./gltfpack -test glTF-Sample-Assets/Models/BoxTextured/glTF/BoxTextured.gltf -tc - ./gltfpack -test glTF-Sample-Assets/Models/BoxTextured/glTF/BoxTextured.gltf -tc -tq color 10 -tu normal,attrib -ts attrib 0.5 + ./gltfpack -test glTF-Sample-Assets/Models/BoxTextured/glTF/BoxTextured.gltf -tc -tq color 10 -tu normal,attrib -ts attrib 0.5 -tl color 512 ./gltfpack -test glTF-Sample-Assets/Models/BoxTextured/glTF/BoxTextured.gltf -tr ./gltfpack -test glTF-Sample-Assets/Models/BoxTextured/glTF/BoxTextured.gltf -tc -ts 0.5 -tl 64 ./gltfpack -test glTF-Sample-Assets/Models/BoxTextured/glTF/BoxTextured.gltf -tc color -tfy -tq 4 -tj 1 diff --git a/gltf/gltfpack.cpp b/gltf/gltfpack.cpp index 82395eb0d..a3ec5a60a 100644 --- a/gltf/gltfpack.cpp +++ b/gltf/gltfpack.cpp @@ -421,7 +421,7 @@ static void process(cgltf_data* data, const char* input_path, const char* output if (settings.meshlet_debug > 0) { Mesh meshlets = {}; - debugMeshlets(mesh, meshlets, settings.meshlet_debug, /* scan= */ false); + debugMeshlets(mesh, meshlets, settings.meshlet_debug); debug_meshes.push_back(meshlets); } } diff --git a/gltf/gltfpack.h b/gltf/gltfpack.h index b5bcf7b70..9644d3862 100644 --- a/gltf/gltfpack.h +++ b/gltf/gltfpack.h @@ -312,7 +312,7 @@ void processAnimation(Animation& animation, const Settings& settings); void processMesh(Mesh& mesh, const Settings& settings); void debugSimplify(const Mesh& mesh, Mesh& kinds, Mesh& loops, float ratio, float error, bool attributes, bool quantize_tbn); -void debugMeshlets(const Mesh& mesh, Mesh& meshlets, int max_vertices, bool scan); +void debugMeshlets(const Mesh& mesh, Mesh& meshlets, int max_vertices); bool compareMeshTargets(const Mesh& lhs, const Mesh& rhs); bool compareMeshVariants(const Mesh& lhs, const Mesh& rhs); diff --git a/gltf/mesh.cpp b/gltf/mesh.cpp index c4899dcb7..ae44322f3 100644 --- a/gltf/mesh.cpp +++ b/gltf/mesh.cpp @@ -1114,16 +1114,13 @@ void debugSimplify(const Mesh& source, Mesh& kinds, Mesh& loops, float ratio, fl loops.streams.push_back(colors); } -void debugMeshlets(const Mesh& source, Mesh& meshlets, int max_vertices, bool scan) +void debugMeshlets(const Mesh& source, Mesh& meshlets, int max_vertices) { Mesh mesh = source; assert(mesh.type == cgltf_primitive_type_triangles); reindexMesh(mesh, /* quantize_tbn= */ true); - if (scan) - optimizeMesh(mesh, false); - const Stream* positions = getStream(mesh, cgltf_attribute_type_position); assert(positions); @@ -1135,11 +1132,7 @@ void debugMeshlets(const Mesh& source, Mesh& meshlets, int max_vertices, bool sc std::vector ml(max_meshlets); std::vector mlv(max_meshlets * max_vertices); std::vector mlt(max_meshlets * max_triangles * 3); - - if (scan) - ml.resize(meshopt_buildMeshletsScan(&ml[0], &mlv[0], &mlt[0], &mesh.indices[0], mesh.indices.size(), positions->data.size(), max_vertices, max_triangles)); - else - ml.resize(meshopt_buildMeshlets(&ml[0], &mlv[0], &mlt[0], &mesh.indices[0], mesh.indices.size(), positions->data[0].f, positions->data.size(), sizeof(Attr), max_vertices, max_triangles, cone_weight)); + ml.resize(meshopt_buildMeshlets(&ml[0], &mlv[0], &mlt[0], &mesh.indices[0], mesh.indices.size(), positions->data[0].f, positions->data.size(), sizeof(Attr), max_vertices, max_triangles, cone_weight)); // generate meshlet meshes, using unique colors meshlets.nodes = mesh.nodes;