Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/lattice_deform_test.cc
| /* SPDX-License-Identifier: GPL-2.0-or-later | /* SPDX-License-Identifier: GPL-2.0-or-later | ||||
| * Copyright 2020 Blender Foundation. */ | * Copyright 2020 Blender Foundation. */ | ||||
| #include "testing/testing.h" | #include "testing/testing.h" | ||||
| #include "BKE_idtype.h" | #include "BKE_idtype.h" | ||||
| #include "BKE_lattice.h" | #include "BKE_lattice.h" | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "DNA_lattice_types.h" | #include "DNA_lattice_types.h" | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "BLI_rand.hh" | #include "BLI_rand.hh" | ||||
| #define DO_PERF_TESTS 0 | |||||
| #if DO_PERF_TESTS | |||||
| namespace blender::bke::tests { | namespace blender::bke::tests { | ||||
| struct LatticeDeformTestContext { | struct LatticeDeformTestContext { | ||||
| Lattice lattice; | Lattice lattice; | ||||
| Object ob_lattice; | Object ob_lattice; | ||||
| Mesh mesh; | Mesh mesh; | ||||
| Object ob_mesh; | Object ob_mesh; | ||||
| float (*coords)[3]; | float (*coords)[3]; | ||||
| ▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | TEST(lattice_deform_performance, performance_no_dvert_10000000) | ||||
| LatticeDeformTestContext ctx = {dna::shallow_zero_initialize()}; | LatticeDeformTestContext ctx = {dna::shallow_zero_initialize()}; | ||||
| RandomNumberGenerator rng; | RandomNumberGenerator rng; | ||||
| test_lattice_deform_init(&ctx, &rng, num_items); | test_lattice_deform_init(&ctx, &rng, num_items); | ||||
| test_lattice_deform(&ctx, num_items); | test_lattice_deform(&ctx, num_items); | ||||
| test_lattice_deform_free(&ctx); | test_lattice_deform_free(&ctx); | ||||
| } | } | ||||
| } // namespace blender::bke::tests | } // namespace blender::bke::tests | ||||
| #endif | |||||