Converting queue.enqueueReadImage -> putMapImage?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Converting queue.enqueueReadImage -> putMapImage?


I'm converting an OpenCL snippet from C++ to jocl, but I'm struggling with this one:

        // Read top of histoPyramid an use this size to allocate VBO below
        int * sum = new int[8];
        if(writingTo3DTextures) {
            queue.enqueueReadImage(images[images.size()-1], CL_FALSE, origin, region, 0, 0, sum);
        } else {
            queue.enqueueReadBuffer(buffers[buffers.size()-1], CL_FALSE, 0, sizeof(int)*8, sum);

My guess is that this should be something like:

                if (writingTo3DTextures) {
        queue.putMapImage(images[images.length - 1], Map.READ, origin[0], origin[1], origin[2], region[0], region[1], region[2], false);
                } else {
                        queue.putMapBuffer(buffers[buffers.length - 1], Map.READ, 0, SIZEOF_INT * 8, false);

but that must be wrong as the C++ snippet is supposed to read 8 values from the image/buffer ... and I can't figure out how that's going to happen. Not too sure about the other parameters either, especially  Map.READ.

Any help appreciated, pointers to reading welcome...

br Kusti