Path: blob/21.2-virgl/src/gallium/drivers/llvmpipe/lp_perf.h
4570 views
/**************************************************************************1*2* Copyright 2009 VMware, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627/**28* Performance / statistic counters, etc.29*/303132#ifndef LP_PERF_H33#define LP_PERF_H3435#include "pipe/p_compiler.h"3637/**38* Various counters39*/40struct lp_counters41{42unsigned nr_tris;43unsigned nr_culled_tris;44unsigned nr_empty_64;45unsigned nr_fully_covered_64;46unsigned nr_partially_covered_64;47unsigned nr_pure_shade_opaque_64;48unsigned nr_pure_shade_64;49unsigned nr_shade_64;50unsigned nr_shade_opaque_64;51unsigned nr_empty_16;52unsigned nr_fully_covered_16;53unsigned nr_partially_covered_16;54unsigned nr_empty_4;55unsigned nr_fully_covered_4;56unsigned nr_partially_covered_4;57unsigned nr_non_empty_4;58unsigned nr_llvm_compiles;59int64_t llvm_compile_time; /**< total, in microseconds */6061unsigned nr_color_tile_clear;62unsigned nr_color_tile_load;63unsigned nr_color_tile_store;64};656667extern struct lp_counters lp_count;686970/** Increment the named counter (only for debug builds) */71#ifdef DEBUG72#define LP_COUNT(counter) lp_count.counter++73#define LP_COUNT_ADD(counter, incr) lp_count.counter += (incr)74#define LP_COUNT_GET(counter) (lp_count.counter)75#else76#define LP_COUNT(counter) do {} while (0)77#define LP_COUNT_ADD(counter, incr) (void)(incr)78#define LP_COUNT_GET(counter) 079#endif808182extern void83lp_reset_counters(void);848586extern void87lp_print_counters(void);888990#endif /* LP_PERF_H */919293