diff options
author | Wade Walker <[email protected]> | 2016-11-26 08:48:46 -0600 |
---|---|---|
committer | GitHub <[email protected]> | 2016-11-26 08:48:46 -0600 |
commit | 39624f4be4587c41a1bfc6f7f4627d06c224f869 (patch) | |
tree | 9bd719adc485a6749704ffa823c8c4102eb53bed /src/com/jogamp/opencl | |
parent | feb8b2646c8d85e2533dd1dcd7ff3c3b3718bea4 (diff) | |
parent | 01f69625995299262c11ae6bcbf345119c7b892f (diff) |
Merge pull request #2 from EmilyBjoerk/master
Changing CLBuffer to use Buffer#limit() over Buffer#capacity()
Diffstat (limited to 'src/com/jogamp/opencl')
-rw-r--r-- | src/com/jogamp/opencl/CLBuffer.java | 2 | ||||
-rw-r--r-- | src/com/jogamp/opencl/CLMemory.java | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/com/jogamp/opencl/CLBuffer.java b/src/com/jogamp/opencl/CLBuffer.java index 065de079..81e036fc 100644 --- a/src/com/jogamp/opencl/CLBuffer.java +++ b/src/com/jogamp/opencl/CLBuffer.java @@ -82,7 +82,7 @@ public class CLBuffer<B extends Buffer> extends CLMemory<B> { final CL binding = context.getPlatform().getCLBinding(); final int[] result = new int[1]; - final int size = Buffers.sizeOfBufferElem(directBuffer) * directBuffer.capacity(); + final int size = Buffers.sizeOfBufferElem(directBuffer) * directBuffer.limit(); final long id = binding.clCreateBuffer(context.ID, flags, size, host_ptr, result, 0); CLException.checkForError(result[0], "can not create cl buffer"); diff --git a/src/com/jogamp/opencl/CLMemory.java b/src/com/jogamp/opencl/CLMemory.java index 6a28d0a5..00f51b6b 100644 --- a/src/com/jogamp/opencl/CLMemory.java +++ b/src/com/jogamp/opencl/CLMemory.java @@ -145,7 +145,7 @@ public abstract class CLMemory <B extends Buffer> extends CLObjectResource { if(buffer == null) { return 0; } - return buffer.capacity(); + return buffer.limit(); } /** @@ -155,7 +155,7 @@ public abstract class CLMemory <B extends Buffer> extends CLObjectResource { if(buffer == null) { return 0; } - return getElementSize() * buffer.capacity(); + return getElementSize() * buffer.limit(); } /** |