Login  Register

Re: Another variant for glBufferData?

Posted by Sven Gothel on Aug 31, 2014; 1:42am
URL: https://forum.jogamp.org/Another-variant-for-glBufferData-tp4032875p4032996.html

On 08/31/2014 03:30 AM, adi [via jogamp] wrote:

> Hi
>
> The problem is another. If i have put all datas in vbo's, the nio buffers are
> all deleted.  There are situations where my complete scenegraph must be
> serialized.
> Now, the nio buffers are gone before, so that the objects can't created from a
> de-serialization. Problem in my opinion is the method *glBufferData* that
> can only handle nio-buffers and not simple float array's.
> What says the opengl Reference?
> Must buffer parameters in opengl functions forced to set with nio buffers in
> java?
this is answered by the lifecycle requirement
of the data passed to the GL functions,
i.e. is the data/reference still used after
the gl function returns ?
If the answer is YES, you have to use NIO buffers.
Reason: passing a java array will use GC pinned memory
passing to the native function, only valid during function call.

Here: Probably yes .. depending on deferred execution of GL driver.

BTW .. if you like to stream data, maybe you like to use GL mmap,
i.e. glMapBuffer[Range] ?

~Sven



signature.asc (828 bytes) Download Attachment