From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/make_opengl | 11 ++++ dlls/opengl32/thunks.c | 110 ++++------------------------------ dlls/opengl32/wgl.c | 123 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 99 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 861fd104c08..7bfe0f219a2 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -164,6 +164,17 @@ my %manual_win_thunks = ( "glGetString" => 1, "glGetStringi" => 1, + "glMapBuffer" => 1, + "glMapBufferARB" => 1, + "glMapBufferRange" => 1, + "glMapNamedBuffer" => 1, + "glMapNamedBufferEXT" => 1, + "glMapNamedBufferRange" => 1, + "glMapNamedBufferRangeEXT" => 1, + "glUnmapBuffer" => 1, + "glUnmapBufferARB" => 1, + "glUnmapNamedBuffer" => 1, + "glUnmapNamedBufferEXT" => 1, "wglGetCurrentReadDCARB" => 1, "wglGetExtensionsStringARB" => 1, "wglGetExtensionsStringEXT" => 1, diff --git a/dlls/opengl32/thunks.c b/dlls/opengl32/thunks.c index 3f9c68f4f6f..bf1e961e53c 100644 --- a/dlls/opengl32/thunks.c +++ b/dlls/opengl32/thunks.c @@ -12147,33 +12147,6 @@ static void WINAPI glMap2xOES( GLenum target, GLfixed u1, GLfixed u2, GLint ustr if ((status = UNIX_CALL( glMap2xOES, &args ))) WARN( "glMap2xOES returned %#lx\n", status ); }
-static void * WINAPI glMapBuffer( GLenum target, GLenum access ) -{ - struct glMapBuffer_params args = { .target = target, .access = access, }; - NTSTATUS status; - TRACE( "target %d, access %d\n", target, access ); - if ((status = UNIX_CALL( glMapBuffer, &args ))) WARN( "glMapBuffer returned %#lx\n", status ); - return args.ret; -} - -static void * WINAPI glMapBufferARB( GLenum target, GLenum access ) -{ - struct glMapBufferARB_params args = { .target = target, .access = access, }; - NTSTATUS status; - TRACE( "target %d, access %d\n", target, access ); - if ((status = UNIX_CALL( glMapBufferARB, &args ))) WARN( "glMapBufferARB returned %#lx\n", status ); - return args.ret; -} - -static void * WINAPI glMapBufferRange( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) -{ - struct glMapBufferRange_params args = { .target = target, .offset = offset, .length = length, .access = access, }; - NTSTATUS status; - TRACE( "target %d, offset %Id, length %Id, access %d\n", target, offset, length, access ); - if ((status = UNIX_CALL( glMapBufferRange, &args ))) WARN( "glMapBufferRange returned %#lx\n", status ); - return args.ret; -} - static void WINAPI glMapControlPointsNV( GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void *points ) { struct glMapControlPointsNV_params args = { .target = target, .index = index, .type = type, .ustride = ustride, .vstride = vstride, .uorder = uorder, .vorder = vorder, .packed = packed, .points = points, }; @@ -12198,42 +12171,6 @@ static void WINAPI glMapGrid2xOES( GLint n, GLfixed u1, GLfixed u2, GLfixed v1, if ((status = UNIX_CALL( glMapGrid2xOES, &args ))) WARN( "glMapGrid2xOES returned %#lx\n", status ); }
-static void * WINAPI glMapNamedBuffer( GLuint buffer, GLenum access ) -{ - struct glMapNamedBuffer_params args = { .buffer = buffer, .access = access, }; - NTSTATUS status; - TRACE( "buffer %d, access %d\n", buffer, access ); - if ((status = UNIX_CALL( glMapNamedBuffer, &args ))) WARN( "glMapNamedBuffer returned %#lx\n", status ); - return args.ret; -} - -static void * WINAPI glMapNamedBufferEXT( GLuint buffer, GLenum access ) -{ - struct glMapNamedBufferEXT_params args = { .buffer = buffer, .access = access, }; - NTSTATUS status; - TRACE( "buffer %d, access %d\n", buffer, access ); - if ((status = UNIX_CALL( glMapNamedBufferEXT, &args ))) WARN( "glMapNamedBufferEXT returned %#lx\n", status ); - return args.ret; -} - -static void * WINAPI glMapNamedBufferRange( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ) -{ - struct glMapNamedBufferRange_params args = { .buffer = buffer, .offset = offset, .length = length, .access = access, }; - NTSTATUS status; - TRACE( "buffer %d, offset %Id, length %Id, access %d\n", buffer, offset, length, access ); - if ((status = UNIX_CALL( glMapNamedBufferRange, &args ))) WARN( "glMapNamedBufferRange returned %#lx\n", status ); - return args.ret; -} - -static void * WINAPI glMapNamedBufferRangeEXT( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ) -{ - struct glMapNamedBufferRangeEXT_params args = { .buffer = buffer, .offset = offset, .length = length, .access = access, }; - NTSTATUS status; - TRACE( "buffer %d, offset %Id, length %Id, access %d\n", buffer, offset, length, access ); - if ((status = UNIX_CALL( glMapNamedBufferRangeEXT, &args ))) WARN( "glMapNamedBufferRangeEXT returned %#lx\n", status ); - return args.ret; -} - static void * WINAPI glMapObjectBufferATI( GLuint buffer ) { struct glMapObjectBufferATI_params args = { .buffer = buffer, }; @@ -20733,42 +20670,6 @@ static void WINAPI glUnlockArraysEXT(void) if ((status = UNIX_CALL( glUnlockArraysEXT, &args ))) WARN( "glUnlockArraysEXT returned %#lx\n", status ); }
-static GLboolean WINAPI glUnmapBuffer( GLenum target ) -{ - struct glUnmapBuffer_params args = { .target = target, }; - NTSTATUS status; - TRACE( "target %d\n", target ); - if ((status = UNIX_CALL( glUnmapBuffer, &args ))) WARN( "glUnmapBuffer returned %#lx\n", status ); - return args.ret; -} - -static GLboolean WINAPI glUnmapBufferARB( GLenum target ) -{ - struct glUnmapBufferARB_params args = { .target = target, }; - NTSTATUS status; - TRACE( "target %d\n", target ); - if ((status = UNIX_CALL( glUnmapBufferARB, &args ))) WARN( "glUnmapBufferARB returned %#lx\n", status ); - return args.ret; -} - -static GLboolean WINAPI glUnmapNamedBuffer( GLuint buffer ) -{ - struct glUnmapNamedBuffer_params args = { .buffer = buffer, }; - NTSTATUS status; - TRACE( "buffer %d\n", buffer ); - if ((status = UNIX_CALL( glUnmapNamedBuffer, &args ))) WARN( "glUnmapNamedBuffer returned %#lx\n", status ); - return args.ret; -} - -static GLboolean WINAPI glUnmapNamedBufferEXT( GLuint buffer ) -{ - struct glUnmapNamedBufferEXT_params args = { .buffer = buffer, }; - NTSTATUS status; - TRACE( "buffer %d\n", buffer ); - if ((status = UNIX_CALL( glUnmapNamedBufferEXT, &args ))) WARN( "glUnmapNamedBufferEXT returned %#lx\n", status ); - return args.ret; -} - static void WINAPI glUnmapObjectBufferATI( GLuint buffer ) { struct glUnmapObjectBufferATI_params args = { .buffer = buffer, }; @@ -24434,6 +24335,17 @@ static BOOL WINAPI wglSwapIntervalEXT( int interval ) }
extern const GLubyte * WINAPI glGetStringi( GLenum name, GLuint index ) DECLSPEC_HIDDEN; +extern void * WINAPI glMapBuffer( GLenum target, GLenum access ) DECLSPEC_HIDDEN; +extern void * WINAPI glMapBufferARB( GLenum target, GLenum access ) DECLSPEC_HIDDEN; +extern void * WINAPI glMapBufferRange( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) DECLSPEC_HIDDEN; +extern void * WINAPI glMapNamedBuffer( GLuint buffer, GLenum access ) DECLSPEC_HIDDEN; +extern void * WINAPI glMapNamedBufferEXT( GLuint buffer, GLenum access ) DECLSPEC_HIDDEN; +extern void * WINAPI glMapNamedBufferRange( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ) DECLSPEC_HIDDEN; +extern void * WINAPI glMapNamedBufferRangeEXT( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ) DECLSPEC_HIDDEN; +extern GLboolean WINAPI glUnmapBuffer( GLenum target ) DECLSPEC_HIDDEN; +extern GLboolean WINAPI glUnmapBufferARB( GLenum target ) DECLSPEC_HIDDEN; +extern GLboolean WINAPI glUnmapNamedBuffer( GLuint buffer ) DECLSPEC_HIDDEN; +extern GLboolean WINAPI glUnmapNamedBufferEXT( GLuint buffer ) DECLSPEC_HIDDEN; extern HDC WINAPI wglGetCurrentReadDCARB(void) DECLSPEC_HIDDEN; extern const char * WINAPI wglGetExtensionsStringARB( HDC hdc ) DECLSPEC_HIDDEN; extern const char * WINAPI wglGetExtensionsStringEXT(void) DECLSPEC_HIDDEN; diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c index 08b12f48ce3..a0b924256d7 100644 --- a/dlls/opengl32/wgl.c +++ b/dlls/opengl32/wgl.c @@ -1036,6 +1036,129 @@ const GLchar * WINAPI wglQueryRendererStringWINE( HDC dc, GLint renderer, GLenum return args.ret; }
+void * WINAPI glMapBuffer( GLenum target, GLenum access ) +{ + struct glMapBuffer_params args = + { + .target = target, + .access = access, + }; + NTSTATUS status; + + TRACE( "target %d, access %d\n", target, access ); + + if (!(status = UNIX_CALL( glMapBuffer, &args ))) return args.ret; + WARN( "glMapBuffer returned %#lx\n", status ); + return args.ret; +} + +void * WINAPI glMapBufferARB( GLenum target, GLenum access ) +{ + return glMapBuffer( target, access ); +} + +void * WINAPI glMapBufferRange( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) +{ + struct glMapBufferRange_params args = + { + .target = target, + .offset = offset, + .length = length, + .access = access, + }; + NTSTATUS status; + + TRACE( "target %d, offset %Id, length %Id, access %d\n", target, offset, length, access ); + + if (!(status = UNIX_CALL( glMapBufferRange, &args ))) return args.ret; + WARN( "glMapBufferRange returned %#lx\n", status ); + return args.ret; +} + +void * WINAPI glMapNamedBuffer( GLuint buffer, GLenum access ) +{ + struct glMapNamedBuffer_params args = + { + .buffer = buffer, + .access = access, + }; + NTSTATUS status; + + TRACE( "(%d, %d)\n", buffer, access ); + + if (!(status = UNIX_CALL( glMapNamedBuffer, &args ))) return args.ret; + WARN( "glMapNamedBuffer returned %#lx\n", status ); + return args.ret; +} + +void * WINAPI glMapNamedBufferEXT( GLuint buffer, GLenum access ) +{ + return glMapNamedBuffer( buffer, access ); +} + +void * WINAPI glMapNamedBufferRange( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ) +{ + struct glMapNamedBufferRange_params args = + { + .buffer = buffer, + .offset = offset, + .length = length, + .access = access, + }; + NTSTATUS status; + + TRACE( "buffer %d, offset %Id, length %Id, access %d\n", buffer, offset, length, access ); + + if (!(status = UNIX_CALL( glMapNamedBufferRange, &args ))) return args.ret; + WARN( "glMapNamedBufferRange returned %#lx\n", status ); + return args.ret; +} + +void * WINAPI glMapNamedBufferRangeEXT( GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access ) +{ + return glMapNamedBufferRange( buffer, offset, length, access ); +} + +GLboolean WINAPI glUnmapBuffer( GLenum target ) +{ + struct glUnmapBuffer_params args = + { + .target = target, + }; + NTSTATUS status; + + TRACE( "target %d\n", target ); + + if (!(status = UNIX_CALL( glUnmapBuffer, &args ))) return args.ret; + WARN( "glUnmapBuffer returned %#lx\n", status ); + return args.ret; +} + +GLboolean WINAPI glUnmapBufferARB( GLenum target ) +{ + return glUnmapBuffer( target ); +} + +GLboolean WINAPI glUnmapNamedBuffer( GLuint buffer ) +{ + struct glUnmapNamedBuffer_params args = + { + .buffer = buffer, + }; + NTSTATUS status; + + TRACE( "buffer %d\n", buffer ); + + if (!(status = UNIX_CALL( glUnmapNamedBuffer, &args ))) return args.ret; + WARN( "glUnmapNamedBuffer returned %#lx\n", status ); + return args.ret; +} + +GLboolean WINAPI glUnmapNamedBufferEXT( GLuint buffer ) +{ + return glUnmapNamedBuffer( buffer ); +} + static BOOL WINAPI call_opengl_debug_message_callback( struct wine_gl_debug_message_params *params, ULONG size ) { params->user_callback( params->source, params->type, params->id, params->severity,