Fix sort heuristic being wrong on pending blocks surviving more than one thread_sync(), we really have to overwrite it

master
Marc Gilleron 2019-06-02 01:52:46 +01:00
parent 6515ac2c94
commit 439e5d9964
2 changed files with 3 additions and 4 deletions

View File

@ -532,8 +532,8 @@ private:
for (auto it = data.input.blocks.begin(); it != data.input.blocks.end(); ++it) {
InputBlock &ib = *it;
// Gets added so it can be modified by queries
ib.sort_heuristic += get_priority_heuristic(ib,
// Set or override previous heuristic based on new infos
ib.sort_heuristic = get_priority_heuristic(ib,
data.input.priority_position,
data.input.priority_direction,
data.input.max_lod_index);

View File

@ -219,8 +219,7 @@ struct ScheduleSaveAction {
VoxelDataLoader::InputBlock b;
b.data.voxels_to_save = with_copy ? block->voxels->duplicate() : block->voxels;
b.position = block->position;
// Modify heuristic so it doesn't get processed too soon
b.sort_heuristic = 2 << block->lod_index;
b.can_be_discarded = false;
blocks_to_save.push_back(b);
block->modified = false;
}