1958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian/**************************************************************************
2958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian *
3958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
4958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * All Rights Reserved.
5958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian *
6958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * Permission is hereby granted, free of charge, to any person obtaining a
7958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * copy of this software and associated documentation files (the
8958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * "Software"), to deal in the Software without restriction, including
9958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * without limitation the rights to use, copy, modify, merge, publish,
10958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * distribute, sub license, and/or sell copies of the Software, and to
11958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * permit persons to whom the Software is furnished to do so, subject to
12958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * the following conditions:
13958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian *
14958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * The above copyright notice and this permission notice (including the
15958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * next paragraph) shall be included in all copies or substantial portions
16958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * of the Software.
17958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian *
18958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian *
26958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian **************************************************************************/
27958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian
28958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian
29958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian#ifndef ST_DEBUG_H
30958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian#define ST_DEBUG_H
31958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian
32b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#include "pipe/p_compiler.h"
33b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#include "util/u_debug.h"
34b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell
35958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrianextern void
36958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrianst_print_current(void);
37958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian
38958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian
39b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#define DEBUG_MESA      0x1
40b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#define DEBUG_TGSI      0x2
41b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#define DEBUG_CONSTANTS 0x4
42b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#define DEBUG_PIPE      0x8
43b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#define DEBUG_TEX       0x10
44b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#define DEBUG_FALLBACK  0x20
45b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#define DEBUG_QUERY     0x40
46b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#define DEBUG_SCREEN    0x80
47b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell
48b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#ifdef DEBUG
49b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwellextern int ST_DEBUG;
50b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#define DBSTR(x) x
51b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#else
52b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#define ST_DEBUG 0
53b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#define DBSTR(x) ""
54b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell#endif
55b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell
56b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwellvoid st_debug_init( void );
57b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell
58b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwellstatic INLINE void
59b02ef740b90029bc40629e5b81270a8cf77101d3Keith WhitwellST_DBG( unsigned flag, const char *fmt, ... )
60b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell{
61b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell    if (ST_DEBUG & flag)
62b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell    {
63b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell        va_list args;
64b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell
65b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell        va_start( args, fmt );
66b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell        debug_vprintf( fmt, args );
67b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell        va_end( args );
68b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell    }
69b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell}
70b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell
71b02ef740b90029bc40629e5b81270a8cf77101d3Keith Whitwell
72958c92e0c74f8cd4b303e7a7485a1c8b8cfde2cbBrian#endif /* ST_DEBUG_H */
73