Re: [Mesa-dev] [PATCH] mesa: move GL_ARB_debug_output code into new debug_output.c file

2016-02-08 Thread Brian Paul

On 02/05/2016 06:28 PM, Timothy Arceri wrote:

On Fri, 2016-02-05 at 17:54 -0700, Brian Paul wrote:

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.


I was going to do this when I added KHR_debug but was too new at the
time and didn't want to make such a big change.

Acked-by: Timothy Arceri 

I guess we could also move the object labels suff in there but probably
not worth the effort.


I think I'd prefer to keep them separate as-is, actually.

-Brian

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] mesa: move GL_ARB_debug_output code into new debug_output.c file

2016-02-05 Thread Brian Paul
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.
---
 src/compiler/glsl/glsl_parser_extras.cpp |1 +
 src/mapi/glapi/gen/gl_genexec.py |1 +
 src/mesa/Makefile.sources|2 +
 src/mesa/main/context.c  |3 +-
 src/mesa/main/debug_output.c | 1301 ++
 src/mesa/main/debug_output.h |  107 +++
 src/mesa/main/enable.c   |1 +
 src/mesa/main/errors.c   | 1286 +
 src/mesa/main/errors.h   |   48 +-
 src/mesa/main/get.c  |1 +
 src/mesa/main/getstring.c|1 +
 src/mesa/state_tracker/st_manager.c  |1 +
 12 files changed, 1435 insertions(+), 1318 deletions(-)
 create mode 100644 src/mesa/main/debug_output.c
 create mode 100644 src/mesa/main/debug_output.h

diff --git a/src/compiler/glsl/glsl_parser_extras.cpp 
b/src/compiler/glsl/glsl_parser_extras.cpp
index b635d99..20ec89d 100644
--- a/src/compiler/glsl/glsl_parser_extras.cpp
+++ b/src/compiler/glsl/glsl_parser_extras.cpp
@@ -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"
diff --git a/src/mapi/glapi/gen/gl_genexec.py b/src/mapi/glapi/gen/gl_genexec.py
index 6c66779..72d7b6f 100644
--- a/src/mapi/glapi/gen/gl_genexec.py
+++ b/src/mapi/glapi/gen/gl_genexec.py
@@ -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"
diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources
index ffe560f..35405e7 100644
--- a/src/mesa/Makefile.sources
+++ b/src/mesa/Makefile.sources
@@ -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 \
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 8b415ed..9388a1c 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -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 );
diff --git a/src/mesa/main/debug_output.c b/src/mesa/main/debug_output.c
new file mode 100644
index 000..10ee675
--- /dev/null
+++ b/src/mesa/main/debug_output.c
@@ -0,0 +1,1301 @@
+/*
+ * 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.
+ */
+
+
+#include 
+#include 
+#include "context.h"
+#include "debug_output.h"
+#include "dispatch.h"
+#include "enums.h"
+#include "imports.h"
+#include "hash.h"
+#include "mtypes.h"
+#include "version.h"
+#include "util/hash_table.h"
+#include "util/simple_list.h"
+
+
+static mtx_t DynamicIDMutex = _MTX_INITIALIZER_NP;
+static GLuint NextDynamicID = 1;
+
+
+/**
+ * A namespace element.
+ */
+struct gl_debug_element
+{
+   struct simple_node link;
+
+   GLuint ID;
+   /* at which severity levels (mesa_debug_severity) is the message enabled */
+   GLbitfield State;
+};
+
+
+struct gl_debug_namespace
+{
+   struct simple_node Elements;
+   GLbitfield DefaultState;
+};
+
+
+struct 

Re: [Mesa-dev] [PATCH] mesa: move GL_ARB_debug_output code into new debug_output.c file

2016-02-05 Thread Timothy Arceri
On Fri, 2016-02-05 at 17:54 -0700, Brian Paul wrote:
> 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.

I was going to do this when I added KHR_debug but was too new at the
time and didn't want to make such a big change.

Acked-by: Timothy Arceri 

I guess we could also move the object labels suff in there but probably
not worth the effort.

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev