diff options
author | Michael Bien <[email protected]> | 2011-02-27 03:25:57 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2011-02-27 03:25:57 +0100 |
commit | 77fae67d8d448018df83dd00b2d40adc7614bee1 (patch) | |
tree | d9f4c20b4c2d39672e146e68908ef7ba040c298f /src/com/jogamp/opencl/CLCommandQueue.java | |
parent | 61d365bd7c352262bff711b3954731e7928c203f (diff) |
CachedBufferFactory optimization in CLCommandQueue and CLProgram.create(binaries).
Diffstat (limited to 'src/com/jogamp/opencl/CLCommandQueue.java')
-rw-r--r-- | src/com/jogamp/opencl/CLCommandQueue.java | 15 |
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); } |