summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmily Leiviskä <[email protected]>2016-11-16 17:10:00 +0100
committerEmily Leiviskä <[email protected]>2016-11-16 17:10:00 +0100
commit01f69625995299262c11ae6bcbf345119c7b892f (patch)
tree9bd719adc485a6749704ffa823c8c4102eb53bed /src
parentcf5340c0bfc1914073ea1f4fc3ccad83f50dc57d (diff)
Changing CLBuffer#create to respect the limit instead of capacity on the direct buffer that the CLBuffer is being created for as this more closely represents the users intention about the buffer size.
Diffstat (limited to 'src')
-rw-r--r--src/com/jogamp/opencl/CLBuffer.java2
1 files changed, 1 insertions, 1 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");