summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/CLCommandQueue.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/jogamp/opencl/CLCommandQueue.java')
-rw-r--r--src/com/jogamp/opencl/CLCommandQueue.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/com/jogamp/opencl/CLCommandQueue.java b/src/com/jogamp/opencl/CLCommandQueue.java
index 0fc7d383..d24fb115 100644
--- a/src/com/jogamp/opencl/CLCommandQueue.java
+++ b/src/com/jogamp/opencl/CLCommandQueue.java
@@ -28,7 +28,7 @@
package com.jogamp.opencl;
-import com.jogamp.common.nio.Buffers;
+import com.jogamp.common.nio.CachedBufferFactory;
import com.jogamp.opencl.gl.CLGLI;
import com.jogamp.common.nio.PointerBuffer;
import java.nio.ByteBuffer;
@@ -74,11 +74,14 @@ public class CLCommandQueue extends CLObject implements CLResource {
this.device = device;
this.properties = properties;
- this.ibA = PointerBuffer.allocateDirect(3);
- this.ibB = PointerBuffer.allocateDirect(3);
- this.ibC = PointerBuffer.allocateDirect(3);
-
- this.pbA = Buffers.newDirectIntBuffer(1);
+ int pbsize = PointerBuffer.elementSize();
+ CachedBufferFactory factory = CachedBufferFactory.create(9*pbsize + 4, true);
+
+ this.ibA = PointerBuffer.wrap(factory.newDirectByteBuffer(3*pbsize));
+ this.ibB = PointerBuffer.wrap(factory.newDirectByteBuffer(3*pbsize));
+ this.ibC = PointerBuffer.wrap(factory.newDirectByteBuffer(3*pbsize));
+
+ this.pbA = factory.newDirectIntBuffer(1);
}