|
|
@ -1321,13 +1321,6 @@ public class GLRenderer implements Renderer { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
glfbo.glBindFramebufferEXT(GLExt.GL_FRAMEBUFFER_EXT, prevFBO); |
|
|
|
glfbo.glBindFramebufferEXT(GLExt.GL_FRAMEBUFFER_EXT, prevFBO); |
|
|
|
try { |
|
|
|
|
|
|
|
checkFrameBufferError(); |
|
|
|
|
|
|
|
} catch (IllegalStateException ex) { |
|
|
|
|
|
|
|
logger.log(Level.SEVERE, "Source FBO:\n{0}", src); |
|
|
|
|
|
|
|
logger.log(Level.SEVERE, "Dest FBO:\n{0}", dst); |
|
|
|
|
|
|
|
throw ex; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
throw new RendererException("Framebuffer blitting not supported by the video hardware"); |
|
|
|
throw new RendererException("Framebuffer blitting not supported by the video hardware"); |
|
|
|
} |
|
|
|
} |
|
|
@ -1488,6 +1481,8 @@ public class GLRenderer implements Renderer { |
|
|
|
updateFrameBufferAttachment(fb, colorBuf); |
|
|
|
updateFrameBufferAttachment(fb, colorBuf); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
checkFrameBufferError(); |
|
|
|
|
|
|
|
|
|
|
|
fb.clearUpdateNeeded(); |
|
|
|
fb.clearUpdateNeeded(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1645,8 +1640,6 @@ public class GLRenderer implements Renderer { |
|
|
|
assert context.boundFBO == fb.getId(); |
|
|
|
assert context.boundFBO == fb.getId(); |
|
|
|
|
|
|
|
|
|
|
|
context.boundFB = fb; |
|
|
|
context.boundFB = fb; |
|
|
|
|
|
|
|
|
|
|
|
checkFrameBufferError(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -2221,53 +2214,25 @@ public class GLRenderer implements Renderer { |
|
|
|
int usage = convertUsage(vb.getUsage()); |
|
|
|
int usage = convertUsage(vb.getUsage()); |
|
|
|
vb.getData().rewind(); |
|
|
|
vb.getData().rewind(); |
|
|
|
|
|
|
|
|
|
|
|
// if (created || vb.hasDataSizeChanged()) {
|
|
|
|
switch (vb.getFormat()) { |
|
|
|
// upload data based on format
|
|
|
|
case Byte: |
|
|
|
switch (vb.getFormat()) { |
|
|
|
case UnsignedByte: |
|
|
|
case Byte: |
|
|
|
gl.glBufferData(target, (ByteBuffer) vb.getData(), usage); |
|
|
|
case UnsignedByte: |
|
|
|
break; |
|
|
|
gl.glBufferData(target, (ByteBuffer) vb.getData(), usage); |
|
|
|
case Short: |
|
|
|
break; |
|
|
|
case UnsignedShort: |
|
|
|
// case Half:
|
|
|
|
gl.glBufferData(target, (ShortBuffer) vb.getData(), usage); |
|
|
|
case Short: |
|
|
|
break; |
|
|
|
case UnsignedShort: |
|
|
|
case Int: |
|
|
|
gl.glBufferData(target, (ShortBuffer) vb.getData(), usage); |
|
|
|
case UnsignedInt: |
|
|
|
break; |
|
|
|
glext.glBufferData(target, (IntBuffer) vb.getData(), usage); |
|
|
|
case Int: |
|
|
|
break; |
|
|
|
case UnsignedInt: |
|
|
|
case Float: |
|
|
|
glext.glBufferData(target, (IntBuffer) vb.getData(), usage); |
|
|
|
gl.glBufferData(target, (FloatBuffer) vb.getData(), usage); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case Float: |
|
|
|
default: |
|
|
|
gl.glBufferData(target, (FloatBuffer) vb.getData(), usage); |
|
|
|
throw new UnsupportedOperationException("Unknown buffer format."); |
|
|
|
break; |
|
|
|
} |
|
|
|
default: |
|
|
|
|
|
|
|
throw new UnsupportedOperationException("Unknown buffer format."); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
|
|
// // Invalidate buffer data (orphan) before uploading new data.
|
|
|
|
|
|
|
|
// switch (vb.getFormat()) {
|
|
|
|
|
|
|
|
// case Byte:
|
|
|
|
|
|
|
|
// case UnsignedByte:
|
|
|
|
|
|
|
|
// gl.glBufferSubData(target, 0, (ByteBuffer) vb.getData());
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// case Short:
|
|
|
|
|
|
|
|
// case UnsignedShort:
|
|
|
|
|
|
|
|
// gl.glBufferSubData(target, 0, (ShortBuffer) vb.getData());
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// case Int:
|
|
|
|
|
|
|
|
// case UnsignedInt:
|
|
|
|
|
|
|
|
// gl.glBufferSubData(target, 0, (IntBuffer) vb.getData());
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// case Float:
|
|
|
|
|
|
|
|
// gl.glBufferSubData(target, 0, (FloatBuffer) vb.getData());
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// case Double:
|
|
|
|
|
|
|
|
// gl.glBufferSubData(target, 0, (DoubleBuffer) vb.getData());
|
|
|
|
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// default:
|
|
|
|
|
|
|
|
// throw new UnsupportedOperationException("Unknown buffer format.");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vb.clearUpdateNeeded(); |
|
|
|
vb.clearUpdateNeeded(); |
|
|
|
} |
|
|
|
} |
|
|
|