summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl
diff options
context:
space:
mode:
authorEmily Leiviskä <[email protected]>2016-11-16 16:55:30 +0100
committerEmily Leiviskä <[email protected]>2016-11-16 16:55:30 +0100
commitcf5340c0bfc1914073ea1f4fc3ccad83f50dc57d (patch)
treec61da2b8a1551e60e0d706d093f093f506cdb17a /src/com/jogamp/opencl
parentfeb8b2646c8d85e2533dd1dcd7ff3c3b3718bea4 (diff)
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.
Diffstat (limited to 'src/com/jogamp/opencl')
-rw-r--r--src/com/jogamp/opencl/CLMemory.java4
1 files changed, 2 insertions, 2 deletions
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();
}
/**