| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#pragma once |
| 5 |
|
| 6 |
#include <array> |
| 7 |
#include <vector> |
| 8 |
|
| 9 |
#include "VideoCommon/BPFunctions.h" |
| 10 |
|
| 11 |
struct Statistics |
| 12 |
{ |
| 13 |
int num_pixel_shaders_created = 0; |
| 14 |
int num_pixel_shaders_alive = 0; |
| 15 |
int num_vertex_shaders_created = 0; |
| 16 |
int num_vertex_shaders_alive = 0; |
| 17 |
|
| 18 |
int num_textures_created = 0; |
| 19 |
int num_textures_uploaded = 0; |
| 20 |
int num_textures_alive = 0; |
| 21 |
|
| 22 |
int num_vertex_loaders = 0; |
| 23 |
|
| 24 |
std::array<float, 6> proj{}; |
| 25 |
std::array<float, 16> gproj{}; |
| 26 |
std::array<float, 16> g2proj{}; |
| 27 |
|
| 28 |
|
| 29 |
float avg_persp_proj_viewport_ratio = 0; |
| 30 |
float avg_ortho_proj_viewport_ratio = 0; |
| 31 |
|
| 32 |
std::vector<BPFunctions::ScissorResult> scissors{}; |
| 33 |
size_t current_scissor = 0; |
| 34 |
int scissor_scale = 10; |
| 35 |
int scissor_expected_count = 0; |
| 36 |
bool allow_duplicate_scissors = false; |
| 37 |
bool show_scissors = true; |
| 38 |
bool show_raw_scissors = true; |
| 39 |
bool show_viewports = false; |
| 40 |
bool show_text = true; |
| 41 |
|
| 42 |
struct ThisFrame |
| 43 |
{ |
| 44 |
int num_bp_loads = 0; |
| 45 |
int num_cp_loads = 0; |
| 46 |
int num_xf_loads = 0; |
| 47 |
|
| 48 |
int num_bp_loads_in_dl = 0; |
| 49 |
int num_cp_loads_in_dl = 0; |
| 50 |
int num_xf_loads_in_dl = 0; |
| 51 |
|
| 52 |
int num_prims = 0; |
| 53 |
int num_dl_prims = 0; |
| 54 |
int num_shader_changes = 0; |
| 55 |
|
| 56 |
int num_primitive_joins = 0; |
| 57 |
int num_draw_calls = 0; |
| 58 |
|
| 59 |
int num_dlists_called = 0; |
| 60 |
|
| 61 |
int bytes_vertex_streamed = 0; |
| 62 |
int bytes_index_streamed = 0; |
| 63 |
int bytes_uniform_streamed = 0; |
| 64 |
|
| 65 |
int num_triangles_clipped = 0; |
| 66 |
int num_triangles_in = 0; |
| 67 |
int num_triangles_rejected = 0; |
| 68 |
int num_triangles_culled = 0; |
| 69 |
int num_drawn_objects = 0; |
| 70 |
int rasterized_pixels = 0; |
| 71 |
int num_triangles_drawn = 0; |
| 72 |
int num_vertices_loaded = 0; |
| 73 |
int tev_pixels_in = 0; |
| 74 |
int tev_pixels_out = 0; |
| 75 |
|
| 76 |
int num_efb_peeks = 0; |
| 77 |
int num_efb_pokes = 0; |
| 78 |
|
| 79 |
int num_draw_done = 0; |
| 80 |
int num_token = 0; |
| 81 |
int num_token_int = 0; |
| 82 |
}; |
| 83 |
ThisFrame this_frame; |
| 84 |
void ResetFrame(); |
| 85 |
void SwapDL(); |
| 86 |
void AddScissorRect(); |
| 87 |
void Display() const; |
| 88 |
void DisplayProj() const; |
| 89 |
void DisplayScissor(); |
| 90 |
|
| 91 |
static void Init(); |
| 92 |
static void Shutdown(); |
| 93 |
}; |
| 94 |
|
| 95 |
extern Statistics g_stats; |
| 96 |
|
| 97 |
#define STATISTICS |
| 98 |
|
| 99 |
#ifdef STATISTICS |
| 100 |
#define INCSTAT(a) \ |
| 101 |
do \ |
| 102 |
{ \ |
| 103 |
(a)++; \ |
| 104 |
} while (false) |
| 105 |
#define ADDSTAT(a, b) \ |
| 106 |
do \ |
| 107 |
{ \ |
| 108 |
(a) += (b); \ |
| 109 |
} while (false) |
| 110 |
#define SETSTAT(a, x) \ |
| 111 |
do \ |
| 112 |
{ \ |
| 113 |
(a) = static_cast<int>(x); \ |
| 114 |
} while (false) |
| 115 |
#else |
| 116 |
#define INCSTAT(a) \ |
| 117 |
do \ |
| 118 |
{ \ |
| 119 |
} while (false) |
| 120 |
#define ADDSTAT(a, b) \ |
| 121 |
do \ |
| 122 |
{ \ |
| 123 |
} while (false) |
| 124 |
#define SETSTAT(a, x) \ |
| 125 |
do \ |
| 126 |
{ \ |
| 127 |
} while (false) |
| 128 |
#endif |