Re: [opengl] Catch BadMatch errors before they can occur.

2006-03-24 Thread Lionel Ulmer
 Oh, and this patch creates a new debug-channel 'swapbuffers' and puts
 both opengl swapbuffers functions into it.

What is the reason for this change ?

   Lionel

-- 
 Lionel Ulmer - http://www.bbrox.org/




Re: [opengl] Catch BadMatch errors before they can occur.

2006-03-24 Thread Tomas Carnecky
Lionel Ulmer wrote:
 Oh, and this patch creates a new debug-channel 'swapbuffers' and puts
 both opengl swapbuffers functions into it.
 
 What is the reason for this change ?
 

When debugging opengl applications, I'm usually not interested in the
*Swap*Buffers() functions, but in context creation, pbuffers stuff etc.
It just writes unnecessary messages into the console. When debugging an
application that crashes after 10 minutes it makes the log very big. If
someone is interested in the *Swap*Buffers() functions, he still can
enable them, but for the majority of the cases its useless.

That was basically the idea. I'll rewrite the patch and split it up, the
GLX spec violation thing could be committed without breaking
applications, other changes have to be tested first :)

tom




Re: [opengl] Catch BadMatch errors before they can occur.

2006-03-24 Thread Lionel Ulmer
On Fri, Mar 24, 2006 at 08:20:08PM +0100, Tomas Carnecky wrote:
 When debugging opengl applications, I'm usually not interested in the
 *Swap*Buffers() functions, but in context creation, pbuffers stuff etc.
 It just writes unnecessary messages into the console. When debugging an
 application that crashes after 10 minutes it makes the log very big. If
 someone is interested in the *Swap*Buffers() functions, he still can
 enable them, but for the majority of the cases its useless.

Strange as there are 'opengl' TRACEs for ALL OpenGL functions and extensions
so I would guess that those would vastly dwarf the SwapBuffer traces (except
if you have an application that does not draw anything on screen and just
does swapping its buffers :-) ).

   Lionel

-- 
 Lionel Ulmer - http://www.bbrox.org/




Re: [opengl] Catch BadMatch errors before they can occur.

2006-03-24 Thread Tomas Carnecky
Lionel Ulmer wrote:
 On Fri, Mar 24, 2006 at 08:20:08PM +0100, Tomas Carnecky wrote:
 When debugging opengl applications, I'm usually not interested in the
 *Swap*Buffers() functions, but in context creation, pbuffers stuff etc.
 It just writes unnecessary messages into the console. When debugging an
 application that crashes after 10 minutes it makes the log very big. If
 someone is interested in the *Swap*Buffers() functions, he still can
 enable them, but for the majority of the cases its useless.
 
 Strange as there are 'opengl' TRACEs for ALL OpenGL functions and extensions
 so I would guess that those would vastly dwarf the SwapBuffer traces (except
 if you have an application that does not draw anything on screen and just
 does swapping its buffers :-) ).
 

That's what I also thought.. now it comes to my mind! I may have
compiled with with debug disabled and now with debug enabled make didn't
recompile the file with all the 'real' OpenGL functions.

so.. what about splitting 'opengl' up into 'opengl' (all the opengl
functions) and 'oglsetup' with the setup/wgl/pbuffer etc. functions ?

tom




Re: [opengl] Catch BadMatch errors before they can occur.

2006-03-24 Thread Lionel Ulmer
On Fri, Mar 24, 2006 at 08:48:16PM +0100, Tomas Carnecky wrote:
 so.. what about splitting 'opengl' up into 'opengl' (all the opengl
 functions) and 'oglsetup' with the setup/wgl/pbuffer etc. functions ?

Why not 'wgl' ? So we would have 'opengl' for 'core' functions and 'wgl' for
the rest.

Lionel

-- 
 Lionel Ulmer - http://www.bbrox.org/




Re: [opengl] Catch BadMatch errors before they can occur.

2006-03-24 Thread Tomas Carnecky
Lionel Ulmer wrote:
 On Fri, Mar 24, 2006 at 08:48:16PM +0100, Tomas Carnecky wrote:
 so.. what about splitting 'opengl' up into 'opengl' (all the opengl
 functions) and 'oglsetup' with the setup/wgl/pbuffer etc. functions ?
 
 Why not 'wgl' ? So we would have 'opengl' for 'core' functions and 'wgl' for
 the rest.
 

ok.. here is a patch, but I can't make it work. Maybe someone else sees
the bug.

tom
diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index 71f7511..0a682b2 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -44,7 +44,8 @@
 #include wine/library.h
 #include wine/debug.h
 
-WINE_DEFAULT_DEBUG_CHANNEL(opengl);
+WINE_DEFAULT_DEBUG_CHANNEL(wgl);
+WINE_DECLARE_DEBUG_CHANNEL(opengl);
 
 /** global glx object */
 wine_glx_t wine_glx;
@@ -698,7 +720,7 @@ BOOL WINAPI wglShareLists(HGLRC hglrc1,
  */
 BOOL WINAPI wglSwapLayerBuffers(HDC hdc,
 UINT fuPlanes) {
-  TRACE((%p, %08x)\n, hdc, fuPlanes);
+  TRACE_(opengl)((%p, %08x)\n, hdc, fuPlanes);
 
   if (fuPlanes  WGL_SWAP_MAIN_PLANE) {
 if (!SwapBuffers(hdc)) return FALSE;
diff --git a/dlls/opengl32/wgl_ext.c b/dlls/opengl32/wgl_ext.c
index 24e990d..624a82c 100644
--- a/dlls/opengl32/wgl_ext.c
+++ b/dlls/opengl32/wgl_ext.c
@@ -37,7 +37,7 @@
 #include wine/library.h
 #include wine/debug.h
 
-WINE_DEFAULT_DEBUG_CHANNEL(opengl);
+WINE_DEFAULT_DEBUG_CHANNEL(wgl);
 
 
 /* x11drv GDI escapes */
diff --git a/dlls/x11drv/opengl.c b/dlls/x11drv/opengl.c
index 3fc0231..68733b4 100644
--- a/dlls/x11drv/opengl.c
+++ b/dlls/x11drv/opengl.c
@@ -28,7 +28,8 @@
 #include wine/library.h
 #include wine/debug.h
 
-WINE_DEFAULT_DEBUG_CHANNEL(opengl);
+WINE_DEFAULT_DEBUG_CHANNEL(wgl);
+WINE_DECLARE_DEBUG_CHANNEL(opengl);
 
 #if defined(HAVE_GL_GL_H)  defined(HAVE_GL_GLX_H)
 
@@ -533,7 +534,7 @@ BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *
 return 0;
   }
   
-  TRACE((%p)\n, physDev);
+  TRACE_(opengl)((%p)\n, physDev);
 
   wine_tsx11_lock();
   pglXSwapBuffers(gdi_display, physDev-drawable);



Re: [opengl] Catch BadMatch errors before they can occur.

2006-03-24 Thread Tony Lambregts

Tomas Carnecky wrote:

Lionel Ulmer wrote:

On Fri, Mar 24, 2006 at 08:48:16PM +0100, Tomas Carnecky wrote:

so.. what about splitting 'opengl' up into 'opengl' (all the opengl
functions) and 'oglsetup' with the setup/wgl/pbuffer etc. functions ?

Why not 'wgl' ? So we would have 'opengl' for 'core' functions and 'wgl' for
the rest.



ok.. here is a patch, but I can't make it work. Maybe someone else sees
the bug.

What is the problem. this is from a log of Google using your patch and 
WINEDBUG=+wgl,+opengl


trace:wgl:wglMakeCurrent  returning True
trace:opengl:wine_glGetString (7939)
trace:wgl:internal_glGetString GL_EXTENSIONS reported:

--

Tony Lambregts




Re: [opengl] Catch BadMatch errors before they can occur.

2006-03-24 Thread Tomas Carnecky
Tony Lambregts wrote:
 Tomas Carnecky wrote:
 ok.. here is a patch, but I can't make it work. Maybe someone else sees
 the bug.

 What is the problem. this is from a log of Google using your patch and
 WINEDBUG=+wgl,+opengl

As you maybe see in the patch, I've put both SwapBuffers functions to
the opengl debug channel (rather than to wgl), but they don't show in my
trace. So something with the TRACE_(opengl)(...) is wrong or with the
way I've set up the channels.

tom




Re: [opengl] Catch BadMatch errors before they can occur.

2006-03-24 Thread Tony Lambregts

Tomas Carnecky wrote:

Tony Lambregts wrote:

Tomas Carnecky wrote:

ok.. here is a patch, but I can't make it work. Maybe someone else sees
the bug.


What is the problem. this is from a log of Google using your patch and
WINEDBUG=+wgl,+opengl


As you maybe see in the patch, I've put both SwapBuffers functions to
the opengl debug channel (rather than to wgl), but they don't show in my
trace. So something with the TRACE_(opengl)(...) is wrong or with the
way I've set up the channels.

tom


I do not think there is anything wrong. Just a little further in the same log I 
have:


trace:opengl:X11DRV_SwapBuffers (0x7dde5470)
trace:opengl:wine_glFinish ()
trace:opengl:X11DRV_SwapBuffers (0x7dde5470)
trace:opengl:wine_glFinish ()
trace:opengl:X11DRV_SwapBuffers (0x7dde5470)
trace:opengl:wine_glFinish ()
...

I applied your patch and did:

$./configure  make depend  make
$su
#make install

Perhaps a make clean will help?

--

Tony Lambregts