Login  Register

Re: upcoming semantical change for buffer operations

Posted by Sven Gothel on Feb 19, 2011; 4:31pm
URL: https://forum.jogamp.org/upcoming-semantical-change-for-buffer-operations-tp2519021p2534217.html

On Thursday, February 17, 2011 21:30:07 Michael Bien [via jogamp] wrote:

>
> 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();
>

yup cool .. and as we discussed, the alignment / row-pitch values in bytes,
if appropriate / exists.

~Sven

>
>
> -michael
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://forum.jogamp.org/upcoming-semantical-change-for-buffer-operations-tp2519021p2522140.html
> To start a new topic under jocl, email [hidden email]
> To unsubscribe from jocl, visit