barrier
This commit is contained in:
@@ -105,10 +105,12 @@ public class DownloadStream {
|
||||
|
||||
|
||||
public void commit() {
|
||||
glMemoryBarrier(GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT | GL_BUFFER_UPDATE_BARRIER_BIT);
|
||||
//Copies all the data from target buffers into the download stream
|
||||
for (var entry : this.downloadList) {
|
||||
glCopyNamedBufferSubData(entry.target.id, this.downloadBuffer.id, entry.targetOffset, entry.downloadStreamOffset, entry.size);
|
||||
}
|
||||
glMemoryBarrier(GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT | GL_BUFFER_UPDATE_BARRIER_BIT);
|
||||
this.thisFrameDownloadList.addAll(this.downloadList);
|
||||
this.downloadList.clear();
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ import static org.lwjgl.opengl.GL11.glFinish;
|
||||
import static org.lwjgl.opengl.GL42.glMemoryBarrier;
|
||||
import static org.lwjgl.opengl.GL42C.GL_BUFFER_UPDATE_BARRIER_BIT;
|
||||
import static org.lwjgl.opengl.GL43.GL_SHADER_STORAGE_BARRIER_BIT;
|
||||
import static org.lwjgl.opengl.GL44.GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT;
|
||||
import static org.lwjgl.opengl.GL44.GL_MAP_COHERENT_BIT;
|
||||
|
||||
public class UploadStream {
|
||||
@@ -79,6 +80,7 @@ public class UploadStream {
|
||||
|
||||
|
||||
public void commit() {
|
||||
glMemoryBarrier(GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT);
|
||||
//Execute all the copies
|
||||
for (var entry : this.uploadList) {
|
||||
glCopyNamedBufferSubData(this.uploadBuffer.id, entry.target.id, entry.uploadOffset, entry.targetOffset, entry.size);
|
||||
|
||||
Reference in New Issue
Block a user