2015-05-23 22:55:12 -06:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2021-07-04 19:22:19 -06:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2014-05-03 22:24:21 -06:00
|
|
|
#pragma once
|
|
|
|
|
2019-06-20 05:42:16 -06:00
|
|
|
#include <array>
|
2021-11-27 18:09:55 -07:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "VideoCommon/BPFunctions.h"
|
2019-06-20 05:42:16 -06:00
|
|
|
|
2008-07-12 11:40:22 -06:00
|
|
|
struct Statistics
|
|
|
|
{
|
2019-07-10 21:11:14 -06:00
|
|
|
int num_pixel_shaders_created;
|
|
|
|
int num_pixel_shaders_alive;
|
|
|
|
int num_vertex_shaders_created;
|
|
|
|
int num_vertex_shaders_alive;
|
2016-06-24 02:43:46 -06:00
|
|
|
|
2019-07-10 21:11:14 -06:00
|
|
|
int num_textures_created;
|
|
|
|
int num_textures_uploaded;
|
|
|
|
int num_textures_alive;
|
2016-06-24 02:43:46 -06:00
|
|
|
|
2019-07-10 21:11:14 -06:00
|
|
|
int num_vertex_loaders;
|
2016-06-24 02:43:46 -06:00
|
|
|
|
2019-06-20 05:42:16 -06:00
|
|
|
std::array<float, 6> proj;
|
|
|
|
std::array<float, 16> gproj;
|
|
|
|
std::array<float, 16> g2proj;
|
2016-06-24 02:43:46 -06:00
|
|
|
|
2021-11-27 18:09:55 -07:00
|
|
|
std::vector<BPFunctions::ScissorResult> scissors;
|
|
|
|
size_t current_scissor = 0; // 0 => all, otherwise index + 1
|
|
|
|
int scissor_scale = 10;
|
|
|
|
int scissor_expected_count = 0;
|
|
|
|
bool allow_duplicate_scissors = false;
|
|
|
|
bool show_scissors = true;
|
|
|
|
bool show_raw_scissors = true;
|
|
|
|
bool show_viewports = false;
|
|
|
|
bool show_text = true;
|
|
|
|
|
2008-08-30 13:19:40 -06:00
|
|
|
struct ThisFrame
|
|
|
|
{
|
2019-07-10 21:11:14 -06:00
|
|
|
int num_bp_loads;
|
|
|
|
int num_cp_loads;
|
|
|
|
int num_xf_loads;
|
|
|
|
|
|
|
|
int num_bp_loads_in_dl;
|
|
|
|
int num_cp_loads_in_dl;
|
|
|
|
int num_xf_loads_in_dl;
|
|
|
|
|
|
|
|
int num_prims;
|
|
|
|
int num_dl_prims;
|
|
|
|
int num_shader_changes;
|
|
|
|
|
|
|
|
int num_primitive_joins;
|
|
|
|
int num_draw_calls;
|
|
|
|
|
|
|
|
int num_dlists_called;
|
|
|
|
|
|
|
|
int bytes_vertex_streamed;
|
|
|
|
int bytes_index_streamed;
|
|
|
|
int bytes_uniform_streamed;
|
|
|
|
|
|
|
|
int num_triangles_clipped;
|
|
|
|
int num_triangles_in;
|
|
|
|
int num_triangles_rejected;
|
|
|
|
int num_triangles_culled;
|
|
|
|
int num_drawn_objects;
|
|
|
|
int rasterized_pixels;
|
|
|
|
int num_triangles_drawn;
|
|
|
|
int num_vertices_loaded;
|
|
|
|
int tev_pixels_in;
|
|
|
|
int tev_pixels_out;
|
|
|
|
|
|
|
|
int num_efb_peeks;
|
|
|
|
int num_efb_pokes;
|
2022-09-26 17:11:12 -06:00
|
|
|
|
|
|
|
int num_draw_done;
|
|
|
|
int num_token;
|
|
|
|
int num_token_int;
|
2008-08-30 13:19:40 -06:00
|
|
|
};
|
2019-07-10 21:11:14 -06:00
|
|
|
ThisFrame this_frame;
|
2008-10-22 14:54:40 -06:00
|
|
|
void ResetFrame();
|
2019-07-10 21:24:35 -06:00
|
|
|
void SwapDL();
|
2021-11-27 18:09:55 -07:00
|
|
|
void AddScissorRect();
|
2019-07-10 21:24:35 -06:00
|
|
|
void Display() const;
|
|
|
|
void DisplayProj() const;
|
2021-11-27 18:09:55 -07:00
|
|
|
void DisplayScissor();
|
2008-07-12 11:40:22 -06:00
|
|
|
};
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2019-07-10 21:34:50 -06:00
|
|
|
extern Statistics g_stats;
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2008-07-12 11:40:22 -06:00
|
|
|
#define STATISTICS
|
2008-12-07 21:46:09 -07:00
|
|
|
|
2008-07-12 11:40:22 -06:00
|
|
|
#ifdef STATISTICS
|
2022-01-03 22:43:11 -07:00
|
|
|
#define INCSTAT(a) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
(a)++; \
|
|
|
|
} while (false)
|
|
|
|
#define ADDSTAT(a, b) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
(a) += (b); \
|
|
|
|
} while (false)
|
|
|
|
#define SETSTAT(a, x) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
(a) = static_cast<int>(x); \
|
|
|
|
} while (false)
|
2008-07-12 11:40:22 -06:00
|
|
|
#else
|
2022-01-03 22:43:11 -07:00
|
|
|
#define INCSTAT(a) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
} while (false)
|
|
|
|
#define ADDSTAT(a, b) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
} while (false)
|
|
|
|
#define SETSTAT(a, x) \
|
|
|
|
do \
|
|
|
|
{ \
|
|
|
|
} while (false)
|
2008-07-12 11:40:22 -06:00
|
|
|
#endif
|