Commit aaa7f2ca authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Make OpenGL traces more compact and readable.

parent ef9c0cec
...@@ -740,16 +740,15 @@ failed: ...@@ -740,16 +740,15 @@ failed:
return FALSE; return FALSE;
} }
static int describeContext( struct wgl_context *ctx ) { static const char *debugstr_fbconfig( GLXFBConfig fbconfig )
int tmp; {
int ctx_vis_id; int id, visual, drawable;
TRACE(" Context %p have (vis:%p):\n", ctx, ctx->vis);
pglXGetFBConfigAttrib(gdi_display, ctx->fmt->fbconfig, GLX_FBCONFIG_ID, &tmp); if (pglXGetFBConfigAttrib( gdi_display, fbconfig, GLX_FBCONFIG_ID, &id ))
TRACE(" - FBCONFIG_ID 0x%x\n", tmp); return "*** invalid fbconfig";
pglXGetFBConfigAttrib(gdi_display, ctx->fmt->fbconfig, GLX_VISUAL_ID, &tmp); pglXGetFBConfigAttrib( gdi_display, fbconfig, GLX_VISUAL_ID, &visual );
TRACE(" - VISUAL_ID 0x%x\n", tmp); pglXGetFBConfigAttrib( gdi_display, fbconfig, GLX_DRAWABLE_TYPE, &drawable );
ctx_vis_id = tmp; return wine_dbg_sprintf( "fbconfig %#x visual id %#x drawable type %#x", id, visual, drawable );
return ctx_vis_id;
} }
static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, struct wgl_pbuffer* pbuf) { static int ConvertAttribWGLtoGLX(const int* iWGLAttr, int* oGLXAttr, struct wgl_pbuffer* pbuf) {
...@@ -1408,7 +1407,8 @@ static BOOL set_win_format( HWND hwnd, const struct wgl_pixel_format *format ) ...@@ -1408,7 +1407,8 @@ static BOOL set_win_format( HWND hwnd, const struct wgl_pixel_format *format )
return FALSE; return FALSE;
} }
TRACE("created GL drawable %lx for win %p format %x\n", gl->drawable, hwnd, format->fmt_id ); TRACE( "created GL drawable %lx for win %p %s\n",
gl->drawable, hwnd, debugstr_fbconfig( format->fbconfig ));
XFlush( gdi_display ); XFlush( gdi_display );
...@@ -1465,22 +1465,6 @@ static BOOL set_pixel_format(HDC hdc, int format, BOOL allow_change) ...@@ -1465,22 +1465,6 @@ static BOOL set_pixel_format(HDC hdc, int format, BOOL allow_change)
} }
} }
if (TRACE_ON(wgl)) {
int gl_test = 0;
gl_test = pglXGetFBConfigAttrib(gdi_display, fmt->fbconfig, GLX_FBCONFIG_ID, &value);
if (gl_test) {
ERR("Failed to retrieve FBCONFIG_ID from GLXFBConfig, expect problems.\n");
} else {
TRACE(" FBConfig have :\n");
TRACE(" - FBCONFIG_ID 0x%x\n", value);
pglXGetFBConfigAttrib(gdi_display, fmt->fbconfig, GLX_VISUAL_ID, &value);
TRACE(" - VISUAL_ID 0x%x\n", value);
pglXGetFBConfigAttrib(gdi_display, fmt->fbconfig, GLX_DRAWABLE_TYPE, &value);
TRACE(" - DRAWABLE_TYPE 0x%x\n", value);
}
}
return set_win_format( hwnd, fmt ); return set_win_format( hwnd, fmt );
} }
...@@ -1858,10 +1842,8 @@ static BOOL glxdrv_wglMakeCurrent(HDC hdc, struct wgl_context *ctx) ...@@ -1858,10 +1842,8 @@ static BOOL glxdrv_wglMakeCurrent(HDC hdc, struct wgl_context *ctx)
goto done; goto done;
} }
if (TRACE_ON(wgl)) { TRACE("hdc %p drawable %lx fmt %p ctx %p %s\n", hdc, gl->drawable, gl->format, ctx->ctx,
describeContext(ctx); debugstr_fbconfig( gl->format->fbconfig ));
TRACE("hdc %p drawable %lx fmt %p ctx %p\n", hdc, gl->drawable, gl->format, ctx->ctx );
}
ret = pglXMakeCurrent(gdi_display, gl->drawable, ctx->ctx); ret = pglXMakeCurrent(gdi_display, gl->drawable, ctx->ctx);
if (ret) if (ret)
...@@ -1957,13 +1939,12 @@ static BOOL glxdrv_wglShareLists(struct wgl_context *org, struct wgl_context *de ...@@ -1957,13 +1939,12 @@ static BOOL glxdrv_wglShareLists(struct wgl_context *org, struct wgl_context *de
} }
else else
{ {
describeContext(org);
describeContext(dest);
/* Re-create the GLX context and share display lists */ /* Re-create the GLX context and share display lists */
pglXDestroyContext(gdi_display, dest->ctx); pglXDestroyContext(gdi_display, dest->ctx);
dest->ctx = create_glxcontext(gdi_display, dest, org->ctx); dest->ctx = create_glxcontext(gdi_display, dest, org->ctx);
TRACE(" re-created an OpenGL context (%p) for Wine context %p sharing lists with OpenGL ctx %p\n", dest->ctx, dest, org->ctx); TRACE(" re-created context (%p) for Wine context %p (%s) sharing lists with ctx %p (%s)\n",
dest->ctx, dest, debugstr_fbconfig(dest->fmt->fbconfig),
org->ctx, debugstr_fbconfig( org->fmt->fbconfig));
org->sharing = TRUE; org->sharing = TRUE;
dest->sharing = TRUE; dest->sharing = TRUE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment