From: Rémi Bernon <rbernon@codeweavers.com> --- dlls/opengl32/unix_wgl.c | 48 ++++------------------------------------ dlls/win32u/opengl.c | 17 +------------- 2 files changed, 5 insertions(+), 60 deletions(-) diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index a638b29bb91..7cc6b6a8968 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -879,8 +879,6 @@ const GLubyte *wrap_glGetString( TEB *teb, GLenum name ) PROC wrap_wglGetProcAddress( TEB *teb, LPCSTR name ) { const struct registry_entry *found; - struct opengl_funcs *funcs = teb->glTable; - const void **func_ptr; struct context *ctx; /* Without an active context opengl32 doesn't know to what @@ -904,20 +902,6 @@ PROC wrap_wglGetProcAddress( TEB *teb, LPCSTR name ) return (void *)-1; } - func_ptr = (const void **)((char *)funcs + found->offset); - if (!*func_ptr) - { - void *driver_func = funcs->p_wglGetProcAddress( name ); - - if (driver_func == NULL) - { - WARN( "Function %s not supported by driver\n", name ); - return (void *)-1; - } - - *func_ptr = driver_func; - } - /* Return the index into the extension registry instead of a useless * function pointer, PE side will returns its own function pointers. */ @@ -995,15 +979,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++) { @@ -1176,13 +1151,6 @@ static void make_context_current( TEB *teb, const struct opengl_funcs *funcs, HD if (client->major_version >= 3) { GLint extensions_count; - - if (!funcs->p_glGetStringi) - { - void **func_ptr = (void **)&funcs->p_glGetStringi; - *func_ptr = funcs->p_wglGetProcAddress( "glGetStringi" ); - } - funcs->p_glGetIntegerv( GL_NUM_EXTENSIONS, &extensions_count ); for (i = 0; i < extensions_count; i++) { @@ -2075,37 +2043,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 28050d9a94c..dd8b243f9f3 100644 --- a/dlls/win32u/opengl.c +++ b/dlls/win32u/opengl.c @@ -2687,22 +2687,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(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/10349