Fix flickering with batching

- Call syncPoint before submitting tasks
- Reset DrawBuffer even if it has no vertices when drawing
This commit is contained in:
PepperCode1 2022-08-21 20:56:22 -07:00
parent 8bea467409
commit d3c280d298
2 changed files with 4 additions and 1 deletions

View file

@ -53,8 +53,9 @@ public class BatchingDrawTracker {
BufferBuilderExtension scratch = (BufferBuilderExtension) this.scratch;
buffer.inject(scratch);
renderType.end(this.scratch, 0, 0, 0);
buffer.reset();
}
buffer.reset();
}
/**

View file

@ -48,6 +48,8 @@ public class BatchingEngine implements Engine {
var stack = FlwUtil.copyPoseStack(context.stack());
stack.translate(-cameraPos.x, -cameraPos.y, -cameraPos.z);
// TODO: async task engine barriers
taskEngine.syncPoint();
submitTasks(taskEngine, stack, context.level());
}