From 564cef879e76c69bf9eb41b94e062eef772034fc Mon Sep 17 00:00:00 2001 From: Noemi Erli Date: Tue, 15 Jun 2021 14:04:15 +0000 Subject: [PATCH] Backed out 2 changesets (bug 1716395, bug 1716317) for causing webrender bustages CLOSED TREE Backed out changeset d0526849e7c3 (bug 1716317) Backed out changeset 0693eb0f1e49 (bug 1716395) [ghsync] From https://hg.mozilla.org/mozilla-central/rev/ad4edb3c20fcc4c6f363250cc3e3efec9ffece3a --- webrender/src/internal_types.rs | 12 -- webrender/src/profiler.rs | 313 ++++++++++++++++--------------- webrender/src/render_api.rs | 4 +- webrender/src/renderer/mod.rs | 121 ++++-------- webrender/src/renderer/upload.rs | 6 +- webrender/src/texture_cache.rs | 66 ++++--- 6 files changed, 238 insertions(+), 284 deletions(-) diff --git a/webrender/src/internal_types.rs b/webrender/src/internal_types.rs index 6f440058f3..a8f70e809b 100644 --- a/webrender/src/internal_types.rs +++ b/webrender/src/internal_types.rs @@ -313,17 +313,6 @@ pub struct TextureCacheAllocation { pub kind: TextureCacheAllocationKind, } -/// A little bit of extra information to make memory reports more useful -#[derive(Copy, Clone, Debug, Eq, PartialEq)] -#[cfg_attr(feature = "capture", derive(Serialize))] -#[cfg_attr(feature = "replay", derive(Deserialize))] -pub enum TextureCacheCategory { - Atlas, - Standalone, - PictureTile, - RenderTarget, -} - /// Information used when allocating / reallocating. #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub struct TextureCacheAllocInfo { @@ -336,7 +325,6 @@ pub struct TextureCacheAllocInfo { pub is_shared_cache: bool, /// If true, this texture requires a depth target. pub has_depth: bool, - pub category: TextureCacheCategory } /// Sub-operation-specific information for allocation operations. diff --git a/webrender/src/profiler.rs b/webrender/src/profiler.rs index ed471dd865..2d2e104d2c 100644 --- a/webrender/src/profiler.rs +++ b/webrender/src/profiler.rs @@ -69,11 +69,14 @@ static PROFILER_PRESETS: &'static[(&'static str, &'static str)] = &[ // Stats about the content of the frame. (&"Frame stats", &"Primitives,Visible primitives,Draw calls,Vertices,Color passes,Alpha passes,Rendered picture tiles,Rasterized glyphs"), // Texture cache allocation stats. - (&"Texture cache stats", &"Atlas textures mem, Standalone textures mem, Picture tiles mem, Render targets mem, Atlas items mem, - Texture cache standalone pressure, Texture cache eviction count, Texture cache youngest evicted, , - Atlas RGBA8 linear pixels, Atlas RGBA8 glyphs pixels, Atlas A8 glyphs pixels, Atlas A8 pixels, Atlas A16 pixels, Atlas RGBA8 nearest pixels, - Atlas RGBA8 linear textures, Atlas RGBA8 glyphs textures, Atlas A8 glyphs textures, Atlas A8 textures, Atlas A16 textures, Atlas RGBA8 nearest textures, - Atlas RGBA8 linear pressure, Atlas RGBA8 glyphs pressure, Atlas A8 glyphs pressure, Atlas A8 pressure, Atlas A16 pressure, Atlas RGBA8 nearest pressure," + (&"Texture cache stats", &"Texture cache RGBA8 linear textures, Texture cache RGBA8 linear pixels, Texture cache RGBA8 linear pressure, + , ,Texture cache RGBA8 glyphs textures, Texture cache RGBA8 glyphs pixels, Texture cache RGBA8 glyphs pressure, + , ,Texture cache A8 glyphs textures, Texture cache A8 glyphs pixels, Texture cache A8 glyphs pressure, + , ,Texture cache A8 textures, Texture cache A8 pixels, Texture cache A8 pressure, + , ,Texture cache A16 textures, Texture cache A16 pixels, Texture cache A16 pressure, + , ,Texture cache RGBA8 nearest textures, Texture cache RGBA8 nearest pixels, Texture cache RGBA8 nearest pressure, + , ,Texture cache shared mem, Texture cache standalone mem, Texture cache standalone pressure, + , ,Texture cache eviction count, Texture cache youngest evicted" ), // Graphs to investigate driver overhead of texture cache updates. (&"Texture upload perf", &"#Texture cache update,#Texture cache upload, ,#Staging CPU allocation,#Staging GPU allocation,#Staging CPU copy,#Staging GPU copy,#Upload time, ,#Upload copy batches,#Rasterized glyphs, ,#Cache texture creation,#Cache texture deletion"), @@ -123,111 +126,108 @@ pub const DISPLAY_LIST_MEM: usize = 10; pub const SCENE_BUILD_TIME: usize = 11; -pub const SLOW_FRAME: usize = 12; -pub const SLOW_TXN: usize = 13; - -pub const FRAME_TIME: usize = 14; - -pub const TEXTURE_UPLOADS: usize = 15; -pub const TEXTURE_UPLOADS_MEM: usize = 16; -pub const TEXTURE_CACHE_UPDATE_TIME: usize = 17; -pub const CPU_TEXTURE_ALLOCATION_TIME: usize = 18; -pub const STAGING_TEXTURE_ALLOCATION_TIME: usize = 19; -pub const UPLOAD_CPU_COPY_TIME: usize = 20; -pub const UPLOAD_GPU_COPY_TIME: usize = 21; -pub const UPLOAD_TIME: usize = 22; -pub const UPLOAD_NUM_COPY_BATCHES: usize = 23; -pub const TOTAL_UPLOAD_TIME: usize = 24; -pub const CREATE_CACHE_TEXTURE_TIME: usize = 25; -pub const DELETE_CACHE_TEXTURE_TIME: usize = 26; -pub const GPU_CACHE_UPLOAD_TIME: usize = 27; - -pub const RASTERIZED_BLOBS: usize = 28; -pub const RASTERIZED_BLOB_TILES: usize = 29; -pub const RASTERIZED_BLOBS_PX: usize = 30; -pub const BLOB_RASTERIZATION_TIME: usize = 31; - -pub const RASTERIZED_GLYPHS: usize = 32; -pub const GLYPH_RESOLVE_TIME: usize = 33; - -pub const DRAW_CALLS: usize = 34; -pub const VERTICES: usize = 35; -pub const PRIMITIVES: usize = 36; -pub const VISIBLE_PRIMITIVES: usize = 37; - -pub const USED_TARGETS: usize = 38; -pub const CREATED_TARGETS: usize = 39; -pub const PICTURE_CACHE_SLICES: usize = 40; - -pub const COLOR_PASSES: usize = 41; -pub const ALPHA_PASSES: usize = 42; -pub const PICTURE_TILES: usize = 43; -pub const RENDERED_PICTURE_TILES: usize = 44; - -pub const FONT_TEMPLATES: usize = 45; -pub const FONT_TEMPLATES_MEM: usize = 46; -pub const IMAGE_TEMPLATES: usize = 47; -pub const IMAGE_TEMPLATES_MEM: usize = 48; - -pub const GPU_CACHE_ROWS_TOTAL: usize = 49; -pub const GPU_CACHE_ROWS_UPDATED: usize = 50; -pub const GPU_CACHE_BLOCKS_TOTAL: usize = 51; -pub const GPU_CACHE_BLOCKS_UPDATED: usize = 52; -pub const GPU_CACHE_BLOCKS_SAVED: usize = 53; - -// Atlas items represents the area occupied by items in the cache textures. -// The actual texture memory allocated is ATLAS_TEXTURES_MEM. -pub const ATLAS_ITEMS_MEM: usize = 54; -pub const ATLAS_A8_PIXELS: usize = 55; -pub const ATLAS_A8_TEXTURES: usize = 56; -pub const ATLAS_A16_PIXELS: usize = 57; -pub const ATLAS_A16_TEXTURES: usize = 58; -pub const ATLAS_RGBA8_LINEAR_PIXELS: usize = 59; -pub const ATLAS_RGBA8_LINEAR_TEXTURES: usize = 60; -pub const ATLAS_RGBA8_NEAREST_PIXELS: usize = 61; -pub const ATLAS_RGBA8_NEAREST_TEXTURES: usize = 62; -pub const ATLAS_RGBA8_GLYPHS_PIXELS: usize = 63; -pub const ATLAS_RGBA8_GLYPHS_TEXTURES: usize = 64; -pub const ATLAS_A8_GLYPHS_PIXELS: usize = 65; -pub const ATLAS_A8_GLYPHS_TEXTURES: usize = 66; -pub const ATLAS_COLOR8_LINEAR_PRESSURE: usize = 67; -pub const ATLAS_COLOR8_NEAREST_PRESSURE: usize = 68; -pub const ATLAS_COLOR8_GLYPHS_PRESSURE: usize = 69; -pub const ATLAS_ALPHA8_PRESSURE: usize = 70; -pub const ATLAS_ALPHA8_GLYPHS_PRESSURE: usize = 71; -pub const ATLAS_ALPHA16_PRESSURE: usize = 72; -pub const ATLAS_STANDALONE_PRESSURE: usize = 73; - -pub const TEXTURE_CACHE_EVICTION_COUNT: usize = 74; -pub const TEXTURE_CACHE_YOUNGEST_EVICTION: usize = 75; -pub const EXTERNAL_IMAGE_BYTES: usize = 76; -pub const ATLAS_TEXTURES_MEM: usize = 77; -pub const STANDALONE_TEXTURES_MEM: usize = 78; -pub const PICTURE_TILES_MEM: usize = 79; -pub const RENDER_TARGET_MEM: usize = 80; - -pub const ALPHA_TARGETS_SAMPLERS: usize = 81; -pub const TRANSPARENT_PASS_SAMPLERS: usize = 82; -pub const OPAQUE_PASS_SAMPLERS: usize = 83; -pub const TOTAL_SAMPLERS: usize = 84; - -pub const INTERNED_PRIMITIVES: usize = 85; -pub const INTERNED_CLIPS: usize = 86; -pub const INTERNED_TEXT_RUNS: usize = 87; -pub const INTERNED_NORMAL_BORDERS: usize = 88; -pub const INTERNED_IMAGE_BORDERS: usize = 89; -pub const INTERNED_IMAGES: usize = 90; -pub const INTERNED_YUV_IMAGES: usize = 91; -pub const INTERNED_LINE_DECORATIONS: usize = 92; -pub const INTERNED_LINEAR_GRADIENTS: usize = 93; -pub const INTERNED_RADIAL_GRADIENTS: usize = 94; -pub const INTERNED_CONIC_GRADIENTS: usize = 95; -pub const INTERNED_PICTURES: usize = 96; -pub const INTERNED_FILTER_DATA: usize = 97; -pub const INTERNED_BACKDROPS: usize = 98; -pub const INTERNED_POLYGONS: usize = 99; - -pub const NUM_PROFILER_EVENTS: usize = 100; +pub const RASTERIZED_BLOBS: usize = 12; +pub const RASTERIZED_BLOB_TILES: usize = 13; +pub const RASTERIZED_BLOBS_PX: usize = 14; +pub const BLOB_RASTERIZATION_TIME: usize = 15; + +pub const RASTERIZED_GLYPHS: usize = 16; +pub const GLYPH_RESOLVE_TIME: usize = 17; + +pub const DRAW_CALLS: usize = 18; +pub const VERTICES: usize = 19; +pub const PRIMITIVES: usize = 20; +pub const VISIBLE_PRIMITIVES: usize = 21; + +pub const USED_TARGETS: usize = 22; +pub const CREATED_TARGETS: usize = 23; +pub const PICTURE_CACHE_SLICES: usize = 24; + +pub const COLOR_PASSES: usize = 25; +pub const ALPHA_PASSES: usize = 26; +pub const PICTURE_TILES: usize = 27; +pub const PICTURE_TILES_MEM: usize = 28; +pub const RENDERED_PICTURE_TILES: usize = 29; +pub const TEXTURE_UPLOADS: usize = 30; +pub const TEXTURE_UPLOADS_MEM: usize = 31; + +pub const FONT_TEMPLATES: usize = 32; +pub const FONT_TEMPLATES_MEM: usize = 33; +pub const IMAGE_TEMPLATES: usize = 34; +pub const IMAGE_TEMPLATES_MEM: usize = 35; + +pub const GPU_CACHE_ROWS_TOTAL: usize = 36; +pub const GPU_CACHE_ROWS_UPDATED: usize = 37; +pub const GPU_CACHE_BLOCKS_TOTAL: usize = 38; +pub const GPU_CACHE_BLOCKS_UPDATED: usize = 39; +pub const GPU_CACHE_BLOCKS_SAVED: usize = 40; + +pub const TEXTURE_CACHE_A8_PIXELS: usize = 41; +pub const TEXTURE_CACHE_A8_TEXTURES: usize = 42; +pub const TEXTURE_CACHE_A16_PIXELS: usize = 43; +pub const TEXTURE_CACHE_A16_TEXTURES: usize = 44; +pub const TEXTURE_CACHE_RGBA8_LINEAR_PIXELS: usize = 45; +pub const TEXTURE_CACHE_RGBA8_LINEAR_TEXTURES: usize = 46; +pub const TEXTURE_CACHE_RGBA8_NEAREST_PIXELS: usize = 47; +pub const TEXTURE_CACHE_RGBA8_NEAREST_TEXTURES: usize = 48; +pub const TEXTURE_CACHE_SHARED_MEM: usize = 49; +pub const TEXTURE_CACHE_STANDALONE_MEM: usize = 50; + +pub const SLOW_FRAME: usize = 51; +pub const SLOW_TXN: usize = 52; + +pub const GPU_CACHE_UPLOAD_TIME: usize = 53; +pub const TEXTURE_CACHE_UPDATE_TIME: usize = 54; + +pub const FRAME_TIME: usize = 55; + +pub const ALPHA_TARGETS_SAMPLERS: usize = 56; +pub const TRANSPARENT_PASS_SAMPLERS: usize = 57; +pub const OPAQUE_PASS_SAMPLERS: usize = 58; +pub const TOTAL_SAMPLERS: usize = 59; + +pub const INTERNED_PRIMITIVES: usize = 60; +pub const INTERNED_CLIPS: usize = 61; +pub const INTERNED_TEXT_RUNS: usize = 62; +pub const INTERNED_NORMAL_BORDERS: usize = 63; +pub const INTERNED_IMAGE_BORDERS: usize = 64; +pub const INTERNED_IMAGES: usize = 65; +pub const INTERNED_YUV_IMAGES: usize = 66; +pub const INTERNED_LINE_DECORATIONS: usize = 67; +pub const INTERNED_LINEAR_GRADIENTS: usize = 68; +pub const INTERNED_RADIAL_GRADIENTS: usize = 69; +pub const INTERNED_CONIC_GRADIENTS: usize = 70; +pub const INTERNED_PICTURES: usize = 71; +pub const INTERNED_FILTER_DATA: usize = 72; +pub const INTERNED_BACKDROPS: usize = 73; +pub const INTERNED_POLYGONS: usize = 74; + +pub const TEXTURE_CACHE_RGBA8_GLYPHS_PIXELS: usize = 75; +pub const TEXTURE_CACHE_RGBA8_GLYPHS_TEXTURES: usize = 76; +pub const TEXTURE_CACHE_A8_GLYPHS_PIXELS: usize = 77; +pub const TEXTURE_CACHE_A8_GLYPHS_TEXTURES: usize = 78; + +pub const CPU_TEXTURE_ALLOCATION_TIME: usize = 79; +pub const STAGING_TEXTURE_ALLOCATION_TIME: usize = 80; +pub const UPLOAD_CPU_COPY_TIME: usize = 81; +pub const UPLOAD_GPU_COPY_TIME: usize = 82; +pub const UPLOAD_TIME: usize = 83; +pub const UPLOAD_NUM_COPY_BATCHES: usize = 84; +pub const TOTAL_UPLOAD_TIME: usize = 85; +pub const CREATE_CACHE_TEXTURE_TIME: usize = 86; +pub const DELETE_CACHE_TEXTURE_TIME: usize = 87; + +pub const TEXTURE_CACHE_COLOR8_LINEAR_PRESSURE: usize = 88; +pub const TEXTURE_CACHE_COLOR8_NEAREST_PRESSURE: usize = 89; +pub const TEXTURE_CACHE_COLOR8_GLYPHS_PRESSURE: usize = 90; +pub const TEXTURE_CACHE_ALPHA8_PRESSURE: usize = 91; +pub const TEXTURE_CACHE_ALPHA8_GLYPHS_PRESSURE: usize = 92; +pub const TEXTURE_CACHE_ALPHA16_PRESSURE: usize = 93; +pub const TEXTURE_CACHE_STANDALONE_PRESSURE: usize = 94; +pub const TEXTURE_CACHE_EVICTION_COUNT: usize = 95; +pub const TEXTURE_CACHE_YOUNGEST_EVICTION: usize = 96; + +pub const NUM_PROFILER_EVENTS: usize = 97; pub struct Profiler { counters: Vec, @@ -264,6 +264,7 @@ impl Profiler { // system. let profile_counters = &[ float("Frame building", "ms", FRAME_BUILDING_TIME, expected(0.0..6.0).avg(0.0..3.0)), + float("Visibility", "ms", FRAME_VISIBILITY_TIME, expected(0.0..3.0).avg(0.0..2.0)), float("Prepare", "ms", FRAME_PREPARE_TIME, expected(0.0..3.0).avg(0.0..2.0)), float("Batching", "ms", FRAME_BATCHING_TIME, expected(0.0..3.0).avg(0.0..2.0)), @@ -278,25 +279,6 @@ impl Profiler { float("DisplayList mem", "MB", DISPLAY_LIST_MEM, expected(0.0..20.0)), float("Scene building", "ms", SCENE_BUILD_TIME, expected(0.0..4.0).avg(0.0..3.0)), - float("Slow frame", "", SLOW_FRAME, expected(0.0..0.0)), - float("Slow transaction", "", SLOW_TXN, expected(0.0..0.0)), - - float("Frame", "ms", FRAME_TIME, Expected::none()), - - int("Texture uploads", "", TEXTURE_UPLOADS, expected(0..10)), - float("Texture uploads mem", "MB", TEXTURE_UPLOADS_MEM, expected(0.0..10.0)), - float("Texture cache update", "ms", TEXTURE_CACHE_UPDATE_TIME, expected(0.0..3.0)), - float("Staging CPU allocation", "ms", CPU_TEXTURE_ALLOCATION_TIME, Expected::none()), - float("Staging GPU allocation", "ms", STAGING_TEXTURE_ALLOCATION_TIME, Expected::none()), - float("Staging CPU copy", "ms", UPLOAD_CPU_COPY_TIME, Expected::none()), - float("Staging GPU copy", "ms", UPLOAD_GPU_COPY_TIME, Expected::none()), - float("Upload time", "ms", UPLOAD_TIME, Expected::none()), - int("Upload copy batches", "", UPLOAD_NUM_COPY_BATCHES, Expected::none()), - float("Texture cache upload", "ms", TOTAL_UPLOAD_TIME, expected(0.0..5.0)), - float("Cache texture creation", "ms", CREATE_CACHE_TEXTURE_TIME, expected(0.0..2.0)), - float("Cache texture deletion", "ms", DELETE_CACHE_TEXTURE_TIME, expected(0.0..1.0)), - float("GPU cache upload", "ms", GPU_CACHE_UPLOAD_TIME, expected(0.0..2.0)), - int("Rasterized blobs", "", RASTERIZED_BLOBS, expected(0..15)), int("Rasterized blob tiles", "", RASTERIZED_BLOB_TILES, expected(0..15)), int("Rasterized blob pixels", "px", RASTERIZED_BLOBS_PX, expected(0..300_000)), @@ -317,7 +299,10 @@ impl Profiler { int("Color passes", "", COLOR_PASSES, expected(1..4)), int("Alpha passes", "", ALPHA_PASSES, expected(0..3)), int("Picture tiles", "", PICTURE_TILES, expected(0..15)), + float("Picture tiles mem", "MB", PICTURE_TILES_MEM, expected(0.0..150.0)), int("Rendered picture tiles", "", RENDERED_PICTURE_TILES, expected(0..5)), + int("Texture uploads", "", TEXTURE_UPLOADS, expected(0..10)), + float("Texture uploads mem", "MB", TEXTURE_UPLOADS_MEM, expected(0.0..10.0)), int("Font templates", "", FONT_TEMPLATES, expected(0..40)), float("Font templates mem", "MB", FONT_TEMPLATES_MEM, expected(0.0..20.0)), @@ -330,34 +315,25 @@ impl Profiler { int("GPU blocks updated", "", GPU_CACHE_BLOCKS_UPDATED, expected(0..1000)), int("GPU blocks saved", "", GPU_CACHE_BLOCKS_SAVED, expected(0..50_000)), - float("Atlas items mem", "MB", ATLAS_ITEMS_MEM, expected(0.0..100.0)), - int("Atlas A8 pixels", "px", ATLAS_A8_PIXELS, expected(0..1_000_000)), - int("Atlas A8 textures", "", ATLAS_A8_TEXTURES, expected(0..2)), - int("Atlas A16 pixels", "px", ATLAS_A16_PIXELS, expected(0..260_000)), - int("Atlas A16 textures", "", ATLAS_A16_TEXTURES, expected(0..2)), - int("Atlas RGBA8 linear pixels", "px", ATLAS_RGBA8_LINEAR_PIXELS, expected(0..8_000_000)), - int("Atlas RGBA8 linear textures", "", ATLAS_RGBA8_LINEAR_TEXTURES, expected(0..3)), - int("Atlas RGBA8 nearest pixels", "px", ATLAS_RGBA8_NEAREST_PIXELS, expected(0..260_000)), - int("Atlas RGBA8 nearest textures", "", ATLAS_RGBA8_NEAREST_TEXTURES, expected(0..2)), - int("Atlas RGBA8 glyphs pixels", "px", ATLAS_RGBA8_GLYPHS_PIXELS, expected(0..4_000_000)), - int("Atlas RGBA8 glyphs textures", "", ATLAS_RGBA8_GLYPHS_TEXTURES, expected(0..2)), - int("Atlas A8 glyphs pixels", "px", ATLAS_A8_GLYPHS_PIXELS, expected(0..4_000_000)), - int("Atlas A8 glyphs textures", "", ATLAS_A8_GLYPHS_TEXTURES, expected(0..2)), - float("Atlas RGBA8 linear pressure", "", ATLAS_COLOR8_LINEAR_PRESSURE, expected(0.0..1.0)), - float("Atlas RGBA8 nearest pressure", "", ATLAS_COLOR8_NEAREST_PRESSURE, expected(0.0..1.0)), - float("Atlas RGBA8 glyphs pressure", "", ATLAS_COLOR8_GLYPHS_PRESSURE, expected(0.0..1.0)), - float("Atlas A8 pressure", "", ATLAS_ALPHA8_PRESSURE, expected(0.0..1.0)), - float("Atlas A8 glyphs pressure", "", ATLAS_ALPHA8_GLYPHS_PRESSURE, expected(0.0..1.0)), - float("Atlas A16 pressure", "", ATLAS_ALPHA16_PRESSURE, expected(0.0..1.0)), - float("Texture cache standalone pressure", "", ATLAS_STANDALONE_PRESSURE, expected(0.0..1.0)), + int("Texture cache A8 pixels", "px", TEXTURE_CACHE_A8_PIXELS, expected(0..1_000_000)), + int("Texture cache A8 textures", "", TEXTURE_CACHE_A8_TEXTURES, expected(0..2)), + int("Texture cache A16 pixels", "px", TEXTURE_CACHE_A16_PIXELS, expected(0..260_000)), + int("Texture cache A16 textures", "", TEXTURE_CACHE_A16_TEXTURES, expected(0..2)), + int("Texture cache RGBA8 linear pixels", "px", TEXTURE_CACHE_RGBA8_LINEAR_PIXELS, expected(0..8_000_000)), + int("Texture cache RGBA8 linear textures", "", TEXTURE_CACHE_RGBA8_LINEAR_TEXTURES, expected(0..3)), + int("Texture cache RGBA8 nearest pixels", "px", TEXTURE_CACHE_RGBA8_NEAREST_PIXELS, expected(0..260_000)), + int("Texture cache RGBA8 nearest textures", "", TEXTURE_CACHE_RGBA8_NEAREST_TEXTURES, expected(0..2)), + float("Texture cache shared mem", "MB", TEXTURE_CACHE_SHARED_MEM, expected(0.0..100.0)), + float("Texture cache standalone mem", "MB", TEXTURE_CACHE_STANDALONE_MEM, expected(0.0..100.0)), - int("Texture cache eviction count", "items", TEXTURE_CACHE_EVICTION_COUNT, Expected::none()), - int("Texture cache youngest evicted", "frames", TEXTURE_CACHE_YOUNGEST_EVICTION, Expected::none()), - float("External image mem", "MB", EXTERNAL_IMAGE_BYTES, Expected::none()), - float("Atlas textures mem", "MB", ATLAS_TEXTURES_MEM, Expected::none()), - float("Standalone textures mem", "MB", STANDALONE_TEXTURES_MEM, Expected::none()), - float("Picture tiles mem", "MB", PICTURE_TILES_MEM, expected(0.0..150.0)), - float("Render targets mem", "MB", RENDER_TARGET_MEM, Expected::none()), + + float("Slow frame", "", SLOW_FRAME, expected(0.0..0.0)), + float("Slow transaction", "", SLOW_TXN, expected(0.0..0.0)), + + float("GPU cache upload", "ms", GPU_CACHE_UPLOAD_TIME, expected(0.0..2.0)), + float("Texture cache update", "ms", TEXTURE_CACHE_UPDATE_TIME, expected(0.0..3.0)), + + float("Frame", "ms", FRAME_TIME, Expected::none()), float("Alpha targets samplers", "%", ALPHA_TARGETS_SAMPLERS, Expected::none()), float("Transparent pass samplers", "%", TRANSPARENT_PASS_SAMPLERS, Expected::none()), @@ -379,6 +355,31 @@ impl Profiler { int("Interned filter data", "", INTERNED_FILTER_DATA, Expected::none()), int("Interned backdrops", "", INTERNED_BACKDROPS, Expected::none()), int("Interned polygons", "", INTERNED_POLYGONS, Expected::none()), + + int("Texture cache RGBA8 glyphs pixels", "px", TEXTURE_CACHE_RGBA8_GLYPHS_PIXELS, expected(0..4_000_000)), + int("Texture cache RGBA8 glyphs textures", "", TEXTURE_CACHE_RGBA8_GLYPHS_TEXTURES, expected(0..2)), + int("Texture cache A8 glyphs pixels", "px", TEXTURE_CACHE_A8_GLYPHS_PIXELS, expected(0..4_000_000)), + int("Texture cache A8 glyphs textures", "", TEXTURE_CACHE_A8_GLYPHS_TEXTURES, expected(0..2)), + + float("Staging CPU allocation", "ms", CPU_TEXTURE_ALLOCATION_TIME, Expected::none()), + float("Staging GPU allocation", "ms", STAGING_TEXTURE_ALLOCATION_TIME, Expected::none()), + float("Staging CPU copy", "ms", UPLOAD_CPU_COPY_TIME, Expected::none()), + float("Staging GPU copy", "ms", UPLOAD_GPU_COPY_TIME, Expected::none()), + float("Upload time", "ms", UPLOAD_TIME, Expected::none()), + int("Upload copy batches", "", UPLOAD_NUM_COPY_BATCHES, Expected::none()), + float("Texture cache upload", "ms", TOTAL_UPLOAD_TIME, expected(0.0..5.0)), + float("Cache texture creation", "ms", CREATE_CACHE_TEXTURE_TIME, expected(0.0..2.0)), + float("Cache texture deletion", "ms", DELETE_CACHE_TEXTURE_TIME, expected(0.0..1.0)), + + float("Texture cache RGBA8 linear pressure", "", TEXTURE_CACHE_COLOR8_LINEAR_PRESSURE, expected(0.0..1.0)), + float("Texture cache RGBA8 nearest pressure", "", TEXTURE_CACHE_COLOR8_NEAREST_PRESSURE, expected(0.0..1.0)), + float("Texture cache RGBA8 glyphs pressure", "", TEXTURE_CACHE_COLOR8_GLYPHS_PRESSURE, expected(0.0..1.0)), + float("Texture cache A8 pressure", "", TEXTURE_CACHE_ALPHA8_PRESSURE, expected(0.0..1.0)), + float("Texture cache A8 glyphs pressure", "", TEXTURE_CACHE_ALPHA8_GLYPHS_PRESSURE, expected(0.0..1.0)), + float("Texture cache A16 pressure", "", TEXTURE_CACHE_ALPHA16_PRESSURE, expected(0.0..1.0)), + float("Texture cache standalone pressure", "", TEXTURE_CACHE_STANDALONE_PRESSURE, expected(0.0..1.0)), + int("Texture cache eviction count", "items", TEXTURE_CACHE_EVICTION_COUNT, Expected::none()), + int("Texture cache youngest evicted", "frames", TEXTURE_CACHE_YOUNGEST_EVICTION, Expected::none()), ]; let mut counters = Vec::with_capacity(profile_counters.len()); diff --git a/webrender/src/render_api.rs b/webrender/src/render_api.rs index d3499e03bb..cff14eb5b3 100644 --- a/webrender/src/render_api.rs +++ b/webrender/src/render_api.rs @@ -1406,9 +1406,7 @@ pub struct MemoryReport { pub gpu_cache_textures: usize, pub vertex_data_textures: usize, pub render_target_textures: usize, - pub picture_tile_textures: usize, - pub atlas_textures: usize, - pub standalone_textures: usize, + pub texture_cache_textures: usize, pub texture_cache_structures: usize, pub depth_target_textures: usize, pub texture_upload_pbos: usize, diff --git a/webrender/src/renderer/mod.rs b/webrender/src/renderer/mod.rs index 6b0ae79c4b..26747ec755 100644 --- a/webrender/src/renderer/mod.rs +++ b/webrender/src/renderer/mod.rs @@ -74,7 +74,7 @@ use crate::gpu_cache::{GpuCacheUpdate, GpuCacheUpdateList}; use crate::gpu_cache::{GpuCacheDebugChunk, GpuCacheDebugCmd}; use crate::gpu_types::{PrimitiveInstanceData, ScalingInstance, SvgFilterInstance}; use crate::gpu_types::{BlurInstance, ClearInstance, CompositeInstance, ZBufferId}; -use crate::internal_types::{TextureSource, ResourceCacheError, TextureCacheCategory}; +use crate::internal_types::{TextureSource, ResourceCacheError}; #[cfg(any(feature = "capture", feature = "replay"))] use crate::internal_types::DebugOutput; use crate::internal_types::{CacheTextureId, FastHashMap, FastHashSet, RenderedDocument, ResultMsg}; @@ -447,11 +447,6 @@ enum PartialPresentMode { }, } -struct CacheTexture { - texture: Texture, - category: TextureCacheCategory, -} - /// Helper struct for resolving device Textures for use during rendering passes. /// /// Manages the mapping between the at-a-distance texture handles used by the @@ -459,7 +454,7 @@ struct CacheTexture { /// device texture handles. struct TextureResolver { /// A map to resolve texture cache IDs to native textures. - texture_cache_map: FastHashMap, + texture_cache_map: FastHashMap, /// Map of external image IDs to native textures. external_images: FastHashMap, @@ -496,8 +491,8 @@ impl TextureResolver { fn deinit(self, device: &mut Device) { device.delete_texture(self.dummy_cache_texture); - for (_id, item) in self.texture_cache_map { - device.delete_texture(item.texture); + for (_id, texture) in self.texture_cache_map { + device.delete_texture(texture); } } @@ -513,7 +508,7 @@ impl TextureResolver { // invalidate it so that tiled GPUs don't need to resolve it // back to memory. for texture_id in textures_to_invalidate { - let render_target = &self.texture_cache_map[texture_id].texture; + let render_target = &self.texture_cache_map[texture_id]; device.invalidate_render_target(render_target); } } @@ -537,7 +532,7 @@ impl TextureResolver { Swizzle::default() } TextureSource::TextureCache(index, swizzle) => { - let texture = &self.texture_cache_map[&index].texture; + let texture = &self.texture_cache_map[&index]; device.bind_texture(sampler, texture, swizzle); swizzle } @@ -557,7 +552,7 @@ impl TextureResolver { panic!("BUG: External textures cannot be resolved, they can only be bound."); } TextureSource::TextureCache(index, swizzle) => { - Some((&self.texture_cache_map[&index].texture, swizzle)) + Some((&self.texture_cache_map[&index], swizzle)) } } } @@ -587,7 +582,7 @@ impl TextureResolver { match *texture { TextureSource::Invalid => DeviceIntSize::zero(), TextureSource::TextureCache(id, _) => { - self.texture_cache_map[&id].texture.get_dimensions() + self.texture_cache_map[&id].get_dimensions() }, TextureSource::External(index, _) => { let uv_rect = self.external_images[&index].get_uv_rect(); @@ -602,40 +597,12 @@ impl TextureResolver { // We're reporting GPU memory rather than heap-allocations, so we don't // use size_of_op. - for item in self.texture_cache_map.values() { - let counter = match item.category { - TextureCacheCategory::Atlas => &mut report.atlas_textures, - TextureCacheCategory::Standalone => &mut report.standalone_textures, - TextureCacheCategory::PictureTile => &mut report.picture_tile_textures, - TextureCacheCategory::RenderTarget => &mut report.render_target_textures, - }; - *counter += item.texture.size_in_bytes(); + for t in self.texture_cache_map.values() { + report.texture_cache_textures += t.size_in_bytes(); } report } - - fn update_profile(&self, profile: &mut TransactionProfile) { - let mut external_image_bytes = 0; - for img in self.external_images.values() { - let uv_rect = img.get_uv_rect(); - let size = (uv_rect.uv1 - uv_rect.uv0).abs().to_size().to_i32(); - - // Assume 4 bytes per pixels which is true most of the time but - // not always. - let bpp = 4; - external_image_bytes += size.area() as usize * bpp; - } - - profile.set(profiler::EXTERNAL_IMAGE_BYTES, profiler::bytes_to_mb(external_image_bytes)); - } - - fn get_cache_texture_mut(&mut self, id: &CacheTextureId) -> &mut Texture { - &mut self.texture_cache_map - .get_mut(id) - .expect("bug: texture not allocated") - .texture - } } #[derive(Debug, Copy, Clone, PartialEq)] @@ -2025,12 +1992,6 @@ impl Renderer { add_text_marker(cstr!("NumDrawCalls"), &message, duration); } - let report = self.texture_resolver.report_memory(); - self.profile.set(profiler::RENDER_TARGET_MEM, profiler::bytes_to_mb(report.render_target_textures)); - self.profile.set(profiler::PICTURE_TILES_MEM, profiler::bytes_to_mb(report.picture_tile_textures)); - self.profile.set(profiler::ATLAS_TEXTURES_MEM, profiler::bytes_to_mb(report.atlas_textures)); - self.profile.set(profiler::STANDALONE_TEXTURES_MEM, profiler::bytes_to_mb(report.standalone_textures)); - results.stats.texture_upload_mb = self.profile.get_or(profiler::TEXTURE_UPLOADS_MEM, 0.0); self.frame_counter += 1; results.stats.resource_upload_time = self.resource_upload_time; @@ -2045,8 +2006,6 @@ impl Renderer { self.profiler.update_frame_stats(stats); } - self.texture_resolver.update_profile(&mut self.profile); - // Note: this clears the values in self.profile. self.profiler.set_counters(&mut self.profile); @@ -2190,21 +2149,19 @@ impl Renderer { assert!(old.is_some(), "Renderer and backend disagree!"); } } - if let Some(old) = old { - + if let Some(texture) = old { // Regenerate the cache allocation info so we can search through deletes for reuse. - let size = old.texture.get_dimensions(); + let size = texture.get_dimensions(); let info = TextureCacheAllocInfo { width: size.width, height: size.height, - format: old.texture.get_format(), - filter: old.texture.get_filter(), - target: old.texture.get_target(), - is_shared_cache: old.texture.flags().contains(TextureFlags::IS_SHARED_TEXTURE_CACHE), - has_depth: old.texture.supports_depth(), - category: old.category, + format: texture.get_format(), + filter: texture.get_filter(), + target: texture.get_target(), + is_shared_cache: texture.flags().contains(TextureFlags::IS_SHARED_TEXTURE_CACHE), + has_depth: texture.supports_depth(), }; - pending_deletes.push((old.texture, info)); + pending_deletes.push((texture, info)); } } // Look for any alloc or reset that has matching alloc info and save it from being deleted. @@ -2283,10 +2240,7 @@ impl Renderer { create_cache_texture_time += precise_time_ns() - create_cache_texture_start; - self.texture_resolver.texture_cache_map.insert(allocation.id, CacheTexture { - texture, - category: info.category, - }); + self.texture_resolver.texture_cache_map.insert(allocation.id, texture); } TextureCacheAllocationKind::Free => {} }; @@ -3855,7 +3809,7 @@ impl Renderer { self.set_blend(false, FramebufferKind::Other); - let texture = &self.texture_resolver.texture_cache_map[texture].texture; + let texture = &self.texture_resolver.texture_cache_map[texture]; let target_size = texture.get_dimensions(); let projection = Transform3D::ortho( @@ -4563,7 +4517,10 @@ impl Renderer { let texture_id = target.texture_id(); - let alpha_tex = self.texture_resolver.get_cache_texture_mut(&texture_id); + let alpha_tex = self.texture_resolver + .texture_cache_map + .get_mut(&texture_id) + .expect("bug: texture not allocated"); let draw_target = DrawTarget::from_texture( alpha_tex, @@ -4595,7 +4552,10 @@ impl Renderer { let texture_id = target.texture_id(); - let color_tex = self.texture_resolver.get_cache_texture_mut(&texture_id); + let color_tex = self.texture_resolver + .texture_cache_map + .get_mut(&texture_id) + .expect("bug: texture not allocated"); self.device.reuse_render_target::( color_tex, @@ -4822,8 +4782,7 @@ impl Renderer { let textures = self.texture_resolver .texture_cache_map .values() - .filter(|item| { item.texture.is_render_target() }) - .map(|item| &item.texture) + .filter(|texture| { texture.is_render_target() }) .collect::>(); Self::do_debug_blit( @@ -4932,7 +4891,7 @@ impl Renderer { }; let textures = - self.texture_resolver.texture_cache_map.values().map(|item| &item.texture).collect::>(); + self.texture_resolver.texture_cache_map.values().collect::>(); fn select_color(texture: &Texture) -> [f32; 4] { if texture.flags().contains(TextureFlags::IS_SHARED_TEXTURE_CACHE) { @@ -5582,7 +5541,6 @@ struct PlainTexture { format: ImageFormat, filter: TextureFilter, has_depth: bool, - category: Option, } @@ -5638,7 +5596,7 @@ pub struct PipelineInfo { impl Renderer { #[cfg(feature = "capture")] fn save_texture( - texture: &Texture, category: Option, name: &str, root: &PathBuf, device: &mut Device + texture: &Texture, name: &str, root: &PathBuf, device: &mut Device ) -> PlainTexture { use std::fs; use std::io::Write; @@ -5688,7 +5646,6 @@ impl Renderer { format: texture.get_format(), filter: texture.get_filter(), has_depth: texture.supports_depth(), - category, } } @@ -5831,17 +5788,17 @@ impl Renderer { device_size: self.device_size, gpu_cache: Self::save_texture( self.gpu_cache_texture.get_texture(), - None, "gpu", &root, &mut self.device, + "gpu", &root, &mut self.device, ), gpu_cache_frame_id: self.gpu_cache_frame_id, textures: FastHashMap::default(), }; info!("saving cached textures"); - for (id, item) in &self.texture_resolver.texture_cache_map { + for (id, texture) in &self.texture_resolver.texture_cache_map { let file_name = format!("cache-{}", plain_self.textures.len() + 1); info!("\t{}", file_name); - let plain = Self::save_texture(&item.texture, Some(item.category), &file_name, &root, &mut self.device); + let plain = Self::save_texture(texture, &file_name, &root, &mut self.device); plain_self.textures.insert(*id, plain); } @@ -5921,7 +5878,6 @@ impl Renderer { format: descriptor.format, filter: TextureFilter::Linear, has_depth: false, - category: None, }; let t = Self::load_texture( target, @@ -5948,8 +5904,8 @@ impl Renderer { info!("loading cached textures"); self.device_size = renderer.device_size; - for (_id, item) in self.texture_resolver.texture_cache_map.drain() { - self.device.delete_texture(item.texture); + for (_id, texture) in self.texture_resolver.texture_cache_map.drain() { + self.device.delete_texture(texture); } for (id, texture) in renderer.textures { info!("\t{}", texture.data); @@ -5961,10 +5917,7 @@ impl Renderer { &root, &mut self.device ); - self.texture_resolver.texture_cache_map.insert(id, Cachetexture { - texture: t.0, - category: texture.category, - }); + self.texture_resolver.texture_cache_map.insert(id, t.0); } info!("loading gpu cache"); diff --git a/webrender/src/renderer/upload.rs b/webrender/src/renderer/upload.rs index 9171fd9d5e..fecdf44493 100644 --- a/webrender/src/renderer/upload.rs +++ b/webrender/src/renderer/upload.rs @@ -82,7 +82,7 @@ pub fn upload_to_texture_cache( let num_updates = update_list.len(); for (texture_id, updates) in update_list { - let texture = &renderer.texture_resolver.texture_cache_map[&texture_id].texture; + let texture = &renderer.texture_resolver.texture_cache_map[&texture_id]; for update in updates { let TextureCacheUpdate { rect, stride, offset, format_override, source } = update; @@ -429,7 +429,7 @@ fn copy_from_staging_to_cache( batch_upload_copies: Vec, ) { for copy in batch_upload_copies { - let dest_texture = &renderer.texture_resolver.texture_cache_map[©.dest_texture_id].texture; + let dest_texture = &renderer.texture_resolver.texture_cache_map[©.dest_texture_id]; renderer.device.copy_texture_sub_region( &batch_upload_textures[copy.src_texture_index], @@ -495,7 +495,7 @@ fn copy_from_staging_to_cache_using_draw_calls( } if dst_changed { - let dest_texture = &renderer.texture_resolver.texture_cache_map[©.dest_texture_id].texture; + let dest_texture = &renderer.texture_resolver.texture_cache_map[©.dest_texture_id]; let target_size = dest_texture.get_dimensions(); let draw_target = DrawTarget::from_texture( diff --git a/webrender/src/texture_cache.rs b/webrender/src/texture_cache.rs index cefd2c70a1..936b6b8d25 100644 --- a/webrender/src/texture_cache.rs +++ b/webrender/src/texture_cache.rs @@ -14,7 +14,7 @@ use crate::gpu_types::{ImageSource, UvRectKind}; use crate::internal_types::{ CacheTextureId, Swizzle, SwizzleSettings, TextureUpdateList, TextureUpdateSource, TextureSource, - TextureCacheAllocInfo, TextureCacheUpdate, TextureCacheCategory, + TextureCacheAllocInfo, TextureCacheUpdate, }; use crate::lru_cache::LRUCache; use crate::profiler::{self, TransactionProfile}; @@ -305,13 +305,13 @@ impl BudgetType { ]; pub const PRESSURE_COUNTERS: [usize; BudgetType::COUNT] = [ - profiler::ATLAS_COLOR8_LINEAR_PRESSURE, - profiler::ATLAS_COLOR8_NEAREST_PRESSURE, - profiler::ATLAS_COLOR8_GLYPHS_PRESSURE, - profiler::ATLAS_ALPHA8_PRESSURE, - profiler::ATLAS_ALPHA8_GLYPHS_PRESSURE, - profiler::ATLAS_ALPHA16_PRESSURE, - profiler::ATLAS_STANDALONE_PRESSURE, + profiler::TEXTURE_CACHE_COLOR8_LINEAR_PRESSURE, + profiler::TEXTURE_CACHE_COLOR8_NEAREST_PRESSURE, + profiler::TEXTURE_CACHE_COLOR8_GLYPHS_PRESSURE, + profiler::TEXTURE_CACHE_ALPHA8_PRESSURE, + profiler::TEXTURE_CACHE_ALPHA8_GLYPHS_PRESSURE, + profiler::TEXTURE_CACHE_ALPHA16_PRESSURE, + profiler::TEXTURE_CACHE_STANDALONE_PRESSURE, ]; pub fn iter() -> impl Iterator { @@ -522,6 +522,13 @@ struct PictureTexture { last_frame_used: FrameId, } +impl PictureTexture { + fn size_in_bytes(&self) -> usize { + let bpp = self.format.bytes_per_pixel() as usize; + (self.size.width * self.size.height) as usize * bpp + } +} + /// The textures used to hold picture cache tiles. #[cfg_attr(feature = "capture", derive(Serialize))] #[cfg_attr(feature = "replay", derive(Deserialize))] @@ -581,7 +588,6 @@ impl PictureTextures { filter: TextureFilter::Nearest, is_shared_cache: false, has_depth: true, - category: TextureCacheCategory::PictureTile, }; pending_updates.push_alloc(texture_id, info); @@ -641,7 +647,16 @@ impl PictureTextures { } fn update_profile(&self, profile: &mut TransactionProfile) { - profile.set(profiler::PICTURE_TILES, self.textures.len()); + // For now, this profile counter just accumulates the tiles and bytes + // from all picture cache textures. + let mut picture_tiles = 0; + let mut picture_bytes = 0; + for texture in &self.textures { + picture_tiles += 1; + picture_bytes += texture.size_in_bytes(); + } + profile.set(profiler::PICTURE_TILES, picture_tiles); + profile.set(profiler::PICTURE_TILES_MEM, profiler::bytes_to_mb(picture_bytes)); } /// Simple garbage collect of picture cache tiles @@ -937,18 +952,18 @@ impl TextureCache { profile.set(BudgetType::PRESSURE_COUNTERS[budget as usize], pressure); } - profile.set(profiler::ATLAS_A8_PIXELS, self.shared_textures.alpha8_linear.allocated_space()); - profile.set(profiler::ATLAS_A8_TEXTURES, self.shared_textures.alpha8_linear.allocated_textures()); - profile.set(profiler::ATLAS_A8_GLYPHS_PIXELS, self.shared_textures.alpha8_glyphs.allocated_space()); - profile.set(profiler::ATLAS_A8_GLYPHS_TEXTURES, self.shared_textures.alpha8_glyphs.allocated_textures()); - profile.set(profiler::ATLAS_A16_PIXELS, self.shared_textures.alpha16_linear.allocated_space()); - profile.set(profiler::ATLAS_A16_TEXTURES, self.shared_textures.alpha16_linear.allocated_textures()); - profile.set(profiler::ATLAS_RGBA8_LINEAR_PIXELS, self.shared_textures.color8_linear.allocated_space()); - profile.set(profiler::ATLAS_RGBA8_LINEAR_TEXTURES, self.shared_textures.color8_linear.allocated_textures()); - profile.set(profiler::ATLAS_RGBA8_NEAREST_PIXELS, self.shared_textures.color8_nearest.allocated_space()); - profile.set(profiler::ATLAS_RGBA8_NEAREST_TEXTURES, self.shared_textures.color8_nearest.allocated_textures()); - profile.set(profiler::ATLAS_RGBA8_GLYPHS_PIXELS, self.shared_textures.color8_glyphs.allocated_space()); - profile.set(profiler::ATLAS_RGBA8_GLYPHS_TEXTURES, self.shared_textures.color8_glyphs.allocated_textures()); + profile.set(profiler::TEXTURE_CACHE_A8_PIXELS, self.shared_textures.alpha8_linear.allocated_space()); + profile.set(profiler::TEXTURE_CACHE_A8_TEXTURES, self.shared_textures.alpha8_linear.allocated_textures()); + profile.set(profiler::TEXTURE_CACHE_A8_GLYPHS_PIXELS, self.shared_textures.alpha8_glyphs.allocated_space()); + profile.set(profiler::TEXTURE_CACHE_A8_GLYPHS_TEXTURES, self.shared_textures.alpha8_glyphs.allocated_textures()); + profile.set(profiler::TEXTURE_CACHE_A16_PIXELS, self.shared_textures.alpha16_linear.allocated_space()); + profile.set(profiler::TEXTURE_CACHE_A16_TEXTURES, self.shared_textures.alpha16_linear.allocated_textures()); + profile.set(profiler::TEXTURE_CACHE_RGBA8_LINEAR_PIXELS, self.shared_textures.color8_linear.allocated_space()); + profile.set(profiler::TEXTURE_CACHE_RGBA8_LINEAR_TEXTURES, self.shared_textures.color8_linear.allocated_textures()); + profile.set(profiler::TEXTURE_CACHE_RGBA8_NEAREST_PIXELS, self.shared_textures.color8_nearest.allocated_space()); + profile.set(profiler::TEXTURE_CACHE_RGBA8_NEAREST_TEXTURES, self.shared_textures.color8_nearest.allocated_textures()); + profile.set(profiler::TEXTURE_CACHE_RGBA8_GLYPHS_PIXELS, self.shared_textures.color8_glyphs.allocated_space()); + profile.set(profiler::TEXTURE_CACHE_RGBA8_GLYPHS_TEXTURES, self.shared_textures.color8_glyphs.allocated_textures()); self.picture_textures.update_profile(profile); @@ -960,8 +975,10 @@ impl TextureCache { BudgetType::SharedAlpha8Glyphs, BudgetType::SharedAlpha16, ].iter().map(|b| self.bytes_allocated[*b as usize]).sum(); + let standalone_bytes = self.bytes_allocated[BudgetType::Standalone as usize]; - profile.set(profiler::ATLAS_ITEMS_MEM, profiler::bytes_to_mb(shared_bytes)); + profile.set(profiler::TEXTURE_CACHE_SHARED_MEM, profiler::bytes_to_mb(shared_bytes)); + profile.set(profiler::TEXTURE_CACHE_STANDALONE_MEM, profiler::bytes_to_mb(standalone_bytes)); self.now = FrameStamp::INVALID; } @@ -1468,7 +1485,6 @@ impl TextureCache { filter: parameters.filter, is_shared_cache: true, has_depth: false, - category: TextureCacheCategory::Atlas, }, ); @@ -1560,7 +1576,6 @@ impl TextureCache { filter: TextureFilter::Linear, is_shared_cache: false, has_depth: false, - category: TextureCacheCategory::RenderTarget, }; self.pending_updates.push_alloc(texture_id, info); @@ -1593,7 +1608,6 @@ impl TextureCache { filter: params.filter, is_shared_cache: false, has_depth: false, - category: TextureCacheCategory::Standalone, }; let size_in_bytes = (info.width * info.height * info.format.bytes_per_pixel()) as usize;