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
5956fbfaa0
commit
f82b9d2d23
3 changed files with 8 additions and 3 deletions
|
@ -27,6 +27,10 @@ public abstract class GlBuffer extends GlObject {
|
||||||
GL20.glBindBuffer(type.glEnum, 0);
|
GL20.glBindBuffer(type.glEnum, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void doneForThisFrame() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public abstract void alloc(long size);
|
public abstract void alloc(long size);
|
||||||
|
|
||||||
public abstract void upload(ByteBuffer directBuffer);
|
public abstract void upload(ByteBuffer directBuffer);
|
||||||
|
|
|
@ -20,9 +20,7 @@ public class PersistentGlBuffer extends GlBuffer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void unbind() {
|
public void doneForThisFrame() {
|
||||||
super.unbind();
|
|
||||||
|
|
||||||
fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
fence = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,6 +90,9 @@ public class Instancer<D extends InstanceData> {
|
||||||
|
|
||||||
if (glInstanceCount > 0) model.drawInstances(glInstanceCount);
|
if (glInstanceCount > 0) model.drawInstances(glInstanceCount);
|
||||||
|
|
||||||
|
// persistent mapping sync point
|
||||||
|
instanceVBO.doneForThisFrame();
|
||||||
|
|
||||||
vao.unbind();
|
vao.unbind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue