summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWade Walker <[email protected]>2014-03-02 14:02:25 -0600
committerWade Walker <[email protected]>2014-03-02 14:02:25 -0600
commit806f2902482af7c77c6a25ac3f9e4d4f73d56a54 (patch)
treefc9f1a04cb6a7d369ab51df9e5011dd720e92269
parenteb06798a7af0da8febbf31abd34e62e7100633aa (diff)
Pass function pointers into clEnqueueMapImage.
These pointers were showing up as uninitialized variables; on inspection they just weren't being passed in from the Java side or assigned on the C side. There are currently no tests of this function, which is how we didn't notice this omission.
-rw-r--r--make/config/clImplCustomCode.c4
-rw-r--r--src/com/jogamp/opencl/llb/impl/CLImpl.java14
2 files changed, 9 insertions, 9 deletions
diff --git a/make/config/clImplCustomCode.c b/make/config/clImplCustomCode.c
index a19cd400..1d640863 100644
--- a/make/config/clImplCustomCode.c
+++ b/make/config/clImplCustomCode.c
@@ -348,11 +348,11 @@ Java_com_jogamp_opencl_llb_impl_CLImpl_clEnqueueMapImage0__JJIJLjava_lang_Object
cl_int status;
typedef int32_t (*imageInfoFunctionType)(cl_mem, uint32_t, size_t, void *, size_t *);
- imageInfoFunctionType clGetImageInfo;
+ imageInfoFunctionType clGetImageInfo = (imageInfoFunctionType)(intptr_t)imageInfoAddress;
typedef void* (*mapInfoFunctionType)(cl_command_queue, cl_mem, uint32_t, uint64_t, const size_t *,
const size_t *, size_t *, size_t *, uint32_t, cl_event *, cl_event *, int32_t *);
- mapInfoFunctionType clEnqueueMapImage;
+ mapInfoFunctionType clEnqueueMapImage = (mapInfoFunctionType)(intptr_t)mapImageAddress;
void * _res;
diff --git a/src/com/jogamp/opencl/llb/impl/CLImpl.java b/src/com/jogamp/opencl/llb/impl/CLImpl.java
index ad89ff9f..57d45dfc 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.PointerBuffer;
-import com.jogamp.common.os.Platform;
import com.jogamp.common.util.LongLongHashMap;
import com.jogamp.opencl.CLErrorHandler;
import com.jogamp.opencl.CLException;
@@ -215,14 +214,14 @@ public class CLImpl extends CLAbstractImpl {
throw new CLException("Argument \"errcode_ret\" was not a direct buffer");
}
- final long mapImageAddress = addressTable._addressof_clEnqueueMapImage;
- if (mapImageAddress == 0) {
- throw new UnsupportedOperationException("Method not available");
- }
final long getImageInfoAddress = addressTable._addressof_clGetImageInfo;
if (getImageInfoAddress == 0) {
throw new UnsupportedOperationException("Method not available");
}
+ final long mapImageAddress = addressTable._addressof_clEnqueueMapImage;
+ if (mapImageAddress == 0) {
+ throw new UnsupportedOperationException("Method not available");
+ }
ByteBuffer _res;
_res = clEnqueueMapImage0(command_queue, image, blocking_map, map_flags, origin != null ? origin.getBuffer() : null,
getDirectBufferByteOffset(origin), range != null ? range.getBuffer() : null,
@@ -231,7 +230,7 @@ public class CLImpl extends CLAbstractImpl {
getDirectBufferByteOffset(image_slice_pitch), num_events_in_wait_list,
event_wait_list != null ? event_wait_list.getBuffer() : null, getDirectBufferByteOffset(event_wait_list),
event != null ? event.getBuffer() : null, getDirectBufferByteOffset(event), errcode_ret,
- getDirectBufferByteOffset(errcode_ret));
+ getDirectBufferByteOffset(errcode_ret), getImageInfoAddress, mapImageAddress);
if (_res == null) {
return null;
}
@@ -251,7 +250,8 @@ public class CLImpl extends CLAbstractImpl {
Object origin, int origin_byte_offset, Object range, int range_byte_offset, Object image_row_pitch,
int image_row_pitch_byte_offset, Object image_slice_pitch, int image_slice_pitch_byte_offset,
int num_events_in_wait_list, Object event_wait_list, int event_wait_list_byte_offset, Object event,
- int event_byte_offset, Object errcode_ret, int errcode_ret_byte_offset);
+ int event_byte_offset, Object errcode_ret, int errcode_ret_byte_offset,
+ long getImageInfoAddress, long mapImageAddress);
public CLProcAddressTable getAddressTable() {
return addressTable;