[PATCH 1/2] opencl: Don't bother generating a Unix function table entry for clGetExtensionFunctionAddress().

Zebediah Figura z.figura12 at gmail.com
Thu Mar 18 23:06:31 CDT 2021


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/opencl/make_opencl   | 15 +++++++++++++++
 dlls/opencl/unix_thunks.c |  6 ------
 dlls/opencl/unixlib.h     |  1 -
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/dlls/opencl/make_opencl b/dlls/opencl/make_opencl
index 4859a45b292..72b7386d1e2 100755
--- a/dlls/opencl/make_opencl
+++ b/dlls/opencl/make_opencl
@@ -238,6 +238,18 @@ sub needs_unix_wrapper($)
     return defined $funcs{$name};
 }
 
+# don't bother putting unused functions in the interface
+sub needs_unix_function($)
+{
+    my %funcs =
+        (
+            "clGetExtensionFunctionAddress" => 1,
+        );
+    my $name = shift;
+
+    return not defined $funcs{$name};
+}
+
 sub generate_struct($)
 {
     my $type = shift;
@@ -382,6 +394,7 @@ EOF
 
 foreach (sort keys %core_functions)
 {
+    next unless needs_unix_function( $_ );
     next if needs_unix_wrapper( $_ );
     print UNIX "\n", generate_unix_thunk( $_, $core_functions{$_} );
 }
@@ -389,6 +402,7 @@ foreach (sort keys %core_functions)
 print UNIX "\nconst struct opencl_funcs funcs =\n{\n";
 foreach (sort keys %core_functions)
 {
+    next unless needs_unix_function( $_ );
     print UNIX "    wrap_" . $_ . ",\n";
 }
 print UNIX "};\n";
@@ -403,6 +417,7 @@ print UNIXHEADER "/* Automatically generated from OpenCL registry files; DO NOT
 print UNIXHEADER "struct opencl_funcs\n{\n";
 foreach (sort keys %core_functions)
 {
+    next unless needs_unix_function( $_ );
     print UNIXHEADER get_func_proto( "    %s (WINAPI *p%s)(%s);\n", $_, $core_functions{$_} );
 }
 print UNIXHEADER "};\n\n";
diff --git a/dlls/opencl/unix_thunks.c b/dlls/opencl/unix_thunks.c
index 084131468d6..0fe3a081e0b 100644
--- a/dlls/opencl/unix_thunks.c
+++ b/dlls/opencl/unix_thunks.c
@@ -172,11 +172,6 @@ static cl_int WINAPI wrap_clGetEventProfilingInfo( cl_event event, cl_profiling_
     return clGetEventProfilingInfo( event, param_name, param_value_size, param_value, param_value_size_ret );
 }
 
-static void* WINAPI wrap_clGetExtensionFunctionAddress( const char* func_name )
-{
-    return clGetExtensionFunctionAddress( func_name );
-}
-
 static cl_int WINAPI wrap_clGetImageInfo( cl_mem image, cl_image_info param_name, size_t param_value_size, void* param_value, size_t* param_value_size_ret )
 {
     return clGetImageInfo( image, param_name, param_value_size, param_value, param_value_size_ret );
@@ -356,7 +351,6 @@ const struct opencl_funcs funcs =
     wrap_clGetDeviceInfo,
     wrap_clGetEventInfo,
     wrap_clGetEventProfilingInfo,
-    wrap_clGetExtensionFunctionAddress,
     wrap_clGetImageInfo,
     wrap_clGetKernelInfo,
     wrap_clGetKernelWorkGroupInfo,
diff --git a/dlls/opencl/unixlib.h b/dlls/opencl/unixlib.h
index b6e53c30330..e0d01317db7 100644
--- a/dlls/opencl/unixlib.h
+++ b/dlls/opencl/unixlib.h
@@ -39,7 +39,6 @@ struct opencl_funcs
     cl_int (WINAPI *pclGetDeviceInfo)( cl_device_id device, cl_device_info param_name, size_t param_value_size, void* param_value, size_t* param_value_size_ret );
     cl_int (WINAPI *pclGetEventInfo)( cl_event event, cl_event_info param_name, size_t param_value_size, void* param_value, size_t* param_value_size_ret );
     cl_int (WINAPI *pclGetEventProfilingInfo)( cl_event event, cl_profiling_info param_name, size_t param_value_size, void* param_value, size_t* param_value_size_ret );
-    void* (WINAPI *pclGetExtensionFunctionAddress)( const char* func_name );
     cl_int (WINAPI *pclGetImageInfo)( cl_mem image, cl_image_info param_name, size_t param_value_size, void* param_value, size_t* param_value_size_ret );
     cl_int (WINAPI *pclGetKernelInfo)( cl_kernel kernel, cl_kernel_info param_name, size_t param_value_size, void* param_value, size_t* param_value_size_ret );
     cl_int (WINAPI *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 );
-- 
2.30.2




More information about the wine-devel mailing list