dont zero the geometry buffer
This commit is contained in:
@@ -19,12 +19,19 @@ public class GlBuffer extends TrackedObject {
|
|||||||
public GlBuffer(long size) {
|
public GlBuffer(long size) {
|
||||||
this(size, 0);
|
this(size, 0);
|
||||||
}
|
}
|
||||||
|
public GlBuffer(long size, boolean zero) {
|
||||||
|
this(size, 0, zero);
|
||||||
|
}
|
||||||
|
|
||||||
public GlBuffer(long size, int flags) {
|
public GlBuffer(long size, int flags) {
|
||||||
|
this(size, flags, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GlBuffer(long size, int flags, boolean zero) {
|
||||||
this.id = glCreateBuffers();
|
this.id = glCreateBuffers();
|
||||||
this.size = size;
|
this.size = size;
|
||||||
glNamedBufferStorage(this.id, size, flags);
|
glNamedBufferStorage(this.id, size, flags);
|
||||||
if ((flags&GL_SPARSE_STORAGE_BIT_ARB)==0) {
|
if ((flags&GL_SPARSE_STORAGE_BIT_ARB)==0 && zero) {
|
||||||
this.zero();
|
this.zero();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ public class BasicSectionGeometryData implements IGeometryData {
|
|||||||
glGetError();//Clear any errors
|
glGetError();//Clear any errors
|
||||||
GlBuffer buffer = null;
|
GlBuffer buffer = null;
|
||||||
if (!(Capabilities.INSTANCE.isNvidia && ThreadUtils.isWindows)) {
|
if (!(Capabilities.INSTANCE.isNvidia && ThreadUtils.isWindows)) {
|
||||||
buffer = new GlBuffer(geometryCapacity);//Only do this if we are not on nvidia
|
buffer = new GlBuffer(geometryCapacity, false);//Only do this if we are not on nvidia
|
||||||
//TODO: FIXME: TEST, see if the issue is that we are trying to zero the entire buffer, try only zeroing increments
|
//TODO: FIXME: TEST, see if the issue is that we are trying to zero the entire buffer, try only zeroing increments
|
||||||
// or dont zero it at all
|
// or dont zero it at all
|
||||||
} else {
|
} else {
|
||||||
@@ -52,7 +52,7 @@ public class BasicSectionGeometryData implements IGeometryData {
|
|||||||
glBindBuffer(GL_ARRAY_BUFFER, buffer.id);
|
glBindBuffer(GL_ARRAY_BUFFER, buffer.id);
|
||||||
glBufferPageCommitmentARB(GL_ARRAY_BUFFER, 0, geometryCapacity, true);
|
glBufferPageCommitmentARB(GL_ARRAY_BUFFER, 0, geometryCapacity, true);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
buffer.zero();
|
//buffer.zero();
|
||||||
error = glGetError();
|
error = glGetError();
|
||||||
if (error != GL_NO_ERROR) {
|
if (error != GL_NO_ERROR) {
|
||||||
buffer.free();
|
buffer.free();
|
||||||
|
|||||||
Reference in New Issue
Block a user