[rs] Format PassErrorScope pipelines

This commit is contained in:
Mikko Lehtonen
2021-01-05 22:41:56 +02:00
parent 76bfba0969
commit 9ab5cdbd1f
2 changed files with 19 additions and 3 deletions

View File

@@ -26,20 +26,20 @@ webgl = ["wgc"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "ae3e5057aff64a8e6f13e75be661c0f8a98abcd5"
rev = "c788b1cef630fa5b5f0a86132fe84551d4149fb6"
features = ["raw-window-handle"]
[target.'cfg(target_arch = "wasm32")'.dependencies.wgc]
package = "wgpu-core"
git = "https://github.com/gfx-rs/wgpu"
rev = "ae3e5057aff64a8e6f13e75be661c0f8a98abcd5"
rev = "c788b1cef630fa5b5f0a86132fe84551d4149fb6"
features = ["raw-window-handle"]
optional = true
[dependencies.wgt]
package = "wgpu-types"
git = "https://github.com/gfx-rs/wgpu"
rev = "ae3e5057aff64a8e6f13e75be661c0f8a98abcd5"
rev = "c788b1cef630fa5b5f0a86132fe84551d4149fb6"
[dependencies]
arrayvec = "0.5"

View File

@@ -317,6 +317,22 @@ impl PrettyError for wgc::command::PassErrorScope {
let name = wgc::gfx_select!(id => global.buffer_label(id));
format_label_line("buffer", &name)
}
Self::Draw { pipeline, .. } => {
if let Some(id) = pipeline {
let name = wgc::gfx_select!(id => global.render_pipeline_label(id));
format_label_line("render pipeline", &name)
} else {
String::new()
}
}
Self::Dispatch { pipeline, .. } => {
if let Some(id) = pipeline {
let name = wgc::gfx_select!(id => global.compute_pipeline_label(id));
format_label_line("compute pipeline", &name)
} else {
String::new()
}
}
_ => String::new(),
}
}