Results 1 to 3 of 3

Thread: OpenCL 1.2 2D image array

  1. #1
    Junior Member
    Join Date
    Oct 2012

    OpenCL 1.2 2D image array

    I'm currently planning to use a 2D image array (image2d_array_t) to store read-only material information, i.e. one slice for each material, however I am having difficulties understanding how to sample it properly. Is there a way to enable linear filtering on the x- and y- dimensions, but disable sampling in the z-dimension? Something akin to:

    Code :
    read_imagef(my_image, my_sampler, (float2)(x, y), (int)(slice_index))

    Or do I need to use the old +0.5 offset trick to exactly sample the desired slice so that other slices don't "bleed" on the result?

    I would imagine there is a way to select the desired slice, since otherwise 2D image arrays would be equivalent to 3D images and thus redundant, yet I cannot find any indication of that in the spec.

  2. #2
    Senior Member
    Join Date
    Sep 2002
    Santa Clara

    Re: OpenCL 1.2 2D image array

    The addressing & filter mode specified in the sampler only get applied to the x and y dimensions of a 2D image array. The z dimension (for a 2D image array) is only clamped and no filtering is performed between the image slices of the 2D image array. Refer to section 8.4 on how an image layer is selected from an image array.

  3. #3
    Junior Member
    Join Date
    Oct 2012

    Re: OpenCL 1.2 2D image array

    Hello, that is good news, and thank you for the reference, I will read up on it.

Similar Threads

  1. Image computing in OpenCL (image2D or array)
    By Elhassan in forum OpenCL
    Replies: 1
    Last Post: 11-19-2012, 11:34 PM
  2. 2D Array using OpenCL?
    By HolyGeneralK in forum OpenCL
    Replies: 0
    Last Post: 03-25-2010, 02:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Proudly hosted by Digital Ocean