From cf5340c0bfc1914073ea1f4fc3ccad83f50dc57d Mon Sep 17 00:00:00 2001 From: Emily Leiviskä Date: Wed, 16 Nov 2016 16:55:30 +0100 Subject: Changes CLMemory's getNIOSize() and getNIOCapacity() to use buffer.limit() instead of capacity() in order to respect the user's desired buffer size in memory operations. --- src/com/jogamp/opencl/CLMemory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/com') 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 extends CLObjectResource { if(buffer == null) { return 0; } - return buffer.capacity(); + return buffer.limit(); } /** @@ -155,7 +155,7 @@ public abstract class CLMemory extends CLObjectResource { if(buffer == null) { return 0; } - return getElementSize() * buffer.capacity(); + return getElementSize() * buffer.limit(); } /** -- cgit v1.2.3