mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-11-21 16:46:54 -08:00
Rebase against 41df83c50e1c3cfdd6e8ffb65de7838f8503632c.
This commit is contained in:
parent
f8b6fde40c
commit
5897bc1d27
@ -1,448 +0,0 @@
|
||||
From e68537a9ede159797a7b2e2f92007a37323a1ffd Mon Sep 17 00:00:00 2001
|
||||
From: Nakarin Khankham <garuda2550@gmail.com>
|
||||
Date: Sat, 9 Mar 2019 21:37:24 +0700
|
||||
Subject: [PATCH] opencl: Add OpenCL 1.0 function pointer loader.
|
||||
|
||||
Signed-off-by: Nakarin Khankham <garuda2550@gmail.com>
|
||||
---
|
||||
configure | 56 +++++++++
|
||||
configure.ac | 1 +
|
||||
dlls/opencl/opencl.c | 328 +++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
include/config.h.in | 3 +
|
||||
4 files changed, 388 insertions(+)
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index 3c976c9..be244ee 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -11801,6 +11801,62 @@ if test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" = xyes; then :
|
||||
|
||||
fi
|
||||
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lOpenCL" >&5
|
||||
+$as_echo_n "checking for -lOpenCL... " >&6; }
|
||||
+if ${ac_cv_lib_soname_OpenCL+:} false; then :
|
||||
+ $as_echo_n "(cached) " >&6
|
||||
+else
|
||||
+ ac_check_soname_save_LIBS=$LIBS
|
||||
+LIBS="-lOpenCL $LIBS"
|
||||
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
+/* end confdefs.h. */
|
||||
+
|
||||
+/* Override any GCC internal prototype to avoid an error.
|
||||
+ Use char because int might match the return type of a GCC
|
||||
+ builtin and then its argument prototype would still apply. */
|
||||
+#ifdef __cplusplus
|
||||
+extern "C"
|
||||
+#endif
|
||||
+char clGetPlatformInfo ();
|
||||
+int
|
||||
+main ()
|
||||
+{
|
||||
+return clGetPlatformInfo ();
|
||||
+ ;
|
||||
+ return 0;
|
||||
+}
|
||||
+_ACEOF
|
||||
+if ac_fn_c_try_link "$LINENO"; then :
|
||||
+ case "$LIBEXT" in
|
||||
+ dll) ac_cv_lib_soname_OpenCL=`$ac_cv_path_LDD conftest.exe | grep "OpenCL" | sed -e "s/dll.*/dll/"';2,$d'` ;;
|
||||
+ dylib) ac_cv_lib_soname_OpenCL=`$OTOOL -L conftest$ac_exeext | grep "libOpenCL\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libOpenCL\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
|
||||
+ *) ac_cv_lib_soname_OpenCL=`$READELF -d conftest$ac_exeext | grep "NEEDED.*libOpenCL\\.$LIBEXT" | sed -e "s/^.*\\[\\(libOpenCL\\.$LIBEXT[^ ]*\\)\\].*$/\1/"';2,$d'`
|
||||
+ if ${ac_cv_lib_soname_OpenCL:+false} :; then :
|
||||
+ ac_cv_lib_soname_OpenCL=`$LDD conftest$ac_exeext | grep "libOpenCL\\.$LIBEXT" | sed -e "s/^.*\(libOpenCL\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'`
|
||||
+fi ;;
|
||||
+ esac
|
||||
+fi
|
||||
+rm -f core conftest.err conftest.$ac_objext \
|
||||
+ conftest$ac_exeext conftest.$ac_ext
|
||||
+ LIBS=$ac_check_soname_save_LIBS
|
||||
+fi
|
||||
+if ${ac_cv_lib_soname_OpenCL:+false} :; then :
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
|
||||
+$as_echo "not found" >&6; }
|
||||
+ cat >>confdefs.h <<_ACEOF
|
||||
+#define SONAME_LIBOPENCL "libOpenCL.$LIBEXT"
|
||||
+_ACEOF
|
||||
+
|
||||
+else
|
||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_OpenCL" >&5
|
||||
+$as_echo "$ac_cv_lib_soname_OpenCL" >&6; }
|
||||
+
|
||||
+cat >>confdefs.h <<_ACEOF
|
||||
+#define SONAME_LIBOPENCL "$ac_cv_lib_soname_OpenCL"
|
||||
+_ACEOF
|
||||
+
|
||||
+
|
||||
+fi
|
||||
fi
|
||||
if test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" != xyes; then :
|
||||
case "x$with_opencl" in
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 45c22dd..f6e6da2 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -1264,6 +1264,7 @@ dnl **** Check for OpenCL ****
|
||||
if test "$ac_cv_header_CL_cl_h" = "yes"
|
||||
then
|
||||
AC_CHECK_LIB(OpenCL,clGetPlatformInfo,[AC_SUBST(OPENCL_LIBS,["-lOpenCL"])])
|
||||
+ WINE_CHECK_SONAME(OpenCL,clGetPlatformInfo,,[AC_DEFINE_UNQUOTED(SONAME_LIBOPENCL,["libOpenCL.$LIBEXT"])])
|
||||
fi
|
||||
WINE_NOTICE_WITH(opencl,[test "x$ac_cv_lib_OpenCL_clGetPlatformInfo" != xyes],
|
||||
[OpenCL ${notice_platform}development files not found, OpenCL won't be supported.],
|
||||
diff --git a/dlls/opencl/opencl.c b/dlls/opencl/opencl.c
|
||||
index 2d145bf..81feabb 100644
|
||||
--- a/dlls/opencl/opencl.c
|
||||
+++ b/dlls/opencl/opencl.c
|
||||
@@ -42,6 +42,334 @@ WINE_DEFAULT_DEBUG_CHANNEL(opencl);
|
||||
/* TODO: Figure out how to provide GL context sharing before enabling OpenGL */
|
||||
#define OPENCL_WITH_GL 0
|
||||
|
||||
+#ifndef SONAME_LIBOPENCL
|
||||
+#if defined(HAVE_OPENCL_OPENCL_H)
|
||||
+#define SONAME_LIBOPENCL "libOpenCL.dylib"
|
||||
+#else
|
||||
+#define SONAME_LIBOPENCL "libOpenCL.so"
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
+/* Platform API */
|
||||
+static cl_int (*pclGetPlatformIDs)(cl_uint num_entries, cl_platform_id *platforms, cl_uint *num_platforms);
|
||||
+static cl_int (*pclGetPlatformInfo)(cl_platform_id platform, cl_platform_info param_name,
|
||||
+ size_t param_value_size, void * param_value, size_t * param_value_size_ret);
|
||||
+
|
||||
+/* Device APIs */
|
||||
+static cl_int (*pclGetDeviceIDs)(cl_platform_id platform, cl_device_type device_type,
|
||||
+ cl_uint num_entries, cl_device_id * devices, cl_uint * num_devices);
|
||||
+static cl_int (*pclGetDeviceInfo)(cl_device_id device, cl_device_info param_name,
|
||||
+ size_t param_value_size, void * param_value, size_t * param_value_size_ret);
|
||||
+
|
||||
+/* Context APIs */
|
||||
+static cl_context (*pclCreateContext)(const cl_context_properties * properties, cl_uint num_devices, const cl_device_id * devices,
|
||||
+ void (*pfn_notify)(const char *errinfo, const void *private_info, size_t cb, void *user_data),
|
||||
+ void * user_data, cl_int * errcode_ret);
|
||||
+static cl_context (*pclCreateContextFromType)(const cl_context_properties * properties, cl_device_type device_type,
|
||||
+ void (*pfn_notify)(const char *errinfo, const void *private_info, size_t cb, void *user_data),
|
||||
+ void * user_data, cl_int * errcode_ret);
|
||||
+static cl_int (*pclRetainContext)(cl_context context);
|
||||
+static cl_int (*pclReleaseContext)(cl_context context);
|
||||
+static cl_int (*pclGetContextInfo)(cl_context context, cl_context_info param_name,
|
||||
+ size_t param_value_size, void * param_value, size_t * param_value_size_ret);
|
||||
+
|
||||
+/* Command Queue APIs */
|
||||
+static cl_command_queue (*pclCreateCommandQueue)(cl_context context, cl_device_id device,
|
||||
+ cl_command_queue_properties properties, cl_int * errcode_ret);
|
||||
+static cl_int (*pclRetainCommandQueue)(cl_command_queue command_queue);
|
||||
+static cl_int (*pclReleaseCommandQueue)(cl_command_queue command_queue);
|
||||
+static cl_int (*pclGetCommandQueueInfo)(cl_command_queue command_queue, cl_command_queue_info param_name,
|
||||
+ size_t param_value_size, void * param_value, size_t * param_value_size_ret);
|
||||
+static cl_int (*pclSetCommandQueueProperty)(cl_command_queue command_queue, cl_command_queue_properties properties, cl_bool enable,
|
||||
+ cl_command_queue_properties * old_properties);
|
||||
+
|
||||
+/* Memory Object APIs */
|
||||
+static cl_mem (*pclCreateBuffer)(cl_context context, cl_mem_flags flags, size_t size, void * host_ptr, cl_int * errcode_ret);
|
||||
+static cl_mem (*pclCreateImage2D)(cl_context context, cl_mem_flags flags, cl_image_format * image_format,
|
||||
+ size_t image_width, size_t image_height, size_t image_row_pitch, void * host_ptr, cl_int * errcode_ret);
|
||||
+static cl_mem (*pclCreateImage3D)(cl_context context, cl_mem_flags flags, cl_image_format * image_format,
|
||||
+ size_t image_width, size_t image_height, size_t image_depth, size_t image_row_pitch, size_t image_slice_pitch,
|
||||
+ void * host_ptr, cl_int * errcode_ret);
|
||||
+static cl_int (*pclRetainMemObject)(cl_mem memobj);
|
||||
+static cl_int (*pclReleaseMemObject)(cl_mem memobj);
|
||||
+static cl_int (*pclGetSupportedImageFormats)(cl_context context, cl_mem_flags flags, cl_mem_object_type image_type, cl_uint num_entries,
|
||||
+ cl_image_format * image_formats, cl_uint * num_image_formats);
|
||||
+static cl_int (*pclGetMemObjectInfo)(cl_mem memobj, cl_mem_info param_name, size_t param_value_size, void * param_value, size_t * param_value_size_ret);
|
||||
+static cl_int (*pclGetImageInfo)(cl_mem image, cl_image_info param_name, size_t param_value_size, void * param_value, size_t * param_value_size_ret);
|
||||
+
|
||||
+/* Sampler APIs */
|
||||
+static cl_sampler (*pclCreateSampler)(cl_context context, cl_bool normalized_coords, cl_addressing_mode addressing_mode,
|
||||
+ cl_filter_mode filter_mode, cl_int * errcode_ret);
|
||||
+static cl_int (*pclRetainSampler)(cl_sampler sampler);
|
||||
+static cl_int (*pclReleaseSampler)(cl_sampler sampler);
|
||||
+static cl_int (*pclGetSamplerInfo)(cl_sampler sampler, cl_sampler_info param_name, size_t param_value_size,
|
||||
+ void * param_value, size_t * param_value_size_ret);
|
||||
+
|
||||
+/* Program Object APIs */
|
||||
+static cl_program (*pclCreateProgramWithSource)(cl_context context, cl_uint count, const char ** strings,
|
||||
+ const size_t * lengths, cl_int * errcode_ret);
|
||||
+static cl_program (*pclCreateProgramWithBinary)(cl_context context, cl_uint num_devices, const cl_device_id * device_list,
|
||||
+ const size_t * lengths, const unsigned char ** binaries, cl_int * binary_status,
|
||||
+ cl_int * errcode_ret);
|
||||
+static cl_int (*pclRetainProgram)(cl_program program);
|
||||
+static cl_int (*pclReleaseProgram)(cl_program program);
|
||||
+static cl_int (*pclBuildProgram)(cl_program program, cl_uint num_devices, const cl_device_id * device_list, const char * options,
|
||||
+ void (*pfn_notify)(cl_program program, void * user_data),
|
||||
+ void * user_data);
|
||||
+static cl_int (*pclUnloadCompiler)(void);
|
||||
+static cl_int (*pclGetProgramInfo)(cl_program program, cl_program_info param_name,
|
||||
+ size_t param_value_size, void * param_value, size_t * param_value_size_ret);
|
||||
+static cl_int (*pclGetProgramBuildInfo)(cl_program program, cl_device_id device,
|
||||
+ cl_program_build_info param_name, size_t param_value_size, void * param_value,
|
||||
+ size_t * param_value_size_ret);
|
||||
+
|
||||
+/* Kernel Object APIs */
|
||||
+static cl_kernel (*pclCreateKernel)(cl_program program, char * kernel_name, cl_int * errcode_ret);
|
||||
+static cl_int (*pclCreateKernelsInProgram)(cl_program program, cl_uint num_kernels,
|
||||
+ cl_kernel * kernels, cl_uint * num_kernels_ret);
|
||||
+static cl_int (*pclRetainKernel)(cl_kernel kernel);
|
||||
+static cl_int (*pclReleaseKernel)(cl_kernel kernel);
|
||||
+static cl_int (*pclSetKernelArg)(cl_kernel kernel, cl_uint arg_index, size_t arg_size, void * arg_value);
|
||||
+static cl_int (*pclGetKernelInfo)(cl_kernel kernel, cl_kernel_info param_name,
|
||||
+ size_t param_value_size, void * param_value, size_t * param_value_size_ret);
|
||||
+static cl_int (*pclGetKernelWorkGroupInfo)(cl_kernel kernel, cl_device_id device,
|
||||
+ cl_kernel_work_group_info param_name, size_t param_value_size,
|
||||
+ void * param_value, size_t * param_value_size_ret);
|
||||
+/* Event Object APIs */
|
||||
+static cl_int (*pclWaitForEvents)(cl_uint num_events, cl_event * event_list);
|
||||
+static cl_int (*pclGetEventInfo)(cl_event event, cl_event_info param_name, size_t param_value_size,
|
||||
+ void * param_value, size_t * param_value_size_ret);
|
||||
+static cl_int (*pclRetainEvent)(cl_event event);
|
||||
+static cl_int (*pclReleaseEvent)(cl_event event);
|
||||
+
|
||||
+/* Profiling APIs */
|
||||
+static cl_int (*pclGetEventProfilingInfo)(cl_event event, cl_profiling_info param_name, size_t param_value_size,
|
||||
+ void * param_value, size_t * param_value_size_ret);
|
||||
+
|
||||
+/* Flush and Finish APIs */
|
||||
+static cl_int (*pclFlush)(cl_command_queue command_queue);
|
||||
+static cl_int (*pclFinish)(cl_command_queue command_queue);
|
||||
+
|
||||
+/* Enqueued Commands APIs */
|
||||
+static cl_int (*pclEnqueueReadBuffer)(cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_read,
|
||||
+ size_t offset, size_t cb, void * ptr,
|
||||
+ cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueWriteBuffer)(cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_write,
|
||||
+ size_t offset, size_t cb, const void * ptr,
|
||||
+ cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueCopyBuffer)(cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_buffer,
|
||||
+ size_t src_offset, size_t dst_offset, size_t cb,
|
||||
+ cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueReadImage)(cl_command_queue command_queue, cl_mem image, cl_bool blocking_read,
|
||||
+ const size_t * origin, const size_t * region,
|
||||
+ size_t row_pitch, size_t slice_pitch, void * ptr,
|
||||
+ cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueWriteImage)(cl_command_queue command_queue, cl_mem image, cl_bool blocking_write,
|
||||
+ const size_t * origin, const size_t * region,
|
||||
+ size_t input_row_pitch, size_t input_slice_pitch, const void * ptr,
|
||||
+ cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueCopyImage)(cl_command_queue command_queue, cl_mem src_image, cl_mem dst_image,
|
||||
+ size_t * src_origin, size_t * dst_origin, size_t * region,
|
||||
+ cl_uint num_events_in_wait_list, cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueCopyImageToBuffer)(cl_command_queue command_queue, cl_mem src_image, cl_mem dst_buffer,
|
||||
+ size_t * src_origin, size_t * region, size_t dst_offset,
|
||||
+ cl_uint num_events_in_wait_list, cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueCopyBufferToImage)(cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_image,
|
||||
+ size_t src_offset, size_t * dst_origin, size_t * region,
|
||||
+ cl_uint num_events_in_wait_list, cl_event * event_wait_list, cl_event * event);
|
||||
+static void * (*pclEnqueueMapBuffer)(cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_map,
|
||||
+ cl_map_flags map_flags, size_t offset, size_t cb,
|
||||
+ cl_uint num_events_in_wait_list, cl_event * event_wait_list, cl_event * event, cl_int * errcode_ret);
|
||||
+static void * (*pclEnqueueMapImage)(cl_command_queue command_queue, cl_mem image, cl_bool blocking_map,
|
||||
+ cl_map_flags map_flags, size_t * origin, size_t * region,
|
||||
+ size_t * image_row_pitch, size_t * image_slice_pitch,
|
||||
+ cl_uint num_events_in_wait_list, cl_event * event_wait_list, cl_event * event, cl_int * errcode_ret);
|
||||
+static cl_int (*pclEnqueueUnmapMemObject)(cl_command_queue command_queue, cl_mem memobj, void * mapped_ptr,
|
||||
+ cl_uint num_events_in_wait_list, cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueNDRangeKernel)(cl_command_queue command_queue, cl_kernel kernel, cl_uint work_dim,
|
||||
+ size_t * global_work_offset, size_t * global_work_size, size_t * local_work_size,
|
||||
+ cl_uint num_events_in_wait_list, cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueTask)(cl_command_queue command_queue, cl_kernel kernel,
|
||||
+ cl_uint num_events_in_wait_list, cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueNativeKernel)(cl_command_queue command_queue,
|
||||
+ void (*user_func)(void *args),
|
||||
+ void * args, size_t cb_args,
|
||||
+ cl_uint num_mem_objects, const cl_mem * mem_list, const void ** args_mem_loc,
|
||||
+ cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueMarker)(cl_command_queue command_queue, cl_event * event);
|
||||
+static cl_int (*pclEnqueueWaitForEvents)(cl_command_queue command_queue, cl_uint num_events, cl_event * event_list);
|
||||
+static cl_int (*pclEnqueueBarrier)(cl_command_queue command_queue);
|
||||
+
|
||||
+/* Extension function access */
|
||||
+static void * (*pclGetExtensionFunctionAddress)(const char * func_name);
|
||||
+
|
||||
+
|
||||
+static BOOL init_opencl(void);
|
||||
+static BOOL load_opencl_func(void);
|
||||
+
|
||||
+static void * opencl_handle = NULL;
|
||||
+
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * DllMain [Internal]
|
||||
+ *
|
||||
+ * Initializes the internal 'opencl.dll'.
|
||||
+ */
|
||||
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
|
||||
+{
|
||||
+ TRACE("opencl.dll: %p,%x,%p\n", hinstDLL, reason, reserved);
|
||||
+
|
||||
+ switch (reason)
|
||||
+ {
|
||||
+ case DLL_PROCESS_ATTACH:
|
||||
+ DisableThreadLibraryCalls(hinstDLL);
|
||||
+ if (init_opencl())
|
||||
+ load_opencl_func();
|
||||
+ break;
|
||||
+
|
||||
+ case DLL_PROCESS_DETACH:
|
||||
+ if (reserved) break;
|
||||
+ if (opencl_handle) dlclose(opencl_handle);
|
||||
+ }
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * init_opencl [Internal]
|
||||
+ *
|
||||
+ * Initializes OpenCL library.
|
||||
+ *
|
||||
+ * RETURNS
|
||||
+ * Success: TRUE
|
||||
+ * Failure: FALSE
|
||||
+ */
|
||||
+static BOOL init_opencl(void)
|
||||
+{
|
||||
+#ifdef SONAME_LIBOPENCL
|
||||
+ char error[256];
|
||||
+
|
||||
+ opencl_handle = dlopen(SONAME_LIBOPENCL, RTLD_NOW);
|
||||
+ if (opencl_handle != NULL)
|
||||
+ {
|
||||
+ TRACE("Opened library %s\n", SONAME_LIBOPENCL);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+ else
|
||||
+ ERR("Failed to open library %s: %s\n", SONAME_LIBOPENCL, error);
|
||||
+#else
|
||||
+ ERR("OpenCL is needed but support was not included at build time\n");
|
||||
+#endif
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * load_opencl_func [Internal]
|
||||
+ *
|
||||
+ * Populate function table.
|
||||
+ *
|
||||
+ * RETURNS
|
||||
+ * Success: TRUE
|
||||
+ * Failure: FALSE
|
||||
+ */
|
||||
+static BOOL load_opencl_func(void)
|
||||
+{
|
||||
+
|
||||
+
|
||||
+ if (opencl_handle == NULL)
|
||||
+ return FALSE;
|
||||
+
|
||||
+#define LOAD_FUNCPTR(f) \
|
||||
+ if (!(p##f = dlsym(opencl_handle, #f))) \
|
||||
+ WARN("%s not found in %s\n", #f, SONAME_LIBOPENCL);
|
||||
+
|
||||
+ /* Platform API */
|
||||
+ LOAD_FUNCPTR(clGetPlatformIDs);
|
||||
+ LOAD_FUNCPTR(clGetPlatformInfo);
|
||||
+ /* Device APIs */
|
||||
+ LOAD_FUNCPTR(clGetDeviceIDs);
|
||||
+ LOAD_FUNCPTR(clGetDeviceInfo);
|
||||
+ /* Context APIs */
|
||||
+ LOAD_FUNCPTR(clCreateContext);
|
||||
+ LOAD_FUNCPTR(clCreateContextFromType);
|
||||
+ LOAD_FUNCPTR(clRetainContext);
|
||||
+ LOAD_FUNCPTR(clReleaseContext);
|
||||
+ LOAD_FUNCPTR(clGetContextInfo);
|
||||
+ /* Command Queue APIs */
|
||||
+ LOAD_FUNCPTR(clCreateCommandQueue);
|
||||
+ LOAD_FUNCPTR(clRetainCommandQueue);
|
||||
+ LOAD_FUNCPTR(clReleaseCommandQueue);
|
||||
+ LOAD_FUNCPTR(clGetCommandQueueInfo);
|
||||
+ LOAD_FUNCPTR(clSetCommandQueueProperty);
|
||||
+ /* Memory Object APIs */
|
||||
+ LOAD_FUNCPTR(clCreateBuffer);
|
||||
+ LOAD_FUNCPTR(clCreateImage2D);
|
||||
+ LOAD_FUNCPTR(clCreateImage3D);
|
||||
+ LOAD_FUNCPTR(clRetainMemObject);
|
||||
+ LOAD_FUNCPTR(clReleaseMemObject);
|
||||
+ LOAD_FUNCPTR(clGetSupportedImageFormats);
|
||||
+ LOAD_FUNCPTR(clGetMemObjectInfo);
|
||||
+ LOAD_FUNCPTR(clGetImageInfo);
|
||||
+ /* Sampler APIs */
|
||||
+ LOAD_FUNCPTR(clCreateSampler);
|
||||
+ LOAD_FUNCPTR(clRetainSampler);
|
||||
+ LOAD_FUNCPTR(clReleaseSampler);
|
||||
+ LOAD_FUNCPTR(clGetSamplerInfo);
|
||||
+ /* Program Object APIs */
|
||||
+ LOAD_FUNCPTR(clCreateProgramWithSource);
|
||||
+ LOAD_FUNCPTR(clCreateProgramWithBinary);
|
||||
+ LOAD_FUNCPTR(clRetainProgram);
|
||||
+ LOAD_FUNCPTR(clReleaseProgram);
|
||||
+ LOAD_FUNCPTR(clBuildProgram);
|
||||
+ LOAD_FUNCPTR(clUnloadCompiler);
|
||||
+ LOAD_FUNCPTR(clGetProgramInfo);
|
||||
+ LOAD_FUNCPTR(clGetProgramBuildInfo);
|
||||
+ /* Kernel Object APIs */
|
||||
+ LOAD_FUNCPTR(clCreateKernel);
|
||||
+ LOAD_FUNCPTR(clCreateKernelsInProgram);
|
||||
+ LOAD_FUNCPTR(clRetainKernel);
|
||||
+ LOAD_FUNCPTR(clReleaseKernel);
|
||||
+ LOAD_FUNCPTR(clSetKernelArg);
|
||||
+ LOAD_FUNCPTR(clGetKernelInfo);
|
||||
+ LOAD_FUNCPTR(clGetKernelWorkGroupInfo);
|
||||
+ /* Event Object APIs */
|
||||
+ LOAD_FUNCPTR(clWaitForEvents);
|
||||
+ LOAD_FUNCPTR(clGetEventInfo);
|
||||
+ LOAD_FUNCPTR(clRetainEvent);
|
||||
+ LOAD_FUNCPTR(clReleaseEvent);
|
||||
+ /* Profiling APIs */
|
||||
+ LOAD_FUNCPTR(clGetEventProfilingInfo);
|
||||
+ /* Flush and Finish APIs */
|
||||
+ LOAD_FUNCPTR(clFlush);
|
||||
+ LOAD_FUNCPTR(clFinish);
|
||||
+ /* Enqueued Commands APIs */
|
||||
+ LOAD_FUNCPTR(clEnqueueReadBuffer);
|
||||
+ LOAD_FUNCPTR(clEnqueueWriteBuffer);
|
||||
+ LOAD_FUNCPTR(clEnqueueCopyBuffer);
|
||||
+ LOAD_FUNCPTR(clEnqueueReadImage);
|
||||
+ LOAD_FUNCPTR(clEnqueueWriteImage);
|
||||
+ LOAD_FUNCPTR(clEnqueueCopyImage);
|
||||
+ LOAD_FUNCPTR(clEnqueueCopyImageToBuffer);
|
||||
+ LOAD_FUNCPTR(clEnqueueCopyBufferToImage);
|
||||
+ LOAD_FUNCPTR(clEnqueueMapBuffer);
|
||||
+ LOAD_FUNCPTR(clEnqueueMapImage);
|
||||
+ LOAD_FUNCPTR(clEnqueueUnmapMemObject);
|
||||
+ LOAD_FUNCPTR(clEnqueueNDRangeKernel);
|
||||
+ LOAD_FUNCPTR(clEnqueueTask);
|
||||
+ LOAD_FUNCPTR(clEnqueueNativeKernel);
|
||||
+ LOAD_FUNCPTR(clEnqueueMarker);
|
||||
+ LOAD_FUNCPTR(clEnqueueWaitForEvents);
|
||||
+ LOAD_FUNCPTR(clEnqueueBarrier);
|
||||
+ /* Extension function access */
|
||||
+ LOAD_FUNCPTR(clGetExtensionFunctionAddress);
|
||||
+
|
||||
+#undef LOAD_FUNCPTR
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
|
||||
/*---------------------------------------------------------------*/
|
||||
/* Platform API */
|
||||
diff --git a/include/config.h.in b/include/config.h.in
|
||||
index b3df2f3..1330d30 100644
|
||||
--- a/include/config.h.in
|
||||
+++ b/include/config.h.in
|
||||
@@ -1443,6 +1443,9 @@
|
||||
/* Define to the soname of the libopenal library. */
|
||||
#undef SONAME_LIBOPENAL
|
||||
|
||||
+/* Define to the soname of the libOpenCL library. */
|
||||
+#undef SONAME_LIBOPENCL
|
||||
+
|
||||
/* Define to the soname of the libOSMesa library. */
|
||||
#undef SONAME_LIBOSMESA
|
||||
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,739 +0,0 @@
|
||||
From f99a46f3697d10d3db1d92db1e450f9be34fed55 Mon Sep 17 00:00:00 2001
|
||||
From: Nakarin Khankham <garuda2550@gmail.com>
|
||||
Date: Sat, 9 Mar 2019 21:40:48 +0700
|
||||
Subject: [PATCH 2/5] opencl: Use function pointer instead of call the function
|
||||
directly.
|
||||
|
||||
Signed-off-by: Nakarin Khankham <garuda2550@gmail.com>
|
||||
---
|
||||
dlls/opencl/opencl.c | 241 +++++++++++++++++++++++++++++++++++++--------------
|
||||
1 file changed, 177 insertions(+), 64 deletions(-)
|
||||
|
||||
diff --git a/dlls/opencl/opencl.c b/dlls/opencl/opencl.c
|
||||
index 7d292c0..221cf1a 100644
|
||||
--- a/dlls/opencl/opencl.c
|
||||
+++ b/dlls/opencl/opencl.c
|
||||
@@ -371,7 +371,8 @@ cl_int WINAPI wine_clGetPlatformIDs(cl_uint num_entries, cl_platform_id *platfor
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("(%d, %p, %p)\n", num_entries, platforms, num_platforms);
|
||||
- ret = clGetPlatformIDs(num_entries, platforms, num_platforms);
|
||||
+ if (!pclGetPlatformIDs) return CL_INVALID_VALUE;
|
||||
+ ret = pclGetPlatformIDs(num_entries, platforms, num_platforms);
|
||||
TRACE("(%d, %p, %p)=%d\n", num_entries, platforms, num_platforms, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -382,6 +383,8 @@ cl_int WINAPI wine_clGetPlatformInfo(cl_platform_id platform, cl_platform_info p
|
||||
cl_int ret;
|
||||
TRACE("(%p, 0x%x, %ld, %p, %p)\n", platform, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
|
||||
+ if (!pclGetPlatformInfo) return CL_INVALID_VALUE;
|
||||
+
|
||||
/* Hide all extensions.
|
||||
* TODO: Add individual extension support as needed.
|
||||
*/
|
||||
@@ -404,7 +407,7 @@ cl_int WINAPI wine_clGetPlatformInfo(cl_platform_id platform, cl_platform_info p
|
||||
}
|
||||
else
|
||||
{
|
||||
- ret = clGetPlatformInfo(platform, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
+ ret = pclGetPlatformInfo(platform, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
}
|
||||
|
||||
TRACE("(%p, 0x%x, %ld, %p, %p)=%d\n", platform, param_name, param_value_size, param_value, param_value_size_ret, ret);
|
||||
@@ -420,7 +423,8 @@ cl_int WINAPI wine_clGetDeviceIDs(cl_platform_id platform, cl_device_type device
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("(%p, 0x%lx, %d, %p, %p)\n", platform, (long unsigned int)device_type, num_entries, devices, num_devices);
|
||||
- ret = clGetDeviceIDs(platform, device_type, num_entries, devices, num_devices);
|
||||
+ if (!pclGetDeviceIDs) return CL_INVALID_VALUE;
|
||||
+ ret = pclGetDeviceIDs(platform, device_type, num_entries, devices, num_devices);
|
||||
TRACE("(%p, 0x%lx, %d, %p, %p)=%d\n", platform, (long unsigned int)device_type, num_entries, devices, num_devices, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -431,6 +435,8 @@ cl_int WINAPI wine_clGetDeviceInfo(cl_device_id device, cl_device_info param_nam
|
||||
cl_int ret;
|
||||
TRACE("(%p, 0x%x, %ld, %p, %p)\n",device, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
|
||||
+ if (!pclGetDeviceInfo) return CL_INVALID_VALUE;
|
||||
+
|
||||
/* Hide all extensions.
|
||||
* TODO: Add individual extension support as needed.
|
||||
*/
|
||||
@@ -453,7 +459,7 @@ cl_int WINAPI wine_clGetDeviceInfo(cl_device_id device, cl_device_info param_nam
|
||||
}
|
||||
else
|
||||
{
|
||||
- ret = clGetDeviceInfo(device, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
+ ret = pclGetDeviceInfo(device, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
}
|
||||
|
||||
/* Filter out the CL_EXEC_NATIVE_KERNEL flag */
|
||||
@@ -493,6 +499,11 @@ cl_context WINAPI wine_clCreateContext(const cl_context_properties * properties,
|
||||
cl_context ret;
|
||||
CONTEXT_CALLBACK *ccb;
|
||||
TRACE("(%p, %d, %p, %p, %p, %p)\n", properties, num_devices, devices, pfn_notify, user_data, errcode_ret);
|
||||
+ if (!pclCreateContext)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
/* FIXME: The CONTEXT_CALLBACK structure is currently leaked.
|
||||
* Pointers to callback redirectors should be remembered and free()d when the context is destroyed.
|
||||
* The problem is determining when a context is being destroyed. clReleaseContext only decrements
|
||||
@@ -502,7 +513,7 @@ cl_context WINAPI wine_clCreateContext(const cl_context_properties * properties,
|
||||
ccb = HeapAlloc(GetProcessHeap(), 0, sizeof(CONTEXT_CALLBACK));
|
||||
ccb->pfn_notify = pfn_notify;
|
||||
ccb->user_data = user_data;
|
||||
- ret = clCreateContext(properties, num_devices, devices, context_fn_notify, ccb, errcode_ret);
|
||||
+ ret = pclCreateContext(properties, num_devices, devices, context_fn_notify, ccb, errcode_ret);
|
||||
TRACE("(%p, %d, %p, %p, %p, %p (%d)))=%p\n", properties, num_devices, devices, &pfn_notify, user_data, errcode_ret, errcode_ret ? *errcode_ret : 0, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -514,6 +525,11 @@ cl_context WINAPI wine_clCreateContextFromType(const cl_context_properties * pro
|
||||
cl_context ret;
|
||||
CONTEXT_CALLBACK *ccb;
|
||||
TRACE("(%p, 0x%lx, %p, %p, %p)\n", properties, (long unsigned int)device_type, pfn_notify, user_data, errcode_ret);
|
||||
+ if (!pclCreateContextFromType)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
/* FIXME: The CONTEXT_CALLBACK structure is currently leaked.
|
||||
* Pointers to callback redirectors should be remembered and free()d when the context is destroyed.
|
||||
* The problem is determining when a context is being destroyed. clReleaseContext only decrements
|
||||
@@ -523,7 +539,7 @@ cl_context WINAPI wine_clCreateContextFromType(const cl_context_properties * pro
|
||||
ccb = HeapAlloc(GetProcessHeap(), 0, sizeof(CONTEXT_CALLBACK));
|
||||
ccb->pfn_notify = pfn_notify;
|
||||
ccb->user_data = user_data;
|
||||
- ret = clCreateContextFromType(properties, device_type, context_fn_notify, ccb, errcode_ret);
|
||||
+ ret = pclCreateContextFromType(properties, device_type, context_fn_notify, ccb, errcode_ret);
|
||||
TRACE("(%p, 0x%lx, %p, %p, %p (%d)))=%p\n", properties, (long unsigned int)device_type, pfn_notify, user_data, errcode_ret, errcode_ret ? *errcode_ret : 0, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -532,7 +548,8 @@ cl_int WINAPI wine_clRetainContext(cl_context context)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("(%p)\n", context);
|
||||
- ret = clRetainContext(context);
|
||||
+ if (!pclRetainContext) return CL_INVALID_VALUE;
|
||||
+ ret = pclRetainContext(context);
|
||||
TRACE("(%p)=%d\n", context, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -541,7 +558,8 @@ cl_int WINAPI wine_clReleaseContext(cl_context context)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("(%p)\n", context);
|
||||
- ret = clReleaseContext(context);
|
||||
+ if (!pclReleaseContext) return CL_INVALID_VALUE;
|
||||
+ ret = pclReleaseContext(context);
|
||||
TRACE("(%p)=%d\n", context, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -551,7 +569,8 @@ cl_int WINAPI wine_clGetContextInfo(cl_context context, cl_context_info param_na
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("(%p, 0x%x, %ld, %p, %p)\n", context, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
- ret = clGetContextInfo(context, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
+ if (!pclGetContextInfo) return CL_INVALID_VALUE;
|
||||
+ ret = pclGetContextInfo(context, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
TRACE("(%p, 0x%x, %ld, %p, %p)=%d\n", context, param_name, param_value_size, param_value, param_value_size_ret, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -565,7 +584,12 @@ cl_command_queue WINAPI wine_clCreateCommandQueue(cl_context context, cl_device_
|
||||
{
|
||||
cl_command_queue ret;
|
||||
TRACE("(%p, %p, 0x%lx, %p)\n", context, device, (long unsigned int)properties, errcode_ret);
|
||||
- ret = clCreateCommandQueue(context, device, properties, errcode_ret);
|
||||
+ if (!pclCreateCommandQueue)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ ret = pclCreateCommandQueue(context, device, properties, errcode_ret);
|
||||
TRACE("(%p, %p, 0x%lx, %p)=%p\n", context, device, (long unsigned int)properties, errcode_ret, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -574,7 +598,8 @@ cl_int WINAPI wine_clRetainCommandQueue(cl_command_queue command_queue)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("(%p)\n", command_queue);
|
||||
- ret = clRetainCommandQueue(command_queue);
|
||||
+ if (!pclRetainCommandQueue) return CL_INVALID_VALUE;
|
||||
+ ret = pclRetainCommandQueue(command_queue);
|
||||
TRACE("(%p)=%d\n", command_queue, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -583,7 +608,8 @@ cl_int WINAPI wine_clReleaseCommandQueue(cl_command_queue command_queue)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("(%p)\n", command_queue);
|
||||
- ret = clReleaseCommandQueue(command_queue);
|
||||
+ if (!pclReleaseCommandQueue) return CL_INVALID_VALUE;
|
||||
+ ret = pclReleaseCommandQueue(command_queue);
|
||||
TRACE("(%p)=%d\n", command_queue, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -593,7 +619,8 @@ cl_int WINAPI wine_clGetCommandQueueInfo(cl_command_queue command_queue, cl_comm
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("%p, %d, %ld, %p, %p\n", command_queue, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
- ret = clGetCommandQueueInfo(command_queue, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
+ if (!pclGetCommandQueueInfo) return CL_INVALID_VALUE;
|
||||
+ ret = pclGetCommandQueueInfo(command_queue, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -612,7 +639,12 @@ cl_mem WINAPI wine_clCreateBuffer(cl_context context, cl_mem_flags flags, size_t
|
||||
{
|
||||
cl_mem ret;
|
||||
TRACE("\n");
|
||||
- ret = clCreateBuffer(context, flags, size, host_ptr, errcode_ret);
|
||||
+ if (!pclCreateBuffer)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ ret = pclCreateBuffer(context, flags, size, host_ptr, errcode_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -621,7 +653,12 @@ cl_mem WINAPI wine_clCreateImage2D(cl_context context, cl_mem_flags flags, cl_im
|
||||
{
|
||||
cl_mem ret;
|
||||
TRACE("\n");
|
||||
- ret = clCreateImage2D(context, flags, image_format, image_width, image_height, image_row_pitch, host_ptr, errcode_ret);
|
||||
+ if (!pclCreateImage2D)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ ret = pclCreateImage2D(context, flags, image_format, image_width, image_height, image_row_pitch, host_ptr, errcode_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -631,7 +668,12 @@ cl_mem WINAPI wine_clCreateImage3D(cl_context context, cl_mem_flags flags, cl_im
|
||||
{
|
||||
cl_mem ret;
|
||||
TRACE("\n");
|
||||
- ret = clCreateImage3D(context, flags, image_format, image_width, image_height, image_depth, image_row_pitch, image_slice_pitch, host_ptr, errcode_ret);
|
||||
+ if (!pclCreateImage3D)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ ret = pclCreateImage3D(context, flags, image_format, image_width, image_height, image_depth, image_row_pitch, image_slice_pitch, host_ptr, errcode_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -639,7 +681,8 @@ cl_int WINAPI wine_clRetainMemObject(cl_mem memobj)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("(%p)\n", memobj);
|
||||
- ret = clRetainMemObject(memobj);
|
||||
+ if (!pclRetainMemObject) return CL_INVALID_VALUE;
|
||||
+ ret = pclRetainMemObject(memobj);
|
||||
TRACE("(%p)=%d\n", memobj, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -648,7 +691,8 @@ cl_int WINAPI wine_clReleaseMemObject(cl_mem memobj)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("(%p)\n", memobj);
|
||||
- ret = clReleaseMemObject(memobj);
|
||||
+ if (!pclReleaseMemObject) return CL_INVALID_VALUE;
|
||||
+ ret = pclReleaseMemObject(memobj);
|
||||
TRACE("(%p)=%d\n", memobj, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -658,7 +702,8 @@ cl_int WINAPI wine_clGetSupportedImageFormats(cl_context context, cl_mem_flags f
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clGetSupportedImageFormats(context, flags, image_type, num_entries, image_formats, num_image_formats);
|
||||
+ if (!pclGetSupportedImageFormats) return CL_INVALID_VALUE;
|
||||
+ ret = pclGetSupportedImageFormats(context, flags, image_type, num_entries, image_formats, num_image_formats);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -666,7 +711,8 @@ cl_int WINAPI wine_clGetMemObjectInfo(cl_mem memobj, cl_mem_info param_name, siz
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clGetMemObjectInfo(memobj, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
+ if (!pclGetMemObjectInfo) return CL_INVALID_VALUE;
|
||||
+ ret = pclGetMemObjectInfo(memobj, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -674,7 +720,8 @@ cl_int WINAPI wine_clGetImageInfo(cl_mem image, cl_image_info param_name, size_t
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clGetImageInfo(image, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
+ if (!pclGetImageInfo) return CL_INVALID_VALUE;
|
||||
+ ret = pclGetImageInfo(image, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -687,7 +734,12 @@ cl_sampler WINAPI wine_clCreateSampler(cl_context context, cl_bool normalized_co
|
||||
{
|
||||
cl_sampler ret;
|
||||
TRACE("\n");
|
||||
- ret = clCreateSampler(context, normalized_coords, addressing_mode, filter_mode, errcode_ret);
|
||||
+ if (!pclCreateSampler)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ ret = pclCreateSampler(context, normalized_coords, addressing_mode, filter_mode, errcode_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -695,7 +747,8 @@ cl_int WINAPI wine_clRetainSampler(cl_sampler sampler)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clRetainSampler(sampler);
|
||||
+ if (!pclRetainSampler) return CL_INVALID_VALUE;
|
||||
+ ret = pclRetainSampler(sampler);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -703,7 +756,8 @@ cl_int WINAPI wine_clReleaseSampler(cl_sampler sampler)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clReleaseSampler(sampler);
|
||||
+ if (!pclReleaseSampler) return CL_INVALID_VALUE;
|
||||
+ ret = pclReleaseSampler(sampler);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -712,7 +766,8 @@ cl_int WINAPI wine_clGetSamplerInfo(cl_sampler sampler, cl_sampler_info param_na
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clGetSamplerInfo(sampler, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
+ if (!pclGetSamplerInfo) return CL_INVALID_VALUE;
|
||||
+ ret = pclGetSamplerInfo(sampler, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -725,7 +780,12 @@ cl_program WINAPI wine_clCreateProgramWithSource(cl_context context, cl_uint cou
|
||||
{
|
||||
cl_program ret;
|
||||
TRACE("\n");
|
||||
- ret = clCreateProgramWithSource(context, count, strings, lengths, errcode_ret);
|
||||
+ if (!pclCreateProgramWithSource)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ ret = pclCreateProgramWithSource(context, count, strings, lengths, errcode_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -735,7 +795,12 @@ cl_program WINAPI wine_clCreateProgramWithBinary(cl_context context, cl_uint num
|
||||
{
|
||||
cl_program ret;
|
||||
TRACE("\n");
|
||||
- ret = clCreateProgramWithBinary(context, num_devices, device_list, lengths, binaries, binary_status, errcode_ret);
|
||||
+ if (!pclCreateProgramWithBinary)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ ret = pclCreateProgramWithBinary(context, num_devices, device_list, lengths, binaries, binary_status, errcode_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -743,7 +808,8 @@ cl_int WINAPI wine_clRetainProgram(cl_program program)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clRetainProgram(program);
|
||||
+ if (!pclRetainProgram) return CL_INVALID_PROGRAM;
|
||||
+ ret = pclRetainProgram(program);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -751,7 +817,8 @@ cl_int WINAPI wine_clReleaseProgram(cl_program program)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clReleaseProgram(program);
|
||||
+ if (!pclReleaseProgram) return CL_INVALID_PROGRAM;
|
||||
+ ret = pclReleaseProgram(program);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -777,6 +844,7 @@ cl_int WINAPI wine_clBuildProgram(cl_program program, cl_uint num_devices, const
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
+ if (!pclBuildProgram) return CL_INVALID_VALUE;
|
||||
if(pfn_notify)
|
||||
{
|
||||
/* When pfn_notify is provided, clBuildProgram is asynchronous */
|
||||
@@ -784,12 +852,12 @@ cl_int WINAPI wine_clBuildProgram(cl_program program, cl_uint num_devices, const
|
||||
pcb = HeapAlloc(GetProcessHeap(), 0, sizeof(PROGRAM_CALLBACK));
|
||||
pcb->pfn_notify = pfn_notify;
|
||||
pcb->user_data = user_data;
|
||||
- ret = clBuildProgram(program, num_devices, device_list, options, program_fn_notify, pcb);
|
||||
+ ret = pclBuildProgram(program, num_devices, device_list, options, program_fn_notify, pcb);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* When pfn_notify is NULL, clBuildProgram is synchronous */
|
||||
- ret = clBuildProgram(program, num_devices, device_list, options, NULL, user_data);
|
||||
+ ret = pclBuildProgram(program, num_devices, device_list, options, NULL, user_data);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -798,7 +866,8 @@ cl_int WINAPI wine_clUnloadCompiler(void)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("()\n");
|
||||
- ret = clUnloadCompiler();
|
||||
+ if (!pclUnloadCompiler) return CL_SUCCESS;
|
||||
+ ret = pclUnloadCompiler();
|
||||
TRACE("()=%d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -808,7 +877,8 @@ cl_int WINAPI wine_clGetProgramInfo(cl_program program, cl_program_info param_na
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clGetProgramInfo(program, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
+ if (!pclGetProgramInfo) return CL_INVALID_VALUE;
|
||||
+ ret = pclGetProgramInfo(program, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -818,7 +888,8 @@ cl_int WINAPI wine_clGetProgramBuildInfo(cl_program program, cl_device_id device
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clGetProgramBuildInfo(program, device, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
+ if (!pclGetProgramBuildInfo) return CL_INVALID_VALUE;
|
||||
+ ret = pclGetProgramBuildInfo(program, device, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -830,7 +901,12 @@ cl_kernel WINAPI wine_clCreateKernel(cl_program program, char * kernel_name, cl_
|
||||
{
|
||||
cl_kernel ret;
|
||||
TRACE("\n");
|
||||
- ret = clCreateKernel(program, kernel_name, errcode_ret);
|
||||
+ if (!pclCreateKernel)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ ret = pclCreateKernel(program, kernel_name, errcode_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -839,7 +915,8 @@ cl_int WINAPI wine_clCreateKernelsInProgram(cl_program program, cl_uint num_kern
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clCreateKernelsInProgram(program, num_kernels, kernels, num_kernels_ret);
|
||||
+ if (!pclCreateKernelsInProgram) return CL_INVALID_VALUE;
|
||||
+ ret = pclCreateKernelsInProgram(program, num_kernels, kernels, num_kernels_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -847,7 +924,8 @@ cl_int WINAPI wine_clRetainKernel(cl_kernel kernel)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clRetainKernel(kernel);
|
||||
+ if (!pclRetainKernel) return CL_INVALID_KERNEL;
|
||||
+ ret = pclRetainKernel(kernel);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -855,7 +933,8 @@ cl_int WINAPI wine_clReleaseKernel(cl_kernel kernel)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clReleaseKernel(kernel);
|
||||
+ if (!pclReleaseKernel) return CL_INVALID_KERNEL;
|
||||
+ ret = pclReleaseKernel(kernel);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -863,7 +942,8 @@ cl_int WINAPI wine_clSetKernelArg(cl_kernel kernel, cl_uint arg_index, size_t ar
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clSetKernelArg(kernel, arg_index, arg_size, arg_value);
|
||||
+ if (!pclSetKernelArg) return CL_INVALID_KERNEL;
|
||||
+ ret = pclSetKernelArg(kernel, arg_index, arg_size, arg_value);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -872,7 +952,8 @@ cl_int WINAPI wine_clGetKernelInfo(cl_kernel kernel, cl_kernel_info param_name,
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clGetKernelInfo(kernel, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
+ if (!pclGetKernelInfo) return CL_INVALID_VALUE;
|
||||
+ ret = pclGetKernelInfo(kernel, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -882,7 +963,8 @@ cl_int WINAPI wine_clGetKernelWorkGroupInfo(cl_kernel kernel, cl_device_id devic
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clGetKernelWorkGroupInfo(kernel, device, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
+ if (!pclGetKernelWorkGroupInfo) return CL_INVALID_VALUE;
|
||||
+ ret = pclGetKernelWorkGroupInfo(kernel, device, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -894,7 +976,8 @@ cl_int WINAPI wine_clWaitForEvents(cl_uint num_events, cl_event * event_list)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clWaitForEvents(num_events, event_list);
|
||||
+ if (!pclWaitForEvents) return CL_INVALID_EVENT;
|
||||
+ ret = pclWaitForEvents(num_events, event_list);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -903,7 +986,8 @@ cl_int WINAPI wine_clGetEventInfo(cl_event event, cl_event_info param_name, size
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clGetEventInfo(event, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
+ if (!pclGetEventInfo) return CL_INVALID_EVENT;
|
||||
+ ret = pclGetEventInfo(event, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -911,7 +995,8 @@ cl_int WINAPI wine_clRetainEvent(cl_event event)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clRetainEvent(event);
|
||||
+ if (!pclRetainEvent) return CL_INVALID_EVENT;
|
||||
+ ret = pclRetainEvent(event);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -919,7 +1004,8 @@ cl_int WINAPI wine_clReleaseEvent(cl_event event)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clReleaseEvent(event);
|
||||
+ if (!pclReleaseEvent) return CL_INVALID_EVENT;
|
||||
+ ret = pclReleaseEvent(event);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -932,7 +1018,8 @@ cl_int WINAPI wine_clGetEventProfilingInfo(cl_event event, cl_profiling_info par
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clGetEventProfilingInfo(event, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
+ if (!pclGetEventProfilingInfo) return CL_INVALID_EVENT;
|
||||
+ ret = pclGetEventProfilingInfo(event, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -944,7 +1031,8 @@ cl_int WINAPI wine_clFlush(cl_command_queue command_queue)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("(%p)\n", command_queue);
|
||||
- ret = clFlush(command_queue);
|
||||
+ if (!pclFlush) return CL_INVALID_COMMAND_QUEUE;
|
||||
+ ret = pclFlush(command_queue);
|
||||
TRACE("(%p)=%d\n", command_queue, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -953,7 +1041,8 @@ cl_int WINAPI wine_clFinish(cl_command_queue command_queue)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("(%p)\n", command_queue);
|
||||
- ret = clFinish(command_queue);
|
||||
+ if (!pclFinish) return CL_INVALID_COMMAND_QUEUE;
|
||||
+ ret = pclFinish(command_queue);
|
||||
TRACE("(%p)=%d\n", command_queue, ret);
|
||||
return ret;
|
||||
}
|
||||
@@ -968,7 +1057,8 @@ cl_int WINAPI wine_clEnqueueReadBuffer(cl_command_queue command_queue, cl_mem bu
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clEnqueueReadBuffer(command_queue, buffer, blocking_read, offset, cb, ptr, num_events_in_wait_list, event_wait_list, event);
|
||||
+ if (!pclEnqueueReadBuffer) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueReadBuffer(command_queue, buffer, blocking_read, offset, cb, ptr, num_events_in_wait_list, event_wait_list, event);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -978,7 +1068,8 @@ cl_int WINAPI wine_clEnqueueWriteBuffer(cl_command_queue command_queue, cl_mem b
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clEnqueueWriteBuffer(command_queue, buffer, blocking_write, offset, cb, ptr, num_events_in_wait_list, event_wait_list, event);
|
||||
+ if (!pclEnqueueWriteBuffer) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueWriteBuffer(command_queue, buffer, blocking_write, offset, cb, ptr, num_events_in_wait_list, event_wait_list, event);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -988,7 +1079,8 @@ cl_int WINAPI wine_clEnqueueCopyBuffer(cl_command_queue command_queue, cl_mem sr
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clEnqueueCopyBuffer(command_queue, src_buffer, dst_buffer, src_offset, dst_offset, cb, num_events_in_wait_list, event_wait_list, event);
|
||||
+ if (!pclEnqueueCopyBuffer) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueCopyBuffer(command_queue, src_buffer, dst_buffer, src_offset, dst_offset, cb, num_events_in_wait_list, event_wait_list, event);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1000,7 +1092,8 @@ cl_int WINAPI wine_clEnqueueReadImage(cl_command_queue command_queue, cl_mem ima
|
||||
cl_int ret;
|
||||
TRACE("(%p, %p, %d, %p, %p, %ld, %ld, %p, %d, %p, %p)\n", command_queue, image, blocking_read,
|
||||
origin, region, row_pitch, slice_pitch, ptr, num_events_in_wait_list, event_wait_list, event);
|
||||
- ret = clEnqueueReadImage(command_queue, image, blocking_read, origin, region, row_pitch, slice_pitch, ptr, num_events_in_wait_list, event_wait_list, event);
|
||||
+ if (!pclEnqueueReadImage) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueReadImage(command_queue, image, blocking_read, origin, region, row_pitch, slice_pitch, ptr, num_events_in_wait_list, event_wait_list, event);
|
||||
TRACE("(%p, %p, %d, %p, %p, %ld, %ld, %p, %d, %p, %p)=%d\n", command_queue, image, blocking_read,
|
||||
origin, region, row_pitch, slice_pitch, ptr, num_events_in_wait_list, event_wait_list, event, ret);
|
||||
return ret;
|
||||
@@ -1013,7 +1106,8 @@ cl_int WINAPI wine_clEnqueueWriteImage(cl_command_queue command_queue, cl_mem im
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clEnqueueWriteImage(command_queue, image, blocking_write, origin, region, input_row_pitch, input_slice_pitch, ptr, num_events_in_wait_list, event_wait_list, event);
|
||||
+ if (!pclEnqueueWriteImage) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueWriteImage(command_queue, image, blocking_write, origin, region, input_row_pitch, input_slice_pitch, ptr, num_events_in_wait_list, event_wait_list, event);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1023,7 +1117,8 @@ cl_int WINAPI wine_clEnqueueCopyImage(cl_command_queue command_queue, cl_mem src
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clEnqueueCopyImage(command_queue, src_image, dst_image, src_origin, dst_origin, region, num_events_in_wait_list, event_wait_list, event);
|
||||
+ if (!pclEnqueueCopyImage) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueCopyImage(command_queue, src_image, dst_image, src_origin, dst_origin, region, num_events_in_wait_list, event_wait_list, event);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1033,7 +1128,8 @@ cl_int WINAPI wine_clEnqueueCopyImageToBuffer(cl_command_queue command_queue, cl
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clEnqueueCopyImageToBuffer(command_queue, src_image, dst_buffer, src_origin, region, dst_offset, num_events_in_wait_list, event_wait_list, event);
|
||||
+ if (!pclEnqueueCopyImageToBuffer) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueCopyImageToBuffer(command_queue, src_image, dst_buffer, src_origin, region, dst_offset, num_events_in_wait_list, event_wait_list, event);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1043,7 +1139,8 @@ cl_int WINAPI wine_clEnqueueCopyBufferToImage(cl_command_queue command_queue, cl
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clEnqueueCopyBufferToImage(command_queue, src_buffer, dst_image, src_offset, dst_origin, region, num_events_in_wait_list, event_wait_list, event);
|
||||
+ if (!pclEnqueueCopyBufferToImage) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueCopyBufferToImage(command_queue, src_buffer, dst_image, src_offset, dst_origin, region, num_events_in_wait_list, event_wait_list, event);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1053,7 +1150,12 @@ void * WINAPI wine_clEnqueueMapBuffer(cl_command_queue command_queue, cl_mem buf
|
||||
{
|
||||
void * ret;
|
||||
TRACE("\n");
|
||||
- ret = clEnqueueMapBuffer(command_queue, buffer, blocking_map, map_flags, offset, cb, num_events_in_wait_list, event_wait_list, event, errcode_ret);
|
||||
+ if (!pclEnqueueMapBuffer)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ ret = pclEnqueueMapBuffer(command_queue, buffer, blocking_map, map_flags, offset, cb, num_events_in_wait_list, event_wait_list, event, errcode_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1064,7 +1166,12 @@ void * WINAPI wine_clEnqueueMapImage(cl_command_queue command_queue, cl_mem imag
|
||||
{
|
||||
void * ret;
|
||||
TRACE("\n");
|
||||
- ret = clEnqueueMapImage(command_queue, image, blocking_map, map_flags, origin, region, image_row_pitch, image_slice_pitch, num_events_in_wait_list, event_wait_list, event, errcode_ret);
|
||||
+ if (!pclEnqueueMapImage)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ ret = pclEnqueueMapImage(command_queue, image, blocking_map, map_flags, origin, region, image_row_pitch, image_slice_pitch, num_events_in_wait_list, event_wait_list, event, errcode_ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1073,7 +1180,8 @@ cl_int WINAPI wine_clEnqueueUnmapMemObject(cl_command_queue command_queue, cl_me
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clEnqueueUnmapMemObject(command_queue, memobj, mapped_ptr, num_events_in_wait_list, event_wait_list, event);
|
||||
+ if (!pclEnqueueUnmapMemObject) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueUnmapMemObject(command_queue, memobj, mapped_ptr, num_events_in_wait_list, event_wait_list, event);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1083,7 +1191,8 @@ cl_int WINAPI wine_clEnqueueNDRangeKernel(cl_command_queue command_queue, cl_ker
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clEnqueueNDRangeKernel(command_queue, kernel, work_dim, global_work_offset, global_work_size, local_work_size, num_events_in_wait_list, event_wait_list, event);
|
||||
+ if (!pclEnqueueNDRangeKernel) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueNDRangeKernel(command_queue, kernel, work_dim, global_work_offset, global_work_size, local_work_size, num_events_in_wait_list, event_wait_list, event);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1092,7 +1201,8 @@ cl_int WINAPI wine_clEnqueueTask(cl_command_queue command_queue, cl_kernel kerne
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clEnqueueTask(command_queue, kernel, num_events_in_wait_list, event_wait_list, event);
|
||||
+ if (!pclEnqueueTask) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueTask(command_queue, kernel, num_events_in_wait_list, event_wait_list, event);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1121,7 +1231,8 @@ cl_int WINAPI wine_clEnqueueMarker(cl_command_queue command_queue, cl_event * ev
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clEnqueueMarker(command_queue, event);
|
||||
+ if (!pclEnqueueMarker) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueMarker(command_queue, event);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1129,7 +1240,8 @@ cl_int WINAPI wine_clEnqueueWaitForEvents(cl_command_queue command_queue, cl_uin
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clEnqueueWaitForEvents(command_queue, num_events, event_list);
|
||||
+ if (!pclEnqueueWaitForEvents) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueWaitForEvents(command_queue, num_events, event_list);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1137,7 +1249,8 @@ cl_int WINAPI wine_clEnqueueBarrier(cl_command_queue command_queue)
|
||||
{
|
||||
cl_int ret;
|
||||
TRACE("\n");
|
||||
- ret = clEnqueueBarrier(command_queue);
|
||||
+ if (!pclEnqueueBarrier) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueBarrier(command_queue);
|
||||
return ret;
|
||||
}
|
||||
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,286 +0,0 @@
|
||||
From 73c7c7b43fcc85af543c53c2cf0180e6be1473a4 Mon Sep 17 00:00:00 2001
|
||||
From: Nakarin Khankham <garuda2550@gmail.com>
|
||||
Date: Sat, 9 Mar 2019 21:53:49 +0700
|
||||
Subject: [PATCH 3/5] opencl: Add OpenCL 1.1 implementation.
|
||||
|
||||
Signed-off-by: Nakarin Khankham <garuda2550@gmail.com>
|
||||
---
|
||||
dlls/opencl/opencl.c | 194 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/opencl/opencl.spec | 10 +++
|
||||
2 files changed, 204 insertions(+)
|
||||
|
||||
diff --git a/dlls/opencl/opencl.c b/dlls/opencl/opencl.c
|
||||
index 221cf1a..41fc71b 100644
|
||||
--- a/dlls/opencl/opencl.c
|
||||
+++ b/dlls/opencl/opencl.c
|
||||
@@ -196,6 +196,28 @@ static cl_int (*pclEnqueueBarrier)(cl_command_queue command_queue);
|
||||
/* Extension function access */
|
||||
static void * (*pclGetExtensionFunctionAddress)(const char * func_name);
|
||||
|
||||
+/* OpenCL 1.1 functions */
|
||||
+static cl_mem (*pclCreateSubBuffer)(cl_mem buffer, cl_mem_flags flags,
|
||||
+ cl_buffer_create_type buffer_create_type, const void * buffer_create_info, cl_int * errcode_ret);
|
||||
+static cl_event (*pclCreateUserEvent)(cl_context context, cl_int * errcode_ret);
|
||||
+static cl_int (*pclEnqueueCopyBufferRect)(cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_buffer,
|
||||
+ const size_t * src_origin, const size_t * dst_origin, const size_t * region,
|
||||
+ size_t src_row_pitch, size_t src_slice_pitch,
|
||||
+ size_t dst_row_pitch, size_t dst_slice_pitch,
|
||||
+ cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueReadBufferRect)(cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_read,
|
||||
+ const size_t * buffer_origin, const size_t * host_origin, const size_t * region,
|
||||
+ size_t buffer_row_pitch, size_t buffer_slice_pitch, size_t host_row_pitch, size_t host_slice_pitch,
|
||||
+ void * ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueWriteBufferRect)(cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_read,
|
||||
+ const size_t * buffer_origin, const size_t * host_origin, const size_t * region,
|
||||
+ size_t buffer_row_pitch, size_t buffer_slice_pitch, size_t host_row_pitch, size_t host_slice_pitch,
|
||||
+ const void * ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclSetEventCallback)(cl_event event, cl_int command_exec_callback_type,
|
||||
+ void (*pfn_notify)(cl_event, cl_int, void *), void *user_data);
|
||||
+static cl_int (*pclSetMemObjectDestructorCallback)(cl_mem memobj, void (*pfn_notify)(cl_mem, void*), void *user_data);
|
||||
+static cl_int (*pclSetUserEventStatus)(cl_event event, cl_int execution_status);
|
||||
+
|
||||
|
||||
static BOOL init_opencl(void);
|
||||
static BOOL load_opencl_func(void);
|
||||
@@ -358,6 +380,18 @@ static BOOL load_opencl_func(void)
|
||||
/* Extension function access */
|
||||
LOAD_FUNCPTR(clGetExtensionFunctionAddress);
|
||||
|
||||
+ /* OpenCL 1.1 functions */
|
||||
+#ifdef CL_VERSION_1_1
|
||||
+ LOAD_FUNCPTR(clCreateSubBuffer);
|
||||
+ LOAD_FUNCPTR(clCreateUserEvent);
|
||||
+ LOAD_FUNCPTR(clEnqueueCopyBufferRect);
|
||||
+ LOAD_FUNCPTR(clEnqueueReadBufferRect);
|
||||
+ LOAD_FUNCPTR(clEnqueueWriteBufferRect);
|
||||
+ LOAD_FUNCPTR(clSetEventCallback);
|
||||
+ LOAD_FUNCPTR(clSetMemObjectDestructorCallback);
|
||||
+ LOAD_FUNCPTR(clSetUserEventStatus);
|
||||
+#endif
|
||||
+
|
||||
#undef LOAD_FUNCPTR
|
||||
|
||||
return TRUE;
|
||||
@@ -648,6 +682,20 @@ cl_mem WINAPI wine_clCreateBuffer(cl_context context, cl_mem_flags flags, size_t
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_mem WINAPI wine_clCreateSubBuffer(cl_mem buffer, cl_mem_flags flags,
|
||||
+ cl_buffer_create_type buffer_create_type, const void * buffer_create_info, cl_int * errcode_ret)
|
||||
+{
|
||||
+ cl_mem ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclCreateSubBuffer)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ ret = pclCreateSubBuffer(buffer, flags, buffer_create_type, buffer_create_info, errcode_ret);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
cl_mem WINAPI wine_clCreateImage2D(cl_context context, cl_mem_flags flags, cl_image_format * image_format,
|
||||
size_t image_width, size_t image_height, size_t image_row_pitch, void * host_ptr, cl_int * errcode_ret)
|
||||
{
|
||||
@@ -725,6 +773,46 @@ cl_int WINAPI wine_clGetImageInfo(cl_mem image, cl_image_info param_name, size_t
|
||||
return ret;
|
||||
}
|
||||
|
||||
+typedef struct
|
||||
+{
|
||||
+ void WINAPI (*pfn_notify)(cl_mem memobj, void* user_data);
|
||||
+ void *user_data;
|
||||
+} MEM_CALLBACK;
|
||||
+
|
||||
+static void mem_fn_notify(cl_mem memobj, void* user_data)
|
||||
+{
|
||||
+ MEM_CALLBACK *mcb;
|
||||
+ FIXME("(%p, %p)\n", memobj, user_data);
|
||||
+ mcb = (MEM_CALLBACK *) user_data;
|
||||
+ mcb->pfn_notify(memobj, mcb->user_data);
|
||||
+ HeapFree(GetProcessHeap(), 0, mcb);
|
||||
+ FIXME("Callback COMPLETED\n");
|
||||
+}
|
||||
+
|
||||
+cl_int WINAPI wine_clSetMemObjectDestructorCallback(cl_mem memobj, void WINAPI (*pfn_notify)(cl_mem, void*), void *user_data)
|
||||
+{
|
||||
+ /* FIXME: Based on PROGRAM_CALLBACK/program_fn_notify function. I'm not sure about this. */
|
||||
+ cl_int ret;
|
||||
+ FIXME("(%p, %p, %p)\n", memobj, pfn_notify, user_data);
|
||||
+ if (!pclSetMemObjectDestructorCallback) return CL_INVALID_VALUE;
|
||||
+ if(pfn_notify)
|
||||
+ {
|
||||
+ /* When pfn_notify is provided, clSetMemObjectDestructorCallback is asynchronous */
|
||||
+ MEM_CALLBACK *mcb;
|
||||
+ mcb = HeapAlloc(GetProcessHeap(), 0, sizeof(MEM_CALLBACK));
|
||||
+ mcb->pfn_notify = pfn_notify;
|
||||
+ mcb->user_data = user_data;
|
||||
+ ret = pclSetMemObjectDestructorCallback(memobj, mem_fn_notify, user_data);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* When pfn_notify is NULL, clSetMemObjectDestructorCallback is synchronous */
|
||||
+ ret = pclSetMemObjectDestructorCallback(memobj, NULL, user_data);
|
||||
+ }
|
||||
+ FIXME("(%p, %p, %p)=%d\n", memobj, pfn_notify, user_data, ret);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
|
||||
/*---------------------------------------------------------------*/
|
||||
/* Sampler APIs */
|
||||
@@ -1009,6 +1097,69 @@ cl_int WINAPI wine_clReleaseEvent(cl_event event)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_event WINAPI wine_clCreateUserEvent(cl_context context, cl_int * errcode_ret)
|
||||
+{
|
||||
+ cl_event ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclCreateUserEvent)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_CONTEXT;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ ret = pclCreateUserEvent(context, errcode_ret);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+typedef struct
|
||||
+{
|
||||
+ void WINAPI (*pfn_notify)(cl_event event, cl_int num, void* user_data);
|
||||
+ void *user_data;
|
||||
+} EVENT_CALLBACK;
|
||||
+
|
||||
+static void event_fn_notify(cl_event event, cl_int num, void* user_data)
|
||||
+{
|
||||
+ EVENT_CALLBACK *ecb;
|
||||
+ FIXME("(%p, %d, %p)\n", event, num, user_data);
|
||||
+ ecb = (EVENT_CALLBACK *) user_data;
|
||||
+ ecb->pfn_notify(event, num, ecb->user_data);
|
||||
+ HeapFree(GetProcessHeap(), 0, ecb);
|
||||
+ FIXME("Callback COMPLETED\n");
|
||||
+}
|
||||
+
|
||||
+cl_int WINAPI wine_clSetEventCallback(cl_event event, cl_int command_exec_callback_type,
|
||||
+ void WINAPI (*pfn_notify)(cl_event, cl_int, void *), void *user_data)
|
||||
+{
|
||||
+ /* FIXME: Based on PROGRAM_CALLBACK/program_fn_notify function. I'm not sure about this. */
|
||||
+ cl_int ret;
|
||||
+ FIXME("(%p, %d, %p, %p)\n", event, command_exec_callback_type, pfn_notify, user_data);
|
||||
+ if (!pclSetEventCallback) return CL_INVALID_EVENT;
|
||||
+ if(pfn_notify)
|
||||
+ {
|
||||
+ /* When pfn_notify is provided, clSetEventCallback is asynchronous */
|
||||
+ EVENT_CALLBACK *ecb;
|
||||
+ ecb = HeapAlloc(GetProcessHeap(), 0, sizeof(EVENT_CALLBACK));
|
||||
+ ecb->pfn_notify = pfn_notify;
|
||||
+ ecb->user_data = user_data;
|
||||
+ ret = pclSetEventCallback(event, command_exec_callback_type, event_fn_notify, user_data);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* When pfn_notify is NULL, clSetEventCallback is synchronous */
|
||||
+ ret = pclSetEventCallback(event, command_exec_callback_type, NULL, user_data);
|
||||
+ }
|
||||
+ FIXME("(%p, %d, %p, %p)=%d\n", event, command_exec_callback_type, pfn_notify, user_data, ret);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+cl_int WINAPI wine_clSetUserEventStatus(cl_event event, cl_int execution_status)
|
||||
+{
|
||||
+ cl_int ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclSetUserEventStatus) return CL_INVALID_EVENT;
|
||||
+ ret = pclSetUserEventStatus(event, execution_status);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
|
||||
/*---------------------------------------------------------------*/
|
||||
/* Profiling APIs */
|
||||
@@ -1062,6 +1213,21 @@ cl_int WINAPI wine_clEnqueueReadBuffer(cl_command_queue command_queue, cl_mem bu
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_int WINAPI wine_clEnqueueReadBufferRect(cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_read,
|
||||
+ const size_t * buffer_origin, const size_t * host_origin, const size_t * region,
|
||||
+ size_t buffer_row_pitch, size_t buffer_slice_pitch, size_t host_row_pitch, size_t host_slice_pitch,
|
||||
+ void * ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event)
|
||||
+{
|
||||
+ cl_int ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclEnqueueReadBufferRect) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueReadBufferRect(command_queue, buffer, blocking_read,
|
||||
+ buffer_origin, host_origin, region,
|
||||
+ buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch,
|
||||
+ ptr, num_events_in_wait_list, event_wait_list, event);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
cl_int WINAPI wine_clEnqueueWriteBuffer(cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_write,
|
||||
size_t offset, size_t cb, const void * ptr,
|
||||
cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event)
|
||||
@@ -1073,6 +1239,21 @@ cl_int WINAPI wine_clEnqueueWriteBuffer(cl_command_queue command_queue, cl_mem b
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_int WINAPI wine_clEnqueueWriteBufferRect( cl_command_queue command_queue, cl_mem buffer, cl_bool blocking_read,
|
||||
+ const size_t * buffer_origin, const size_t * host_origin, const size_t * region,
|
||||
+ size_t buffer_row_pitch, size_t buffer_slice_pitch, size_t host_row_pitch, size_t host_slice_pitch,
|
||||
+ const void * ptr, cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event)
|
||||
+{
|
||||
+ cl_int ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclEnqueueWriteBufferRect) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueWriteBufferRect(command_queue, buffer, blocking_read,
|
||||
+ buffer_origin, host_origin, region,
|
||||
+ buffer_row_pitch, buffer_slice_pitch, host_row_pitch, host_slice_pitch,
|
||||
+ ptr, num_events_in_wait_list, event_wait_list, event);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
cl_int WINAPI wine_clEnqueueCopyBuffer(cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_buffer,
|
||||
size_t src_offset, size_t dst_offset, size_t cb,
|
||||
cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event)
|
||||
@@ -1084,6 +1265,19 @@ cl_int WINAPI wine_clEnqueueCopyBuffer(cl_command_queue command_queue, cl_mem sr
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_int WINAPI wine_clEnqueueCopyBufferRect(cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_buffer,
|
||||
+ const size_t * src_origin, const size_t * dst_origin, const size_t * region,
|
||||
+ size_t src_row_pitch, size_t src_slice_pitch,
|
||||
+ size_t dst_row_pitch, size_t dst_slice_pitch,
|
||||
+ cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event)
|
||||
+{
|
||||
+ cl_int ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclEnqueueCopyBufferRect) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueCopyBufferRect(command_queue, src_buffer, dst_buffer, src_origin, dst_origin, region, src_row_pitch, src_slice_pitch, dst_row_pitch, dst_slice_pitch, num_events_in_wait_list, event_wait_list, event);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
cl_int WINAPI wine_clEnqueueReadImage(cl_command_queue command_queue, cl_mem image, cl_bool blocking_read,
|
||||
const size_t * origin, const size_t * region,
|
||||
SIZE_T row_pitch, SIZE_T slice_pitch, void * ptr,
|
||||
diff --git a/dlls/opencl/opencl.spec b/dlls/opencl/opencl.spec
|
||||
index ba8ce6e..4782653 100644
|
||||
--- a/dlls/opencl/opencl.spec
|
||||
+++ b/dlls/opencl/opencl.spec
|
||||
@@ -94,3 +94,13 @@
|
||||
# @ stdcall clGetGLTextureInfo( long long long ptr ptr ) wine_clGetGLTextureInfo
|
||||
# @ stdcall clEnqueueAcquireGLObjects( long long ptr long ptr ptr ) wine_clEnqueueAcquireGLObjects
|
||||
# @ stdcall clEnqueueReleaseGLObjects( long long ptr long ptr ptr ) wine_clEnqueueReleaseGLObjects
|
||||
+
|
||||
+# OpenCL 1.1
|
||||
+@ stdcall clCreateSubBuffer( long long long ptr ptr ) wine_clCreateSubBuffer
|
||||
+@ stdcall clCreateUserEvent( long ptr ) wine_clCreateUserEvent
|
||||
+@ stdcall clEnqueueCopyBufferRect( long long long ptr ptr ptr long long long long long ptr ptr ) wine_clEnqueueCopyBufferRect
|
||||
+@ stdcall clEnqueueReadBufferRect( long long long ptr ptr ptr long long long long ptr long ptr ptr ) wine_clEnqueueReadBufferRect
|
||||
+@ stdcall clEnqueueWriteBufferRect( long long long ptr ptr ptr long long long long ptr long ptr ptr ) wine_clEnqueueWriteBufferRect
|
||||
+@ stdcall clSetEventCallback( long long ptr ptr ) wine_clSetEventCallback
|
||||
+@ stdcall clSetMemObjectDestructorCallback( long ptr ptr ) wine_clSetMemObjectDestructorCallback
|
||||
+@ stdcall clSetUserEventStatus( long long ) wine_clSetUserEventStatus
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,391 +0,0 @@
|
||||
From da060b9c27b02dfa808185ec7938899b7839e942 Mon Sep 17 00:00:00 2001
|
||||
From: Nakarin Khankham <garuda2550@gmail.com>
|
||||
Date: Sat, 9 Mar 2019 22:27:52 +0700
|
||||
Subject: [PATCH 4/5] opencl: Add OpenCL 1.2 implementation.
|
||||
|
||||
Signed-off-by: Nakarin Khankham <garuda2550@gmail.com>
|
||||
---
|
||||
dlls/opencl/opencl.c | 252 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
dlls/opencl/opencl.spec | 18 ++++
|
||||
2 files changed, 270 insertions(+)
|
||||
|
||||
diff --git a/dlls/opencl/opencl.c b/dlls/opencl/opencl.c
|
||||
index 41fc71b..fccc45c 100644
|
||||
--- a/dlls/opencl/opencl.c
|
||||
+++ b/dlls/opencl/opencl.c
|
||||
@@ -218,6 +218,39 @@ static cl_int (*pclSetEventCallback)(cl_event event, cl_int command_exec_callbac
|
||||
static cl_int (*pclSetMemObjectDestructorCallback)(cl_mem memobj, void (*pfn_notify)(cl_mem, void*), void *user_data);
|
||||
static cl_int (*pclSetUserEventStatus)(cl_event event, cl_int execution_status);
|
||||
|
||||
+/* OpenCL 1.2 functions */
|
||||
+static cl_int (*pclCompileProgram)(cl_program program, cl_uint num_devices, const cl_device_id * device_list, const char * options,
|
||||
+ cl_uint num_input_headers, const cl_program * input_headers, const char ** header_include_names,
|
||||
+ void (*pfn_notify)(cl_program program, void * user_data),
|
||||
+ void * user_data);
|
||||
+static cl_mem (*pclCreateImage)(cl_context context, cl_mem_flags flags,
|
||||
+ const cl_image_format * image_format, const cl_image_desc * image_desc, void * host_ptr, cl_int * errcode_ret);
|
||||
+static cl_program (*pclCreateProgramWithBuiltInKernels)(cl_context context, cl_uint num_devices, const cl_device_id * device_list,
|
||||
+ const char * kernel_names, cl_int * errcode_ret);
|
||||
+static cl_int (*pclCreateSubDevices)(cl_device_id in_device, const cl_device_partition_property * properties, cl_uint num_entries,
|
||||
+ cl_device_id * out_devices, cl_uint * num_devices);
|
||||
+static cl_int (*pclEnqueueBarrierWithWaitList)(cl_command_queue command_queue, cl_uint num_events_in_wait_list,
|
||||
+ const cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueFillBuffer)(cl_command_queue command_queue, cl_mem buffer, const void * pattern, size_t pattern_size, size_t offset, size_t cb,
|
||||
+ cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueFillImage)(cl_command_queue command_queue, cl_mem image, const void * fill_color,
|
||||
+ const size_t * origin, const size_t * region,
|
||||
+ cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueMarkerWithWaitList)(cl_command_queue command_queue, cl_uint num_events_in_wait_list,
|
||||
+ const cl_event * event_wait_list, cl_event * event);
|
||||
+static cl_int (*pclEnqueueMigrateMemObjects)(cl_command_queue command_queue, cl_uint num_mem_objects, const cl_mem * mem_objects, cl_mem_migration_flags flags,
|
||||
+ cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event);
|
||||
+static void * (*pclGetExtensionFunctionAddressForPlatform)(cl_platform_id platform, const char * function_name);
|
||||
+static cl_int (*pclGetKernelArgInfo)(cl_kernel kernel, cl_uint arg_indx, cl_kernel_arg_info param_name,
|
||||
+ size_t param_value_size, void * param_value, size_t * param_value_size_ret);
|
||||
+static cl_program (*pclLinkProgram)(cl_context context, cl_uint num_devices, const cl_device_id * device_list, const char * options,
|
||||
+ cl_uint num_input_programs, const cl_program * input_programs,
|
||||
+ void (* pfn_notify)(cl_program program, void * user_data),
|
||||
+ void * user_data, cl_int * errcode_ret);
|
||||
+static cl_int (*pclReleaseDevice)(cl_device_id device);
|
||||
+static cl_int (*pclRetainDevice)(cl_device_id device);
|
||||
+static cl_int (*pclUnloadPlatformCompiler)(cl_platform_id platform);
|
||||
+
|
||||
|
||||
static BOOL init_opencl(void);
|
||||
static BOOL load_opencl_func(void);
|
||||
@@ -392,6 +425,26 @@ static BOOL load_opencl_func(void)
|
||||
LOAD_FUNCPTR(clSetUserEventStatus);
|
||||
#endif
|
||||
|
||||
+ /* OpenCL 1.2 functions */
|
||||
+#ifdef CL_VERSION_1_2
|
||||
+ LOAD_FUNCPTR(clCompileProgram);
|
||||
+ /*LOAD_FUNCPTR(clCreateFromGLTexture);*/
|
||||
+ LOAD_FUNCPTR(clCreateImage);
|
||||
+ LOAD_FUNCPTR(clCreateProgramWithBuiltInKernels);
|
||||
+ LOAD_FUNCPTR(clCreateSubDevices);
|
||||
+ LOAD_FUNCPTR(clEnqueueBarrierWithWaitList);
|
||||
+ LOAD_FUNCPTR(clEnqueueFillBuffer);
|
||||
+ LOAD_FUNCPTR(clEnqueueFillImage);
|
||||
+ LOAD_FUNCPTR(clEnqueueMarkerWithWaitList);
|
||||
+ LOAD_FUNCPTR(clEnqueueMigrateMemObjects);
|
||||
+ LOAD_FUNCPTR(clGetExtensionFunctionAddressForPlatform);
|
||||
+ LOAD_FUNCPTR(clGetKernelArgInfo);
|
||||
+ LOAD_FUNCPTR(clLinkProgram);
|
||||
+ LOAD_FUNCPTR(clReleaseDevice);
|
||||
+ LOAD_FUNCPTR(clRetainDevice);
|
||||
+ LOAD_FUNCPTR(clUnloadPlatformCompiler);
|
||||
+#endif
|
||||
+
|
||||
#undef LOAD_FUNCPTR
|
||||
|
||||
return TRUE;
|
||||
@@ -507,6 +560,38 @@ cl_int WINAPI wine_clGetDeviceInfo(cl_device_id device, cl_device_info param_nam
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_int WINAPI wine_clCreateSubDevices(cl_device_id in_device, const cl_device_partition_property * properties, cl_uint num_entries,
|
||||
+ cl_device_id * out_devices, cl_uint * num_devices)
|
||||
+{
|
||||
+ cl_int ret;
|
||||
+ TRACE("(%p, %p, %d, %p, %p)\n", in_device, properties, num_entries, out_devices, num_devices);
|
||||
+ if (!pclCreateSubDevices) return CL_INVALID_VALUE;
|
||||
+ ret = pclCreateSubDevices(in_device, properties, num_entries, out_devices, num_devices);
|
||||
+ TRACE("(%p, %p, %d, %p, %p)=%d\n", in_device, properties, num_entries, out_devices, num_devices, ret);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+cl_int WINAPI wine_clRetainDevice(cl_device_id device)
|
||||
+{
|
||||
+ cl_int ret;
|
||||
+ TRACE("(%p)\n", device);
|
||||
+ if (!pclRetainDevice) return CL_INVALID_DEVICE;
|
||||
+ ret = pclRetainDevice(device);
|
||||
+ TRACE("(%p)=%d\n", device, ret);
|
||||
+ return ret;
|
||||
+
|
||||
+}
|
||||
+
|
||||
+cl_int WINAPI wine_clReleaseDevice(cl_device_id device)
|
||||
+{
|
||||
+ cl_int ret;
|
||||
+ TRACE("(%p)\n", device);
|
||||
+ if (!pclReleaseDevice) return CL_INVALID_DEVICE;
|
||||
+ ret = pclReleaseDevice(device);
|
||||
+ TRACE("(%p)=%d\n", device, ret);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
|
||||
/*---------------------------------------------------------------*/
|
||||
/* Context APIs */
|
||||
@@ -696,6 +781,20 @@ cl_mem WINAPI wine_clCreateSubBuffer(cl_mem buffer, cl_mem_flags flags,
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_mem WINAPI wine_clCreateImage(cl_context context, cl_mem_flags flags,
|
||||
+ const cl_image_format * image_format, const cl_image_desc * image_desc, void * host_ptr, cl_int * errcode_ret)
|
||||
+{
|
||||
+ cl_mem ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclCreateImage)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ ret = pclCreateImage(context, flags, image_format, image_desc, host_ptr, errcode_ret);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
cl_mem WINAPI wine_clCreateImage2D(cl_context context, cl_mem_flags flags, cl_image_format * image_format,
|
||||
size_t image_width, size_t image_height, size_t image_row_pitch, void * host_ptr, cl_int * errcode_ret)
|
||||
{
|
||||
@@ -892,6 +991,20 @@ cl_program WINAPI wine_clCreateProgramWithBinary(cl_context context, cl_uint num
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_program WINAPI wine_clCreateProgramWithBuiltInKernels(cl_context context, cl_uint num_devices, const cl_device_id * device_list,
|
||||
+ const char * kernel_names, cl_int * errcode_ret)
|
||||
+{
|
||||
+ cl_program ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclCreateProgramWithBuiltInKernels)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ ret = pclCreateProgramWithBuiltInKernels(context, num_devices, device_list, kernel_names, errcode_ret);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
cl_int WINAPI wine_clRetainProgram(cl_program program)
|
||||
{
|
||||
cl_int ret;
|
||||
@@ -950,6 +1063,60 @@ cl_int WINAPI wine_clBuildProgram(cl_program program, cl_uint num_devices, const
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_int WINAPI wine_clCompileProgram(cl_program program, cl_uint num_devices, const cl_device_id * device_list, const char * options,
|
||||
+ cl_uint num_input_headers, const cl_program * input_headers, const char ** header_include_names,
|
||||
+ void WINAPI (*pfn_notify)(cl_program program, void * user_data),
|
||||
+ void * user_data)
|
||||
+{
|
||||
+ cl_int ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclCompileProgram) return CL_INVALID_VALUE;
|
||||
+ if(pfn_notify)
|
||||
+ {
|
||||
+ /* When pfn_notify is provided, clCompileProgram is asynchronous */
|
||||
+ PROGRAM_CALLBACK *pcb;
|
||||
+ pcb = HeapAlloc(GetProcessHeap(), 0, sizeof(PROGRAM_CALLBACK));
|
||||
+ pcb->pfn_notify = pfn_notify;
|
||||
+ pcb->user_data = user_data;
|
||||
+ ret = pclCompileProgram(program, num_devices, device_list, options, num_input_headers, input_headers, header_include_names, program_fn_notify, user_data);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* When pfn_notify is NULL, clCompileProgram is synchronous */
|
||||
+ ret = pclCompileProgram(program, num_devices, device_list, options, num_input_headers, input_headers, header_include_names, NULL, user_data);
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+cl_program WINAPI wine_clLinkProgram(cl_context context, cl_uint num_devices, const cl_device_id * device_list, const char * options,
|
||||
+ cl_uint num_input_programs, const cl_program * input_programs,
|
||||
+ void WINAPI (* pfn_notify)(cl_program program, void * user_data),
|
||||
+ void * user_data, cl_int * errcode_ret)
|
||||
+{
|
||||
+ cl_program ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclLinkProgram)
|
||||
+ {
|
||||
+ *errcode_ret = CL_INVALID_VALUE;
|
||||
+ return NULL;
|
||||
+ }
|
||||
+ if(pfn_notify)
|
||||
+ {
|
||||
+ /* When pfn_notify is provided, clLinkProgram is asynchronous */
|
||||
+ PROGRAM_CALLBACK *pcb;
|
||||
+ pcb = HeapAlloc(GetProcessHeap(), 0, sizeof(PROGRAM_CALLBACK));
|
||||
+ pcb->pfn_notify = pfn_notify;
|
||||
+ pcb->user_data = user_data;
|
||||
+ ret = pclLinkProgram(context, num_devices, device_list, options, num_input_programs, input_programs, program_fn_notify, user_data, errcode_ret);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ /* When pfn_notify is NULL, clLinkProgram is synchronous */
|
||||
+ ret = pclLinkProgram(context, num_devices, device_list, options, num_input_programs, input_programs, NULL, user_data, errcode_ret);
|
||||
+ }
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
cl_int WINAPI wine_clUnloadCompiler(void)
|
||||
{
|
||||
cl_int ret;
|
||||
@@ -960,6 +1127,16 @@ cl_int WINAPI wine_clUnloadCompiler(void)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_int WINAPI wine_clUnloadPlatformCompiler(cl_platform_id platform)
|
||||
+{
|
||||
+ cl_int ret;
|
||||
+ TRACE("()\n");
|
||||
+ if (!pclUnloadPlatformCompiler) return CL_SUCCESS;
|
||||
+ ret = pclUnloadPlatformCompiler(platform);
|
||||
+ TRACE("()=%d\n", ret);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
cl_int WINAPI wine_clGetProgramInfo(cl_program program, cl_program_info param_name,
|
||||
size_t param_value_size, void * param_value, size_t * param_value_size_ret)
|
||||
{
|
||||
@@ -1035,6 +1212,16 @@ cl_int WINAPI wine_clSetKernelArg(cl_kernel kernel, cl_uint arg_index, size_t ar
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_int WINAPI wine_clGetKernelArgInfo(cl_kernel kernel, cl_uint arg_indx, cl_kernel_arg_info param_name,
|
||||
+ size_t param_value_size, void * param_value, size_t * param_value_size_ret)
|
||||
+{
|
||||
+ cl_int ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclGetKernelArgInfo) return CL_INVALID_VALUE;
|
||||
+ ret = pclGetKernelArgInfo(kernel, arg_indx, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
cl_int WINAPI wine_clGetKernelInfo(cl_kernel kernel, cl_kernel_info param_name,
|
||||
size_t param_value_size, void * param_value, size_t * param_value_size_ret)
|
||||
{
|
||||
@@ -1254,6 +1441,16 @@ cl_int WINAPI wine_clEnqueueWriteBufferRect( cl_command_queue command_queue, cl_
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_int WINAPI wine_clEnqueueFillBuffer(cl_command_queue command_queue, cl_mem buffer, const void * pattern, size_t pattern_size, size_t offset, size_t cb,
|
||||
+ cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event)
|
||||
+{
|
||||
+ cl_int ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclEnqueueFillBuffer) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueFillBuffer(command_queue, buffer, pattern, pattern_size, offset, cb, num_events_in_wait_list, event_wait_list, event);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
cl_int WINAPI wine_clEnqueueCopyBuffer(cl_command_queue command_queue, cl_mem src_buffer, cl_mem dst_buffer,
|
||||
size_t src_offset, size_t dst_offset, size_t cb,
|
||||
cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event)
|
||||
@@ -1305,6 +1502,17 @@ cl_int WINAPI wine_clEnqueueWriteImage(cl_command_queue command_queue, cl_mem im
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_int WINAPI wine_clEnqueueFillImage(cl_command_queue command_queue, cl_mem image, const void * fill_color,
|
||||
+ const size_t * origin, const size_t * region,
|
||||
+ cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event)
|
||||
+{
|
||||
+ cl_int ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclEnqueueFillImage) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueFillImage(command_queue, image, fill_color, origin, region, num_events_in_wait_list, event_wait_list, event);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
cl_int WINAPI wine_clEnqueueCopyImage(cl_command_queue command_queue, cl_mem src_image, cl_mem dst_image,
|
||||
size_t * src_origin, size_t * dst_origin, size_t * region,
|
||||
cl_uint num_events_in_wait_list, cl_event * event_wait_list, cl_event * event)
|
||||
@@ -1379,6 +1587,16 @@ cl_int WINAPI wine_clEnqueueUnmapMemObject(cl_command_queue command_queue, cl_me
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_int WINAPI wine_clEnqueueMigrateMemObjects(cl_command_queue command_queue, cl_uint num_mem_objects, const cl_mem * mem_objects, cl_mem_migration_flags flags,
|
||||
+ cl_uint num_events_in_wait_list, const cl_event * event_wait_list, cl_event * event)
|
||||
+{
|
||||
+ cl_int ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclEnqueueMigrateMemObjects) return CL_INVALID_VALUE;
|
||||
+ ret = pclEnqueueMigrateMemObjects(command_queue, num_mem_objects, mem_objects, flags, num_events_in_wait_list, event_wait_list, event);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
cl_int WINAPI wine_clEnqueueNDRangeKernel(cl_command_queue command_queue, cl_kernel kernel, cl_uint work_dim,
|
||||
size_t * global_work_offset, size_t * global_work_size, size_t * local_work_size,
|
||||
cl_uint num_events_in_wait_list, cl_event * event_wait_list, cl_event * event)
|
||||
@@ -1430,6 +1648,16 @@ cl_int WINAPI wine_clEnqueueMarker(cl_command_queue command_queue, cl_event * ev
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_int WINAPI wine_clEnqueueMarkerWithWaitList(cl_command_queue command_queue, cl_uint num_events_in_wait_list,
|
||||
+ const cl_event * event_wait_list, cl_event * event)
|
||||
+{
|
||||
+ cl_int ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclEnqueueMarkerWithWaitList) return CL_INVALID_COMMAND_QUEUE;
|
||||
+ ret = pclEnqueueMarkerWithWaitList(command_queue, num_events_in_wait_list, event_wait_list, event);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
cl_int WINAPI wine_clEnqueueWaitForEvents(cl_command_queue command_queue, cl_uint num_events, cl_event * event_list)
|
||||
{
|
||||
cl_int ret;
|
||||
@@ -1448,10 +1676,34 @@ cl_int WINAPI wine_clEnqueueBarrier(cl_command_queue command_queue)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+cl_int WINAPI wine_clEnqueueBarrierWithWaitList(cl_command_queue command_queue, cl_uint num_events_in_wait_list,
|
||||
+ const cl_event * event_wait_list, cl_event * event)
|
||||
+{
|
||||
+ cl_int ret;
|
||||
+ TRACE("\n");
|
||||
+ if (!pclEnqueueBarrierWithWaitList) return CL_INVALID_COMMAND_QUEUE;
|
||||
+ ret = pclEnqueueBarrierWithWaitList(command_queue, num_events_in_wait_list, event_wait_list, event);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
|
||||
/*---------------------------------------------------------------*/
|
||||
/* Extension function access */
|
||||
|
||||
+void * WINAPI wine_clGetExtensionFunctionAddressForPlatform(cl_platform_id platform, const char * function_name)
|
||||
+{
|
||||
+ void * ret = NULL;
|
||||
+ TRACE("(%p, %s)\n", platform, function_name);
|
||||
+#if 0
|
||||
+ if (!pclGetExtensionFunctionAddressForPlatform) return NULL;
|
||||
+ ret = pclGetExtensionFunctionAddressForPlatform(platform, function_name);
|
||||
+#else
|
||||
+ FIXME("(%p, %s), extensions support is not implemented\n", platform, function_name);
|
||||
+#endif
|
||||
+ TRACE("(%p, %s)=%p\n", platform, function_name, ret);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
void * WINAPI wine_clGetExtensionFunctionAddress(const char * func_name)
|
||||
{
|
||||
void * ret = 0;
|
||||
diff --git a/dlls/opencl/opencl.spec b/dlls/opencl/opencl.spec
|
||||
index 4782653..60dda4d 100644
|
||||
--- a/dlls/opencl/opencl.spec
|
||||
+++ b/dlls/opencl/opencl.spec
|
||||
@@ -104,3 +104,21 @@
|
||||
@ stdcall clSetEventCallback( long long ptr ptr ) wine_clSetEventCallback
|
||||
@ stdcall clSetMemObjectDestructorCallback( long ptr ptr ) wine_clSetMemObjectDestructorCallback
|
||||
@ stdcall clSetUserEventStatus( long long ) wine_clSetUserEventStatus
|
||||
+
|
||||
+# OpenCL 1.2
|
||||
+@ stdcall clCompileProgram( long long ptr str long ptr ptr ptr ptr ) wine_clCompileProgram
|
||||
+@ stub clCreateFromGLTexture
|
||||
+@ stdcall clCreateImage( long long ptr ptr ptr ptr ) wine_clCreateImage
|
||||
+@ stdcall clCreateProgramWithBuiltInKernels( long long ptr str ptr ) wine_clCreateProgramWithBuiltInKernels
|
||||
+@ stdcall clCreateSubDevices( long ptr long ptr ptr ) wine_clCreateSubDevices
|
||||
+@ stdcall clEnqueueBarrierWithWaitList( long long ptr ptr ) wine_clEnqueueBarrierWithWaitList
|
||||
+@ stdcall clEnqueueFillBuffer( long long ptr long long long long ptr ptr ) wine_clEnqueueFillBuffer
|
||||
+@ stdcall clEnqueueFillImage( long long ptr ptr ptr long ptr ptr ) wine_clEnqueueFillImage
|
||||
+@ stdcall clEnqueueMarkerWithWaitList( long long ptr ptr ) wine_clEnqueueMarkerWithWaitList
|
||||
+@ stdcall clEnqueueMigrateMemObjects( long long ptr long long ptr ptr ) wine_clEnqueueMigrateMemObjects
|
||||
+@ stdcall clGetExtensionFunctionAddressForPlatform( long str ) wine_clGetExtensionFunctionAddressForPlatform
|
||||
+@ stdcall clGetKernelArgInfo( long long long long ptr ptr ) wine_clGetKernelArgInfo
|
||||
+@ stdcall clLinkProgram( long long ptr str long ptr ptr ptr ptr ) wine_clLinkProgram
|
||||
+@ stdcall clReleaseDevice( long ) wine_clReleaseDevice
|
||||
+@ stdcall clRetainDevice( long ) wine_clRetainDevice
|
||||
+@ stdcall clUnloadPlatformCompiler( long ) wine_clUnloadPlatformCompiler
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,55 +0,0 @@
|
||||
From e7d44cc8b01ba8b3b54c79d4eaf5ea674ac4e997 Mon Sep 17 00:00:00 2001
|
||||
From: Nakarin Khankham <garuda2550@gmail.com>
|
||||
Date: Sat, 9 Mar 2019 22:40:55 +0700
|
||||
Subject: [PATCH 5/5] opencl: Expose all extensions list to wine.
|
||||
|
||||
Ideally we should blacklist each extensions instead.
|
||||
|
||||
Signed-off-by: Nakarin Khankham <garuda2550@gmail.com>
|
||||
---
|
||||
dlls/opencl/opencl.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/opencl/opencl.c b/dlls/opencl/opencl.c
|
||||
index fccc45c..d028bcd 100644
|
||||
--- a/dlls/opencl/opencl.c
|
||||
+++ b/dlls/opencl/opencl.c
|
||||
@@ -475,7 +475,7 @@ cl_int WINAPI wine_clGetPlatformInfo(cl_platform_id platform, cl_platform_info p
|
||||
/* Hide all extensions.
|
||||
* TODO: Add individual extension support as needed.
|
||||
*/
|
||||
- if (param_name == CL_PLATFORM_EXTENSIONS)
|
||||
+/* if (param_name == CL_PLATFORM_EXTENSIONS)
|
||||
{
|
||||
ret = CL_INVALID_VALUE;
|
||||
|
||||
@@ -492,7 +492,7 @@ cl_int WINAPI wine_clGetPlatformInfo(cl_platform_id platform, cl_platform_info p
|
||||
ret = CL_SUCCESS;
|
||||
}
|
||||
}
|
||||
- else
|
||||
+ else*/
|
||||
{
|
||||
ret = pclGetPlatformInfo(platform, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
}
|
||||
@@ -527,7 +527,7 @@ cl_int WINAPI wine_clGetDeviceInfo(cl_device_id device, cl_device_info param_nam
|
||||
/* Hide all extensions.
|
||||
* TODO: Add individual extension support as needed.
|
||||
*/
|
||||
- if (param_name == CL_DEVICE_EXTENSIONS)
|
||||
+/* if (param_name == CL_DEVICE_EXTENSIONS)
|
||||
{
|
||||
ret = CL_INVALID_VALUE;
|
||||
|
||||
@@ -544,7 +544,7 @@ cl_int WINAPI wine_clGetDeviceInfo(cl_device_id device, cl_device_info param_nam
|
||||
ret = CL_SUCCESS;
|
||||
}
|
||||
}
|
||||
- else
|
||||
+ else*/
|
||||
{
|
||||
ret = pclGetDeviceInfo(device, param_name, param_value_size, param_value, param_value_size_ret);
|
||||
}
|
||||
--
|
||||
1.9.1
|
||||
|
@ -1,3 +0,0 @@
|
||||
Fixes: [46470] opencl: Add support for OpenCL 1.2.
|
||||
# In the process of upstreaming.
|
||||
Disabled: true
|
@ -1,53 +0,0 @@
|
||||
From e6de4311bc082beedabf8aec5d43ab03c009e0b5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Tue, 13 Oct 2020 17:59:51 +0200
|
||||
Subject: [PATCH] windows.gaming.input: Fake empty IGamepadStatics::Gamepads
|
||||
vector.
|
||||
|
||||
---
|
||||
.../windows.gaming.input_main.c | 11 +++++++----
|
||||
1 file changed, 7 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
index 444eb687175..0df7927a57b 100644
|
||||
--- a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
+++ b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
@@ -112,28 +112,31 @@ static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetAt(
|
||||
IVectorView_Gamepad *iface, ULONG index, IGamepad **value)
|
||||
{
|
||||
FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value);
|
||||
- return E_NOTIMPL;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE vector_view_gamepad_get_Size(
|
||||
IVectorView_Gamepad *iface, ULONG *value)
|
||||
{
|
||||
FIXME("iface %p, value %p stub!\n", iface, value);
|
||||
- return E_NOTIMPL;
|
||||
+ *value = 0;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE vector_view_gamepad_IndexOf(
|
||||
IVectorView_Gamepad *iface, IGamepad *element, ULONG *index, BOOLEAN *value)
|
||||
{
|
||||
FIXME("iface %p, element %p, index %p, value %p stub!\n", iface, element, index, value);
|
||||
- return E_NOTIMPL;
|
||||
+ *value = FALSE;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE vector_view_gamepad_GetMany(
|
||||
IVectorView_Gamepad *iface, ULONG start_index, IGamepad **items, UINT *value)
|
||||
{
|
||||
FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value);
|
||||
- return E_NOTIMPL;
|
||||
+ *value = 0;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static const struct IVectorView_GamepadVtbl vector_view_gamepad_vtbl =
|
||||
--
|
||||
2.20.1
|
||||
|
@ -1,49 +0,0 @@
|
||||
From 9ea954d5306aa3240584c86fff56972b718fd605 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Tue, 13 Oct 2020 17:57:05 +0200
|
||||
Subject: [PATCH] windows.gaming.input: Fake IEventHandler_Gamepad support.
|
||||
|
||||
---
|
||||
dlls/windows.gaming.input.dll/windows.gaming.input_main.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
index 0df7927a57b..dec9d39e7a3 100644
|
||||
--- a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
+++ b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
@@ -215,28 +215,28 @@ static HRESULT STDMETHODCALLTYPE gamepad_statics_add_GamepadAdded(
|
||||
IGamepadStatics *iface, IEventHandler_Gamepad *value, EventRegistrationToken* token)
|
||||
{
|
||||
FIXME("iface %p, value %p, token %p stub!\n", iface, value, token);
|
||||
- return E_NOTIMPL;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE gamepad_statics_remove_GamepadAdded(
|
||||
IGamepadStatics *iface, EventRegistrationToken token)
|
||||
{
|
||||
FIXME("iface %p, token %#I64x stub!\n", iface, token.value);
|
||||
- return E_NOTIMPL;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE gamepad_statics_add_GamepadRemoved(
|
||||
IGamepadStatics *iface, IEventHandler_Gamepad *value, EventRegistrationToken* token)
|
||||
{
|
||||
FIXME("iface %p, value %p, token %p stub!\n", iface, value, token);
|
||||
- return E_NOTIMPL;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE gamepad_statics_remove_GamepadRemoved(
|
||||
IGamepadStatics *iface, EventRegistrationToken token)
|
||||
{
|
||||
FIXME("iface %p, token %#I64x stub!\n", iface, token.value);
|
||||
- return E_NOTIMPL;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE gamepad_statics_get_Gamepads(
|
||||
--
|
||||
2.20.1
|
||||
|
@ -1,799 +0,0 @@
|
||||
From 1f15403b2743fa55e204fd42049df117acee6e78 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Mon, 12 Oct 2020 12:50:32 +0200
|
||||
Subject: [PATCH] windows.gaming.input: Implement IRawGameControllerStatics
|
||||
stubs.
|
||||
|
||||
---
|
||||
.../windows.gaming.input_main.c | 130 ++++++++++++
|
||||
include/Makefile.in | 3 +
|
||||
include/asyncinfo.idl | 45 ++++
|
||||
include/windows.foundation.collections.idl | 21 +-
|
||||
include/windows.foundation.idl | 11 +-
|
||||
.../windows.gaming.input.forcefeedback.idl | 111 ++++++++++
|
||||
include/windows.gaming.input.idl | 195 ++++++++++++++++++
|
||||
include/windows.system.idl | 70 +++++++
|
||||
loader/wine.inf.in | 1 +
|
||||
9 files changed, 585 insertions(+), 2 deletions(-)
|
||||
create mode 100644 include/asyncinfo.idl
|
||||
create mode 100644 include/windows.gaming.input.forcefeedback.idl
|
||||
create mode 100644 include/windows.system.idl
|
||||
|
||||
diff --git a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
index dec9d39e7a3..1a40a8ddc35 100644
|
||||
--- a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
+++ b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
@@ -31,6 +31,7 @@ struct windows_gaming_input
|
||||
{
|
||||
IActivationFactory IActivationFactory_iface;
|
||||
IGamepadStatics IGamepadStatics_iface;
|
||||
+ IRawGameControllerStatics IRawGameControllerStatics_iface;
|
||||
IVectorView_Gamepad IVectorView_Gamepad_iface;
|
||||
LONG ref;
|
||||
};
|
||||
@@ -45,6 +46,11 @@ static inline struct windows_gaming_input *impl_from_IGamepadStatics(IGamepadSta
|
||||
return CONTAINING_RECORD(iface, struct windows_gaming_input, IGamepadStatics_iface);
|
||||
}
|
||||
|
||||
+static inline struct windows_gaming_input *impl_from_IRawGameControllerStatics(IRawGameControllerStatics *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct windows_gaming_input, IRawGameControllerStatics_iface);
|
||||
+}
|
||||
+
|
||||
static inline struct windows_gaming_input *impl_from_IVectorView_Gamepad(IVectorView_Gamepad *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, struct windows_gaming_input, IVectorView_Gamepad_iface);
|
||||
@@ -265,6 +271,122 @@ static const struct IGamepadStaticsVtbl gamepad_statics_vtbl =
|
||||
gamepad_statics_get_Gamepads,
|
||||
};
|
||||
|
||||
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_QueryInterface(
|
||||
+ IRawGameControllerStatics *iface, REFIID iid, void **out)
|
||||
+{
|
||||
+ TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out);
|
||||
+
|
||||
+ if (IsEqualGUID(iid, &IID_IAgileObject))
|
||||
+ {
|
||||
+ IUnknown_AddRef(iface);
|
||||
+ *out = iface;
|
||||
+ return S_OK;
|
||||
+ }
|
||||
+
|
||||
+ WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
|
||||
+ *out = NULL;
|
||||
+ return E_NOINTERFACE;
|
||||
+}
|
||||
+
|
||||
+static ULONG STDMETHODCALLTYPE raw_game_controller_statics_AddRef(
|
||||
+ IRawGameControllerStatics *iface)
|
||||
+{
|
||||
+ struct windows_gaming_input *impl = impl_from_IRawGameControllerStatics(iface);
|
||||
+ ULONG ref = InterlockedIncrement(&impl->ref);
|
||||
+ TRACE("iface %p, ref %u.\n", iface, ref);
|
||||
+ return ref;
|
||||
+}
|
||||
+
|
||||
+static ULONG STDMETHODCALLTYPE raw_game_controller_statics_Release(
|
||||
+ IRawGameControllerStatics *iface)
|
||||
+{
|
||||
+ struct windows_gaming_input *impl = impl_from_IRawGameControllerStatics(iface);
|
||||
+ ULONG ref = InterlockedDecrement(&impl->ref);
|
||||
+ TRACE("iface %p, ref %u.\n", iface, ref);
|
||||
+ return ref;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_GetIids(
|
||||
+ IRawGameControllerStatics *iface, ULONG *iid_count, IID **iids)
|
||||
+{
|
||||
+ FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_GetRuntimeClassName(
|
||||
+ IRawGameControllerStatics *iface, HSTRING *class_name)
|
||||
+{
|
||||
+ FIXME("iface %p, class_name %p stub!\n", iface, class_name);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_GetTrustLevel(
|
||||
+ IRawGameControllerStatics *iface, TrustLevel *trust_level)
|
||||
+{
|
||||
+ FIXME("iface %p, trust_level %p stub!\n", iface, trust_level);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_add_RawGameControllerAdded(
|
||||
+ IRawGameControllerStatics *iface, IEventHandler_RawGameController *value, EventRegistrationToken* token)
|
||||
+{
|
||||
+ FIXME("iface %p, value %p, token %p stub!\n", iface, value, token);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_remove_RawGameControllerAdded(
|
||||
+ IRawGameControllerStatics *iface, EventRegistrationToken token)
|
||||
+{
|
||||
+ FIXME("iface %p, token %#I64x stub!\n", iface, token.value);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_add_RawGameControllerRemoved(
|
||||
+ IRawGameControllerStatics *iface, IEventHandler_RawGameController *value, EventRegistrationToken* token)
|
||||
+{
|
||||
+ FIXME("iface %p, value %p, token %p stub!\n", iface, value, token);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_remove_RawGameControllerRemoved(
|
||||
+ IRawGameControllerStatics *iface, EventRegistrationToken token)
|
||||
+{
|
||||
+ FIXME("iface %p, token %#I64x stub!\n", iface, token.value);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_get_RawGameControllers(
|
||||
+ IRawGameControllerStatics *iface, IVectorView_RawGameController **value)
|
||||
+{
|
||||
+ FIXME("iface %p, value %p stub!\n", iface, value);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_FromGameController(
|
||||
+ IRawGameControllerStatics *iface, IGameController *game_controller, IRawGameController **value)
|
||||
+{
|
||||
+ FIXME("iface %p, game_controller %p, value %p stub!\n", iface, game_controller, value);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const struct IRawGameControllerStaticsVtbl raw_game_controller_statics_vtbl =
|
||||
+{
|
||||
+ raw_game_controller_statics_QueryInterface,
|
||||
+ raw_game_controller_statics_AddRef,
|
||||
+ raw_game_controller_statics_Release,
|
||||
+ /* IInspectable methods */
|
||||
+ raw_game_controller_statics_GetIids,
|
||||
+ raw_game_controller_statics_GetRuntimeClassName,
|
||||
+ raw_game_controller_statics_GetTrustLevel,
|
||||
+ /* IRawGameControllerStatics methods */
|
||||
+ raw_game_controller_statics_add_RawGameControllerAdded,
|
||||
+ raw_game_controller_statics_remove_RawGameControllerAdded,
|
||||
+ raw_game_controller_statics_add_RawGameControllerRemoved,
|
||||
+ raw_game_controller_statics_remove_RawGameControllerRemoved,
|
||||
+ raw_game_controller_statics_get_RawGameControllers,
|
||||
+ raw_game_controller_statics_FromGameController,
|
||||
+};
|
||||
+
|
||||
static HRESULT STDMETHODCALLTYPE windows_gaming_input_QueryInterface(
|
||||
IActivationFactory *iface, REFIID iid, void **out)
|
||||
{
|
||||
@@ -287,6 +409,13 @@ static HRESULT STDMETHODCALLTYPE windows_gaming_input_QueryInterface(
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
+ if (IsEqualGUID(iid, &IID_IRawGameControllerStatics))
|
||||
+ {
|
||||
+ IUnknown_AddRef(iface);
|
||||
+ *out = &impl->IRawGameControllerStatics_iface;
|
||||
+ return S_OK;
|
||||
+ }
|
||||
+
|
||||
FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
|
||||
*out = NULL;
|
||||
return E_NOINTERFACE;
|
||||
@@ -355,6 +484,7 @@ static struct windows_gaming_input windows_gaming_input =
|
||||
{
|
||||
{&activation_factory_vtbl},
|
||||
{&gamepad_statics_vtbl},
|
||||
+ {&raw_game_controller_statics_vtbl},
|
||||
{&vector_view_gamepad_vtbl},
|
||||
0
|
||||
};
|
||||
diff --git a/include/Makefile.in b/include/Makefile.in
|
||||
index 1c80421ef6f..ab49ee0e4b3 100644
|
||||
--- a/include/Makefile.in
|
||||
+++ b/include/Makefile.in
|
||||
@@ -20,6 +20,7 @@ SOURCES = \
|
||||
appmodel.h \
|
||||
asferr.h \
|
||||
asptlb.idl \
|
||||
+ asyncinfo.idl \
|
||||
asynot.idl \
|
||||
asysta.idl \
|
||||
atlbase.h \
|
||||
@@ -751,8 +752,10 @@ SOURCES = \
|
||||
windows.foundation.collections.idl \
|
||||
windows.foundation.idl \
|
||||
windows.gaming.input.idl \
|
||||
+ windows.gaming.input.forcefeedback.idl \
|
||||
windows.h \
|
||||
windows.media.speechsynthesis.idl \
|
||||
+ windows.system.idl \
|
||||
windowscontracts.idl \
|
||||
windowsx.h \
|
||||
wine/debug.h \
|
||||
diff --git a/include/asyncinfo.idl b/include/asyncinfo.idl
|
||||
new file mode 100644
|
||||
index 00000000000..9185bf6880a
|
||||
--- /dev/null
|
||||
+++ b/include/asyncinfo.idl
|
||||
@@ -0,0 +1,45 @@
|
||||
+/*
|
||||
+ * Copyright 2020 Rémi Bernon for CodeWeavers
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2.1 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General Public
|
||||
+ * License along with this library; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
+ */
|
||||
+
|
||||
+#ifdef __WIDL__
|
||||
+#pragma winrt ns_prefix
|
||||
+#endif
|
||||
+
|
||||
+import "inspectable.idl";
|
||||
+
|
||||
+typedef [v1_enum] enum AsyncStatus
|
||||
+{
|
||||
+ Started = 0,
|
||||
+ Completed,
|
||||
+ Canceled,
|
||||
+ Error,
|
||||
+} AsyncStatus;
|
||||
+
|
||||
+[
|
||||
+ object,
|
||||
+ uuid(00000036-0000-0000-c000-000000000046),
|
||||
+ pointer_default(unique)
|
||||
+]
|
||||
+interface IAsyncInfo : IInspectable
|
||||
+{
|
||||
+ [propget] HRESULT Id([out, retval] unsigned __int32 *id);
|
||||
+ [propget] HRESULT Status([out, retval] AsyncStatus *status);
|
||||
+ [propget] HRESULT ErrorCode([out, retval] HRESULT *errorCode);
|
||||
+ HRESULT Cancel();
|
||||
+ HRESULT Close();
|
||||
+}
|
||||
diff --git a/include/windows.foundation.collections.idl b/include/windows.foundation.collections.idl
|
||||
index ba860a1e82e..2562d34791f 100644
|
||||
--- a/include/windows.foundation.collections.idl
|
||||
+++ b/include/windows.foundation.collections.idl
|
||||
@@ -21,7 +21,7 @@
|
||||
#endif
|
||||
|
||||
import "inspectable.idl";
|
||||
-/* import "asyncinfo.idl"; */
|
||||
+import "asyncinfo.idl";
|
||||
import "windowscontracts.idl";
|
||||
/* import "eventtoken.idl"; */
|
||||
|
||||
@@ -53,6 +53,25 @@ cpp_quote("#endif")
|
||||
]
|
||||
delegate HRESULT TypedEventHandler<TSender, TArgs>([in] TSender sender, [in] TArgs args);
|
||||
|
||||
+ interface IAsyncOperation<TResult>;
|
||||
+
|
||||
+ [
|
||||
+ contract(Windows.Foundation.FoundationContract, 1.0),
|
||||
+ uuid(fcdcf02c-e5d8-4478-915a-4d90b74b83a5)
|
||||
+ ]
|
||||
+ delegate HRESULT AsyncOperationCompletedHandler<TResult>([in] IAsyncOperation<TResult> *info, [in] AsyncStatus status);
|
||||
+
|
||||
+ [
|
||||
+ contract(Windows.Foundation.FoundationContract, 1.0),
|
||||
+ uuid(9fc2b0bb-e446-44e2-aa61-9cab8f636af2)
|
||||
+ ]
|
||||
+ interface IAsyncOperation<TResult> : IInspectable
|
||||
+ {
|
||||
+ [propput] HRESULT Completed([in] AsyncOperationCompletedHandler<TResult> *handler);
|
||||
+ [propget] HRESULT Completed([out, retval] AsyncOperationCompletedHandler<TResult> **handler);
|
||||
+ HRESULT GetResults([out, retval] TResult **results);
|
||||
+ }
|
||||
+
|
||||
namespace Collections
|
||||
{
|
||||
[
|
||||
diff --git a/include/windows.foundation.idl b/include/windows.foundation.idl
|
||||
index 3c60278cf05..b06b9eadaf4 100644
|
||||
--- a/include/windows.foundation.idl
|
||||
+++ b/include/windows.foundation.idl
|
||||
@@ -21,7 +21,7 @@
|
||||
#endif
|
||||
|
||||
import "inspectable.idl";
|
||||
-/* import "asyncinfo.idl"; */
|
||||
+import "asyncinfo.idl";
|
||||
import "windowscontracts.idl";
|
||||
/* import "eventtoken.idl"; */
|
||||
/* import "ivectorchangedeventargs.idl"; */
|
||||
@@ -114,3 +114,12 @@ namespace Windows {
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+namespace Windows {
|
||||
+ namespace Foundation {
|
||||
+ declare {
|
||||
+ interface Windows.Foundation.AsyncOperationCompletedHandler<boolean>;
|
||||
+ interface Windows.Foundation.IAsyncOperation<boolean>;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/include/windows.gaming.input.forcefeedback.idl b/include/windows.gaming.input.forcefeedback.idl
|
||||
new file mode 100644
|
||||
index 00000000000..fa9da2f7656
|
||||
--- /dev/null
|
||||
+++ b/include/windows.gaming.input.forcefeedback.idl
|
||||
@@ -0,0 +1,111 @@
|
||||
+/*
|
||||
+ * Copyright 2020 Rémi Bernon for CodeWeavers
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2.1 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General Public
|
||||
+ * License along with this library; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
+ */
|
||||
+
|
||||
+#ifdef __WIDL__
|
||||
+#pragma winrt ns_prefix
|
||||
+#endif
|
||||
+
|
||||
+import "inspectable.idl";
|
||||
+import "windows.foundation.idl";
|
||||
+
|
||||
+namespace Windows {
|
||||
+ namespace Gaming {
|
||||
+ namespace Input {
|
||||
+ namespace ForceFeedback {
|
||||
+ typedef enum ForceFeedbackEffectAxes ForceFeedbackEffectAxes;
|
||||
+ typedef enum ForceFeedbackLoadEffectResult ForceFeedbackLoadEffectResult;
|
||||
+ interface IForceFeedbackEffect;
|
||||
+ runtimeclass ForceFeedbackMotor;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+namespace Windows {
|
||||
+ namespace Gaming {
|
||||
+ namespace Input {
|
||||
+ namespace ForceFeedback {
|
||||
+ declare {
|
||||
+ interface Windows.Foundation.AsyncOperationCompletedHandler<Windows.Gaming.Input.ForceFeedback.ForceFeedbackLoadEffectResult>;
|
||||
+ interface Windows.Foundation.IAsyncOperation<Windows.Gaming.Input.ForceFeedback.ForceFeedbackLoadEffectResult>;
|
||||
+ interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor*>;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+namespace Windows {
|
||||
+ namespace Gaming {
|
||||
+ namespace Input {
|
||||
+ namespace ForceFeedback {
|
||||
+ [
|
||||
+ contract(Windows.Foundation.UniversalApiContract, 3.0),
|
||||
+ flags
|
||||
+ ]
|
||||
+ enum ForceFeedbackEffectAxes
|
||||
+ {
|
||||
+ None = 0x0,
|
||||
+ X = 0x1,
|
||||
+ Y = 0x2,
|
||||
+ Z = 0x4
|
||||
+ };
|
||||
+
|
||||
+ [contract(Windows.Foundation.UniversalApiContract, 3.0)]
|
||||
+ enum ForceFeedbackLoadEffectResult
|
||||
+ {
|
||||
+ Succeeded = 0,
|
||||
+ EffectStorageFull = 1,
|
||||
+ EffectNotSupported = 2
|
||||
+ };
|
||||
+
|
||||
+ [
|
||||
+ contract(Windows.Foundation.UniversalApiContract, 3.0),
|
||||
+ exclusiveto(Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor),
|
||||
+ uuid(8d3d417c-a5ea-4516-8026-2b00f74ef6e5)
|
||||
+ ]
|
||||
+ interface IForceFeedbackMotor : IInspectable
|
||||
+ {
|
||||
+ [propget] HRESULT AreEffectsPaused([out, retval] boolean* value);
|
||||
+ [propget] HRESULT MasterGain([out, retval] DOUBLE* value);
|
||||
+ [propput] HRESULT MasterGain([in] DOUBLE value);
|
||||
+ [propget] HRESULT IsEnabled([out, retval] boolean* value);
|
||||
+ [propget] HRESULT SupportedAxes([out, retval] Windows.Gaming.Input.ForceFeedback.ForceFeedbackEffectAxes* value);
|
||||
+ HRESULT LoadEffectAsync([in] Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect* effect, [out, retval] Windows.Foundation.IAsyncOperation<Windows.Gaming.Input.ForceFeedback.ForceFeedbackLoadEffectResult>** asyncOperation);
|
||||
+ HRESULT PauseAllEffects();
|
||||
+ HRESULT ResumeAllEffects();
|
||||
+ HRESULT StopAllEffects();
|
||||
+ HRESULT TryDisableAsync([out, retval] Windows.Foundation.IAsyncOperation<boolean>** asyncOperation);
|
||||
+ HRESULT TryEnableAsync([out, retval] Windows.Foundation.IAsyncOperation<boolean>** asyncOperation);
|
||||
+ HRESULT TryResetAsync([out, retval] Windows.Foundation.IAsyncOperation<boolean>** asyncOperation);
|
||||
+ HRESULT TryUnloadEffectAsync([in] Windows.Gaming.Input.ForceFeedback.IForceFeedbackEffect* effect, [out, retval] Windows.Foundation.IAsyncOperation<boolean>** asyncOperation);
|
||||
+ }
|
||||
+
|
||||
+ [
|
||||
+ contract(Windows.Foundation.UniversalApiContract, 3.0),
|
||||
+ marshaling_behavior(agile),
|
||||
+ threading(both)
|
||||
+ ]
|
||||
+ runtimeclass ForceFeedbackMotor
|
||||
+ {
|
||||
+ [default] interface Windows.Gaming.Input.ForceFeedback.IForceFeedbackMotor;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/include/windows.gaming.input.idl b/include/windows.gaming.input.idl
|
||||
index 1da22408eeb..90c1f02bd9d 100644
|
||||
--- a/include/windows.gaming.input.idl
|
||||
+++ b/include/windows.gaming.input.idl
|
||||
@@ -23,11 +23,16 @@
|
||||
import "eventtoken.idl";
|
||||
import "inspectable.idl";
|
||||
import "windows.foundation.idl";
|
||||
+import "windows.system.idl";
|
||||
+import "windows.gaming.input.forcefeedback.idl";
|
||||
|
||||
namespace Windows {
|
||||
namespace Gaming {
|
||||
namespace Input {
|
||||
typedef enum GamepadButtons GamepadButtons;
|
||||
+ typedef enum GameControllerButtonLabel GameControllerButtonLabel;
|
||||
+ typedef enum GameControllerSwitchKind GameControllerSwitchKind;
|
||||
+ typedef enum GameControllerSwitchPosition GameControllerSwitchPosition;
|
||||
typedef struct GamepadReading GamepadReading;
|
||||
typedef struct GamepadVibration GamepadVibration;
|
||||
interface IGameController;
|
||||
@@ -36,7 +41,11 @@ namespace Windows {
|
||||
interface IGamepad2;
|
||||
interface IGamepadStatics;
|
||||
interface IGamepadStatics2;
|
||||
+ interface IRawGameController;
|
||||
+ interface IRawGameController2;
|
||||
runtimeclass Gamepad;
|
||||
+ runtimeclass Headset;
|
||||
+ runtimeclass RawGameController;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -46,7 +55,11 @@ namespace Windows {
|
||||
namespace Input {
|
||||
declare {
|
||||
interface Windows.Foundation.EventHandler<Windows.Gaming.Input.Gamepad*>;
|
||||
+ interface Windows.Foundation.EventHandler<Windows.Gaming.Input.RawGameController*>;
|
||||
+ interface Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController*, Windows.Gaming.Input.Headset*>;
|
||||
+ interface Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController*, Windows.System.UserChangedEventArgs*>;
|
||||
interface Windows.Foundation.Collections.IVectorView<Gamepad*>;
|
||||
+ interface Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.RawGameController*>;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,6 +99,102 @@ namespace Windows {
|
||||
Paddle4 = 0x20000
|
||||
};
|
||||
|
||||
+ [contract(Windows.Foundation.UniversalApiContract, 3.0)]
|
||||
+ enum GameControllerButtonLabel
|
||||
+ {
|
||||
+ None = 0,
|
||||
+ XboxBack = 1,
|
||||
+ XboxStart = 2,
|
||||
+ XboxMenu = 3,
|
||||
+ XboxView = 4,
|
||||
+ XboxUp = 5,
|
||||
+ XboxDown = 6,
|
||||
+ XboxLeft = 7,
|
||||
+ XboxRight = 8,
|
||||
+ XboxA = 9,
|
||||
+ XboxB = 10,
|
||||
+ XboxX = 11,
|
||||
+ XboxY = 12,
|
||||
+ XboxLeftBumper = 13,
|
||||
+ XboxLeftTrigger = 14,
|
||||
+ XboxLeftStickButton = 15,
|
||||
+ XboxRightBumper = 16,
|
||||
+ XboxRightTrigger = 17,
|
||||
+ XboxRightStickButton = 18,
|
||||
+ XboxPaddle1 = 19,
|
||||
+ XboxPaddle2 = 20,
|
||||
+ XboxPaddle3 = 21,
|
||||
+ XboxPaddle4 = 22,
|
||||
+ Mode = 23,
|
||||
+ Select = 24,
|
||||
+ Menu = 25,
|
||||
+ View = 26,
|
||||
+ Back = 27,
|
||||
+ Start = 28,
|
||||
+ Options = 29,
|
||||
+ Share = 30,
|
||||
+ Up = 31,
|
||||
+ Down = 32,
|
||||
+ Left = 33,
|
||||
+ Right = 34,
|
||||
+ LetterA = 35,
|
||||
+ LetterB = 36,
|
||||
+ LetterC = 37,
|
||||
+ LetterL = 38,
|
||||
+ LetterR = 39,
|
||||
+ LetterX = 40,
|
||||
+ LetterY = 41,
|
||||
+ LetterZ = 42,
|
||||
+ Cross = 43,
|
||||
+ Circle = 44,
|
||||
+ Square = 45,
|
||||
+ Triangle = 46,
|
||||
+ LeftBumper = 47,
|
||||
+ LeftTrigger = 48,
|
||||
+ LeftStickButton = 49,
|
||||
+ Left1 = 50,
|
||||
+ Left2 = 51,
|
||||
+ Left3 = 52,
|
||||
+ RightBumper = 53,
|
||||
+ RightTrigger = 54,
|
||||
+ RightStickButton = 55,
|
||||
+ Right1 = 56,
|
||||
+ Right2 = 57,
|
||||
+ Right3 = 58,
|
||||
+ Paddle1 = 59,
|
||||
+ Paddle2 = 60,
|
||||
+ Paddle3 = 61,
|
||||
+ Paddle4 = 62,
|
||||
+ Plus = 63,
|
||||
+ Minus = 64,
|
||||
+ DownLeftArrow = 65,
|
||||
+ DialLeft = 66,
|
||||
+ DialRight = 67,
|
||||
+ Suspension = 68
|
||||
+ };
|
||||
+
|
||||
+ [contract(Windows.Foundation.UniversalApiContract, 4.0)]
|
||||
+ enum GameControllerSwitchKind
|
||||
+ {
|
||||
+ TwoWay = 0,
|
||||
+ FourWay = 1,
|
||||
+ EightWay = 2
|
||||
+ };
|
||||
+
|
||||
+ [contract(Windows.Foundation.UniversalApiContract, 4.0)]
|
||||
+ enum GameControllerSwitchPosition
|
||||
+ {
|
||||
+ Center = 0,
|
||||
+ Up = 1,
|
||||
+ UpRight = 2,
|
||||
+ Right = 3,
|
||||
+ DownRight = 4,
|
||||
+ Down = 5,
|
||||
+ DownLeft = 6,
|
||||
+ Left = 7,
|
||||
+ UpLeft = 8
|
||||
+ };
|
||||
+
|
||||
[contract(Windows.Foundation.UniversalApiContract, 1.0)]
|
||||
struct GamepadReading
|
||||
{
|
||||
@@ -108,6 +217,23 @@ namespace Windows {
|
||||
DOUBLE RightTrigger;
|
||||
};
|
||||
|
||||
+ [
|
||||
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
|
||||
+ uuid(1baf6522-5f64-42c5-8267-b9fe2215bfbd)
|
||||
+ ]
|
||||
+ interface IGameController : IInspectable
|
||||
+ {
|
||||
+ [eventadd] HRESULT HeadsetConnected([in] Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController*, Windows.Gaming.Input.Headset*>* value, [out, retval] EventRegistrationToken* token);
|
||||
+ [eventremove] HRESULT HeadsetConnected([in] EventRegistrationToken token);
|
||||
+ [eventadd] HRESULT HeadsetDisconnected([in] Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController*, Windows.Gaming.Input.Headset*>* value, [out, retval] EventRegistrationToken* token);
|
||||
+ [eventremove] HRESULT HeadsetDisconnected([in] EventRegistrationToken token);
|
||||
+ [eventadd] HRESULT UserChanged([in] Windows.Foundation.TypedEventHandler<Windows.Gaming.Input.IGameController*, Windows.System.UserChangedEventArgs*>* value, [out, retval] EventRegistrationToken* token);
|
||||
+ [eventremove] HRESULT UserChanged([in] EventRegistrationToken token);
|
||||
+ [propget] HRESULT Headset([out, retval] Windows.Gaming.Input.Headset** value);
|
||||
+ [propget] HRESULT IsWireless([out, retval] boolean* value);
|
||||
+ [propget] HRESULT User([out, retval] Windows.System.User** value);
|
||||
+ }
|
||||
+
|
||||
[
|
||||
contract(Windows.Foundation.UniversalApiContract, 1.0),
|
||||
exclusiveto(Windows.Gaming.Input.Gamepad),
|
||||
@@ -121,6 +247,25 @@ namespace Windows {
|
||||
HRESULT GetCurrentReading([out, retval] Windows.Gaming.Input.GamepadReading* value);
|
||||
}
|
||||
|
||||
+ [
|
||||
+ contract(Windows.Foundation.UniversalApiContract, 4.0),
|
||||
+ exclusiveto(Windows.Gaming.Input.RawGameController),
|
||||
+ uuid(7cad6d91-a7e1-4f71-9a78-33e9c5dfea62)
|
||||
+ ]
|
||||
+ interface IRawGameController : IInspectable
|
||||
+ requires Windows.Gaming.Input.IGameController
|
||||
+ {
|
||||
+ [propget] HRESULT AxisCount([out] [retval] INT32* value);
|
||||
+ [propget] HRESULT ButtonCount([out] [retval] INT32* value);
|
||||
+ [propget] HRESULT ForceFeedbackMotors([out] [retval] Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.ForceFeedback.ForceFeedbackMotor*>** value);
|
||||
+ [propget] HRESULT HardwareProductId([out] [retval] UINT16* value);
|
||||
+ [propget] HRESULT HardwareVendorId([out] [retval] UINT16* value);
|
||||
+ [propget] HRESULT SwitchCount([out] [retval] INT32* value);
|
||||
+ HRESULT GetButtonLabel([in] INT32 buttonIndex, [out] [retval] Windows.Gaming.Input.GameControllerButtonLabel* value);
|
||||
+ HRESULT GetCurrentReading([in] UINT32 __buttonArraySize, [out] [size_is(__buttonArraySize)] boolean* buttonArray, [in] UINT32 __switchArraySize, [out] [size_is(__switchArraySize)] Windows.Gaming.Input.GameControllerSwitchPosition* switchArray, [in] UINT32 __axisArraySize, [out] [size_is(__axisArraySize)] DOUBLE* axisArray, [out] [retval] UINT64* timestamp);
|
||||
+ HRESULT GetSwitchKind([in] INT32 switchIndex, [out] [retval] Windows.Gaming.Input.GameControllerSwitchKind* value);
|
||||
+ }
|
||||
+
|
||||
[
|
||||
object,
|
||||
uuid(8bbce529-d49c-39e9-9560-e47dde96b7c8)
|
||||
@@ -134,6 +279,31 @@ namespace Windows {
|
||||
[propget] HRESULT Gamepads([out, retval] Windows.Foundation.Collections.IVectorView<Gamepad*> **value);
|
||||
}
|
||||
|
||||
+ [
|
||||
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
|
||||
+ exclusiveto(Windows.Gaming.Input.Headset),
|
||||
+ uuid(3fd156ef-6925-3fa8-9181-029c5223ae3b)
|
||||
+ ]
|
||||
+ interface IHeadset : IInspectable
|
||||
+ {
|
||||
+ [propget] HRESULT CaptureDeviceId([out, retval] HSTRING* value);
|
||||
+ [propget] HRESULT RenderDeviceId([out, retval] HSTRING* value);
|
||||
+ }
|
||||
+
|
||||
+ [
|
||||
+ object,
|
||||
+ uuid(eb8d0792-e95a-4b19-afc7-0a59f8bf759e)
|
||||
+ ]
|
||||
+ interface IRawGameControllerStatics : IInspectable
|
||||
+ {
|
||||
+ [eventadd] HRESULT RawGameControllerAdded([in] Windows.Foundation.EventHandler<Windows.Gaming.Input.RawGameController*> *value, [out, retval] EventRegistrationToken* token);
|
||||
+ [eventremove] HRESULT RawGameControllerAdded([in] EventRegistrationToken token);
|
||||
+ [eventadd] HRESULT RawGameControllerRemoved([in] Windows.Foundation.EventHandler<Windows.Gaming.Input.RawGameController*> *value, [out, retval] EventRegistrationToken* token);
|
||||
+ [eventremove] HRESULT RawGameControllerRemoved([in] EventRegistrationToken token);
|
||||
+ [propget] HRESULT RawGameControllers([out, retval] Windows.Foundation.Collections.IVectorView<Windows.Gaming.Input.RawGameController*> **value);
|
||||
+ HRESULT FromGameController([in] Windows.Gaming.Input.IGameController *game_controller, [out, retval] Windows.Gaming.Input.RawGameController **value);
|
||||
+ }
|
||||
+
|
||||
[
|
||||
contract(Windows.Foundation.UniversalApiContract, 1.0),
|
||||
marshaling_behavior(agile),
|
||||
@@ -148,6 +318,31 @@ namespace Windows {
|
||||
[contract(Windows.Foundation.UniversalApiContract, 3.0)] interface Windows.Gaming.Input.IGamepad2;
|
||||
[contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo;
|
||||
}
|
||||
+
|
||||
+ [
|
||||
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
|
||||
+ marshaling_behavior(agile),
|
||||
+ threading(both)
|
||||
+ ]
|
||||
+ runtimeclass Headset
|
||||
+ {
|
||||
+ [default] interface Windows.Gaming.Input.IHeadset;
|
||||
+ [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.Gaming.Input.IGameControllerBatteryInfo;
|
||||
+ }
|
||||
+
|
||||
+ [
|
||||
+ contract(Windows.Foundation.UniversalApiContract, 4.0),
|
||||
+ marshaling_behavior(agile),
|
||||
+ static(Windows.Gaming.Input.IRawGameControllerStatics, Windows.Foundation.UniversalApiContract, 4.0),
|
||||
+ threading(both)
|
||||
+ ]
|
||||
+ runtimeclass RawGameController
|
||||
+ {
|
||||
+ [default] interface Windows.Gaming.Input.IRawGameController;
|
||||
+ interface Windows.Gaming.Input.IGameController;
|
||||
+ interface Windows.Gaming.Input.IGameControllerBatteryInfo;
|
||||
+ [contract(Windows.Foundation.UniversalApiContract, 5.0)] interface Windows.Gaming.Input.IRawGameController2;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/include/windows.system.idl b/include/windows.system.idl
|
||||
new file mode 100644
|
||||
index 00000000000..824441eaff9
|
||||
--- /dev/null
|
||||
+++ b/include/windows.system.idl
|
||||
@@ -0,0 +1,70 @@
|
||||
+/*
|
||||
+ * Copyright 2020 Rémi Bernon for CodeWeavers
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2.1 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General Public
|
||||
+ * License along with this library; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
+ */
|
||||
+
|
||||
+#ifdef __WIDL__
|
||||
+#pragma winrt ns_prefix
|
||||
+#endif
|
||||
+
|
||||
+import "inspectable.idl";
|
||||
+import "windows.foundation.idl";
|
||||
+
|
||||
+namespace Windows {
|
||||
+ namespace System {
|
||||
+ interface IUser;
|
||||
+ interface IUserStatics;
|
||||
+ interface IUserChangedEventArgs;
|
||||
+ interface IUserChangedEventArgs2;
|
||||
+ runtimeclass User;
|
||||
+ runtimeclass UserChangedEventArgs;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+namespace Windows {
|
||||
+ namespace System {
|
||||
+ [
|
||||
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
|
||||
+ exclusiveto(Windows.System.UserChangedEventArgs),
|
||||
+ uuid(086459dc-18c6-48db-bc99-724fb9203ccc)
|
||||
+ ]
|
||||
+ interface IUserChangedEventArgs : IInspectable
|
||||
+ {
|
||||
+ [propget] HRESULT User([out, retval] Windows.System.User** value);
|
||||
+ }
|
||||
+
|
||||
+ [
|
||||
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
|
||||
+ marshaling_behavior(agile),
|
||||
+ static(Windows.System.IUserStatics, Windows.Foundation.UniversalApiContract, 1.0),
|
||||
+ threading(both),
|
||||
+ ]
|
||||
+ runtimeclass User
|
||||
+ {
|
||||
+ [default] interface Windows.System.IUser;
|
||||
+ }
|
||||
+
|
||||
+ [
|
||||
+ contract(Windows.Foundation.UniversalApiContract, 1.0),
|
||||
+ marshaling_behavior(agile)
|
||||
+ ]
|
||||
+ runtimeclass UserChangedEventArgs
|
||||
+ {
|
||||
+ [default] interface Windows.System.IUserChangedEventArgs;
|
||||
+ [contract(Windows.Foundation.UniversalApiContract, 10.0)] interface Windows.System.IUserChangedEventArgs2;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
|
||||
index a1cc73d6e57..c10cb37a172 100644
|
||||
--- a/loader/wine.inf.in
|
||||
+++ b/loader/wine.inf.in
|
||||
@@ -712,6 +712,7 @@ HKLM,%MciExtStr%,"wvx",,"MPEGVideo"
|
||||
|
||||
[Misc]
|
||||
HKLM,Software\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.Input.Gamepad,"DllPath",2,"Windows.Gaming.Input.dll"
|
||||
+HKLM,Software\Microsoft\WindowsRuntime\ActivatableClassId\Windows.Gaming.Input.RawGameController,"DllPath",2,"Windows.Gaming.Input.dll"
|
||||
HKLM,Software\Borland\Database Engine\Settings\SYSTEM\INIT,SHAREDMEMLOCATION,,9000
|
||||
HKLM,Software\Clients\Mail,,2,"Native Mail Client"
|
||||
HKLM,Software\Clients\Mail\Native Mail Client,,2,"Native Mail Client"
|
||||
--
|
||||
2.20.1
|
||||
|
@ -1,166 +0,0 @@
|
||||
From 0386aec8078e9f75e1841db486a187bc9d07249d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Tue, 13 Oct 2020 18:02:39 +0200
|
||||
Subject: [PATCH] windows.gaming.input: Implement
|
||||
IRawGameControllerStatics::RawGameControllers stubs.
|
||||
|
||||
---
|
||||
.../windows.gaming.input_main.c | 113 +++++++++++++++++-
|
||||
1 file changed, 112 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
index 1a40a8ddc35..b56a2a5962f 100644
|
||||
--- a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
+++ b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
@@ -33,6 +33,7 @@ struct windows_gaming_input
|
||||
IGamepadStatics IGamepadStatics_iface;
|
||||
IRawGameControllerStatics IRawGameControllerStatics_iface;
|
||||
IVectorView_Gamepad IVectorView_Gamepad_iface;
|
||||
+ IVectorView_RawGameController IVectorView_RawGameController_iface;
|
||||
LONG ref;
|
||||
};
|
||||
|
||||
@@ -56,6 +57,11 @@ static inline struct windows_gaming_input *impl_from_IVectorView_Gamepad(IVector
|
||||
return CONTAINING_RECORD(iface, struct windows_gaming_input, IVectorView_Gamepad_iface);
|
||||
}
|
||||
|
||||
+static inline struct windows_gaming_input *impl_from_IVectorView_RawGameController(IVectorView_RawGameController *iface)
|
||||
+{
|
||||
+ return CONTAINING_RECORD(iface, struct windows_gaming_input, IVectorView_RawGameController_iface);
|
||||
+}
|
||||
+
|
||||
static HRESULT STDMETHODCALLTYPE vector_view_gamepad_QueryInterface(
|
||||
IVectorView_Gamepad *iface, REFIID iid, void **out)
|
||||
{
|
||||
@@ -161,6 +167,108 @@ static const struct IVectorView_GamepadVtbl vector_view_gamepad_vtbl =
|
||||
vector_view_gamepad_GetMany,
|
||||
};
|
||||
|
||||
+static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_QueryInterface(
|
||||
+ IVectorView_RawGameController *iface, REFIID iid, void **out)
|
||||
+{
|
||||
+ TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out);
|
||||
+
|
||||
+ if (IsEqualGUID(iid, &IID_IUnknown) ||
|
||||
+ IsEqualGUID(iid, &IID_IInspectable) ||
|
||||
+ IsEqualGUID(iid, &IID_IVectorView_RawGameController))
|
||||
+ {
|
||||
+ IUnknown_AddRef(iface);
|
||||
+ *out = iface;
|
||||
+ return S_OK;
|
||||
+ }
|
||||
+
|
||||
+ WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid));
|
||||
+ *out = NULL;
|
||||
+ return E_NOINTERFACE;
|
||||
+}
|
||||
+
|
||||
+static ULONG STDMETHODCALLTYPE vector_view_raw_game_controller_AddRef(
|
||||
+ IVectorView_RawGameController *iface)
|
||||
+{
|
||||
+ struct windows_gaming_input *impl = impl_from_IVectorView_RawGameController(iface);
|
||||
+ ULONG ref = InterlockedIncrement(&impl->ref);
|
||||
+ TRACE("iface %p, ref %u.\n", iface, ref);
|
||||
+ return ref;
|
||||
+}
|
||||
+
|
||||
+static ULONG STDMETHODCALLTYPE vector_view_raw_game_controller_Release(
|
||||
+ IVectorView_RawGameController *iface)
|
||||
+{
|
||||
+ struct windows_gaming_input *impl = impl_from_IVectorView_RawGameController(iface);
|
||||
+ ULONG ref = InterlockedDecrement(&impl->ref);
|
||||
+ TRACE("iface %p, ref %u.\n", iface, ref);
|
||||
+ return ref;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetIids(
|
||||
+ IVectorView_RawGameController *iface, ULONG *iid_count, IID **iids)
|
||||
+{
|
||||
+ FIXME("iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetRuntimeClassName(
|
||||
+ IVectorView_RawGameController *iface, HSTRING *class_name)
|
||||
+{
|
||||
+ FIXME("iface %p, class_name %p stub!\n", iface, class_name);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetTrustLevel(
|
||||
+ IVectorView_RawGameController *iface, TrustLevel *trust_level)
|
||||
+{
|
||||
+ FIXME("iface %p, trust_level %p stub!\n", iface, trust_level);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetAt(
|
||||
+ IVectorView_RawGameController *iface, ULONG index, IRawGameController **value)
|
||||
+{
|
||||
+ FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_get_Size(
|
||||
+ IVectorView_RawGameController *iface, ULONG *value)
|
||||
+{
|
||||
+ FIXME("iface %p, value %p stub!\n", iface, value);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_IndexOf(
|
||||
+ IVectorView_RawGameController *iface, IRawGameController *element, ULONG *index, BOOLEAN *value)
|
||||
+{
|
||||
+ FIXME("iface %p, element %p, index %p, value %p stub!\n", iface, element, index, value);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetMany(
|
||||
+ IVectorView_RawGameController *iface, ULONG start_index, IRawGameController **items, UINT *value)
|
||||
+{
|
||||
+ FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value);
|
||||
+ return E_NOTIMPL;
|
||||
+}
|
||||
+
|
||||
+static const struct IVectorView_RawGameControllerVtbl vector_view_raw_game_controller_vtbl =
|
||||
+{
|
||||
+ vector_view_raw_game_controller_QueryInterface,
|
||||
+ vector_view_raw_game_controller_AddRef,
|
||||
+ vector_view_raw_game_controller_Release,
|
||||
+ /* IInspectable methods */
|
||||
+ vector_view_raw_game_controller_GetIids,
|
||||
+ vector_view_raw_game_controller_GetRuntimeClassName,
|
||||
+ vector_view_raw_game_controller_GetTrustLevel,
|
||||
+ /* IVectorView<RawGameController> methods */
|
||||
+ vector_view_raw_game_controller_GetAt,
|
||||
+ vector_view_raw_game_controller_get_Size,
|
||||
+ vector_view_raw_game_controller_IndexOf,
|
||||
+ vector_view_raw_game_controller_GetMany,
|
||||
+};
|
||||
+
|
||||
static HRESULT STDMETHODCALLTYPE gamepad_statics_QueryInterface(
|
||||
IGamepadStatics *iface, REFIID iid, void **out)
|
||||
{
|
||||
@@ -358,8 +466,10 @@ static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_remove_RawGameContr
|
||||
static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_get_RawGameControllers(
|
||||
IRawGameControllerStatics *iface, IVectorView_RawGameController **value)
|
||||
{
|
||||
+ struct windows_gaming_input *impl = impl_from_IRawGameControllerStatics(iface);
|
||||
FIXME("iface %p, value %p stub!\n", iface, value);
|
||||
- return E_NOTIMPL;
|
||||
+ *value = &impl->IVectorView_RawGameController_iface;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_FromGameController(
|
||||
@@ -486,6 +596,7 @@ static struct windows_gaming_input windows_gaming_input =
|
||||
{&gamepad_statics_vtbl},
|
||||
{&raw_game_controller_statics_vtbl},
|
||||
{&vector_view_gamepad_vtbl},
|
||||
+ {&vector_view_raw_game_controller_vtbl},
|
||||
0
|
||||
};
|
||||
|
||||
--
|
||||
2.20.1
|
||||
|
@ -1,53 +0,0 @@
|
||||
From 5350d7a4983151aef2435687b43017a78026d3c9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Tue, 13 Oct 2020 18:03:24 +0200
|
||||
Subject: [PATCH] windows.gaming.input: Fake empty
|
||||
IRawGameControllerStatics::RawGameControllers vector.
|
||||
|
||||
---
|
||||
.../windows.gaming.input_main.c | 11 +++++++----
|
||||
1 file changed, 7 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
index b56a2a5962f..813668a32da 100644
|
||||
--- a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
+++ b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
@@ -229,28 +229,31 @@ static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetAt(
|
||||
IVectorView_RawGameController *iface, ULONG index, IRawGameController **value)
|
||||
{
|
||||
FIXME("iface %p, index %#x, value %p stub!\n", iface, index, value);
|
||||
- return E_NOTIMPL;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_get_Size(
|
||||
IVectorView_RawGameController *iface, ULONG *value)
|
||||
{
|
||||
FIXME("iface %p, value %p stub!\n", iface, value);
|
||||
- return E_NOTIMPL;
|
||||
+ *value = 0;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_IndexOf(
|
||||
IVectorView_RawGameController *iface, IRawGameController *element, ULONG *index, BOOLEAN *value)
|
||||
{
|
||||
FIXME("iface %p, element %p, index %p, value %p stub!\n", iface, element, index, value);
|
||||
- return E_NOTIMPL;
|
||||
+ *value = FALSE;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE vector_view_raw_game_controller_GetMany(
|
||||
IVectorView_RawGameController *iface, ULONG start_index, IRawGameController **items, UINT *value)
|
||||
{
|
||||
FIXME("iface %p, start_index %#x, items %p, value %p stub!\n", iface, start_index, items, value);
|
||||
- return E_NOTIMPL;
|
||||
+ *value = 0;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static const struct IVectorView_RawGameControllerVtbl vector_view_raw_game_controller_vtbl =
|
||||
--
|
||||
2.20.1
|
||||
|
@ -1,50 +0,0 @@
|
||||
From 0f7f9030a46d09da6d75c36a46b7854fb0128a46 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <rbernon@codeweavers.com>
|
||||
Date: Tue, 13 Oct 2020 18:03:42 +0200
|
||||
Subject: [PATCH] windows.gaming.input: Fake IEventHandler_RawGameController
|
||||
support.
|
||||
|
||||
---
|
||||
dlls/windows.gaming.input.dll/windows.gaming.input_main.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
index 813668a32da..6274a9144dc 100644
|
||||
--- a/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
+++ b/dlls/windows.gaming.input.dll/windows.gaming.input_main.c
|
||||
@@ -442,28 +442,28 @@ static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_add_RawGameControll
|
||||
IRawGameControllerStatics *iface, IEventHandler_RawGameController *value, EventRegistrationToken* token)
|
||||
{
|
||||
FIXME("iface %p, value %p, token %p stub!\n", iface, value, token);
|
||||
- return E_NOTIMPL;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_remove_RawGameControllerAdded(
|
||||
IRawGameControllerStatics *iface, EventRegistrationToken token)
|
||||
{
|
||||
FIXME("iface %p, token %#I64x stub!\n", iface, token.value);
|
||||
- return E_NOTIMPL;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_add_RawGameControllerRemoved(
|
||||
IRawGameControllerStatics *iface, IEventHandler_RawGameController *value, EventRegistrationToken* token)
|
||||
{
|
||||
FIXME("iface %p, value %p, token %p stub!\n", iface, value, token);
|
||||
- return E_NOTIMPL;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_remove_RawGameControllerRemoved(
|
||||
IRawGameControllerStatics *iface, EventRegistrationToken token)
|
||||
{
|
||||
FIXME("iface %p, token %#I64x stub!\n", iface, token.value);
|
||||
- return E_NOTIMPL;
|
||||
+ return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE raw_game_controller_statics_get_RawGameControllers(
|
||||
--
|
||||
2.20.1
|
||||
|
@ -1,8 +0,0 @@
|
||||
# Taken from Mail List
|
||||
# https://source.winehq.org/patches/data/191190
|
||||
# https://source.winehq.org/patches/data/191189
|
||||
# https://source.winehq.org/patches/data/191191
|
||||
# https://source.winehq.org/patches/data/191192
|
||||
# To support Death Stranding
|
||||
Fixes: [49756] windows.gaming.input: New DLL
|
||||
Disabled: True
|
@ -1,4 +1,3 @@
|
||||
Fixes: [49740] windows.globalization: New DLL
|
||||
Fixes: [49998] windows.globalization: New DLL
|
||||
Depends: windows.gaming.input-dll
|
||||
Disabled: True
|
||||
|
Loading…
Reference in New Issue
Block a user