pre-calculate morton codes in threadpool
This commit is contained in:
@ -91,4 +91,9 @@ constexpr Color BLOCK_COLOR = DARKBLUE;
|
||||
constexpr Color TARGET_BLOCK_COLOR = RED;
|
||||
constexpr Color WALL_COLOR = BLACK;
|
||||
|
||||
// Threadpool
|
||||
static constexpr int SMALL_TASK_BLOCK_SIZE = 256; // Weirdly larger blocks decrease performance...
|
||||
static constexpr int LARGE_TASK_BLOCK_SIZE = 256;
|
||||
|
||||
|
||||
#endif
|
||||
@ -22,9 +22,6 @@ public:
|
||||
};
|
||||
|
||||
public:
|
||||
static constexpr int SMALL_TASK_BLOCK_SIZE = 256;
|
||||
static constexpr int LARGE_TASK_BLOCK_SIZE = 256;
|
||||
|
||||
octree tree;
|
||||
|
||||
// This is the main ownership of all the states/masses/springs.
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
#define OCTREE_HPP_
|
||||
|
||||
#include "util.hpp"
|
||||
#include "config.hpp"
|
||||
|
||||
#include <array>
|
||||
#include <vector>
|
||||
@ -98,7 +99,9 @@ public:
|
||||
[[nodiscard]] auto root() const -> const node&;
|
||||
|
||||
// Morton/linear octree implementation
|
||||
static auto build_octree_morton(octree& t, const std::vector<Vector3>& positions) -> void;
|
||||
static auto build_octree_morton(octree& t,
|
||||
const std::vector<Vector3>& positions,
|
||||
const std::optional<BS::thread_pool<>*>& thread_pool) -> void;
|
||||
[[nodiscard]] auto calculate_force_morton(int node_idx, const Vector3& pos, int self_id) const -> Vector3;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user