* More checkFrameBufferError() only when setting an FBO, and not when setting main FB

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8184 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
sha..rd 2011-09-04 23:22:38 +00:00
parent 045e2a4317
commit 2f41dcfd48

View File

@ -1462,7 +1462,6 @@ public class LwjglRenderer implements Renderer {
} }
} }
if (fb == null) { if (fb == null) {
// unbind any fbos // unbind any fbos
if (context.boundFBO != 0) { if (context.boundFBO != 0) {
@ -1540,13 +1539,13 @@ public class LwjglRenderer implements Renderer {
assert fb.getId() >= 0; assert fb.getId() >= 0;
assert context.boundFBO == fb.getId(); assert context.boundFBO == fb.getId();
lastFb = fb; lastFb = fb;
}
try { try {
checkFrameBufferError(); checkFrameBufferError();
} catch (IllegalStateException ex) { } catch (IllegalStateException ex) {
logger.log(Level.SEVERE, "Problem FBO:\n{0}", fb); logger.log(Level.SEVERE, "Problem FBO:\n{0}", fb);
throw ex; throw ex;
}
} }
} }
@ -1947,6 +1946,8 @@ public class LwjglRenderer implements Renderer {
vb.setId(bufId); vb.setId(bufId);
objManager.registerForCleanup(vb); objManager.registerForCleanup(vb);
//statistics.onNewVertexBuffer();
created = true; created = true;
} }
@ -1957,12 +1958,18 @@ public class LwjglRenderer implements Renderer {
if (context.boundElementArrayVBO != bufId) { if (context.boundElementArrayVBO != bufId) {
glBindBuffer(target, bufId); glBindBuffer(target, bufId);
context.boundElementArrayVBO = bufId; context.boundElementArrayVBO = bufId;
//statistics.onVertexBufferUse(vb, true);
}else{
//statistics.onVertexBufferUse(vb, false);
} }
} else { } else {
target = GL_ARRAY_BUFFER; target = GL_ARRAY_BUFFER;
if (context.boundArrayVBO != bufId) { if (context.boundArrayVBO != bufId) {
glBindBuffer(target, bufId); glBindBuffer(target, bufId);
context.boundArrayVBO = bufId; context.boundArrayVBO = bufId;
//statistics.onVertexBufferUse(vb, true);
}else{
//statistics.onVertexBufferUse(vb, false);
} }
} }
@ -2070,6 +2077,8 @@ public class LwjglRenderer implements Renderer {
intBuf1.position(0).limit(1); intBuf1.position(0).limit(1);
glDeleteBuffers(intBuf1); glDeleteBuffers(intBuf1);
vb.resetObject(); vb.resetObject();
//statistics.onDeleteVertexBuffer();
} }
} }
@ -2127,6 +2136,9 @@ public class LwjglRenderer implements Renderer {
if (context.boundArrayVBO != bufId) { if (context.boundArrayVBO != bufId) {
glBindBuffer(GL_ARRAY_BUFFER, bufId); glBindBuffer(GL_ARRAY_BUFFER, bufId);
context.boundArrayVBO = bufId; context.boundArrayVBO = bufId;
//statistics.onVertexBufferUse(vb, true);
}else{
//statistics.onVertexBufferUse(vb, false);
} }
glVertexAttribPointer(loc, glVertexAttribPointer(loc,
@ -2171,6 +2183,9 @@ public class LwjglRenderer implements Renderer {
if (context.boundElementArrayVBO != bufId) { if (context.boundElementArrayVBO != bufId) {
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufId); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, bufId);
context.boundElementArrayVBO = bufId; context.boundElementArrayVBO = bufId;
//statistics.onVertexBufferUse(indexBuf, true);
}else{
//statistics.onVertexBufferUse(indexBuf, true);
} }
int vertCount = mesh.getVertexCount(); int vertCount = mesh.getVertexCount();