From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/opengl32/unix_wgl.c | 37 ++++++++++--------------------------- dlls/win32u/opengl.c | 18 +----------------- 2 files changed, 11 insertions(+), 44 deletions(-) diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 452af04b22f..01ce51ca99f 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -840,17 +840,17 @@ PROC wrap_wglGetProcAddress( TEB *teb, LPCSTR name ) return (void *)-1; } + if (strncmp( name, "wgl", 3) && !is_any_extension_supported( ctx, found->extension )) + { + WARN( "Extension %s required for %s not supported\n", found->extension, name ); + return (void *)-1; + } + func_ptr = (const void **)((char *)funcs + found->offset); if (!*func_ptr) { void *driver_func = funcs->p_wglGetProcAddress( name ); - if (!is_any_extension_supported( ctx, found->extension )) - { - WARN( "Extension %s required for %s not supported\n", found->extension, name ); - return (void *)-1; - } - if (driver_func == NULL) { WARN( "Function %s not supported by driver\n", name ); @@ -936,15 +936,6 @@ static BOOL initialize_vk_device( TEB *teb, struct context *ctx ) } if (!vk_instance) return FALSE; -#define GET_GL_FUNC(name) if (!funcs->p_##name) funcs->p_##name = (void *)funcs->p_wglGetProcAddress( #name ) - GET_GL_FUNC( glBufferStorageMemEXT ); - GET_GL_FUNC( glCreateMemoryObjectsEXT ); - GET_GL_FUNC( glDeleteMemoryObjectsEXT ); - GET_GL_FUNC( glGetUnsignedBytei_vEXT ); - GET_GL_FUNC( glImportMemoryFdEXT ); - GET_GL_FUNC( glNamedBufferStorageMemEXT ); -#undef GET_GL_FUNC - funcs->p_glGetIntegerv( GL_NUM_DEVICE_UUIDS_EXT, &uuid_count ); for (i = 0; i < uuid_count; i++) { @@ -2148,37 +2139,29 @@ NTSTATUS return_wow64_string( const void *str, PTR32 *wow64_str ) static GLint get_buffer_param( TEB *teb, GLenum target, GLenum param ) { const struct opengl_funcs *funcs = teb->glTable; - typeof(*funcs->p_glGetBufferParameteriv) *func; GLint size = 0; - if (!(func = funcs->p_glGetBufferParameteriv)) func = (void *)funcs->p_wglGetProcAddress( "glGetBufferParameteriv" ); - if (func) func( target, param, &size ); + if (funcs->p_glGetBufferParameteriv) funcs->p_glGetBufferParameteriv( target, param, &size ); return size; } static GLint get_named_buffer_param( TEB *teb, GLint buffer, GLenum param ) { const struct opengl_funcs *funcs = teb->glTable; - typeof(*funcs->p_glGetNamedBufferParameteriv) *func; GLint size = 0; - if (!(func = funcs->p_glGetNamedBufferParameteriv)) func = (void *)funcs->p_wglGetProcAddress( "glGetNamedBufferParameteriv" ); - if (func) func( buffer, param, &size ); + if (funcs->p_glGetNamedBufferParameteriv) funcs->p_glGetNamedBufferParameteriv( buffer, param, &size ); return size; } static void unmap_buffer( TEB *teb, GLenum target ) { const struct opengl_funcs *funcs = teb->glTable; - typeof(*funcs->p_glUnmapBuffer) *func; - if (!(func = funcs->p_glUnmapBuffer)) func = (void *)funcs->p_wglGetProcAddress( "glUnmapBuffer" ); - if (func) func( target ); + if (funcs->p_glUnmapBuffer) funcs->p_glUnmapBuffer( target ); } static void unmap_named_buffer( TEB *teb, GLint buffer ) { const struct opengl_funcs *funcs = teb->glTable; - typeof(*funcs->p_glUnmapNamedBuffer) *func; - if (!(func = funcs->p_glUnmapNamedBuffer)) func = (void *)funcs->p_wglGetProcAddress( "glUnmapNamedBuffer" ); - if (func) func( buffer ); + if (funcs->p_glUnmapNamedBuffer) funcs->p_glUnmapNamedBuffer( buffer ); } static GLuint get_target_name( TEB *teb, GLenum target ) diff --git a/dlls/win32u/opengl.c b/dlls/win32u/opengl.c index 6bc4e363633..c30fd88b7e7 100644 --- a/dlls/win32u/opengl.c +++ b/dlls/win32u/opengl.c @@ -2666,23 +2666,7 @@ static void display_funcs_init(void) if (!display_funcs.p_##func && !(display_funcs.p_##func = driver_funcs->p_get_proc_address( #func ))) \ WARN( "%s not found.\n", #func ); ALL_GL_FUNCS - USE_GL_FUNC(glBindFramebuffer) - USE_GL_FUNC(glBlitFramebuffer) - USE_GL_FUNC(glCheckNamedFramebufferStatus) - USE_GL_FUNC(glCreateFramebuffers) - USE_GL_FUNC(glCreateRenderbuffers) - USE_GL_FUNC(glDeleteFramebuffers) - USE_GL_FUNC(glDeleteRenderbuffers) - USE_GL_FUNC(glGetNamedFramebufferAttachmentParameteriv) - USE_GL_FUNC(glGetStringi) - USE_GL_FUNC(glGetUnsignedBytei_vEXT) - USE_GL_FUNC(glGetUnsignedBytevEXT) - USE_GL_FUNC(glImportMemoryFdEXT) - USE_GL_FUNC(glImportSemaphoreFdEXT) - USE_GL_FUNC(glNamedFramebufferDrawBuffer) - USE_GL_FUNC(glNamedFramebufferReadBuffer) - USE_GL_FUNC(glNamedFramebufferRenderbuffer) - USE_GL_FUNC(glNamedRenderbufferStorageMultisample) + ALL_GL_EXT_FUNCS #undef USE_GL_FUNC display_funcs.p_wglGetProcAddress = win32u_wglGetProcAddress; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10019