Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear evicted entries in the texture cache debug display #3321

Merged
merged 2 commits into from Nov 17, 2018
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Route WebRender pref changes through the RenderBackend.

The overlap between debug flags and debug commands is a bit of a mess,
and this patch does not entirely clean it up. But this at least means
that the RenderBackend can react to pref changes in Firefox.

Differential Revision: https://phabricator.services.mozilla.com/D11958
  • Loading branch information
bholley committed Nov 17, 2018
commit 2d35cf827df69cee03897fe3fd5dd46b7a845e8b
@@ -30,6 +30,7 @@ use api::{MemoryReport, VoidPtrToSizeFn};
use api::{RenderApiSender, RenderNotifier, TexelRect, TextureTarget};
use api::{channel};
use api::DebugCommand;
pub use api::DebugFlags;
use api::channel::PayloadReceiverHelperMethods;
use batch::{BatchKind, BatchTextures, BrushBatchKind};
#[cfg(any(feature = "capture", feature = "replay"))]
@@ -237,26 +238,6 @@ impl BatchKind {
}
}

bitflags! {
#[derive(Default)]
pub struct DebugFlags: u32 {
const PROFILER_DBG = 1 << 0;
const RENDER_TARGET_DBG = 1 << 1;
const TEXTURE_CACHE_DBG = 1 << 2;
const GPU_TIME_QUERIES = 1 << 3;
const GPU_SAMPLE_QUERIES = 1 << 4;
const DISABLE_BATCHING = 1 << 5;
const EPOCHS = 1 << 6;
const COMPACT_PROFILER = 1 << 7;
const ECHO_DRIVER_MESSAGES = 1 << 8;
const NEW_FRAME_INDICATOR = 1 << 9;
const NEW_SCENE_INDICATOR = 1 << 10;
const SHOW_OVERDRAW = 1 << 11;
const GPU_CACHE_DBG = 1 << 12;
const SLOW_FRAME_INDICATOR = 1 << 13;
}
}

fn flag_changed(before: DebugFlags, after: DebugFlags, select: DebugFlags) -> Option<bool> {
if before & select != after & select {
Some(after.contains(select))
@@ -2436,6 +2417,9 @@ impl Renderer {
}
}
}
DebugCommand::SetFlags(flags) => {
self.set_debug_flags(flags);
}
}
}

@@ -664,6 +664,9 @@ pub enum DebugCommand {
/// Causes the low priority scene builder to pause for a given amount of miliseconds
/// each time it processes a transaction.
SimulateLongLowPrioritySceneBuild(u32),
/// Sets the provided debug flags. This may overlap with some of the functionality
/// above.
SetFlags(DebugFlags),
}

#[derive(Clone, Deserialize, Serialize)]
@@ -913,7 +916,26 @@ impl RenderApiSender {
next_id: Cell::new(ResourceId(0)),
}
}
}

bitflags! {
#[derive(Default, Deserialize, Serialize)]
pub struct DebugFlags: u32 {
const PROFILER_DBG = 1 << 0;
const RENDER_TARGET_DBG = 1 << 1;
const TEXTURE_CACHE_DBG = 1 << 2;
const GPU_TIME_QUERIES = 1 << 3;
const GPU_SAMPLE_QUERIES = 1 << 4;
const DISABLE_BATCHING = 1 << 5;
const EPOCHS = 1 << 6;
const COMPACT_PROFILER = 1 << 7;
const ECHO_DRIVER_MESSAGES = 1 << 8;
const NEW_FRAME_INDICATOR = 1 << 9;
const NEW_SCENE_INDICATOR = 1 << 10;
const SHOW_OVERDRAW = 1 << 11;
const GPU_CACHE_DBG = 1 << 12;
const SLOW_FRAME_INDICATOR = 1 << 13;
}
}

pub struct RenderApi {
@@ -1013,6 +1035,11 @@ impl RenderApi {
rx.recv().unwrap()
}

pub fn set_debug_flags(&self, flags: DebugFlags) {
let cmd = DebugCommand::SetFlags(flags);
self.api_sender.send(ApiMsg::DebugCommand(cmd)).unwrap();
}

pub fn shut_down(&self) {
self.api_sender.send(ApiMsg::ShutDown).unwrap();
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.