Login  Register

Re: copy 2d image to 3d image

Posted by Michael Bien on Apr 04, 2011; 7:21pm
URL: https://forum.jogamp.org/copy-2d-image-to-3d-image-tp2773846p2776558.html

  Hello,

the problem here is that the full method definition would look like:

     public CLCommandQueue putCopyImage(CLImage<?> srcImage, CLImage<?>
dstImage,
                                         int srcOriginX, int srcOriginY,
int srcOriginZ,
                                         int dstOriginX, int dstOriginY,
int dstOriginZ,
                                         int rangeX, int rangeY, int
rangeZ, CLEventList condition, CLEventList events) {}


if you would now use this method with 2d images you would have to set
the z-offset to 0 and the z-range to 1 of the 2d image. By using typed
methods the CLCommandQueue can do that for you automatically.

But i could do that if this would help you in your usecase...


The command queue has two code paths, one for 2d and 3d data as you
already mentioned. We could think about merging the impl of both
codepaths into one dispatcher method but it would force us to use
instanceof or similar constructs to get the type of the argument. Since
the impl is so small i see it currently as low priority and would rather
add typed copy2dTo3d and copy3dTo2d methods... but we can talk about
that also..

#491 is fixed, thank you for the report, you are very good in finding
this kind of bugs -> please continue ;)

best regards,
michael

On 04/04/2011 05:48 AM, notzed [via jogamp] wrote:

> Hi,
>
> I'm experimenting with using 3d images, and I noticed that the
> CLCommandQueue api's only support copying from 2d-2d and 3d-3d images.  As
> such there seems no direct way to create 3d images on-gpu from 2d images
> since the 3d image write extension isn't available on my hardware.
>
> I can work around this using the low-level api directly, but there doesn't
> seem to be much point to the duplicated type specific image copying
> functions in the API.  Should they reflect the clEnqueueCopyImage() more
> directly - i.e. accept both 2d and 3d images?  At least in the lowest-level,
> most general method?
>
> i.e. just change
>   putCopyImage(CLImage3d<?>  srcImage, CLImage3d<?>  dstImage, ...)
> to
>   putCopyImage(CLImage<?>  srcImage, CLImage<?>  dstImage, ...)
>
> Speaking of 3d images, there looks to be a bug in createImage3d(int width,
> int height, int depth, int rowPitch, CLImageFormat, Mem...).  It passes
> rowPitch as the depth to it's callee, and discards depth.  I've filed a bug
> (#491).
>
> Cheers,
>   Z
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://forum.jogamp.org/copy-2d-image-to-3d-image-tp2773846p2773846.html
> To start a new topic under jogamp, email [hidden email]
> To unsubscribe from jogamp, visit