mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-28 16:06:28 +01:00
Persistent buffers v1.5
- Add new sync function to GlBuffer
This commit is contained in:
parent
2ab0e221ce
commit
b9ac4f1fdc
3 changed files with 8 additions and 3 deletions
|
@ -27,6 +27,10 @@ public abstract class GlBuffer extends GlObject {
|
|||
GL20.glBindBuffer(type.glEnum, 0);
|
||||
}
|
||||
|
||||
public void doneForThisFrame() {
|
||||
|
||||
}
|
||||
|
||||
public abstract void alloc(long size);
|
||||
|
||||
public abstract void upload(ByteBuffer directBuffer);
|
||||
|
|
|
@ -20,9 +20,7 @@ public class PersistentGlBuffer extends GlBuffer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void unbind() {
|
||||
super.unbind();
|
||||
|
||||
public void doneForThisFrame() {
|
||||
fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -90,6 +90,9 @@ public class Instancer<D extends InstanceData> {
|
|||
|
||||
if (glInstanceCount > 0) model.drawInstances(glInstanceCount);
|
||||
|
||||
// persistent mapping sync point
|
||||
instanceVBO.doneForThisFrame();
|
||||
|
||||
vao.unbind();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue