mesa: move GL_ARB_debug_output code into new debug_output.c file

The errors.c file had grown quite large so split off this extension
code into its own file.  This involved making a handful of functions
non-static.

Acked-by: Timothy Arceri <timothy.arceri@collabora.com>
This commit is contained in:
Brian Paul
2016-02-08 09:29:38 -07:00
parent 6691ba1fe8
commit 5fdbfb8d6f
12 changed files with 1435 additions and 1318 deletions

View File

@@ -27,6 +27,7 @@
#include "main/core.h" /* for struct gl_context */
#include "main/context.h"
#include "main/debug_output.h"
#include "main/shaderobj.h"
#include "util/u_atomic.h" /* for p_atomic_cmpxchg */
#include "util/ralloc.h"

View File

@@ -66,6 +66,7 @@ header = """/**
#include "main/convolve.h"
#include "main/copyimage.h"
#include "main/depth.h"
#include "main/debug_output.h"
#include "main/dlist.h"
#include "main/drawpix.h"
#include "main/drawtex.h"

View File

@@ -57,6 +57,8 @@ MAIN_FILES = \
main/dd.h \
main/debug.c \
main/debug.h \
main/debug_output.c \
main/debug_output.h \
main/depth.c \
main/depth.h \
main/dlist.c \

View File

@@ -89,6 +89,7 @@
#include "context.h"
#include "cpuinfo.h"
#include "debug.h"
#include "debug_output.h"
#include "depth.h"
#include "dlist.h"
#include "eval.h"
@@ -814,8 +815,8 @@ init_attrib_groups(struct gl_context *ctx)
_mesa_init_current( ctx );
_mesa_init_depth( ctx );
_mesa_init_debug( ctx );
_mesa_init_debug_output( ctx );
_mesa_init_display_list( ctx );
_mesa_init_errors( ctx );
_mesa_init_eval( ctx );
_mesa_init_fbobjects( ctx );
_mesa_init_feedback( ctx );

1301
src/mesa/main/debug_output.c Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,107 @@
/*
* Mesa 3-D graphics library
*
* Copyright (C) 1999-2016 Brian Paul, et al All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef DEBUG_OUTPUT_H
#define DEBUG_OUTPUT_H
#include <stdio.h>
#include <stdarg.h>
#include "compiler.h"
#include "glheader.h"
#include "mtypes.h"
#ifdef __cplusplus
extern "C" {
#endif
void
_mesa_init_debug_output(struct gl_context *ctx);
void
_mesa_free_errors_data(struct gl_context *ctx);
void
_mesa_debug_get_id(GLuint *id);
bool
_mesa_set_debug_state_int(struct gl_context *ctx, GLenum pname, GLint val);
GLint
_mesa_get_debug_state_int(struct gl_context *ctx, GLenum pname);
void *
_mesa_get_debug_state_ptr(struct gl_context *ctx, GLenum pname);
void
_mesa_log_msg(struct gl_context *ctx, enum mesa_debug_source source,
enum mesa_debug_type type, GLuint id,
enum mesa_debug_severity severity, GLint len, const char *buf);
bool
_mesa_debug_is_message_enabled(const struct gl_debug_state *debug,
enum mesa_debug_source source,
enum mesa_debug_type type,
GLuint id,
enum mesa_debug_severity severity);
void GLAPIENTRY
_mesa_DebugMessageInsert(GLenum source, GLenum type, GLuint id,
GLenum severity, GLint length,
const GLchar* buf);
GLuint GLAPIENTRY
_mesa_GetDebugMessageLog(GLuint count, GLsizei logSize, GLenum* sources,
GLenum* types, GLenum* ids, GLenum* severities,
GLsizei* lengths, GLchar* messageLog);
void GLAPIENTRY
_mesa_DebugMessageControl(GLenum source, GLenum type, GLenum severity,
GLsizei count, const GLuint *ids,
GLboolean enabled);
void GLAPIENTRY
_mesa_DebugMessageCallback(GLDEBUGPROC callback,
const void *userParam);
void GLAPIENTRY
_mesa_PushDebugGroup(GLenum source, GLuint id, GLsizei length,
const GLchar *message);
void GLAPIENTRY
_mesa_PopDebugGroup(void);
void GLAPIENTRY
_mesa_StringMarkerGREMEDY(GLsizei len, const GLvoid *string);
#ifdef __cplusplus
}
#endif
#endif /* DEBUG_OUTPUT_H */

View File

@@ -31,6 +31,7 @@
#include "glheader.h"
#include "clip.h"
#include "context.h"
#include "debug_output.h"
#include "enable.h"
#include "errors.h"
#include "light.h"

File diff suppressed because it is too large Load Diff

View File

@@ -47,14 +47,6 @@
extern "C" {
#endif
struct _glapi_table;
extern void
_mesa_init_errors( struct gl_context *ctx );
extern void
_mesa_free_errors_data( struct gl_context *ctx );
extern void
_mesa_warning( struct gl_context *gc, const char *fmtString, ... ) PRINTFLIKE(2, 3);
@@ -76,6 +68,10 @@ _mesa_log(const char *fmtString, ...) PRINTFLIKE(1, 2);
extern FILE *
_mesa_get_log_file(void);
void
_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id,
const char *msg);
extern void
_mesa_gl_vdebug(struct gl_context *ctx,
GLuint *id,
@@ -104,42 +100,6 @@ _mesa_gl_debug(struct gl_context *ctx,
} \
} while (0)
bool
_mesa_set_debug_state_int(struct gl_context *ctx, GLenum pname, GLint val);
GLint
_mesa_get_debug_state_int(struct gl_context *ctx, GLenum pname);
void *
_mesa_get_debug_state_ptr(struct gl_context *ctx, GLenum pname);
extern void
_mesa_shader_debug(struct gl_context *ctx, GLenum type, GLuint *id,
const char *msg);
void GLAPIENTRY
_mesa_DebugMessageInsert(GLenum source, GLenum type, GLuint id,
GLenum severity, GLint length,
const GLchar* buf);
GLuint GLAPIENTRY
_mesa_GetDebugMessageLog(GLuint count, GLsizei logSize, GLenum* sources,
GLenum* types, GLenum* ids, GLenum* severities,
GLsizei* lengths, GLchar* messageLog);
void GLAPIENTRY
_mesa_DebugMessageControl(GLenum source, GLenum type, GLenum severity,
GLsizei count, const GLuint *ids,
GLboolean enabled);
void GLAPIENTRY
_mesa_DebugMessageCallback(GLDEBUGPROC callback,
const void *userParam);
void GLAPIENTRY
_mesa_PushDebugGroup(GLenum source, GLuint id, GLsizei length,
const GLchar *message);
void GLAPIENTRY
_mesa_PopDebugGroup(void);
void GLAPIENTRY
_mesa_StringMarkerGREMEDY(GLsizei len, const GLvoid *string);
#ifdef __cplusplus
}

View File

@@ -26,6 +26,7 @@
#include "glheader.h"
#include "context.h"
#include "blend.h"
#include "debug_output.h"
#include "enable.h"
#include "enums.h"
#include "errors.h"

View File

@@ -26,6 +26,7 @@
#include <stdbool.h>
#include "glheader.h"
#include "context.h"
#include "debug_output.h"
#include "get.h"
#include "enums.h"
#include "extensions.h"

View File

@@ -28,6 +28,7 @@
#include "main/mtypes.h"
#include "main/extensions.h"
#include "main/context.h"
#include "main/debug_output.h"
#include "main/texobj.h"
#include "main/teximage.h"
#include "main/texstate.h"