14a49301eSmrg/************************************************************************** 24a49301eSmrg * 3af69d88dSmrg * Copyright 2007 VMware, Inc. 44a49301eSmrg * All Rights Reserved. 54a49301eSmrg * 64a49301eSmrg * Permission is hereby granted, free of charge, to any person obtaining a 74a49301eSmrg * copy of this software and associated documentation files (the 84a49301eSmrg * "Software"), to deal in the Software without restriction, including 94a49301eSmrg * without limitation the rights to use, copy, modify, merge, publish, 104a49301eSmrg * distribute, sub license, and/or sell copies of the Software, and to 114a49301eSmrg * permit persons to whom the Software is furnished to do so, subject to 124a49301eSmrg * the following conditions: 134a49301eSmrg * 144a49301eSmrg * The above copyright notice and this permission notice (including the 154a49301eSmrg * next paragraph) shall be included in all copies or substantial portions 164a49301eSmrg * of the Software. 174a49301eSmrg * 184a49301eSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 194a49301eSmrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 204a49301eSmrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 21af69d88dSmrg * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR 224a49301eSmrg * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 234a49301eSmrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 244a49301eSmrg * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 254a49301eSmrg * 264a49301eSmrg **************************************************************************/ 274a49301eSmrg 284a49301eSmrg 294a49301eSmrg#ifndef LP_DEBUG_H 304a49301eSmrg#define LP_DEBUG_H 314a49301eSmrg 324a49301eSmrg#include "pipe/p_compiler.h" 334a49301eSmrg#include "util/u_debug.h" 344a49301eSmrg 354a49301eSmrg#define DEBUG_PIPE 0x1 364a49301eSmrg#define DEBUG_TGSI 0x2 374a49301eSmrg#define DEBUG_TEX 0x4 384a49301eSmrg#define DEBUG_SETUP 0x10 394a49301eSmrg#define DEBUG_RAST 0x20 404a49301eSmrg#define DEBUG_QUERY 0x40 414a49301eSmrg#define DEBUG_SCREEN 0x80 42cdc920a0Smrg#define DEBUG_COUNTERS 0x800 433464ebd5Sriastradh#define DEBUG_SCENE 0x1000 443464ebd5Sriastradh#define DEBUG_FENCE 0x2000 453464ebd5Sriastradh#define DEBUG_MEM 0x4000 463464ebd5Sriastradh#define DEBUG_FS 0x8000 477ec681f3Smrg#define DEBUG_CS 0x10000 487ec681f3Smrg#define DEBUG_TGSI_IR 0x20000 497ec681f3Smrg#define DEBUG_CACHE_STATS 0x40000 507ec681f3Smrg#define DEBUG_NO_FASTPATH 0x80000 517ec681f3Smrg#define DEBUG_LINEAR 0x100000 527ec681f3Smrg#define DEBUG_LINEAR2 0x200000 537ec681f3Smrg#define DEBUG_SHOW_DEPTH 0x400000 547ec681f3Smrg#define DEBUG_ACCURATE_A0 0x800000 /* verbose */ 55cdc920a0Smrg 563464ebd5Sriastradh/* Performance flags. These are active even on release builds. 573464ebd5Sriastradh */ 583464ebd5Sriastradh#define PERF_TEX_MEM 0x1 /* minimize texture cache footprint */ 593464ebd5Sriastradh#define PERF_NO_MIP_LINEAR 0x2 /* MIP_FILTER_LINEAR ==> _NEAREST */ 603464ebd5Sriastradh#define PERF_NO_MIPMAPS 0x4 /* MIP_FILTER_NONE always */ 613464ebd5Sriastradh#define PERF_NO_LINEAR 0x8 /* FILTER_NEAREST always */ 623464ebd5Sriastradh#define PERF_NO_TEX 0x10 /* sample white always */ 633464ebd5Sriastradh#define PERF_NO_BLEND 0x20 /* disable blending */ 643464ebd5Sriastradh#define PERF_NO_DEPTH 0x40 /* disable depth buffering entirely */ 653464ebd5Sriastradh#define PERF_NO_ALPHATEST 0x80 /* disable alpha testing */ 667ec681f3Smrg#define PERF_NO_RAST_LINEAR 0x100 /* disable linear rast */ 677ec681f3Smrg#define PERF_NO_SHADE 0x200 /* disable fragment shaders */ 683464ebd5Sriastradh 693464ebd5Sriastradh 703464ebd5Sriastradhextern int LP_PERF; 714a49301eSmrg 724a49301eSmrg#ifdef DEBUG 734a49301eSmrgextern int LP_DEBUG; 744a49301eSmrg#else 754a49301eSmrg#define LP_DEBUG 0 764a49301eSmrg#endif 774a49301eSmrg 784a49301eSmrgvoid st_debug_init( void ); 794a49301eSmrg 8001e04c3fSmrgstatic inline void 814a49301eSmrgLP_DBG( unsigned flag, const char *fmt, ... ) 824a49301eSmrg{ 834a49301eSmrg if (LP_DEBUG & flag) 844a49301eSmrg { 854a49301eSmrg va_list args; 864a49301eSmrg 874a49301eSmrg va_start( args, fmt ); 884a49301eSmrg debug_vprintf( fmt, args ); 894a49301eSmrg va_end( args ); 904a49301eSmrg } 914a49301eSmrg} 924a49301eSmrg 934a49301eSmrg 944a49301eSmrg#endif /* LP_DEBUG_H */ 95