summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/CLImage2d.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-08-07 15:21:09 +0200
committerMichael Bien <[email protected]>2010-08-07 15:21:09 +0200
commitb32190b0b899e4806e85625e7b0d1e242fdf0f05 (patch)
tree2c375fee04e4d8b45095f1911830c09be2fb94bd /src/com/jogamp/opencl/CLImage2d.java
parent2f1035db067feef9111ac3cd28c6d1256efa9a18 (diff)
added a few CLImage junit tests.
Diffstat (limited to 'src/com/jogamp/opencl/CLImage2d.java')
-rw-r--r--src/com/jogamp/opencl/CLImage2d.java9
1 files changed, 6 insertions, 3 deletions
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<B extends Buffer> extends CLImage<B> {
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<B>(context, directBuffer, format, width, height, id, flags);