summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/llb
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2011-07-18 19:06:59 +0200
committerMichael Bien <[email protected]>2011-07-18 19:06:59 +0200
commit140b7b5020f3b85e43fb0203ca041c176d9e730b (patch)
tree9b0d11c10526f924426f87f541b0bbbdaa9f618e /src/com/jogamp/opencl/llb
parent6bd00879eec56c2753d84708f551557a2684904b (diff)
custom impl for clGetExtensionFuncitonAddress binding to remove a few gluegen workarounds.
should be also a bit more gc friendly.
Diffstat (limited to 'src/com/jogamp/opencl/llb')
-rw-r--r--src/com/jogamp/opencl/llb/impl/CLImpl.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/com/jogamp/opencl/llb/impl/CLImpl.java b/src/com/jogamp/opencl/llb/impl/CLImpl.java
index d4a1672b..c5a49f44 100644
--- a/src/com/jogamp/opencl/llb/impl/CLImpl.java
+++ b/src/com/jogamp/opencl/llb/impl/CLImpl.java
@@ -32,7 +32,6 @@
package com.jogamp.opencl.llb.impl;
import com.jogamp.common.nio.NativeSizeBuffer;
-import com.jogamp.common.os.Platform;
import com.jogamp.common.util.LongLongHashMap;
import com.jogamp.opencl.CLErrorHandler;
import com.jogamp.opencl.CLException;
@@ -256,19 +255,23 @@ public class CLImpl extends CLAbstractImpl {
int event_byte_offset, Object errcode_ret, int errcode_ret_byte_offset);
/**
- * Returns the extension function address for the given function name.
+ * Returns the address of a extension function with the supplied name.
*/
public long clGetExtensionFunctionAddress(String name) {
- ByteBuffer res = super.clGetExtensionFunctionAddressImpl(name);
- if(res == null) {
- return 0;
- }else if (Platform.is32Bit()) {
- return res.getInt();
- } else {
- return res.getLong();
+
+ final long address = addressTable._addressof_clGetExtensionFunctionAddress;
+
+ if (address == 0) {
+ throw new UnsupportedOperationException("Method not available");
}
+
+ return dispatch_clGetExtensionFunctionAddress1(name, address);
}
+ /** Entry point (through function pointer) to C language function: <br> <code> void * {@native clGetExtensionFunctionAddress}(const char * func_name); </code> */
+ private native long dispatch_clGetExtensionFunctionAddress1(String func_name, long procAddress);
+
+
public CLProcAddressTable getAddressTable() {
return addressTable;
}