only wait for buffers once. fix chunk mesh edges
This commit is contained in:
parent
50bd5c1a7e
commit
1f4dc3aa84
2 changed files with 3 additions and 1 deletions
|
@ -52,8 +52,8 @@ void Model::deleteModel(Model* model) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Model::submitDeleteQueue(bool purge) {
|
void Model::submitDeleteQueue(bool purge) {
|
||||||
|
vkDeviceWaitIdle(Engine::getInstance()->xeDevice.device());
|
||||||
for(Model* model: DELETION_QUEUE) {
|
for(Model* model: DELETION_QUEUE) {
|
||||||
vkDeviceWaitIdle(model->xeDevice.device());
|
|
||||||
try { delete model; } catch(int err) {};
|
try { delete model; } catch(int err) {};
|
||||||
}
|
}
|
||||||
DELETION_QUEUE.clear();
|
DELETION_QUEUE.clear();
|
||||||
|
|
|
@ -79,8 +79,10 @@ void FirstApp::reloadLoadedChunks(xe::GameObject& viewer) {
|
||||||
if(chunk == nullptr) {
|
if(chunk == nullptr) {
|
||||||
chunk = Chunk::newChunk(newGridX, newGridZ, 12345);
|
chunk = Chunk::newChunk(newGridX, newGridZ, 12345);
|
||||||
Chunk::createMeshAsync(chunk);
|
Chunk::createMeshAsync(chunk);
|
||||||
|
Chunk::createMeshAsync(Chunk::getChunk(newGridX+1, newGridZ));
|
||||||
Chunk::createMeshAsync(Chunk::getChunk(newGridX-1, newGridZ));
|
Chunk::createMeshAsync(Chunk::getChunk(newGridX-1, newGridZ));
|
||||||
Chunk::createMeshAsync(Chunk::getChunk(newGridX, newGridZ+1));
|
Chunk::createMeshAsync(Chunk::getChunk(newGridX, newGridZ+1));
|
||||||
|
Chunk::createMeshAsync(Chunk::getChunk(newGridX, newGridZ-1));
|
||||||
}
|
}
|
||||||
gameObject.model = chunk->getMesh();
|
gameObject.model = chunk->getMesh();
|
||||||
gameObject.transform.translation = glm::vec3(newGridX * 16.f, 0, newGridZ * 16.f);
|
gameObject.transform.translation = glm::vec3(newGridX * 16.f, 0, newGridZ * 16.f);
|
||||||
|
|
Loading…
Reference in a new issue