Bug 1589119 - Add profile counters for rendered and total number of picture cache tiles. r=gw

Differential Revision: https://phabricator.services.mozilla.com/D49438

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicolas Silva 2019-10-18 01:03:07 +00:00
Родитель 20956de078
Коммит bfc2b52283
2 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@ -34,6 +34,8 @@ pub mod expected {
pub const USED_TARGETS: Range<u64> = 1..4;
pub const COLOR_TARGETS: Range<u64> = 1..4;
pub const ALPHA_TARGETS: Range<u64> = 0..2;
pub const RENDERED_PICTURE_CACHE_TILES: Range<u64> = 0..5;
pub const TOTAL_PICTURE_CACHE_TILES: Range<u64> = 0..15;
pub const CREATED_TARGETS: Range<u64> = 0..3;
pub const CHANGED_TARGETS: Range<u64> = 0..3;
pub const TEXTURE_DATA_UPLOADED: Range<u64> = 0..10;
@ -788,6 +790,8 @@ pub struct RendererProfileCounters {
pub color_targets: AverageIntProfileCounter,
pub alpha_targets: AverageIntProfileCounter,
pub texture_data_uploaded: AverageIntProfileCounter,
pub rendered_picture_cache_tiles: AverageIntProfileCounter,
pub total_picture_cache_tiles: AverageIntProfileCounter,
}
pub struct RendererProfileTimers {
@ -826,6 +830,14 @@ impl RendererProfileCounters {
"Texture data, kb",
None, Some(expected::TEXTURE_DATA_UPLOADED),
),
rendered_picture_cache_tiles: AverageIntProfileCounter::new(
"Rendered tiles",
None, Some(expected::RENDERED_PICTURE_CACHE_TILES),
),
total_picture_cache_tiles: AverageIntProfileCounter::new(
"Total tiles",
None, Some(expected::TOTAL_PICTURE_CACHE_TILES),
),
}
}
@ -835,6 +847,8 @@ impl RendererProfileCounters {
self.color_targets.reset();
self.alpha_targets.reset();
self.texture_data_uploaded.reset();
self.rendered_picture_cache_tiles.reset();
self.total_picture_cache_tiles.reset();
}
}
@ -1421,6 +1435,7 @@ impl Profiler {
&renderer_profile.alpha_targets,
&renderer_profile.draw_calls,
&renderer_profile.vertices,
&renderer_profile.rendered_picture_cache_tiles,
&renderer_profile.texture_data_uploaded,
&self.ipc_time,
&self.backend_time,
@ -1450,6 +1465,8 @@ impl Profiler {
&renderer_profile.frame_counter,
&renderer_profile.color_targets,
&renderer_profile.alpha_targets,
&renderer_profile.rendered_picture_cache_tiles,
&renderer_profile.total_picture_cache_tiles,
&renderer_profile.texture_data_uploaded,
],
None,
@ -1621,6 +1638,8 @@ impl Profiler {
&renderer_profile.alpha_targets,
&renderer_profile.draw_calls,
&renderer_profile.vertices,
&renderer_profile.rendered_picture_cache_tiles,
&renderer_profile.total_picture_cache_tiles,
],
&[
&backend_profile.resources.gpu_cache.allocated_rows,

Просмотреть файл

@ -3640,6 +3640,7 @@ impl Renderer {
render_tasks: &RenderTaskGraph,
stats: &mut RendererStats,
) {
self.profile_counters.rendered_picture_cache_tiles.inc();
self.profile_counters.color_targets.inc();
let _gm = self.gpu_profile.start_marker("picture cache target");
let framebuffer_kind = FramebufferKind::Other;
@ -4065,6 +4066,12 @@ impl Renderer {
&mut self.renderer_errors
);
// We are only interested in tiles backed with actual cached pixels so we don't
// count clear tiles here.
let num_tiles = composite_state.opaque_tiles.len()
+ composite_state.alpha_tiles.len();
self.profile_counters.total_picture_cache_tiles.set(num_tiles);
// Draw opaque tiles first, front-to-back to get maxmum
// z-reject efficiency.
if !composite_state.opaque_tiles.is_empty() {