diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/jogamp/opencl/CLPlatform.java | 7 | ||||
-rw-r--r-- | src/com/jogamp/opencl/llb/impl/CLImpl.java | 21 |
2 files changed, 13 insertions, 15 deletions
diff --git a/src/com/jogamp/opencl/CLPlatform.java b/src/com/jogamp/opencl/CLPlatform.java index 9e5308f9..6c08e9ee 100644 --- a/src/com/jogamp/opencl/CLPlatform.java +++ b/src/com/jogamp/opencl/CLPlatform.java @@ -174,11 +174,6 @@ public class CLPlatform { @Override public long resolve(String name, DynamicLookupHelper lookup) { - //FIXME workaround to fix a gluegen issue - if(name.endsWith("Impl")) { - name = name.substring(0, name.length() - "Impl".length()); - } - if(name.endsWith("KHR") || name.endsWith("EXT")) { long address = ((CLImpl) cl).clGetExtensionFunctionAddress(name); if(address != 0) { @@ -203,7 +198,7 @@ public class CLPlatform { } //eagerly init function to query extension addresses (used in reset()) - table.initEntry("clGetExtensionFunctionAddressImpl", libOpenCL); + table.initEntry("clGetExtensionFunctionAddress", libOpenCL); table.reset(libOpenCL); return null; } 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; } |