Re: glTexImage performance
Posted by Ondrej on Feb 23, 2011; 10:59am
URL: https://forum.jogamp.org/glTexImage-performance-tp2555613p2559188.html
Thanks, the class com.jogamp.common.nio.Buffers looks very interesting and useful.
As far I found out that the buffer implementation for glTexImage can be both direct and indirect. If it is indirect it must backed by array. For example ByteBuffer.allocate(512*512*4).asFloatBuffer() throws exeception:
java.lang.UnsupportedOperationException
at java.nio.FloatBuffer.array(FloatBuffer.java:940)
at com.jogamp.common.nio.Buffers.getArray(Buffers.java:371)
at com.jogamp.opengl.impl.gl4.GL4bcImpl.glTexImage2D(GL4bcImpl.java:23832)
Direct buffer must be in native order. If it is not in native order glTextImage2D works but uploaded texture is corrupted.
Looks like no big performance differences whether using direct or indirect buffers. (tested on notebook with poor graphic card)
By the way, how can I see the code at GL4bcImpl.java:23832 ? Cound not found it in repositories. Is this the part of code which is generated by gluegen?