wined3d: Don't bother with glGetError() if we have ARB_DEBUG_OUTPUT.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-06-21 10:32:43 +02:00 committed by Alexandre Julliard
parent c7bbc83062
commit a1bc5b8c97
3 changed files with 26 additions and 11 deletions

View File

@ -1550,6 +1550,25 @@ static void bind_dummy_textures(const struct wined3d_device *device, const struc
}
}
void wined3d_check_gl_call(const struct wined3d_gl_info *gl_info,
const char *file, unsigned int line, const char *name)
{
GLint err;
if (gl_info->supported[ARB_DEBUG_OUTPUT] || (err = gl_info->gl_ops.gl.p_glGetError()) == GL_NO_ERROR)
{
TRACE("%s call ok %s / %u.\n", name, file, line);
return;
}
do
{
ERR(">>>>>>> %s (%#x) from %s @ %s / %u.\n",
debug_glerror(err), err, name, file,line);
err = gl_info->gl_ops.gl.p_glGetError();
} while (err != GL_NO_ERROR);
}
static BOOL context_debug_output_enabled(const struct wined3d_gl_info *gl_info)
{
return gl_info->supported[ARB_DEBUG_OUTPUT]

View File

@ -31,6 +31,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(d3d_draw);
WINE_DECLARE_DEBUG_CHANNEL(d3d_perf);
WINE_DECLARE_DEBUG_CHANNEL(d3d);
#include <stdio.h>
#include <math.h>

View File

@ -1130,22 +1130,17 @@ static inline void wined3d_color_from_d3dcolor(struct wined3d_color *wined3d_col
#define HIGHEST_TRANSFORMSTATE WINED3D_TS_WORLD_MATRIX(255) /* Highest value in wined3d_transform_state. */
void wined3d_check_gl_call(const struct wined3d_gl_info *gl_info,
const char *file, unsigned int line, const char *name) DECLSPEC_HIDDEN;
/* Checking of API calls */
/* --------------------- */
#ifndef WINE_NO_DEBUG_MSGS
#define checkGLcall(A) \
do { \
GLint err; \
if (!__WINE_IS_DEBUG_ON(_ERR, __wine_dbch___default)) break; \
err = gl_info->gl_ops.gl.p_glGetError(); \
if (err == GL_NO_ERROR) { \
TRACE("%s call ok %s / %d\n", A, __FILE__, __LINE__); \
\
} else do { \
ERR(">>>>>>>>>>>>>>>>> %s (%#x) from %s @ %s / %d\n", \
debug_glerror(err), err, A, __FILE__, __LINE__); \
err = gl_info->gl_ops.gl.p_glGetError(); \
} while (err != GL_NO_ERROR); \
if (__WINE_IS_DEBUG_ON(_ERR, &__wine_dbch_d3d) \
&& !gl_info->supported[ARB_DEBUG_OUTPUT]) \
wined3d_check_gl_call(gl_info, __FILE__, __LINE__, A); \
} while(0)
#else
#define checkGLcall(A) do {} while(0)