[Bf-blender-cvs] [3c80e4bc929] functions: code for testing
Jacques Lucke
noreply at git.blender.org
Sun Jun 30 16:01:13 CEST 2019
Commit: 3c80e4bc92942d2e5be38db86bdee8441bd0ce50
Author: Jacques Lucke
Date: Sun Jun 30 13:47:20 2019 +0200
Branches: functions
https://developer.blender.org/rB3c80e4bc92942d2e5be38db86bdee8441bd0ce50
code for testing
===================================================================
M source/blender/blenlib/BLI_timeit.hpp
M source/blender/simulations/bparticles/c_wrapper.cpp
M source/blender/simulations/bparticles/emitters.cpp
===================================================================
diff --git a/source/blender/blenlib/BLI_timeit.hpp b/source/blender/blenlib/BLI_timeit.hpp
index 8d461b621a1..4ba84afcf3a 100644
--- a/source/blender/blenlib/BLI_timeit.hpp
+++ b/source/blender/blenlib/BLI_timeit.hpp
@@ -17,7 +17,7 @@ using Nanoseconds = std::chrono::nanoseconds;
inline void print_duration(Nanoseconds duration)
{
- if (duration.count() < 10000000) {
+ if (duration.count() < 100000) {
std::cout << duration.count() << " ns";
}
else {
diff --git a/source/blender/simulations/bparticles/c_wrapper.cpp b/source/blender/simulations/bparticles/c_wrapper.cpp
index 5d36fd24cf0..828107fd18e 100644
--- a/source/blender/simulations/bparticles/c_wrapper.cpp
+++ b/source/blender/simulations/bparticles/c_wrapper.cpp
@@ -127,6 +127,10 @@ class EventActionTest : public EventAction {
Event *m_event;
Action *m_action;
+ EventActionTest(Event *event, Action *action) : m_event(event), m_action(action)
+ {
+ }
+
~EventActionTest()
{
delete m_event;
@@ -216,7 +220,7 @@ void BParticles_simulate_modifier(NodeParticlesModifierData *npmd,
Depsgraph *UNUSED(depsgraph),
BParticlesState state_c)
{
- SCOPED_TIMER("simulate");
+ SCOPED_TIMER_STATS("simulate");
ParticlesState &state = *unwrap(state_c);
ModifierStepDescription description;
@@ -225,6 +229,7 @@ void BParticles_simulate_modifier(NodeParticlesModifierData *npmd,
auto *type0 = new ModifierParticleType();
description.m_types.add_new(0, type0);
+ type0->m_event_actions.append(new EventActionTest(EVENT_age_reached(30.0f), ACTION_kill()));
// if (npmd->emitter_object) {
// description.m_emitters.append(EMITTER_mesh_surface(
diff --git a/source/blender/simulations/bparticles/emitters.cpp b/source/blender/simulations/bparticles/emitters.cpp
index c604589055d..938cc554a97 100644
--- a/source/blender/simulations/bparticles/emitters.cpp
+++ b/source/blender/simulations/bparticles/emitters.cpp
@@ -117,7 +117,7 @@ class EmitAtStartEmitter : public Emitter {
}
SmallVector<float3> positions;
- for (uint i = 0; i < 10000; i++) {
+ for (uint i = 0; i < 1000000; i++) {
positions.append(float3(i / 1000.0f, 0, 0));
}
More information about the Bf-blender-cvs
mailing list