1848b8605Smrg/**************************************************************************
2848b8605Smrg *
3848b8605Smrg * Copyright 2007 VMware, Inc.
4848b8605Smrg * All Rights Reserved.
5848b8605Smrg *
6848b8605Smrg * Permission is hereby granted, free of charge, to any person obtaining a
7848b8605Smrg * copy of this software and associated documentation files (the
8848b8605Smrg * "Software"), to deal in the Software without restriction, including
9848b8605Smrg * without limitation the rights to use, copy, modify, merge, publish,
10848b8605Smrg * distribute, sub license, and/or sell copies of the Software, and to
11848b8605Smrg * permit persons to whom the Software is furnished to do so, subject to
12848b8605Smrg * the following conditions:
13848b8605Smrg *
14848b8605Smrg * The above copyright notice and this permission notice (including the
15848b8605Smrg * next paragraph) shall be included in all copies or substantial portions
16848b8605Smrg * of the Software.
17848b8605Smrg *
18848b8605Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19848b8605Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20848b8605Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21848b8605Smrg * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22848b8605Smrg * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23848b8605Smrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24848b8605Smrg * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25848b8605Smrg *
26848b8605Smrg **************************************************************************/
27848b8605Smrg
28848b8605Smrg
29848b8605Smrg#ifndef LP_DEBUG_H
30848b8605Smrg#define LP_DEBUG_H
31848b8605Smrg
32848b8605Smrg#include "pipe/p_compiler.h"
33848b8605Smrg#include "util/u_debug.h"
34848b8605Smrg
35848b8605Smrgextern void
36848b8605Smrgst_print_current(void);
37848b8605Smrg
38848b8605Smrg
39848b8605Smrg#define DEBUG_PIPE      0x1
40848b8605Smrg#define DEBUG_TGSI      0x2
41848b8605Smrg#define DEBUG_TEX       0x4
42848b8605Smrg#define DEBUG_SETUP     0x10
43848b8605Smrg#define DEBUG_RAST      0x20
44848b8605Smrg#define DEBUG_QUERY     0x40
45848b8605Smrg#define DEBUG_SCREEN    0x80
46848b8605Smrg#define DEBUG_COUNTERS      0x800
47848b8605Smrg#define DEBUG_SCENE         0x1000
48848b8605Smrg#define DEBUG_FENCE         0x2000
49848b8605Smrg#define DEBUG_MEM           0x4000
50848b8605Smrg#define DEBUG_FS            0x8000
51848b8605Smrg
52848b8605Smrg/* Performance flags.  These are active even on release builds.
53848b8605Smrg */
54848b8605Smrg#define PERF_TEX_MEM        0x1  	/* minimize texture cache footprint */
55848b8605Smrg#define PERF_NO_MIP_LINEAR  0x2  	/* MIP_FILTER_LINEAR ==> _NEAREST */
56848b8605Smrg#define PERF_NO_MIPMAPS     0x4  	/* MIP_FILTER_NONE always */
57848b8605Smrg#define PERF_NO_LINEAR      0x8  	/* FILTER_NEAREST always */
58848b8605Smrg#define PERF_NO_TEX         0x10  	/* sample white always */
59848b8605Smrg#define PERF_NO_BLEND       0x20  	/* disable blending */
60848b8605Smrg#define PERF_NO_DEPTH       0x40  	/* disable depth buffering entirely */
61848b8605Smrg#define PERF_NO_ALPHATEST   0x80  	/* disable alpha testing */
62848b8605Smrg
63848b8605Smrg
64848b8605Smrgextern int LP_PERF;
65848b8605Smrg
66848b8605Smrg#ifdef DEBUG
67848b8605Smrgextern int LP_DEBUG;
68848b8605Smrg#else
69848b8605Smrg#define LP_DEBUG 0
70848b8605Smrg#endif
71848b8605Smrg
72848b8605Smrgvoid st_debug_init( void );
73848b8605Smrg
74b8e80941Smrgstatic inline void
75848b8605SmrgLP_DBG( unsigned flag, const char *fmt, ... )
76848b8605Smrg{
77848b8605Smrg    if (LP_DEBUG & flag)
78848b8605Smrg    {
79848b8605Smrg        va_list args;
80848b8605Smrg
81848b8605Smrg        va_start( args, fmt );
82848b8605Smrg        debug_vprintf( fmt, args );
83848b8605Smrg        va_end( args );
84848b8605Smrg    }
85848b8605Smrg}
86848b8605Smrg
87848b8605Smrg
88848b8605Smrg#endif /* LP_DEBUG_H */
89