Login  Register

Re: upcoming semantical change for buffer operations

Posted by Michael Bien on Feb 17, 2011; 8:30pm
URL: https://forum.jogamp.org/upcoming-semantical-change-for-buffer-operations-tp2519021p2522140.html

a more concrete example would look like:
            CLBuffer<FloatBuffer> src = context.createFloatBuffer(preparedNIOBuffer);
            CLBuffer<FloatBuffer> dst = context.createFloatBuffer(preparedNIOBuffer.capacity());
            
            int src_offset = 12; // ignore first 12 floats
            int dst_offset = 0;
            //now
            queue.putCopyBuffer(src, dst, src_offset*SIZEOF_FLOAT, dst_offset, (src.capacity()-src_offset)*SIZEOF_FLOAT);
            
            //after the change
            queue.putCopyBuffer(src, dst, src_offset, dst_offset, src.capacity()-src_offset);

            queue.finish();


-michael