From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/make_opengl | 1 + dlls/opengl32/unix_thunks.c | 20 +------------------- dlls/opengl32/unix_wgl.c | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+), 19 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 3155a2d797e..d41b6e7c054 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -171,6 +171,7 @@ my %manual_wow64_thunks = ( "glPathGlyphIndexRangeNV" => 1, "wglCreateContext" => 1, + "wglCreateContextAttribsARB" => 1, "wglDeleteContext" => 1, "wglGetProcAddress" => 1, "wglMakeContextCurrentARB" => 1, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 5accad6fc0b..6c8fba0b9f1 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -60644,25 +60644,6 @@ static NTSTATUS wow64_ext_wglChoosePixelFormatARB( void *args ) return status; }
-static NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) -{ - struct - { - PTR32 hDC; - PTR32 hShareContext; - PTR32 attribList; - PTR32 ret; - } *params32 = args; - struct wglCreateContextAttribsARB_params params = - { - .hDC = ULongToPtr(params32->hDC), - .hShareContext = ULongToPtr(params32->hShareContext), - .attribList = ULongToPtr(params32->attribList), - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ) { struct @@ -61006,6 +60987,7 @@ extern NTSTATUS wow64_wgl_wglDeleteContext( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_wgl_wglGetProcAddress( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_wgl_wglMakeCurrent( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_wglMakeContextCurrentARB( void *args ) DECLSPEC_HIDDEN;
const unixlib_entry_t __wine_unix_call_wow64_funcs[] = diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 6dc659dcca5..8f5e8010ea8 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1090,6 +1090,27 @@ NTSTATUS wow64_wgl_wglCreateContext( void *args ) return STATUS_SUCCESS; }
+NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) +{ + struct + { + PTR32 hDC; + PTR32 hShareContext; + PTR32 attribList; + PTR32 ret; + } *params32 = args; + struct wglCreateContextAttribsARB_params params = + { + .hDC = ULongToPtr(params32->hDC), + .hShareContext = ULongToPtr(params32->hShareContext), + .attribList = ULongToPtr(params32->attribList), + }; + NTSTATUS status; + if ((status = ext_wglCreateContextAttribsARB( ¶ms ))) return status; + params32->ret = (UINT_PTR)params.ret; + return STATUS_SUCCESS; +} + NTSTATUS wow64_wgl_wglDeleteContext( void *args ) { struct
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/make_opengl | 1 + dlls/opengl32/unix_thunks.c | 24 +----------------------- dlls/opengl32/unix_wgl.c | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 23 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index d41b6e7c054..85e01379b59 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -172,6 +172,7 @@ my %manual_wow64_thunks = "glPathGlyphIndexRangeNV" => 1, "wglCreateContext" => 1, "wglCreateContextAttribsARB" => 1, + "wglCreatePbufferARB" => 1, "wglDeleteContext" => 1, "wglGetProcAddress" => 1, "wglMakeContextCurrentARB" => 1, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 6c8fba0b9f1..e891b59ac3e 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -60644,29 +60644,6 @@ static NTSTATUS wow64_ext_wglChoosePixelFormatARB( void *args ) return status; }
-static NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ) -{ - struct - { - PTR32 hDC; - int iPixelFormat; - int iWidth; - int iHeight; - PTR32 piAttribList; - PTR32 ret; - } *params32 = args; - struct wglCreatePbufferARB_params params = - { - .hDC = ULongToPtr(params32->hDC), - .iPixelFormat = params32->iPixelFormat, - .iWidth = params32->iWidth, - .iHeight = params32->iHeight, - .piAttribList = ULongToPtr(params32->piAttribList), - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS wow64_ext_wglDestroyPbufferARB( void *args ) { struct @@ -60988,6 +60965,7 @@ extern NTSTATUS wow64_wgl_wglGetProcAddress( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_wgl_wglMakeCurrent( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_wglMakeContextCurrentARB( void *args ) DECLSPEC_HIDDEN;
const unixlib_entry_t __wine_unix_call_wow64_funcs[] = diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 8f5e8010ea8..905cd4472be 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1111,6 +1111,31 @@ NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) return STATUS_SUCCESS; }
+NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ) +{ + struct + { + PTR32 hDC; + GLint iPixelFormat; + GLint iWidth; + GLint iHeight; + PTR32 piAttribList; + PTR32 ret; + } *params32 = args; + struct wglCreatePbufferARB_params params = + { + .hDC = ULongToPtr(params32->hDC), + .iPixelFormat = params32->iPixelFormat, + .iWidth = params32->iWidth, + .iHeight = params32->iHeight, + .piAttribList = ULongToPtr(params32->piAttribList), + }; + NTSTATUS status; + if ((status = ext_wglCreatePbufferARB( ¶ms ))) return status; + params32->ret = (UINT_PTR)params.ret; + return STATUS_SUCCESS; +} + NTSTATUS wow64_wgl_wglDeleteContext( void *args ) { struct
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/make_opengl | 1 + dlls/opengl32/unix_thunks.c | 16 +--------------- dlls/opengl32/unix_wgl.c | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 85e01379b59..1d15234b73d 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -174,6 +174,7 @@ my %manual_wow64_thunks = "wglCreateContextAttribsARB" => 1, "wglCreatePbufferARB" => 1, "wglDeleteContext" => 1, + "wglGetPbufferDCARB" => 1, "wglGetProcAddress" => 1, "wglMakeContextCurrentARB" => 1, "wglMakeCurrent" => 1, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index e891b59ac3e..09d1c145bd1 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -60717,21 +60717,6 @@ static NTSTATUS wow64_ext_wglGetExtensionsStringEXT( void *args ) return STATUS_NOT_IMPLEMENTED; }
-static NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ) -{ - struct - { - PTR32 hPbuffer; - PTR32 ret; - } *params32 = args; - struct wglGetPbufferDCARB_params params = - { - .hPbuffer = ULongToPtr(params32->hPbuffer), - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS wow64_ext_wglGetPixelFormatAttribfvARB( void *args ) { struct @@ -60966,6 +60951,7 @@ extern NTSTATUS wow64_wgl_wglMakeCurrent( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_wglMakeContextCurrentARB( void *args ) DECLSPEC_HIDDEN;
const unixlib_entry_t __wine_unix_call_wow64_funcs[] = diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 905cd4472be..8bf15b47bfe 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -1193,6 +1193,23 @@ NTSTATUS wow64_ext_wglMakeContextCurrentARB( void *args ) return status; }
+NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ) +{ + struct + { + PTR32 hPbuffer; + PTR32 ret; + } *params32 = args; + struct wglGetPbufferDCARB_params params = + { + .hPbuffer = (HPBUFFERARB)ULongToPtr(params32->hPbuffer), + }; + NTSTATUS status; + if ((status = ext_wglGetPbufferDCARB( ¶ms ))) return status; + params32->ret = (UINT_PTR)params.ret; + return STATUS_SUCCESS; +} + NTSTATUS wow64_wgl_wglGetProcAddress( void *args ) { struct
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/make_opengl | 40 +++++++++++- dlls/opengl32/unix_private.h | 11 ++++ dlls/opengl32/unix_thunks.c | 122 +++++++++++++++++++++++++---------- 3 files changed, 138 insertions(+), 35 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 1d15234b73d..6748350529c 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -179,6 +179,26 @@ my %manual_wow64_thunks = "wglMakeContextCurrentARB" => 1, "wglMakeCurrent" => 1, ); +my %pointer_array_count = + ( + "glCompileShaderIncludeARB" => "count", + "glCreateShaderProgramv" => "count", + "glGetUniformIndices" => "uniformCount", + "glMultiDrawElements" => "drawcount", + "glMultiDrawElementsBaseVertex" => "drawcount", + "glMultiDrawElementsEXT" => "primcount", + "glMultiModeDrawElementsIBM" => "primcount", + "glTransformFeedbackVaryings" => "count", + "glTransformFeedbackVaryingsEXT" => "count", + "glShaderSource" => "count", + "glShaderSourceARB" => "count", + "glBindBuffersRange" => "count", + "glBindVertexBuffers" => "count", + "glDrawCommandsNV" => "count", + "glVertexArrayVertexBuffers" => "count", + "glDrawCommandsStatesNV" => "count", + "glListDrawCommandsStatesClientNV" => "count", + );
# # Used to convert some types @@ -364,7 +384,7 @@ sub generate_wow64_thunk($$$) my $ptype = get_wow64_arg_type( $arg ); my $pname = get_arg_name( $arg ); $ret .= " $ptype $pname;\n"; - $need_manual_thunk = 1 if $arg->textContent() =~ /(*.**|[)/ || $arg->textContent() =~ /(sizei|int)ptr.**/; + $need_manual_thunk = 1 if ($arg->textContent() =~ /(*.**|[)/ || $arg->textContent() =~ /(sizei|int)ptr.**/) && !defined $pointer_array_count{$_}; } if (!is_void_func($func)) { @@ -403,6 +423,15 @@ sub generate_wow64_thunk($$$) }
$ret .= " NTSTATUS status;\n"; + + foreach my $arg (@{$func->[1]}) + { + next unless $arg->textContent() =~ /*.**/ || $arg->textContent() =~ /(sizei|int)ptr.**/; + next unless defined $pointer_array_count{$_}; + my $pname = get_arg_name( $arg ); + $ret .= " params.$pname = copy_wow64_ptr32s( (UINT_PTR)params32->$pname, params32->$pointer_array_count{$_} );\n"; + } + $ret .= " status = $prefix_$name( ¶ms );\n"; if (!is_void_func( $func )) { @@ -410,6 +439,15 @@ sub generate_wow64_thunk($$$) $ret .= "(UINT_PTR)" if get_wow64_arg_type( $func->[0] ) =~ /PTR32/; $ret .= "params.ret;\n"; } + + foreach my $arg (@{$func->[1]}) + { + next unless $arg->textContent() =~ /*.**/ || $arg->textContent() =~ /(sizei|int)ptr.**/; + next unless defined $pointer_array_count{$_}; + my $pname = get_arg_name( $arg ); + $ret .= " free( (void *)params.$pname );\n"; + } + $ret .= " return status;\n"; $ret .= "}\n\n";
diff --git a/dlls/opengl32/unix_private.h b/dlls/opengl32/unix_private.h index cab4b8fc502..f67372f4c2f 100644 --- a/dlls/opengl32/unix_private.h +++ b/dlls/opengl32/unix_private.h @@ -20,6 +20,7 @@
#include <stdarg.h> #include <stddef.h> +#include <stdlib.h>
#include "ntstatus.h" #define WIN32_NO_STATUS @@ -50,4 +51,14 @@ static inline struct opengl_funcs *get_dc_funcs( HDC hdc ) return funcs; }
+static inline void *copy_wow64_ptr32s( UINT_PTR address, ULONG count ) +{ + ULONG *ptrs = (ULONG *)address; + void **tmp; + + if (!ptrs || !(tmp = calloc( count, sizeof(*tmp) ))) return NULL; + while (count--) tmp[count] = ULongToPtr(ptrs[count]); + return tmp; +} + #endif /* __WINE_OPENGL32_UNIX_PRIVATE_H */ diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index 09d1c145bd1..f00ae443216 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -30337,8 +30337,13 @@ static NTSTATUS wow64_ext_glBindBuffersRange( void *args ) .count = params32->count, .buffers = ULongToPtr(params32->buffers), }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.offsets = copy_wow64_ptr32s( (UINT_PTR)params32->offsets, params32->count ); + params.sizes = copy_wow64_ptr32s( (UINT_PTR)params32->sizes, params32->count ); + status = ext_glBindBuffersRange( ¶ms ); + free( (void *)params.offsets ); + free( (void *)params.sizes ); + return status; }
static NTSTATUS wow64_ext_glBindFragDataLocation( void *args ) @@ -30495,8 +30500,11 @@ static NTSTATUS wow64_ext_glBindVertexBuffers( void *args ) .buffers = ULongToPtr(params32->buffers), .strides = ULongToPtr(params32->strides), }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.offsets = copy_wow64_ptr32s( (UINT_PTR)params32->offsets, params32->count ); + status = ext_glBindVertexBuffers( ¶ms ); + free( (void *)params.offsets ); + return status; }
static NTSTATUS wow64_ext_glBindVideoCaptureStreamBufferNV( void *args ) @@ -31728,8 +31736,11 @@ static NTSTATUS wow64_ext_glCompileShaderIncludeARB( void *args ) .count = params32->count, .length = ULongToPtr(params32->length), }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.path = copy_wow64_ptr32s( (UINT_PTR)params32->path, params32->count ); + status = ext_glCompileShaderIncludeARB( ¶ms ); + free( (void *)params.path ); + return status; }
static NTSTATUS wow64_ext_glCompressedMultiTexImage1DEXT( void *args ) @@ -33073,8 +33084,12 @@ static NTSTATUS wow64_ext_glCreateShaderProgramv( void *args ) .type = params32->type, .count = params32->count, }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.strings = copy_wow64_ptr32s( (UINT_PTR)params32->strings, params32->count ); + status = ext_glCreateShaderProgramv( ¶ms ); + params32->ret = params.ret; + free( (void *)params.strings ); + return status; }
static NTSTATUS wow64_ext_glCreateStatesNV( void *args ) @@ -34150,8 +34165,11 @@ static NTSTATUS wow64_ext_glDrawCommandsNV( void *args ) .sizes = ULongToPtr(params32->sizes), .count = params32->count, }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.indirects = copy_wow64_ptr32s( (UINT_PTR)params32->indirects, params32->count ); + status = ext_glDrawCommandsNV( ¶ms ); + free( (void *)params.indirects ); + return status; }
static NTSTATUS wow64_ext_glDrawCommandsStatesAddressNV( void *args ) @@ -34196,8 +34214,11 @@ static NTSTATUS wow64_ext_glDrawCommandsStatesNV( void *args ) .fbos = ULongToPtr(params32->fbos), .count = params32->count, }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.indirects = copy_wow64_ptr32s( (UINT_PTR)params32->indirects, params32->count ); + status = ext_glDrawCommandsStatesNV( ¶ms ); + free( (void *)params.indirects ); + return status; }
static NTSTATUS wow64_ext_glDrawElementsBaseVertex( void *args ) @@ -41899,8 +41920,11 @@ static NTSTATUS wow64_ext_glGetUniformIndices( void *args ) .uniformCount = params32->uniformCount, .uniformIndices = ULongToPtr(params32->uniformIndices), }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.uniformNames = copy_wow64_ptr32s( (UINT_PTR)params32->uniformNames, params32->uniformCount ); + status = ext_glGetUniformIndices( ¶ms ); + free( (void *)params.uniformNames ); + return status; }
static NTSTATUS wow64_ext_glGetUniformLocation( void *args ) @@ -44411,8 +44435,11 @@ static NTSTATUS wow64_ext_glListDrawCommandsStatesClientNV( void *args ) .fbos = ULongToPtr(params32->fbos), .count = params32->count, }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.indirects = copy_wow64_ptr32s( (UINT_PTR)params32->indirects, params32->count ); + status = ext_glListDrawCommandsStatesClientNV( ¶ms ); + free( (void *)params.indirects ); + return status; }
static NTSTATUS wow64_ext_glListParameterfvSGIX( void *args ) @@ -45597,8 +45624,11 @@ static NTSTATUS wow64_ext_glMultiDrawElements( void *args ) .type = params32->type, .drawcount = params32->drawcount, }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.indices = copy_wow64_ptr32s( (UINT_PTR)params32->indices, params32->drawcount ); + status = ext_glMultiDrawElements( ¶ms ); + free( (void *)params.indices ); + return status; }
static NTSTATUS wow64_ext_glMultiDrawElementsBaseVertex( void *args ) @@ -45620,8 +45650,11 @@ static NTSTATUS wow64_ext_glMultiDrawElementsBaseVertex( void *args ) .drawcount = params32->drawcount, .basevertex = ULongToPtr(params32->basevertex), }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.indices = copy_wow64_ptr32s( (UINT_PTR)params32->indices, params32->drawcount ); + status = ext_glMultiDrawElementsBaseVertex( ¶ms ); + free( (void *)params.indices ); + return status; }
static NTSTATUS wow64_ext_glMultiDrawElementsEXT( void *args ) @@ -45641,8 +45674,11 @@ static NTSTATUS wow64_ext_glMultiDrawElementsEXT( void *args ) .type = params32->type, .primcount = params32->primcount, }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.indices = copy_wow64_ptr32s( (UINT_PTR)params32->indices, params32->primcount ); + status = ext_glMultiDrawElementsEXT( ¶ms ); + free( (void *)params.indices ); + return status; }
static NTSTATUS wow64_ext_glMultiDrawElementsIndirect( void *args ) @@ -45900,8 +45936,11 @@ static NTSTATUS wow64_ext_glMultiModeDrawElementsIBM( void *args ) .primcount = params32->primcount, .modestride = params32->modestride, }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.indices = copy_wow64_ptr32s( (UINT_PTR)params32->indices, params32->primcount ); + status = ext_glMultiModeDrawElementsIBM( ¶ms ); + free( (void *)params.indices ); + return status; }
static NTSTATUS wow64_ext_glMultiTexCoord1bvOES( void *args ) @@ -52761,8 +52800,11 @@ static NTSTATUS wow64_ext_glShaderSource( void *args ) .count = params32->count, .length = ULongToPtr(params32->length), }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.string = copy_wow64_ptr32s( (UINT_PTR)params32->string, params32->count ); + status = ext_glShaderSource( ¶ms ); + free( (void *)params.string ); + return status; }
static NTSTATUS wow64_ext_glShaderSourceARB( void *args ) @@ -52780,8 +52822,11 @@ static NTSTATUS wow64_ext_glShaderSourceARB( void *args ) .count = params32->count, .length = ULongToPtr(params32->length), }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.string = copy_wow64_ptr32s( (UINT_PTR)params32->string, params32->count ); + status = ext_glShaderSourceARB( ¶ms ); + free( (void *)params.string ); + return status; }
static NTSTATUS wow64_ext_glShadingRateImagePaletteNV( void *args ) @@ -54719,8 +54764,11 @@ static NTSTATUS wow64_ext_glTransformFeedbackVaryings( void *args ) .count = params32->count, .bufferMode = params32->bufferMode, }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.varyings = copy_wow64_ptr32s( (UINT_PTR)params32->varyings, params32->count ); + status = ext_glTransformFeedbackVaryings( ¶ms ); + free( (void *)params.varyings ); + return status; }
static NTSTATUS wow64_ext_glTransformFeedbackVaryingsEXT( void *args ) @@ -54738,8 +54786,11 @@ static NTSTATUS wow64_ext_glTransformFeedbackVaryingsEXT( void *args ) .count = params32->count, .bufferMode = params32->bufferMode, }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.varyings = copy_wow64_ptr32s( (UINT_PTR)params32->varyings, params32->count ); + status = ext_glTransformFeedbackVaryingsEXT( ¶ms ); + free( (void *)params.varyings ); + return status; }
static NTSTATUS wow64_ext_glTransformFeedbackVaryingsNV( void *args ) @@ -56971,8 +57022,11 @@ static NTSTATUS wow64_ext_glVertexArrayVertexBuffers( void *args ) .buffers = ULongToPtr(params32->buffers), .strides = ULongToPtr(params32->strides), }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; + NTSTATUS status; + params.offsets = copy_wow64_ptr32s( (UINT_PTR)params32->offsets, params32->count ); + status = ext_glVertexArrayVertexBuffers( ¶ms ); + free( (void *)params.offsets ); + return status; }
static NTSTATUS wow64_ext_glVertexArrayVertexOffsetEXT( void *args )
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/make_opengl | 6 ++ dlls/opengl32/unix_thunks.c | 130 +++--------------------- dlls/opengl32/unix_wgl.c | 194 +++++++++++++++++++++++++++++++++++- 3 files changed, 211 insertions(+), 119 deletions(-)
diff --git a/dlls/opengl32/make_opengl b/dlls/opengl32/make_opengl index 6748350529c..6c1ab65fb7b 100755 --- a/dlls/opengl32/make_opengl +++ b/dlls/opengl32/make_opengl @@ -169,7 +169,13 @@ my %manual_win_thunks = ); my %manual_wow64_thunks = ( + "glClientWaitSync" => 1, + "glDeleteSync" => 1, + "glFenceSync" => 1, + "glGetSynciv" => 1, + "glIsSync" => 1, "glPathGlyphIndexRangeNV" => 1, + "glWaitSync" => 1, "wglCreateContext" => 1, "wglCreateContextAttribsARB" => 1, "wglCreatePbufferARB" => 1, diff --git a/dlls/opengl32/unix_thunks.c b/dlls/opengl32/unix_thunks.c index f00ae443216..c5e4aedbc6a 100644 --- a/dlls/opengl32/unix_thunks.c +++ b/dlls/opengl32/unix_thunks.c @@ -4146,7 +4146,7 @@ static NTSTATUS ext_glClientWaitSemaphoreui64NVX( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glClientWaitSync( void *args ) +NTSTATUS ext_glClientWaitSync( void *args ) { struct glClientWaitSync_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -5746,7 +5746,7 @@ static NTSTATUS ext_glDeleteStatesNV( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glDeleteSync( void *args ) +NTSTATUS ext_glDeleteSync( void *args ) { struct glDeleteSync_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -6656,7 +6656,7 @@ static NTSTATUS ext_glFeedbackBufferxOES( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glFenceSync( void *args ) +NTSTATUS ext_glFenceSync( void *args ) { struct glFenceSync_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -9803,7 +9803,7 @@ static NTSTATUS ext_glGetSubroutineUniformLocation( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glGetSynciv( void *args ) +NTSTATUS ext_glGetSynciv( void *args ) { struct glGetSynciv_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -11555,7 +11555,7 @@ static NTSTATUS ext_glIsStateNV( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glIsSync( void *args ) +NTSTATUS ext_glIsSync( void *args ) { struct glIsSync_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -23465,7 +23465,7 @@ static NTSTATUS ext_glWaitSemaphoreui64NVX( void *args ) return STATUS_SUCCESS; }
-static NTSTATUS ext_glWaitSync( void *args ) +NTSTATUS ext_glWaitSync( void *args ) { struct glWaitSync_params *params = args; const struct opengl_funcs *funcs = NtCurrentTeb()->glTable; @@ -31187,27 +31187,6 @@ static NTSTATUS wow64_ext_glClientWaitSemaphoreui64NVX( void *args ) return status; }
-static NTSTATUS wow64_ext_glClientWaitSync( void *args ) -{ - struct - { - PTR32 sync; - GLbitfield flags; - GLuint64 timeout; - GLenum ret; - } *params32 = args; - struct glClientWaitSync_params params = - { - .sync = ULongToPtr(params32->sync), - .flags = params32->flags, - .timeout = params32->timeout, - }; - NTSTATUS status; - status = ext_glClientWaitSync( ¶ms ); - params32->ret = params.ret; - return status; -} - static NTSTATUS wow64_ext_glClipPlanefOES( void *args ) { struct @@ -33887,21 +33866,6 @@ static NTSTATUS wow64_ext_glDeleteStatesNV( void *args ) return status; }
-static NTSTATUS wow64_ext_glDeleteSync( void *args ) -{ - struct - { - PTR32 sync; - } *params32 = args; - struct glDeleteSync_params params = - { - .sync = ULongToPtr(params32->sync), - }; - NTSTATUS status; - status = ext_glDeleteSync( ¶ms ); - return status; -} - static NTSTATUS wow64_ext_glDeleteTexturesEXT( void *args ) { struct @@ -34677,23 +34641,6 @@ static NTSTATUS wow64_ext_glFeedbackBufferxOES( void *args ) return status; }
-static NTSTATUS wow64_ext_glFenceSync( void *args ) -{ - struct - { - GLenum condition; - GLbitfield flags; - PTR32 ret; - } *params32 = args; - struct glFenceSync_params params = - { - .condition = params32->condition, - .flags = params32->flags, - }; - FIXME( "params32 %p, params %p stub!\n", params32, ¶ms ); - return STATUS_NOT_IMPLEMENTED; -} - static NTSTATUS wow64_ext_glFinishAsyncSGIX( void *args ) { struct @@ -41149,29 +41096,6 @@ static NTSTATUS wow64_ext_glGetSubroutineUniformLocation( void *args ) return status; }
-static NTSTATUS wow64_ext_glGetSynciv( void *args ) -{ - struct - { - PTR32 sync; - GLenum pname; - GLsizei count; - PTR32 length; - PTR32 values; - } *params32 = args; - struct glGetSynciv_params params = - { - .sync = ULongToPtr(params32->sync), - .pname = params32->pname, - .count = params32->count, - .length = ULongToPtr(params32->length), - .values = ULongToPtr(params32->values), - }; - NTSTATUS status; - status = ext_glGetSynciv( ¶ms ); - return status; -} - static NTSTATUS wow64_ext_glGetTexBumpParameterfvATI( void *args ) { struct @@ -44317,23 +44241,6 @@ static NTSTATUS wow64_ext_glIsNamedStringARB( void *args ) return status; }
-static NTSTATUS wow64_ext_glIsSync( void *args ) -{ - struct - { - PTR32 sync; - GLboolean ret; - } *params32 = args; - struct glIsSync_params params = - { - .sync = ULongToPtr(params32->sync), - }; - NTSTATUS status; - status = ext_glIsSync( ¶ms ); - params32->ret = params.ret; - return status; -} - static NTSTATUS wow64_ext_glLGPUNamedBufferSubDataNVX( void *args ) { struct @@ -59995,25 +59902,6 @@ static NTSTATUS wow64_ext_glWaitSemaphoreui64NVX( void *args ) return status; }
-static NTSTATUS wow64_ext_glWaitSync( void *args ) -{ - struct - { - PTR32 sync; - GLbitfield flags; - GLuint64 timeout; - } *params32 = args; - struct glWaitSync_params params = - { - .sync = ULongToPtr(params32->sync), - .flags = params32->flags, - .timeout = params32->timeout, - }; - NTSTATUS status; - status = ext_glWaitSync( ¶ms ); - return status; -} - static NTSTATUS wow64_ext_glWeightPathsNV( void *args ) { struct @@ -61002,7 +60890,13 @@ extern NTSTATUS wow64_wgl_wglCreateContext( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_wgl_wglDeleteContext( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_wgl_wglGetProcAddress( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_wgl_wglMakeCurrent( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glClientWaitSync( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glDeleteSync( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glFenceSync( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glGetSynciv( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glIsSync( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS wow64_ext_glWaitSync( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_wglCreateContextAttribsARB( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_wglCreatePbufferARB( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS wow64_ext_wglGetPbufferDCARB( void *args ) DECLSPEC_HIDDEN; diff --git a/dlls/opengl32/unix_wgl.c b/dlls/opengl32/unix_wgl.c index 8bf15b47bfe..b53c754be50 100644 --- a/dlls/opengl32/unix_wgl.c +++ b/dlls/opengl32/unix_wgl.c @@ -52,7 +52,8 @@ enum wgl_handle_type HANDLE_PBUFFER = 0 << 12, HANDLE_CONTEXT = 1 << 12, HANDLE_CONTEXT_V3 = 3 << 12, - HANDLE_TYPE_MASK = 15 << 12 + HANDLE_GLSYNC = 4 << 12, + HANDLE_TYPE_MASK = 15 << 12, };
struct opengl_context @@ -1058,7 +1059,13 @@ NTSTATUS WINAPI thread_attach( void *args )
typedef ULONG PTR32;
+extern NTSTATUS ext_glClientWaitSync( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glDeleteSync( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glFenceSync( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glGetSynciv( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glIsSync( void *args ) DECLSPEC_HIDDEN; extern NTSTATUS ext_glPathGlyphIndexRangeNV( void *args ) DECLSPEC_HIDDEN; +extern NTSTATUS ext_glWaitSync( void *args ) DECLSPEC_HIDDEN;
static inline void update_teb32_context(void) { @@ -1254,4 +1261,189 @@ NTSTATUS wow64_ext_glPathGlyphIndexRangeNV( void *args ) return status; }
+NTSTATUS wow64_ext_glClientWaitSync( void *args ) +{ + struct wgl_handle *handle; + struct + { + PTR32 sync; + GLbitfield flags; + GLuint64 timeout; + GLenum ret; + } *params32 = args; + NTSTATUS status; + + pthread_mutex_lock( &wgl_lock ); + + if (!(handle = get_handle_ptr( ULongToPtr(params32->sync), HANDLE_GLSYNC ))) + status = STATUS_INVALID_HANDLE; + else + { + struct glClientWaitSync_params params = + { + .sync = (GLsync)handle->u.context, + .flags = params32->flags, + .timeout = params32->timeout, + }; + status = ext_glClientWaitSync( ¶ms ); + params32->ret = params.ret; + } + + pthread_mutex_unlock( &wgl_lock ); + return status; +} + +NTSTATUS wow64_ext_glDeleteSync( void *args ) +{ + struct wgl_handle *handle; + struct + { + PTR32 sync; + } *params32 = args; + NTSTATUS status; + + pthread_mutex_lock( &wgl_lock ); + + if (!(handle = get_handle_ptr( ULongToPtr(params32->sync), HANDLE_GLSYNC ))) + status = STATUS_INVALID_HANDLE; + else + { + struct glDeleteSync_params params = + { + .sync = (GLsync)handle->u.context, + }; + status = ext_glDeleteSync( ¶ms ); + free_handle_ptr( handle ); + } + + pthread_mutex_unlock( &wgl_lock ); + return status; +} + +NTSTATUS wow64_ext_glFenceSync( void *args ) +{ + struct + { + GLenum condition; + GLbitfield flags; + PTR32 ret; + } *params32 = args; + struct glFenceSync_params params = + { + .condition = params32->condition, + .flags = params32->flags, + }; + NTSTATUS status; + + if ((status = ext_glFenceSync( ¶ms ))) return status; + + pthread_mutex_lock( &wgl_lock ); + + if (!(params32->ret = (UINT_PTR)alloc_handle( HANDLE_GLSYNC, NULL, params.ret ))) + { + struct glDeleteSync_params delete_params = + { + .sync = params.ret, + }; + + ext_glDeleteSync( &delete_params ); + status = STATUS_NO_MEMORY; + } + + pthread_mutex_unlock( &wgl_lock ); + return status; +} + +NTSTATUS wow64_ext_glGetSynciv( void *args ) +{ + struct wgl_handle *handle; + struct + { + PTR32 sync; + GLenum pname; + GLsizei count; + PTR32 length; + PTR32 values; + } *params32 = args; + NTSTATUS status; + + pthread_mutex_lock( &wgl_lock ); + + if (!(handle = get_handle_ptr( ULongToPtr(params32->sync), HANDLE_GLSYNC ))) + status = STATUS_INVALID_HANDLE; + else + { + struct glGetSynciv_params params = + { + .sync = (GLsync)handle->u.context, + .pname = params32->pname, + .count = params32->count, + .length = ULongToPtr(params32->length), + .values = ULongToPtr(params32->values), + }; + status = ext_glGetSynciv( ¶ms ); + } + + pthread_mutex_unlock( &wgl_lock ); + return status; +} + +NTSTATUS wow64_ext_glIsSync( void *args ) +{ + struct wgl_handle *handle; + struct + { + PTR32 sync; + GLboolean ret; + } *params32 = args; + NTSTATUS status; + + pthread_mutex_lock( &wgl_lock ); + + if (!(handle = get_handle_ptr( ULongToPtr(params32->sync), HANDLE_GLSYNC ))) + status = STATUS_INVALID_HANDLE; + else + { + struct glIsSync_params params = + { + .sync = (GLsync)handle->u.context, + }; + status = ext_glIsSync( ¶ms ); + params32->ret = params.ret; + } + + pthread_mutex_unlock( &wgl_lock ); + return status; +} + +NTSTATUS wow64_ext_glWaitSync( void *args ) +{ + struct wgl_handle *handle; + struct + { + PTR32 sync; + GLbitfield flags; + GLuint64 timeout; + } *params32 = args; + NTSTATUS status; + + pthread_mutex_lock( &wgl_lock ); + + if (!(handle = get_handle_ptr( ULongToPtr(params32->sync), HANDLE_GLSYNC ))) + status = STATUS_INVALID_HANDLE; + else + { + struct glWaitSync_params params = + { + .sync = (GLsync)handle->u.context, + .flags = params32->flags, + .timeout = params32->timeout, + }; + status = ext_glWaitSync( ¶ms ); + } + + pthread_mutex_unlock( &wgl_lock ); + return status; +} + #endif
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=126350
Your paranoid android.
=== debian11 (32 bit report) ===
d3d8: stateblock: Timeout visual: Timeout
d3d9: d3d9ex: Timeout device: Timeout stateblock: Timeout visual: Timeout
d3dcompiler_43: asm: Timeout blob: Timeout hlsl_d3d11: Timeout hlsl_d3d9: Timeout reflection: Timeout
d3dcompiler_46: asm: Timeout blob: Timeout hlsl_d3d11: Timeout hlsl_d3d9: Timeout reflection: Timeout
d3dcompiler_47: asm: Timeout blob: Timeout hlsl_d3d11: Timeout hlsl_d3d9: Timeout reflection: Timeout
d3drm: d3drm: Timeout vector: Timeout
d3dx10_34: d3dx10: Timeout
d3dx10_35: d3dx10: Timeout
d3dx10_36: d3dx10: Timeout
d3dx10_37: d3dx10: Timeout
d3dx10_38: d3dx10: Timeout
d3dx10_39: d3dx10: Timeout
d3dx10_40: d3dx10: Timeout
d3dx10_41: d3dx10: Timeout
d3dx10_42: d3dx10: Timeout
d3dx10_43: d3dx10: Timeout
Report validation errors: d3dx11: Timeout
=== debian11 (build log) ===
WineRunWineTest.pl:error: The task timed out
=== debian11b (build log) ===
error: patch failed: dlls/opengl32/make_opengl:171 error: patch failed: dlls/opengl32/unix_thunks.c:60644 error: patch failed: dlls/opengl32/unix_wgl.c:1090 error: patch failed: dlls/opengl32/make_opengl:172 error: patch failed: dlls/opengl32/unix_thunks.c:60644 error: patch failed: dlls/opengl32/unix_wgl.c:1111 error: patch failed: dlls/opengl32/make_opengl:174 error: patch failed: dlls/opengl32/unix_thunks.c:60717 error: patch failed: dlls/opengl32/unix_wgl.c:1193 error: patch failed: dlls/opengl32/make_opengl:179 error: patch failed: dlls/opengl32/unix_thunks.c:30337 error: patch failed: dlls/opengl32/make_opengl:169 error: patch failed: dlls/opengl32/unix_thunks.c:31187 error: patch failed: dlls/opengl32/unix_wgl.c:1058 Task: Patch failed to apply