From b32190b0b899e4806e85625e7b0d1e242fdf0f05 Mon Sep 17 00:00:00 2001 From: Michael Bien Date: Sat, 7 Aug 2010 15:21:09 +0200 Subject: added a few CLImage junit tests. --- src/com/jogamp/opencl/CLImage2d.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/com/jogamp/opencl/CLImage2d.java') diff --git a/src/com/jogamp/opencl/CLImage2d.java b/src/com/jogamp/opencl/CLImage2d.java index 7cf04cf1..c6d4c96a 100644 --- a/src/com/jogamp/opencl/CLImage2d.java +++ b/src/com/jogamp/opencl/CLImage2d.java @@ -24,9 +24,12 @@ public class CLImage2d extends CLImage { int width, int height, int rowPitch, CLImageFormat format, int flags) { CL cl = context.cl; - IntBuffer err = Buffers.newDirectByteBuffer(4).asIntBuffer(); - - long id = cl.clCreateImage2D(context.ID, flags, format.getFormatImpl(), width, height, rowPitch, directBuffer, err); + IntBuffer err = Buffers.newDirectIntBuffer(1); + B host_ptr = null; + if(isHostPointerFlag(flags)) { + host_ptr = directBuffer; + } + long id = cl.clCreateImage2D(context.ID, flags, format.getFormatImpl(), width, height, rowPitch, host_ptr, err); checkForError(err.get(), "can not create 2d image"); return new CLImage2d(context, directBuffer, format, width, height, id, flags); -- cgit v1.2.3