mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 06:44:14 +00:00
Move from tracing
to log
+ profiling
This commit is contained in:
parent
5d993efc85
commit
cf6f9c3ca8
219
Cargo.lock
generated
219
Cargo.lock
generated
@ -36,15 +36,6 @@ dependencies = [
|
||||
"xml-rs",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ansi_term"
|
||||
version = "0.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
|
||||
dependencies = [
|
||||
"winapi 0.3.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "arrayvec"
|
||||
version = "0.5.2"
|
||||
@ -162,19 +153,6 @@ version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
|
||||
|
||||
[[package]]
|
||||
name = "chrono"
|
||||
version = "0.4.19"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"num-integer",
|
||||
"num-traits",
|
||||
"time",
|
||||
"winapi 0.3.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cloudabi"
|
||||
version = "0.1.0"
|
||||
@ -645,7 +623,6 @@ checksum = "1e7724b9aef57ea36d70faf54e0ee6265f86e41de16bed8333efdeab5b00e16b"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"gpu-alloc-types",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -666,7 +643,6 @@ dependencies = [
|
||||
"bitflags",
|
||||
"gpu-descriptor-types",
|
||||
"hashbrown",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -742,12 +718,6 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "0.4.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6"
|
||||
|
||||
[[package]]
|
||||
name = "jni-sys"
|
||||
version = "0.3.0"
|
||||
@ -857,8 +827,6 @@ dependencies = [
|
||||
"cfg-if 0.1.10",
|
||||
"generator",
|
||||
"scoped-tls",
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -870,15 +838,6 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "matchers"
|
||||
version = "0.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1"
|
||||
dependencies = [
|
||||
"regex-automata",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "maybe-uninit"
|
||||
version = "2.0.0"
|
||||
@ -1050,16 +1009,6 @@ dependencies = [
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-integer"
|
||||
version = "0.1.44"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"num-traits",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "num-traits"
|
||||
version = "0.2.14"
|
||||
@ -1167,12 +1116,6 @@ dependencies = [
|
||||
"indexmap",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-lite"
|
||||
version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b"
|
||||
|
||||
[[package]]
|
||||
name = "pkg-config"
|
||||
version = "0.3.19"
|
||||
@ -1190,7 +1133,6 @@ dependencies = [
|
||||
"ron",
|
||||
"serde",
|
||||
"wgpu-core",
|
||||
"wgpu-subscriber",
|
||||
"wgpu-types",
|
||||
"winit",
|
||||
]
|
||||
@ -1213,6 +1155,12 @@ dependencies = [
|
||||
"unicode-xid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "profiling"
|
||||
version = "0.1.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b0c71198452babfbba7419e716d29853c462d59da73c41485ab7dc8b4dc0c4be"
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.7"
|
||||
@ -1254,16 +1202,6 @@ dependencies = [
|
||||
"thread_local",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex-automata"
|
||||
version = "0.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ae1ded71d66a4a97f5e961fd0cb25a5f366a42a41570d16a763a69c092c26ae4"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"regex-syntax",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "regex-syntax"
|
||||
version = "0.6.21"
|
||||
@ -1321,12 +1259,6 @@ dependencies = [
|
||||
"owned_ttf_parser",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ryu"
|
||||
version = "1.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
|
||||
|
||||
[[package]]
|
||||
name = "same-file"
|
||||
version = "1.0.6"
|
||||
@ -1383,27 +1315,6 @@ dependencies = [
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_json"
|
||||
version = "1.0.59"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dcac07dbffa1c65e7f816ab9eba78eb142c6d44410f4eeba1e26e4f5dfa56b95"
|
||||
dependencies = [
|
||||
"itoa",
|
||||
"ryu",
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sharded-slab"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7b4921be914e16899a80adefb821f8ddb7974e3f1250223575a44ed994882127"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"loom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "slab"
|
||||
version = "0.4.2"
|
||||
@ -1517,17 +1428,6 @@ dependencies = [
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thread-id"
|
||||
version = "3.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"redox_syscall",
|
||||
"winapi 0.3.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thread_local"
|
||||
version = "1.0.1"
|
||||
@ -1543,17 +1443,6 @@ version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7572415bd688d401c52f6e36f4c8e805b9ae1622619303b9fa835d531db0acae"
|
||||
|
||||
[[package]]
|
||||
name = "time"
|
||||
version = "0.1.44"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"wasi",
|
||||
"winapi 0.3.9",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml"
|
||||
version = "0.5.7"
|
||||
@ -1563,81 +1452,6 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing"
|
||||
version = "0.1.21"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b0987850db3733619253fe60e17cb59b82d37c7e6c0236bb81e4d6b87c879f27"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.10",
|
||||
"pin-project-lite",
|
||||
"tracing-attributes",
|
||||
"tracing-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-attributes"
|
||||
version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "80e0ccfc3378da0cce270c946b676a376943f5cd16aeba64568e7939806f4ada"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-core"
|
||||
version = "0.1.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-log"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5e0f8c7178e13481ff6765bd169b33e8d554c5d2bbede5e32c356194be02b9b9"
|
||||
dependencies = [
|
||||
"lazy_static",
|
||||
"log",
|
||||
"tracing-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-serde"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fb65ea441fbb84f9f6748fd496cf7f63ec9af5bca94dd86456978d055e8eb28b"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"tracing-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tracing-subscriber"
|
||||
version = "0.2.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1fa8f0c8f4c594e4fc9debc1990deab13238077271ba84dd853d54902ee3401"
|
||||
dependencies = [
|
||||
"ansi_term",
|
||||
"chrono",
|
||||
"lazy_static",
|
||||
"matchers",
|
||||
"regex",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sharded-slab",
|
||||
"smallvec",
|
||||
"thread_local",
|
||||
"tracing",
|
||||
"tracing-core",
|
||||
"tracing-log",
|
||||
"tracing-serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ttf-parser"
|
||||
version = "0.6.2"
|
||||
@ -1673,12 +1487,6 @@ dependencies = [
|
||||
"winapi-util",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wasi"
|
||||
version = "0.10.0+wasi-snapshot-preview1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
|
||||
|
||||
[[package]]
|
||||
name = "wasm-bindgen"
|
||||
version = "0.2.60"
|
||||
@ -1834,30 +1642,19 @@ dependencies = [
|
||||
"gfx-hal",
|
||||
"gpu-alloc",
|
||||
"gpu-descriptor",
|
||||
"log",
|
||||
"loom",
|
||||
"naga",
|
||||
"parking_lot",
|
||||
"profiling",
|
||||
"raw-window-handle",
|
||||
"ron",
|
||||
"serde",
|
||||
"smallvec",
|
||||
"thiserror",
|
||||
"tracing",
|
||||
"wgpu-types",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wgpu-subscriber"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/gfx-rs/subscriber.git?rev=cdc9feb53f152f9c41905ed9efeff2c1ed214361#cdc9feb53f152f9c41905ed9efeff2c1ed214361"
|
||||
dependencies = [
|
||||
"parking_lot",
|
||||
"thread-id",
|
||||
"tracing",
|
||||
"tracing-log",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wgpu-types"
|
||||
version = "0.7.0"
|
||||
|
@ -38,10 +38,5 @@ features = ["replay", "raw-window-handle"]
|
||||
#rev = "" # insert revision here
|
||||
#features = ["auto-capture"]
|
||||
|
||||
[dependencies.wgpu-subscriber]
|
||||
git = "https://github.com/gfx-rs/subscriber.git"
|
||||
rev = "cdc9feb53f152f9c41905ed9efeff2c1ed214361"
|
||||
version = "0.1"
|
||||
|
||||
[dev-dependencies]
|
||||
serde = "1"
|
||||
|
@ -17,12 +17,7 @@ fn main() {
|
||||
#[cfg(feature = "winit")]
|
||||
use winit::{event_loop::EventLoop, window::WindowBuilder};
|
||||
|
||||
wgpu_subscriber::initialize_default_subscriber(
|
||||
std::env::var("WGPU_CHROME_TRACE")
|
||||
.as_ref()
|
||||
.map(Path::new)
|
||||
.ok(),
|
||||
);
|
||||
env_logger::init();
|
||||
|
||||
#[cfg(feature = "renderdoc")]
|
||||
#[cfg_attr(feature = "winit", allow(unused))]
|
||||
|
@ -217,12 +217,7 @@ impl Corpus {
|
||||
|
||||
#[test]
|
||||
fn test_api() {
|
||||
wgpu_subscriber::initialize_default_subscriber(
|
||||
std::env::var("WGPU_CHROME_TRACE")
|
||||
.as_ref()
|
||||
.map(Path::new)
|
||||
.ok(),
|
||||
);
|
||||
env_logger::init();
|
||||
|
||||
Corpus::run_from(PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/data/all.ron"))
|
||||
}
|
||||
|
@ -27,16 +27,17 @@ arrayvec = "0.5"
|
||||
bitflags = "1.0"
|
||||
copyless = "0.1"
|
||||
fxhash = "0.2"
|
||||
log = "0.4"
|
||||
parking_lot = "0.11"
|
||||
profiling = { version = "0.1.10", default-features = false } # Need 0.1.10+ to prevent compile errors with proc macros disabled
|
||||
raw-window-handle = { version = "0.3", optional = true }
|
||||
ron = { version = "0.6", optional = true }
|
||||
serde = { version = "1.0", features = ["serde_derive"], optional = true }
|
||||
smallvec = "1"
|
||||
tracing = { version = "0.1", default-features = false, features = ["std"] }
|
||||
thiserror = "1"
|
||||
|
||||
gpu-alloc = { version = "0.3", features = ["tracing"] }
|
||||
gpu-descriptor = { version = "0.1", features = ["tracing"] }
|
||||
gpu-alloc = { version = "0.3" }
|
||||
gpu-descriptor = { version = "0.1" }
|
||||
|
||||
hal = { package = "gfx-hal", git = "https://github.com/gfx-rs/gfx", rev = "2125c1d96b09f97faaa0d7a8a0d1c5315acc8c45" }
|
||||
gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx", rev = "2125c1d96b09f97faaa0d7a8a0d1c5315acc8c45" }
|
||||
|
@ -32,7 +32,7 @@ impl<B: hal::Backend> CommandPool<B> {
|
||||
for i in (0..self.pending.len()).rev() {
|
||||
if self.pending[i].1 <= last_done_index {
|
||||
let (cmd_buf, index) = self.pending.swap_remove(i);
|
||||
tracing::trace!(
|
||||
log::trace!(
|
||||
"recycling cmdbuf submitted in {} when {} is last done",
|
||||
index,
|
||||
last_done_index,
|
||||
@ -100,7 +100,7 @@ impl<B: GfxBackend> CommandAllocator<B> {
|
||||
use std::collections::hash_map::Entry;
|
||||
let pool = match inner.pools.entry(thread_id) {
|
||||
Entry::Vacant(e) => {
|
||||
tracing::info!("Starting on thread {:?}", thread_id);
|
||||
log::info!("Starting on thread {:?}", thread_id);
|
||||
let raw = unsafe {
|
||||
device
|
||||
.create_command_pool(
|
||||
@ -151,7 +151,7 @@ impl<B: hal::Backend> CommandAllocator<B> {
|
||||
device: &B::Device,
|
||||
) -> Result<Self, CommandAllocatorError> {
|
||||
let internal_thread_id = thread::current().id();
|
||||
tracing::info!("Starting on (internal) thread {:?}", internal_thread_id);
|
||||
log::info!("Starting on (internal) thread {:?}", internal_thread_id);
|
||||
let mut pools = FastHashMap::default();
|
||||
pools.insert(
|
||||
internal_thread_id,
|
||||
@ -250,7 +250,7 @@ impl<B: hal::Backend> CommandAllocator<B> {
|
||||
}
|
||||
}
|
||||
for thread_id in remove_threads {
|
||||
tracing::info!("Removing from thread {:?}", thread_id);
|
||||
log::info!("Removing from thread {:?}", thread_id);
|
||||
let pool = inner.pools.remove(&thread_id).unwrap();
|
||||
pool.destroy(device);
|
||||
}
|
||||
@ -263,7 +263,7 @@ impl<B: hal::Backend> CommandAllocator<B> {
|
||||
pool.recycle(raw);
|
||||
}
|
||||
if pool.total != pool.available.len() {
|
||||
tracing::error!(
|
||||
log::error!(
|
||||
"Some command buffers are still recorded, only tracking {} / {}",
|
||||
pool.available.len(),
|
||||
pool.total
|
||||
|
@ -194,7 +194,7 @@ impl Binder {
|
||||
bind_group: &BindGroup<B>,
|
||||
offsets: &[wgt::DynamicOffset],
|
||||
) -> &'a [EntryPayload] {
|
||||
tracing::trace!("\tBinding [{}] = group {:?}", index, bind_group_id);
|
||||
log::trace!("\tBinding [{}] = group {:?}", index, bind_group_id);
|
||||
debug_assert_eq!(B::VARIANT, bind_group_id.0.backend());
|
||||
|
||||
let payload = &mut self.payloads[index];
|
||||
|
@ -51,7 +51,6 @@ use crate::{
|
||||
id,
|
||||
memory_init_tracker::{MemoryInitKind, MemoryInitTrackerAction},
|
||||
resource::BufferUse,
|
||||
span,
|
||||
track::{TrackerSet, UsageConflict},
|
||||
validation::check_buffer_usage,
|
||||
Label, LabelHelpers, LifeGuard, Stored, MAX_BIND_GROUPS,
|
||||
@ -92,7 +91,7 @@ impl RenderBundleEncoder {
|
||||
parent_id: id::DeviceId,
|
||||
base: Option<BasePass<RenderCommand>>,
|
||||
) -> Result<Self, CreateRenderBundleError> {
|
||||
span!(_guard, INFO, "RenderBundleEncoder::new");
|
||||
profiling::scope!("RenderBundleEncoder::new");
|
||||
Ok(Self {
|
||||
base: base.unwrap_or_else(|| BasePass::new(&desc.label)),
|
||||
parent_id,
|
||||
@ -512,7 +511,7 @@ impl RenderBundleEncoder {
|
||||
offset: wgt::BufferAddress,
|
||||
size: Option<wgt::BufferSize>,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderBundle::set_index_buffer");
|
||||
profiling::scope!("RenderBundle::set_index_buffer");
|
||||
self.base.commands.push(RenderCommand::SetIndexBuffer {
|
||||
buffer_id,
|
||||
index_format,
|
||||
@ -1150,7 +1149,7 @@ where
|
||||
|
||||
pub mod bundle_ffi {
|
||||
use super::{RenderBundleEncoder, RenderCommand};
|
||||
use crate::{id, span, RawString};
|
||||
use crate::{id, RawString};
|
||||
use std::{convert::TryInto, slice};
|
||||
use wgt::{BufferAddress, BufferSize, DynamicOffset};
|
||||
|
||||
@ -1166,7 +1165,6 @@ pub mod bundle_ffi {
|
||||
offsets: *const DynamicOffset,
|
||||
offset_length: usize,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderBundle::set_bind_group");
|
||||
bundle.base.commands.push(RenderCommand::SetBindGroup {
|
||||
index: index.try_into().unwrap(),
|
||||
num_dynamic_offsets: offset_length.try_into().unwrap(),
|
||||
@ -1185,7 +1183,6 @@ pub mod bundle_ffi {
|
||||
bundle: &mut RenderBundleEncoder,
|
||||
pipeline_id: id::RenderPipelineId,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderBundle::set_pipeline");
|
||||
bundle
|
||||
.base
|
||||
.commands
|
||||
@ -1200,7 +1197,6 @@ pub mod bundle_ffi {
|
||||
offset: BufferAddress,
|
||||
size: Option<BufferSize>,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderBundle::set_vertex_buffer");
|
||||
bundle.base.commands.push(RenderCommand::SetVertexBuffer {
|
||||
slot,
|
||||
buffer_id,
|
||||
@ -1221,7 +1217,6 @@ pub mod bundle_ffi {
|
||||
size_bytes: u32,
|
||||
data: *const u8,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderBundle::set_push_constants");
|
||||
assert_eq!(
|
||||
offset & (wgt::PUSH_CONSTANT_ALIGNMENT - 1),
|
||||
0,
|
||||
@ -1259,7 +1254,6 @@ pub mod bundle_ffi {
|
||||
first_vertex: u32,
|
||||
first_instance: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderBundle::draw");
|
||||
bundle.base.commands.push(RenderCommand::Draw {
|
||||
vertex_count,
|
||||
instance_count,
|
||||
@ -1277,7 +1271,6 @@ pub mod bundle_ffi {
|
||||
base_vertex: i32,
|
||||
first_instance: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderBundle::draw_indexed");
|
||||
bundle.base.commands.push(RenderCommand::DrawIndexed {
|
||||
index_count,
|
||||
instance_count,
|
||||
@ -1293,7 +1286,6 @@ pub mod bundle_ffi {
|
||||
buffer_id: id::BufferId,
|
||||
offset: BufferAddress,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderBundle::draw_indirect");
|
||||
bundle.base.commands.push(RenderCommand::MultiDrawIndirect {
|
||||
buffer_id,
|
||||
offset,
|
||||
@ -1308,7 +1300,6 @@ pub mod bundle_ffi {
|
||||
buffer_id: id::BufferId,
|
||||
offset: BufferAddress,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderBundle::draw_indexed_indirect");
|
||||
bundle.base.commands.push(RenderCommand::MultiDrawIndirect {
|
||||
buffer_id,
|
||||
offset,
|
||||
@ -1326,13 +1317,11 @@ pub mod bundle_ffi {
|
||||
_bundle: &mut RenderBundleEncoder,
|
||||
_label: RawString,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderBundle::push_debug_group");
|
||||
//TODO
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wgpu_render_bundle_pop_debug_group(_bundle: &mut RenderBundleEncoder) {
|
||||
span!(_guard, DEBUG, "RenderBundle::pop_debug_group");
|
||||
//TODO
|
||||
}
|
||||
|
||||
@ -1345,7 +1334,6 @@ pub mod bundle_ffi {
|
||||
_bundle: &mut RenderBundleEncoder,
|
||||
_label: RawString,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderBundle::insert_debug_marker");
|
||||
//TODO
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ use crate::{
|
||||
id,
|
||||
memory_init_tracker::{MemoryInitKind, MemoryInitTrackerAction},
|
||||
resource::{Buffer, BufferUse, Texture},
|
||||
span,
|
||||
track::{TrackerSet, UsageConflict},
|
||||
validation::{check_buffer_usage, MissingBufferUsageError},
|
||||
Label,
|
||||
@ -221,7 +220,7 @@ impl State {
|
||||
self.trackers.merge_extend(&bind_group_guard[id].used)?;
|
||||
}
|
||||
|
||||
tracing::trace!("Encoding dispatch barriers");
|
||||
log::trace!("Encoding dispatch barriers");
|
||||
|
||||
CommandBuffer::insert_barriers(
|
||||
raw_cmd_buf,
|
||||
@ -253,7 +252,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
encoder_id: id::CommandEncoderId,
|
||||
base: BasePassRef<ComputeCommand>,
|
||||
) -> Result<(), ComputePassError> {
|
||||
span!(_guard, INFO, "CommandEncoder::run_compute_pass");
|
||||
profiling::scope!("CommandEncoder::run_compute_pass");
|
||||
let scope = PassErrorScope::Pass(encoder_id);
|
||||
|
||||
let hub = B::hub(self);
|
||||
@ -649,7 +648,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
|
||||
pub mod compute_ffi {
|
||||
use super::{ComputeCommand, ComputePass};
|
||||
use crate::{id, span, RawString};
|
||||
use crate::{id, RawString};
|
||||
use std::{convert::TryInto, ffi, slice};
|
||||
use wgt::{BufferAddress, DynamicOffset};
|
||||
|
||||
@ -665,7 +664,6 @@ pub mod compute_ffi {
|
||||
offsets: *const DynamicOffset,
|
||||
offset_length: usize,
|
||||
) {
|
||||
span!(_guard, DEBUG, "ComputePass::set_bind_group");
|
||||
pass.base.commands.push(ComputeCommand::SetBindGroup {
|
||||
index: index.try_into().unwrap(),
|
||||
num_dynamic_offsets: offset_length.try_into().unwrap(),
|
||||
@ -683,7 +681,6 @@ pub mod compute_ffi {
|
||||
pass: &mut ComputePass,
|
||||
pipeline_id: id::ComputePipelineId,
|
||||
) {
|
||||
span!(_guard, DEBUG, "ComputePass::set_pipeline");
|
||||
pass.base
|
||||
.commands
|
||||
.push(ComputeCommand::SetPipeline(pipeline_id));
|
||||
@ -700,7 +697,6 @@ pub mod compute_ffi {
|
||||
size_bytes: u32,
|
||||
data: *const u8,
|
||||
) {
|
||||
span!(_guard, DEBUG, "ComputePass::set_push_constant");
|
||||
assert_eq!(
|
||||
offset & (wgt::PUSH_CONSTANT_ALIGNMENT - 1),
|
||||
0,
|
||||
@ -736,7 +732,6 @@ pub mod compute_ffi {
|
||||
groups_y: u32,
|
||||
groups_z: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "ComputePass::dispatch");
|
||||
pass.base
|
||||
.commands
|
||||
.push(ComputeCommand::Dispatch([groups_x, groups_y, groups_z]));
|
||||
@ -748,7 +743,6 @@ pub mod compute_ffi {
|
||||
buffer_id: id::BufferId,
|
||||
offset: BufferAddress,
|
||||
) {
|
||||
span!(_guard, DEBUG, "ComputePass::dispatch_indirect");
|
||||
pass.base
|
||||
.commands
|
||||
.push(ComputeCommand::DispatchIndirect { buffer_id, offset });
|
||||
@ -764,7 +758,6 @@ pub mod compute_ffi {
|
||||
label: RawString,
|
||||
color: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "ComputePass::push_debug_group");
|
||||
let bytes = ffi::CStr::from_ptr(label).to_bytes();
|
||||
pass.base.string_data.extend_from_slice(bytes);
|
||||
|
||||
@ -776,7 +769,6 @@ pub mod compute_ffi {
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wgpu_compute_pass_pop_debug_group(pass: &mut ComputePass) {
|
||||
span!(_guard, DEBUG, "ComputePass::pop_debug_group");
|
||||
pass.base.commands.push(ComputeCommand::PopDebugGroup);
|
||||
}
|
||||
|
||||
@ -790,7 +782,6 @@ pub mod compute_ffi {
|
||||
label: RawString,
|
||||
color: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "ComputePass::insert_debug_marker");
|
||||
let bytes = ffi::CStr::from_ptr(label).to_bytes();
|
||||
pass.base.string_data.extend_from_slice(bytes);
|
||||
|
||||
@ -806,8 +797,6 @@ pub mod compute_ffi {
|
||||
query_set_id: id::QuerySetId,
|
||||
query_index: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "ComputePass::write_timestamp");
|
||||
|
||||
pass.base.commands.push(ComputeCommand::WriteTimestamp {
|
||||
query_set_id,
|
||||
query_index,
|
||||
@ -820,12 +809,6 @@ pub mod compute_ffi {
|
||||
query_set_id: id::QuerySetId,
|
||||
query_index: u32,
|
||||
) {
|
||||
span!(
|
||||
_guard,
|
||||
DEBUG,
|
||||
"ComputePass::begin_pipeline_statistics query"
|
||||
);
|
||||
|
||||
pass.base
|
||||
.commands
|
||||
.push(ComputeCommand::BeginPipelineStatisticsQuery {
|
||||
@ -836,8 +819,6 @@ pub mod compute_ffi {
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wgpu_compute_pass_end_pipeline_statistics_query(pass: &mut ComputePass) {
|
||||
span!(_guard, DEBUG, "ComputePass::end_pipeline_statistics_query");
|
||||
|
||||
pass.base
|
||||
.commands
|
||||
.push(ComputeCommand::EndPipelineStatisticsQuery);
|
||||
|
@ -26,7 +26,6 @@ use crate::{
|
||||
id,
|
||||
memory_init_tracker::MemoryInitTrackerAction,
|
||||
resource::{Buffer, Texture},
|
||||
span,
|
||||
track::TrackerSet,
|
||||
Label, PrivateFeatures, Stored,
|
||||
};
|
||||
@ -198,7 +197,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
encoder_id: id::CommandEncoderId,
|
||||
_desc: &wgt::CommandBufferDescriptor<Label>,
|
||||
) -> (id::CommandBufferId, Option<CommandEncoderError>) {
|
||||
span!(_guard, INFO, "CommandEncoder::finish");
|
||||
profiling::scope!("CommandEncoder::finish");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -217,7 +216,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
.expect("Used swap chain frame has already presented");
|
||||
cmd_buf.trackers.views.remove(view_id.value);
|
||||
}
|
||||
tracing::trace!("Command buffer {:?} {:#?}", encoder_id, cmd_buf.trackers);
|
||||
log::trace!("Command buffer {:?} {:#?}", encoder_id, cmd_buf.trackers);
|
||||
None
|
||||
}
|
||||
Err(e) => Some(e),
|
||||
@ -231,7 +230,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
encoder_id: id::CommandEncoderId,
|
||||
label: &str,
|
||||
) -> Result<(), CommandEncoderError> {
|
||||
span!(_guard, DEBUG, "CommandEncoder::push_debug_group");
|
||||
profiling::scope!("CommandEncoder::push_debug_group");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -251,7 +250,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
encoder_id: id::CommandEncoderId,
|
||||
label: &str,
|
||||
) -> Result<(), CommandEncoderError> {
|
||||
span!(_guard, DEBUG, "CommandEncoder::insert_debug_marker");
|
||||
profiling::scope!("CommandEncoder::insert_debug_marker");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -270,7 +269,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
&self,
|
||||
encoder_id: id::CommandEncoderId,
|
||||
) -> Result<(), CommandEncoderError> {
|
||||
span!(_guard, DEBUG, "CommandEncoder::pop_debug_marker");
|
||||
profiling::scope!("CommandEncoder::pop_debug_marker");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
|
@ -19,7 +19,6 @@ use crate::{
|
||||
memory_init_tracker::{MemoryInitKind, MemoryInitTrackerAction},
|
||||
pipeline::PipelineFlags,
|
||||
resource::{BufferUse, Texture, TextureUse, TextureView, TextureViewInner},
|
||||
span,
|
||||
track::{TextureSelector, TrackerSet, UsageConflict},
|
||||
validation::{
|
||||
check_buffer_usage, check_texture_usage, MissingBufferUsageError, MissingTextureUsageError,
|
||||
@ -187,7 +186,7 @@ impl RenderPass {
|
||||
offset: BufferAddress,
|
||||
size: Option<BufferSize>,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::set_index_buffer");
|
||||
profiling::scope!("RenderPass::set_index_buffer");
|
||||
self.base.commands.push(RenderCommand::SetIndexBuffer {
|
||||
buffer_id,
|
||||
index_format,
|
||||
@ -1018,7 +1017,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
color_attachments: &[ColorAttachmentDescriptor],
|
||||
depth_stencil_attachment: Option<&DepthStencilAttachmentDescriptor>,
|
||||
) -> Result<(), RenderPassError> {
|
||||
span!(_guard, INFO, "CommandEncoder::run_render_pass");
|
||||
profiling::scope!("CommandEncoder::run_render_pass");
|
||||
let scope = PassErrorScope::Pass(encoder_id);
|
||||
|
||||
let hub = B::hub(self);
|
||||
@ -1051,7 +1050,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let (texture_guard, mut token) = hub.textures.read(&mut token);
|
||||
let (view_guard, _) = hub.texture_views.read(&mut token);
|
||||
|
||||
tracing::trace!(
|
||||
log::trace!(
|
||||
"Encoding render pass begin in command buffer {:?}",
|
||||
encoder_id
|
||||
);
|
||||
@ -1923,7 +1922,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
}
|
||||
|
||||
tracing::trace!("Merging {:?} with the render pass", encoder_id);
|
||||
log::trace!("Merging {:?} with the render pass", encoder_id);
|
||||
unsafe {
|
||||
raw.end_render_pass();
|
||||
}
|
||||
@ -1982,7 +1981,7 @@ pub mod render_ffi {
|
||||
super::{Rect, RenderCommand},
|
||||
RenderPass,
|
||||
};
|
||||
use crate::{id, span, RawString};
|
||||
use crate::{id, RawString};
|
||||
use std::{convert::TryInto, ffi, num::NonZeroU32, slice};
|
||||
use wgt::{BufferAddress, BufferSize, Color, DynamicOffset};
|
||||
|
||||
@ -1998,7 +1997,6 @@ pub mod render_ffi {
|
||||
offsets: *const DynamicOffset,
|
||||
offset_length: usize,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::set_bind_group");
|
||||
pass.base.commands.push(RenderCommand::SetBindGroup {
|
||||
index: index.try_into().unwrap(),
|
||||
num_dynamic_offsets: offset_length.try_into().unwrap(),
|
||||
@ -2016,7 +2014,6 @@ pub mod render_ffi {
|
||||
pass: &mut RenderPass,
|
||||
pipeline_id: id::RenderPipelineId,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::set_pipeline");
|
||||
pass.base
|
||||
.commands
|
||||
.push(RenderCommand::SetPipeline(pipeline_id));
|
||||
@ -2030,7 +2027,6 @@ pub mod render_ffi {
|
||||
offset: BufferAddress,
|
||||
size: Option<BufferSize>,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::set_vertex_buffer");
|
||||
pass.base.commands.push(RenderCommand::SetVertexBuffer {
|
||||
slot,
|
||||
buffer_id,
|
||||
@ -2041,7 +2037,6 @@ pub mod render_ffi {
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wgpu_render_pass_set_blend_color(pass: &mut RenderPass, color: &Color) {
|
||||
span!(_guard, DEBUG, "RenderPass::set_blend_color");
|
||||
pass.base
|
||||
.commands
|
||||
.push(RenderCommand::SetBlendColor(*color));
|
||||
@ -2049,7 +2044,6 @@ pub mod render_ffi {
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wgpu_render_pass_set_stencil_reference(pass: &mut RenderPass, value: u32) {
|
||||
span!(_guard, DEBUG, "RenderPass::set_stencil_buffer");
|
||||
pass.base
|
||||
.commands
|
||||
.push(RenderCommand::SetStencilReference(value));
|
||||
@ -2065,7 +2059,6 @@ pub mod render_ffi {
|
||||
depth_min: f32,
|
||||
depth_max: f32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::set_viewport");
|
||||
pass.base.commands.push(RenderCommand::SetViewport {
|
||||
rect: Rect { x, y, w, h },
|
||||
depth_min,
|
||||
@ -2081,7 +2074,6 @@ pub mod render_ffi {
|
||||
w: u32,
|
||||
h: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::set_scissor_rect");
|
||||
pass.base
|
||||
.commands
|
||||
.push(RenderCommand::SetScissor(Rect { x, y, w, h }));
|
||||
@ -2099,7 +2091,6 @@ pub mod render_ffi {
|
||||
size_bytes: u32,
|
||||
data: *const u8,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::set_push_constants");
|
||||
assert_eq!(
|
||||
offset & (wgt::PUSH_CONSTANT_ALIGNMENT - 1),
|
||||
0,
|
||||
@ -2137,7 +2128,6 @@ pub mod render_ffi {
|
||||
first_vertex: u32,
|
||||
first_instance: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::draw");
|
||||
pass.base.commands.push(RenderCommand::Draw {
|
||||
vertex_count,
|
||||
instance_count,
|
||||
@ -2155,7 +2145,6 @@ pub mod render_ffi {
|
||||
base_vertex: i32,
|
||||
first_instance: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::draw_indexed");
|
||||
pass.base.commands.push(RenderCommand::DrawIndexed {
|
||||
index_count,
|
||||
instance_count,
|
||||
@ -2171,7 +2160,6 @@ pub mod render_ffi {
|
||||
buffer_id: id::BufferId,
|
||||
offset: BufferAddress,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::draw_indirect");
|
||||
pass.base.commands.push(RenderCommand::MultiDrawIndirect {
|
||||
buffer_id,
|
||||
offset,
|
||||
@ -2186,7 +2174,6 @@ pub mod render_ffi {
|
||||
buffer_id: id::BufferId,
|
||||
offset: BufferAddress,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::draw_indexed_indirect");
|
||||
pass.base.commands.push(RenderCommand::MultiDrawIndirect {
|
||||
buffer_id,
|
||||
offset,
|
||||
@ -2202,7 +2189,6 @@ pub mod render_ffi {
|
||||
offset: BufferAddress,
|
||||
count: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::multi_draw_indirect");
|
||||
pass.base.commands.push(RenderCommand::MultiDrawIndirect {
|
||||
buffer_id,
|
||||
offset,
|
||||
@ -2218,7 +2204,6 @@ pub mod render_ffi {
|
||||
offset: BufferAddress,
|
||||
count: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::multi_draw_indexed_indirect");
|
||||
pass.base.commands.push(RenderCommand::MultiDrawIndirect {
|
||||
buffer_id,
|
||||
offset,
|
||||
@ -2236,7 +2221,6 @@ pub mod render_ffi {
|
||||
count_buffer_offset: BufferAddress,
|
||||
max_count: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::multi_draw_indirect_count");
|
||||
pass.base
|
||||
.commands
|
||||
.push(RenderCommand::MultiDrawIndirectCount {
|
||||
@ -2258,11 +2242,6 @@ pub mod render_ffi {
|
||||
count_buffer_offset: BufferAddress,
|
||||
max_count: u32,
|
||||
) {
|
||||
span!(
|
||||
_guard,
|
||||
DEBUG,
|
||||
"RenderPass::multi_draw_indexed_indirect_count"
|
||||
);
|
||||
pass.base
|
||||
.commands
|
||||
.push(RenderCommand::MultiDrawIndirectCount {
|
||||
@ -2285,7 +2264,6 @@ pub mod render_ffi {
|
||||
label: RawString,
|
||||
color: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::push_debug_group");
|
||||
let bytes = ffi::CStr::from_ptr(label).to_bytes();
|
||||
pass.base.string_data.extend_from_slice(bytes);
|
||||
|
||||
@ -2297,7 +2275,6 @@ pub mod render_ffi {
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wgpu_render_pass_pop_debug_group(pass: &mut RenderPass) {
|
||||
span!(_guard, DEBUG, "RenderPass::pop_debug_group");
|
||||
pass.base.commands.push(RenderCommand::PopDebugGroup);
|
||||
}
|
||||
|
||||
@ -2311,7 +2288,6 @@ pub mod render_ffi {
|
||||
label: RawString,
|
||||
color: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::insert_debug_marker");
|
||||
let bytes = ffi::CStr::from_ptr(label).to_bytes();
|
||||
pass.base.string_data.extend_from_slice(bytes);
|
||||
|
||||
@ -2327,8 +2303,6 @@ pub mod render_ffi {
|
||||
query_set_id: id::QuerySetId,
|
||||
query_index: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::write_timestamp");
|
||||
|
||||
pass.base.commands.push(RenderCommand::WriteTimestamp {
|
||||
query_set_id,
|
||||
query_index,
|
||||
@ -2341,8 +2315,6 @@ pub mod render_ffi {
|
||||
query_set_id: id::QuerySetId,
|
||||
query_index: u32,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::begin_pipeline_statistics query");
|
||||
|
||||
pass.base
|
||||
.commands
|
||||
.push(RenderCommand::BeginPipelineStatisticsQuery {
|
||||
@ -2353,8 +2325,6 @@ pub mod render_ffi {
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn wgpu_render_pass_end_pipeline_statistics_query(pass: &mut RenderPass) {
|
||||
span!(_guard, DEBUG, "RenderPass::end_pipeline_statistics_query");
|
||||
|
||||
pass.base
|
||||
.commands
|
||||
.push(RenderCommand::EndPipelineStatisticsQuery);
|
||||
@ -2370,7 +2340,6 @@ pub mod render_ffi {
|
||||
render_bundle_ids: *const id::RenderBundleId,
|
||||
render_bundle_ids_length: usize,
|
||||
) {
|
||||
span!(_guard, DEBUG, "RenderPass::execute_bundles");
|
||||
for &bundle_id in slice::from_raw_parts(render_bundle_ids, render_bundle_ids_length) {
|
||||
pass.base
|
||||
.commands
|
||||
|
@ -12,7 +12,6 @@ use crate::{
|
||||
id::{BufferId, CommandEncoderId, TextureId},
|
||||
memory_init_tracker::{MemoryInitKind, MemoryInitTrackerAction},
|
||||
resource::{BufferUse, Texture, TextureErrorDimension, TextureUse},
|
||||
span,
|
||||
track::TextureSelector,
|
||||
};
|
||||
|
||||
@ -310,7 +309,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
destination_offset: BufferAddress,
|
||||
size: BufferAddress,
|
||||
) -> Result<(), CopyError> {
|
||||
span!(_guard, INFO, "CommandEncoder::copy_buffer_to_buffer");
|
||||
profiling::scope!("CommandEncoder::copy_buffer_to_buffer");
|
||||
|
||||
if source == destination {
|
||||
return Err(TransferError::SameSourceDestinationBuffer.into());
|
||||
@ -398,7 +397,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
if size == 0 {
|
||||
tracing::trace!("Ignoring copy_buffer_to_buffer of size 0");
|
||||
log::trace!("Ignoring copy_buffer_to_buffer of size 0");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@ -448,7 +447,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
destination: &TextureCopyView,
|
||||
copy_size: &Extent3d,
|
||||
) -> Result<(), CopyError> {
|
||||
span!(_guard, INFO, "CommandEncoder::copy_buffer_to_texture");
|
||||
profiling::scope!("CommandEncoder::copy_buffer_to_texture");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -469,7 +468,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
if copy_size.width == 0 || copy_size.height == 0 || copy_size.depth_or_array_layers == 0 {
|
||||
tracing::trace!("Ignoring copy_buffer_to_texture of size 0");
|
||||
log::trace!("Ignoring copy_buffer_to_texture of size 0");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@ -596,7 +595,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
destination: &BufferCopyView,
|
||||
copy_size: &Extent3d,
|
||||
) -> Result<(), CopyError> {
|
||||
span!(_guard, INFO, "CommandEncoder::copy_texture_to_buffer");
|
||||
profiling::scope!("CommandEncoder::copy_texture_to_buffer");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -617,7 +616,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
if copy_size.width == 0 || copy_size.height == 0 || copy_size.depth_or_array_layers == 0 {
|
||||
tracing::trace!("Ignoring copy_texture_to_buffer of size 0");
|
||||
log::trace!("Ignoring copy_texture_to_buffer of size 0");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@ -748,7 +747,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
destination: &TextureCopyView,
|
||||
copy_size: &Extent3d,
|
||||
) -> Result<(), CopyError> {
|
||||
span!(_guard, INFO, "CommandEncoder::copy_texture_to_texture");
|
||||
profiling::scope!("CommandEncoder::copy_texture_to_texture");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -775,7 +774,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
if copy_size.width == 0 || copy_size.height == 0 || copy_size.depth_or_array_layers == 0 {
|
||||
tracing::trace!("Ignoring copy_texture_to_texture of size 0");
|
||||
log::trace!("Ignoring copy_texture_to_texture of size 0");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ impl<B: hal::Backend> MemoryAllocator<B> {
|
||||
.collect::<Vec<_>>(),
|
||||
),
|
||||
max_memory_allocation_count: if limits.max_memory_allocation_count == 0 {
|
||||
tracing::warn!("max_memory_allocation_count is not set by gfx-rs backend");
|
||||
log::warn!("max_memory_allocation_count is not set by gfx-rs backend");
|
||||
!0
|
||||
} else {
|
||||
limits.max_memory_allocation_count.min(!0u32 as usize) as u32
|
||||
@ -205,13 +205,14 @@ impl<B: hal::Backend> MemoryBlock<B> {
|
||||
}
|
||||
|
||||
impl<B: hal::Backend> gpu_alloc::MemoryDevice<B::Memory> for MemoryDevice<'_, B> {
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(skip(self)))]
|
||||
unsafe fn allocate_memory(
|
||||
&self,
|
||||
size: u64,
|
||||
memory_type: u32,
|
||||
flags: gpu_alloc::AllocationFlags,
|
||||
) -> Result<B::Memory, gpu_alloc::OutOfMemory> {
|
||||
profiling::scope!("Allocate Memory");
|
||||
|
||||
assert!(flags.is_empty());
|
||||
|
||||
self.0
|
||||
@ -219,18 +220,18 @@ impl<B: hal::Backend> gpu_alloc::MemoryDevice<B::Memory> for MemoryDevice<'_, B>
|
||||
.map_err(|_| gpu_alloc::OutOfMemory::OutOfDeviceMemory)
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(skip(self)))]
|
||||
unsafe fn deallocate_memory(&self, memory: B::Memory) {
|
||||
profiling::scope!("Deallocate Memory");
|
||||
self.0.free_memory(memory);
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(skip(self)))]
|
||||
unsafe fn map_memory(
|
||||
&self,
|
||||
memory: &mut B::Memory,
|
||||
offset: u64,
|
||||
size: u64,
|
||||
) -> Result<NonNull<u8>, gpu_alloc::DeviceMapError> {
|
||||
profiling::scope!("Map memory");
|
||||
match self.0.map_memory(
|
||||
memory,
|
||||
hal::memory::Segment {
|
||||
@ -247,16 +248,16 @@ impl<B: hal::Backend> gpu_alloc::MemoryDevice<B::Memory> for MemoryDevice<'_, B>
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(skip(self)))]
|
||||
unsafe fn unmap_memory(&self, memory: &mut B::Memory) {
|
||||
profiling::scope!("Unmap memory");
|
||||
self.0.unmap_memory(memory);
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(skip(self)))]
|
||||
unsafe fn invalidate_memory_ranges(
|
||||
&self,
|
||||
ranges: &[gpu_alloc::MappedMemoryRange<'_, B::Memory>],
|
||||
) -> Result<(), gpu_alloc::OutOfMemory> {
|
||||
profiling::scope!("Invalidate memory ranges");
|
||||
self.0
|
||||
.invalidate_mapped_memory_ranges(ranges.iter().map(|r| {
|
||||
(
|
||||
@ -270,11 +271,11 @@ impl<B: hal::Backend> gpu_alloc::MemoryDevice<B::Memory> for MemoryDevice<'_, B>
|
||||
.map_err(|_| gpu_alloc::OutOfMemory::OutOfHostMemory)
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "tracing", tracing::instrument(skip(self)))]
|
||||
unsafe fn flush_memory_ranges(
|
||||
&self,
|
||||
ranges: &[gpu_alloc::MappedMemoryRange<'_, B::Memory>],
|
||||
) -> Result<(), gpu_alloc::OutOfMemory> {
|
||||
profiling::scope!("Flush memory ranges");
|
||||
self.0
|
||||
.flush_mapped_memory_ranges(ranges.iter().map(|r| {
|
||||
(
|
||||
|
@ -37,7 +37,7 @@ impl<B: hal::Backend> DescriptorAllocator<B> {
|
||||
)
|
||||
}
|
||||
.map_err(|err| {
|
||||
tracing::warn!("Descriptor set allocation failed: {}", err);
|
||||
log::warn!("Descriptor set allocation failed: {}", err);
|
||||
DeviceError::OutOfMemory
|
||||
})
|
||||
}
|
||||
|
@ -146,12 +146,12 @@ impl<B: hal::Backend> NonReferencedResources<B> {
|
||||
if !self.buffers.is_empty() || !self.images.is_empty() {
|
||||
let mut allocator = memory_allocator_mutex.lock();
|
||||
for (raw, memory) in self.buffers.drain(..) {
|
||||
tracing::trace!("Buffer {:?} is destroyed with memory {:?}", raw, memory);
|
||||
log::trace!("Buffer {:?} is destroyed with memory {:?}", raw, memory);
|
||||
device.destroy_buffer(raw);
|
||||
allocator.free(device, memory);
|
||||
}
|
||||
for (raw, memory) in self.images.drain(..) {
|
||||
tracing::trace!("Image {:?} is destroyed with memory {:?}", raw, memory);
|
||||
log::trace!("Image {:?} is destroyed with memory {:?}", raw, memory);
|
||||
device.destroy_image(raw);
|
||||
allocator.free(device, memory);
|
||||
}
|
||||
@ -290,7 +290,7 @@ impl<B: hal::Backend> LifetimeTracker<B> {
|
||||
|
||||
fn wait_idle(&self, device: &B::Device) -> Result<(), WaitIdleError> {
|
||||
if !self.active.is_empty() {
|
||||
tracing::debug!("Waiting for IDLE...");
|
||||
log::debug!("Waiting for IDLE...");
|
||||
let status = unsafe {
|
||||
device
|
||||
.wait_for_fences(
|
||||
@ -300,7 +300,7 @@ impl<B: hal::Backend> LifetimeTracker<B> {
|
||||
)
|
||||
.map_err(DeviceError::from)?
|
||||
};
|
||||
tracing::debug!("...Done");
|
||||
log::debug!("...Done");
|
||||
|
||||
if !status {
|
||||
// We timed out while waiting for the fences
|
||||
@ -332,7 +332,7 @@ impl<B: hal::Backend> LifetimeTracker<B> {
|
||||
};
|
||||
|
||||
for a in self.active.drain(..done_count) {
|
||||
tracing::trace!("Active submission {} is done", a.index);
|
||||
log::trace!("Active submission {} is done", a.index);
|
||||
self.free_resources.extend(a.last_resources);
|
||||
self.ready_to_map.extend(a.mapped);
|
||||
unsafe {
|
||||
@ -516,7 +516,7 @@ impl<B: GfxBackend> LifetimeTracker<B> {
|
||||
if let Some(t) = trace {
|
||||
t.lock().add(trace::Action::DestroyBuffer(id.0));
|
||||
}
|
||||
tracing::debug!("Buffer {:?} is detached", id);
|
||||
log::debug!("Buffer {:?} is detached", id);
|
||||
|
||||
if let Some(res) = hub.buffers.unregister_locked(id.0, &mut *guard) {
|
||||
let submit_index = res.life_guard.submission_index.load(Ordering::Acquire);
|
||||
@ -671,7 +671,7 @@ impl<B: GfxBackend> LifetimeTracker<B> {
|
||||
let buf = &buffer_guard[resource_id];
|
||||
|
||||
let submit_index = buf.life_guard.submission_index.load(Ordering::Acquire);
|
||||
tracing::trace!(
|
||||
log::trace!(
|
||||
"Mapping of {:?} at submission {:?} gets assigned to active {:?}",
|
||||
resource_id,
|
||||
submit_index,
|
||||
@ -705,7 +705,7 @@ impl<B: GfxBackend> LifetimeTracker<B> {
|
||||
if buffer.life_guard.ref_count.is_none() && trackers.buffers.remove_abandoned(buffer_id)
|
||||
{
|
||||
buffer.map_state = resource::BufferMapState::Idle;
|
||||
tracing::debug!("Mapping request is dropped because the buffer is destroyed.");
|
||||
log::debug!("Mapping request is dropped because the buffer is destroyed.");
|
||||
if let Some(buf) = hub
|
||||
.buffers
|
||||
.unregister_locked(buffer_id.0, &mut *buffer_guard)
|
||||
@ -729,7 +729,7 @@ impl<B: GfxBackend> LifetimeTracker<B> {
|
||||
_ => panic!("No pending mapping."),
|
||||
};
|
||||
let status = if mapping.range.start != mapping.range.end {
|
||||
tracing::debug!("Buffer {:?} map state -> Active", buffer_id);
|
||||
log::debug!("Buffer {:?} map state -> Active", buffer_id);
|
||||
let host = mapping.op.host;
|
||||
let size = mapping.range.end - mapping.range.start;
|
||||
match super::map_buffer(raw, buffer, mapping.range.start, size, host) {
|
||||
@ -745,7 +745,7 @@ impl<B: GfxBackend> LifetimeTracker<B> {
|
||||
resource::BufferMapAsyncStatus::Success
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::error!("Mapping failed {:?}", e);
|
||||
log::error!("Mapping failed {:?}", e);
|
||||
resource::BufferMapAsyncStatus::Error
|
||||
}
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ use crate::{
|
||||
},
|
||||
id, instance,
|
||||
memory_init_tracker::{MemoryInitKind, MemoryInitTracker, MemoryInitTrackerAction},
|
||||
pipeline, resource, span, swap_chain,
|
||||
pipeline, resource, swap_chain,
|
||||
track::{BufferState, TextureSelector, TextureState, TrackerSet},
|
||||
validation::{self, check_buffer_usage, check_texture_usage},
|
||||
FastHashMap, Label, LabelHelpers, LifeGuard, MultiRefCount, PrivateFeatures, Stored,
|
||||
@ -316,7 +316,7 @@ impl<B: GfxBackend> Device<B> {
|
||||
let descriptors = descriptor::DescriptorAllocator::new();
|
||||
#[cfg(not(feature = "trace"))]
|
||||
match trace_path {
|
||||
Some(_) => tracing::error!("Feature 'trace' is not enabled"),
|
||||
Some(_) => log::error!("Feature 'trace' is not enabled"),
|
||||
None => (),
|
||||
}
|
||||
|
||||
@ -367,7 +367,7 @@ impl<B: GfxBackend> Device<B> {
|
||||
Some(Mutex::new(trace))
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::error!("Unable to start a trace in '{:?}': {:?}", path, e);
|
||||
log::error!("Unable to start a trace in '{:?}': {:?}", path, e);
|
||||
None
|
||||
}
|
||||
}),
|
||||
@ -992,8 +992,8 @@ impl<B: GfxBackend> Device<B> {
|
||||
Err(err) => {
|
||||
// TODO: eventually, when Naga gets support for all features,
|
||||
// we want to convert these to a hard error,
|
||||
tracing::warn!("Failed to parse shader SPIR-V code: {:?}", err);
|
||||
tracing::warn!("Shader module will not be validated or reflected");
|
||||
log::warn!("Failed to parse shader SPIR-V code: {:?}", err);
|
||||
log::warn!("Shader module will not be validated or reflected");
|
||||
None
|
||||
}
|
||||
};
|
||||
@ -1005,7 +1005,7 @@ impl<B: GfxBackend> Device<B> {
|
||||
match naga::front::wgsl::parse_str(&code) {
|
||||
Ok(module) => (None, Some(module)),
|
||||
Err(err) => {
|
||||
tracing::error!("Failed to parse WGSL code: {}", err);
|
||||
log::error!("Failed to parse WGSL code: {}", err);
|
||||
return Err(pipeline::CreateShaderModuleError::Parsing);
|
||||
}
|
||||
}
|
||||
@ -1036,7 +1036,7 @@ impl<B: GfxBackend> Device<B> {
|
||||
match unsafe { self.raw.create_shader_module_from_naga(shader) } {
|
||||
Ok(raw) => Ok(raw),
|
||||
Err((hal::device::ShaderError::CompilationFailed(msg), shader)) => {
|
||||
tracing::warn!("Shader module compilation failed: {}", msg);
|
||||
log::warn!("Shader module compilation failed: {}", msg);
|
||||
Err(Some(shader))
|
||||
}
|
||||
Err((_, shader)) => Err(Some(shader)),
|
||||
@ -1083,7 +1083,7 @@ impl<B: GfxBackend> Device<B> {
|
||||
return Err(DeviceError::OutOfMemory.into());
|
||||
}
|
||||
Err(error) => {
|
||||
tracing::error!("Shader error: {}", error);
|
||||
log::error!("Shader error: {}", error);
|
||||
return Err(pipeline::CreateShaderModuleError::Parsing);
|
||||
}
|
||||
},
|
||||
@ -1812,7 +1812,7 @@ impl<B: GfxBackend> Device<B> {
|
||||
let mut ids = implicit_context.ok_or(pipeline::ImplicitLayoutError::MissingIds(0))?;
|
||||
let group_count = derived_group_layouts.len();
|
||||
if ids.group_ids.len() < group_count {
|
||||
tracing::error!(
|
||||
log::error!(
|
||||
"Not enough bind group IDs ({}) specified for the implicit layout ({})",
|
||||
ids.group_ids.len(),
|
||||
derived_group_layouts.len()
|
||||
@ -1941,7 +1941,7 @@ impl<B: GfxBackend> Device<B> {
|
||||
match err {
|
||||
hal::pso::CreationError::OutOfMemory(_) => DeviceError::OutOfMemory,
|
||||
_ => {
|
||||
tracing::error!("failed to create compute pipeline: {}", err);
|
||||
log::error!("failed to create compute pipeline: {}", err);
|
||||
DeviceError::OutOfMemory
|
||||
}
|
||||
}
|
||||
@ -2302,7 +2302,7 @@ impl<B: GfxBackend> Device<B> {
|
||||
match io.get(&(i as wgt::ShaderLocation)) {
|
||||
Some(output) if validation::check_texture_format(state.format, output) => {}
|
||||
Some(output) => {
|
||||
tracing::warn!(
|
||||
log::warn!(
|
||||
"Incompatible fragment output[{}] from shader: {:?}, expected {:?}",
|
||||
i,
|
||||
output,
|
||||
@ -2316,7 +2316,7 @@ impl<B: GfxBackend> Device<B> {
|
||||
}
|
||||
None if state.write_mask.is_empty() => {}
|
||||
None => {
|
||||
tracing::warn!("Missing fragment output[{}], expected {:?}", i, state,);
|
||||
log::warn!("Missing fragment output[{}], expected {:?}", i, state,);
|
||||
return Err(pipeline::CreateRenderPipelineError::MissingOutput {
|
||||
index: i as u8,
|
||||
});
|
||||
@ -2392,7 +2392,7 @@ impl<B: GfxBackend> Device<B> {
|
||||
match err {
|
||||
hal::pso::CreationError::OutOfMemory(_) => DeviceError::OutOfMemory,
|
||||
_ => {
|
||||
tracing::error!("failed to create graphics pipeline: {}", err);
|
||||
log::error!("failed to create graphics pipeline: {}", err);
|
||||
DeviceError::OutOfMemory
|
||||
}
|
||||
}
|
||||
@ -2449,7 +2449,7 @@ impl<B: GfxBackend> Device<B> {
|
||||
token: &mut Token<Self>,
|
||||
) -> Result<(), WaitIdleError> {
|
||||
if self.last_completed_submission_index() <= submission_index {
|
||||
tracing::info!("Waiting for submission {:?}", submission_index);
|
||||
log::info!("Waiting for submission {:?}", submission_index);
|
||||
self.lock_life(token)
|
||||
.triage_submissions(&self.raw, true)
|
||||
.map(|_| ())
|
||||
@ -2488,7 +2488,7 @@ impl<B: hal::Backend> Device<B> {
|
||||
pub(crate) fn prepare_to_die(&mut self) {
|
||||
let mut life_tracker = self.life_tracker.lock();
|
||||
if let Err(error) = life_tracker.triage_submissions(&self.raw, true) {
|
||||
tracing::error!("failed to triage submissions: {}", error);
|
||||
log::error!("failed to triage submissions: {}", error);
|
||||
}
|
||||
life_tracker.cleanup(&self.raw, &self.mem_allocator, &self.desc_allocator);
|
||||
}
|
||||
@ -2596,7 +2596,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
adapter_id: id::AdapterId,
|
||||
surface_id: id::SurfaceId,
|
||||
) -> Result<TextureFormat, instance::GetSwapChainPreferredFormatError> {
|
||||
span!(_guard, INFO, "Adapter::get_swap_chain_preferred_format");
|
||||
profiling::scope!("Adapter::get_swap_chain_preferred_format");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -2617,7 +2617,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
&self,
|
||||
device_id: id::DeviceId,
|
||||
) -> Result<wgt::Features, InvalidDevice> {
|
||||
span!(_guard, INFO, "Device::features");
|
||||
profiling::scope!("Device::features");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -2631,7 +2631,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
&self,
|
||||
device_id: id::DeviceId,
|
||||
) -> Result<wgt::Limits, InvalidDevice> {
|
||||
span!(_guard, INFO, "Device::limits");
|
||||
profiling::scope!("Device::limits");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -2647,7 +2647,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
desc: &resource::BufferDescriptor,
|
||||
id_in: Input<G, id::BufferId>,
|
||||
) -> (id::BufferId, Option<resource::CreateBufferError>) {
|
||||
span!(_guard, INFO, "Device::create_buffer");
|
||||
profiling::scope!("Device::create_buffer");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -2756,7 +2756,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
};
|
||||
|
||||
let id = fid.assign(buffer, &mut token);
|
||||
tracing::info!("Created buffer {:?} with {:?}", id, desc);
|
||||
log::info!("Created buffer {:?} with {:?}", id, desc);
|
||||
|
||||
device
|
||||
.trackers
|
||||
@ -2801,7 +2801,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
offset: BufferAddress,
|
||||
data: &[u8],
|
||||
) -> Result<(), resource::BufferAccessError> {
|
||||
span!(_guard, INFO, "Device::set_buffer_sub_data");
|
||||
profiling::scope!("Device::set_buffer_sub_data");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -2846,7 +2846,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
offset: BufferAddress,
|
||||
data: &mut [u8],
|
||||
) -> Result<(), resource::BufferAccessError> {
|
||||
span!(_guard, INFO, "Device::get_buffer_sub_data");
|
||||
profiling::scope!("Device::get_buffer_sub_data");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -2880,7 +2880,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
&self,
|
||||
buffer_id: id::BufferId,
|
||||
) -> Result<(), resource::DestroyError> {
|
||||
span!(_guard, INFO, "Buffer::destroy");
|
||||
profiling::scope!("Buffer::destroy");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -2888,7 +2888,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
//TODO: lock pending writes separately, keep the device read-only
|
||||
let (mut device_guard, mut token) = hub.devices.write(&mut token);
|
||||
|
||||
tracing::info!("Buffer {:?} is destroyed", buffer_id);
|
||||
log::info!("Buffer {:?} is destroyed", buffer_id);
|
||||
let (mut buffer_guard, _) = hub.buffers.write(&mut token);
|
||||
let buffer = buffer_guard
|
||||
.get_mut(buffer_id)
|
||||
@ -2923,12 +2923,12 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
pub fn buffer_drop<B: GfxBackend>(&self, buffer_id: id::BufferId, wait: bool) {
|
||||
span!(_guard, INFO, "Buffer::drop");
|
||||
profiling::scope!("Buffer::drop");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
|
||||
tracing::info!("Buffer {:?} is dropped", buffer_id);
|
||||
log::info!("Buffer {:?} is dropped", buffer_id);
|
||||
let (ref_count, last_submit_index, device_id) = {
|
||||
let (mut buffer_guard, _) = hub.buffers.write(&mut token);
|
||||
match buffer_guard.get_mut(buffer_id) {
|
||||
@ -2966,7 +2966,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
if wait {
|
||||
match device.wait_for_submit(last_submit_index, &mut token) {
|
||||
Ok(()) => (),
|
||||
Err(e) => tracing::error!("Failed to wait for buffer {:?}: {:?}", buffer_id, e),
|
||||
Err(e) => log::error!("Failed to wait for buffer {:?}: {:?}", buffer_id, e),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2977,7 +2977,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
desc: &resource::TextureDescriptor,
|
||||
id_in: Input<G, id::TextureId>,
|
||||
) -> (id::TextureId, Option<resource::CreateTextureError>) {
|
||||
span!(_guard, INFO, "Device::create_texture");
|
||||
profiling::scope!("Device::create_texture");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3007,7 +3007,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let ref_count = texture.life_guard.add_ref();
|
||||
|
||||
let id = fid.assign(texture, &mut token);
|
||||
tracing::info!("Created texture {:?} with {:?}", id, desc);
|
||||
log::info!("Created texture {:?} with {:?}", id, desc);
|
||||
|
||||
device
|
||||
.trackers
|
||||
@ -3030,7 +3030,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
&self,
|
||||
texture_id: id::TextureId,
|
||||
) -> Result<(), resource::DestroyError> {
|
||||
span!(_guard, INFO, "Texture::destroy");
|
||||
profiling::scope!("Texture::destroy");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3038,7 +3038,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
//TODO: lock pending writes separately, keep the device read-only
|
||||
let (mut device_guard, mut token) = hub.devices.write(&mut token);
|
||||
|
||||
tracing::info!("Buffer {:?} is destroyed", texture_id);
|
||||
log::info!("Buffer {:?} is destroyed", texture_id);
|
||||
let (mut texture_guard, _) = hub.textures.write(&mut token);
|
||||
let texture = texture_guard
|
||||
.get_mut(texture_id)
|
||||
@ -3073,7 +3073,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
pub fn texture_drop<B: GfxBackend>(&self, texture_id: id::TextureId, wait: bool) {
|
||||
span!(_guard, INFO, "Texture::drop");
|
||||
profiling::scope!("Texture::drop");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3116,7 +3116,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
if wait {
|
||||
match device.wait_for_submit(last_submit_index, &mut token) {
|
||||
Ok(()) => (),
|
||||
Err(e) => tracing::error!("Failed to wait for texture {:?}: {:?}", texture_id, e),
|
||||
Err(e) => log::error!("Failed to wait for texture {:?}: {:?}", texture_id, e),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3127,7 +3127,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
desc: &resource::TextureViewDescriptor,
|
||||
id_in: Input<G, id::TextureViewId>,
|
||||
) -> (id::TextureViewId, Option<resource::CreateTextureViewError>) {
|
||||
span!(_guard, INFO, "Texture::create_view");
|
||||
profiling::scope!("Texture::create_view");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3179,7 +3179,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
texture_view_id: id::TextureViewId,
|
||||
wait: bool,
|
||||
) -> Result<(), resource::TextureViewDestroyError> {
|
||||
span!(_guard, INFO, "TextureView::drop");
|
||||
profiling::scope!("TextureView::drop");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3222,7 +3222,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
if wait {
|
||||
match device.wait_for_submit(last_submit_index, &mut token) {
|
||||
Ok(()) => (),
|
||||
Err(e) => tracing::error!(
|
||||
Err(e) => log::error!(
|
||||
"Failed to wait for texture view {:?}: {:?}",
|
||||
texture_view_id,
|
||||
e
|
||||
@ -3238,7 +3238,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
desc: &resource::SamplerDescriptor,
|
||||
id_in: Input<G, id::SamplerId>,
|
||||
) -> (id::SamplerId, Option<resource::CreateSamplerError>) {
|
||||
span!(_guard, INFO, "Device::create_sampler");
|
||||
profiling::scope!("Device::create_sampler");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3282,7 +3282,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
pub fn sampler_drop<B: GfxBackend>(&self, sampler_id: id::SamplerId) {
|
||||
span!(_guard, INFO, "Sampler::drop");
|
||||
profiling::scope!("Sampler::drop");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3319,7 +3319,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
id::BindGroupLayoutId,
|
||||
Option<binding_model::CreateBindGroupLayoutError>,
|
||||
) {
|
||||
span!(_guard, INFO, "Device::create_bind_group_layout");
|
||||
profiling::scope!("Device::create_bind_group_layout");
|
||||
|
||||
let mut token = Token::root();
|
||||
let hub = B::hub(self);
|
||||
@ -3384,7 +3384,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
&self,
|
||||
bind_group_layout_id: id::BindGroupLayoutId,
|
||||
) {
|
||||
span!(_guard, INFO, "BindGroupLayout::drop");
|
||||
profiling::scope!("BindGroupLayout::drop");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3417,7 +3417,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
id::PipelineLayoutId,
|
||||
Option<binding_model::CreatePipelineLayoutError>,
|
||||
) {
|
||||
span!(_guard, INFO, "Device::create_pipeline_layout");
|
||||
profiling::scope!("Device::create_pipeline_layout");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3457,7 +3457,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
pub fn pipeline_layout_drop<B: GfxBackend>(&self, pipeline_layout_id: id::PipelineLayoutId) {
|
||||
span!(_guard, INFO, "PipelineLayout::drop");
|
||||
profiling::scope!("PipelineLayout::drop");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3493,7 +3493,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
desc: &binding_model::BindGroupDescriptor,
|
||||
id_in: Input<G, id::BindGroupId>,
|
||||
) -> (id::BindGroupId, Option<binding_model::CreateBindGroupError>) {
|
||||
span!(_guard, INFO, "Device::create_bind_group");
|
||||
profiling::scope!("Device::create_bind_group");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3531,7 +3531,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let ref_count = bind_group.life_guard.add_ref();
|
||||
|
||||
let id = fid.assign(bind_group, &mut token);
|
||||
tracing::debug!(
|
||||
log::debug!(
|
||||
"Bind group {:?} {:#?}",
|
||||
id,
|
||||
hub.bind_groups.read(&mut token).0[id].used
|
||||
@ -3555,7 +3555,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
pub fn bind_group_drop<B: GfxBackend>(&self, bind_group_id: id::BindGroupId) {
|
||||
span!(_guard, INFO, "BindGroup::drop");
|
||||
profiling::scope!("BindGroup::drop");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3593,7 +3593,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
id::ShaderModuleId,
|
||||
Option<pipeline::CreateShaderModuleError>,
|
||||
) {
|
||||
span!(_guard, INFO, "Device::create_shader_module");
|
||||
profiling::scope!("Device::create_shader_module");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3646,7 +3646,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
pub fn shader_module_drop<B: GfxBackend>(&self, shader_module_id: id::ShaderModuleId) {
|
||||
span!(_guard, INFO, "ShaderModule::drop");
|
||||
profiling::scope!("ShaderModule::drop");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3672,7 +3672,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
desc: &wgt::CommandEncoderDescriptor<Label>,
|
||||
id_in: Input<G, id::CommandEncoderId>,
|
||||
) -> (id::CommandEncoderId, Option<command::CommandAllocatorError>) {
|
||||
span!(_guard, INFO, "Device::create_command_encoder");
|
||||
profiling::scope!("Device::create_command_encoder");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3724,7 +3724,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
pub fn command_encoder_drop<B: GfxBackend>(&self, command_encoder_id: id::CommandEncoderId) {
|
||||
span!(_guard, INFO, "CommandEncoder::drop");
|
||||
profiling::scope!("CommandEncoder::drop");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3741,7 +3741,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
pub fn command_buffer_drop<B: GfxBackend>(&self, command_buffer_id: id::CommandBufferId) {
|
||||
span!(_guard, INFO, "CommandBuffer::drop");
|
||||
profiling::scope!("CommandBuffer::drop");
|
||||
self.command_encoder_drop::<B>(command_buffer_id)
|
||||
}
|
||||
|
||||
@ -3753,7 +3753,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
id::RenderBundleEncoderId,
|
||||
Option<command::CreateRenderBundleError>,
|
||||
) {
|
||||
span!(_guard, INFO, "Device::create_render_bundle_encoder");
|
||||
profiling::scope!("Device::create_render_bundle_encoder");
|
||||
let (encoder, error) = match command::RenderBundleEncoder::new(desc, device_id, None) {
|
||||
Ok(encoder) => (encoder, None),
|
||||
Err(e) => (command::RenderBundleEncoder::dummy(device_id), Some(e)),
|
||||
@ -3767,7 +3767,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
desc: &command::RenderBundleDescriptor,
|
||||
id_in: Input<G, id::RenderBundleId>,
|
||||
) -> (id::RenderBundleId, Option<command::RenderBundleError>) {
|
||||
span!(_guard, INFO, "RenderBundleEncoder::finish");
|
||||
profiling::scope!("RenderBundleEncoder::finish");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3796,7 +3796,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
Err(e) => break e,
|
||||
};
|
||||
|
||||
tracing::debug!("Render bundle {:#?}", render_bundle.used);
|
||||
log::debug!("Render bundle {:#?}", render_bundle.used);
|
||||
let ref_count = render_bundle.life_guard.add_ref();
|
||||
let id = fid.assign(render_bundle, &mut token);
|
||||
|
||||
@ -3818,7 +3818,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
pub fn render_bundle_drop<B: GfxBackend>(&self, render_bundle_id: id::RenderBundleId) {
|
||||
span!(_guard, INFO, "RenderBundle::drop");
|
||||
profiling::scope!("RenderBundle::drop");
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
|
||||
@ -3851,7 +3851,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
desc: &wgt::QuerySetDescriptor,
|
||||
id_in: Input<G, id::QuerySetId>,
|
||||
) -> (id::QuerySetId, Option<resource::CreateQuerySetError>) {
|
||||
span!(_guard, INFO, "Device::create_query_set");
|
||||
profiling::scope!("Device::create_query_set");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3935,7 +3935,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
pub fn query_set_drop<B: GfxBackend>(&self, query_set_id: id::QuerySetId) {
|
||||
span!(_guard, INFO, "QuerySet::drop");
|
||||
profiling::scope!("QuerySet::drop");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -3975,7 +3975,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
pipeline::ImplicitBindGroupCount,
|
||||
Option<pipeline::CreateRenderPipelineError>,
|
||||
) {
|
||||
span!(_guard, INFO, "Device::create_render_pipeline");
|
||||
profiling::scope!("Device::create_render_pipeline");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -4061,7 +4061,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
pub fn render_pipeline_drop<B: GfxBackend>(&self, render_pipeline_id: id::RenderPipelineId) {
|
||||
span!(_guard, INFO, "RenderPipeline::drop");
|
||||
profiling::scope!("RenderPipeline::drop");
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
let (device_guard, mut token) = hub.devices.read(&mut token);
|
||||
@ -4103,7 +4103,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
pipeline::ImplicitBindGroupCount,
|
||||
Option<pipeline::CreateComputePipelineError>,
|
||||
) {
|
||||
span!(_guard, INFO, "Device::create_compute_pipeline");
|
||||
profiling::scope!("Device::create_compute_pipeline");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -4189,7 +4189,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
pub fn compute_pipeline_drop<B: GfxBackend>(&self, compute_pipeline_id: id::ComputePipelineId) {
|
||||
span!(_guard, INFO, "ComputePipeline::drop");
|
||||
profiling::scope!("ComputePipeline::drop");
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
let (device_guard, mut token) = hub.devices.read(&mut token);
|
||||
@ -4226,7 +4226,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
surface_id: id::SurfaceId,
|
||||
desc: &wgt::SwapChainDescriptor,
|
||||
) -> Result<id::SwapChainId, swap_chain::CreateSwapChainError> {
|
||||
span!(_guard, INFO, "Device::create_swap_chain");
|
||||
profiling::scope!("Device::create_swap_chain");
|
||||
|
||||
fn validate_swap_chain_descriptor(
|
||||
config: &mut hal::window::SwapchainConfig,
|
||||
@ -4239,7 +4239,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
|| height < caps.extents.start().height
|
||||
|| height > caps.extents.end().height
|
||||
{
|
||||
tracing::warn!(
|
||||
log::warn!(
|
||||
"Requested size {}x{} is outside of the supported range: {:?}",
|
||||
width,
|
||||
height,
|
||||
@ -4247,7 +4247,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
);
|
||||
}
|
||||
if !caps.present_modes.contains(config.present_mode) {
|
||||
tracing::warn!(
|
||||
log::warn!(
|
||||
"Surface does not support present mode: {:?}, falling back to {:?}",
|
||||
config.present_mode,
|
||||
hal::window::PresentMode::FIFO
|
||||
@ -4260,7 +4260,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
tracing::info!("creating swap chain {:?}", desc);
|
||||
log::info!("creating swap chain {:?}", desc);
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
|
||||
@ -4374,7 +4374,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
device_id: id::DeviceId,
|
||||
force_wait: bool,
|
||||
) -> Result<(), WaitIdleError> {
|
||||
span!(_guard, INFO, "Device::poll");
|
||||
profiling::scope!("Device::poll");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -4394,7 +4394,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
force_wait: bool,
|
||||
callbacks: &mut Vec<BufferMapPendingCallback>,
|
||||
) -> Result<(), WaitIdleError> {
|
||||
span!(_guard, INFO, "Device::poll_devices");
|
||||
profiling::scope!("Device::poll_devices");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -4437,7 +4437,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
pub fn device_drop<B: GfxBackend>(&self, device_id: id::DeviceId) {
|
||||
span!(_guard, INFO, "Device::drop");
|
||||
profiling::scope!("Device::drop");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -4463,7 +4463,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
range: Range<BufferAddress>,
|
||||
op: resource::BufferMapOperation,
|
||||
) -> Result<(), resource::BufferAccessError> {
|
||||
span!(_guard, INFO, "Device::buffer_map_async");
|
||||
profiling::scope!("Device::buffer_map_async");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -4502,7 +4502,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
})
|
||||
}
|
||||
};
|
||||
tracing::debug!("Buffer {:?} map state -> Waiting", buffer_id);
|
||||
log::debug!("Buffer {:?} map state -> Waiting", buffer_id);
|
||||
|
||||
(buffer.device_id.value, buffer.life_guard.add_ref())
|
||||
};
|
||||
@ -4528,7 +4528,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
offset: BufferAddress,
|
||||
size: Option<BufferSize>,
|
||||
) -> Result<(*mut u8, u64), resource::BufferAccessError> {
|
||||
span!(_guard, INFO, "Device::buffer_get_mapped_range");
|
||||
profiling::scope!("Device::buffer_get_mapped_range");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -4594,7 +4594,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
&self,
|
||||
buffer_id: id::BufferId,
|
||||
) -> Result<Option<BufferMapPendingCallback>, resource::BufferAccessError> {
|
||||
span!(_guard, INFO, "Device::buffer_unmap");
|
||||
profiling::scope!("Device::buffer_unmap");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -4606,7 +4606,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
.map_err(|_| resource::BufferAccessError::Invalid)?;
|
||||
let device = &mut device_guard[buffer.device_id.value];
|
||||
|
||||
tracing::debug!("Buffer {:?} map state -> Idle", buffer_id);
|
||||
log::debug!("Buffer {:?} map state -> Idle", buffer_id);
|
||||
match mem::replace(&mut buffer.map_state, resource::BufferMapState::Idle) {
|
||||
resource::BufferMapState::Init {
|
||||
ptr,
|
||||
|
@ -15,7 +15,7 @@ use crate::{
|
||||
id,
|
||||
memory_init_tracker::MemoryInitKind,
|
||||
resource::{BufferAccessError, BufferMapState, BufferUse, TextureUse},
|
||||
span, FastHashMap, FastHashSet,
|
||||
FastHashMap, FastHashSet,
|
||||
};
|
||||
|
||||
use hal::{command::CommandBuffer as _, device::Device as _, queue::Queue as _};
|
||||
@ -192,7 +192,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
buffer_offset: wgt::BufferAddress,
|
||||
data: &[u8],
|
||||
) -> Result<(), QueueWriteError> {
|
||||
span!(_guard, INFO, "Queue::write_buffer");
|
||||
profiling::scope!("Queue::write_buffer");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -216,7 +216,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
|
||||
let data_size = data.len() as wgt::BufferAddress;
|
||||
if data_size == 0 {
|
||||
tracing::trace!("Ignoring write_buffer of size 0");
|
||||
log::trace!("Ignoring write_buffer of size 0");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@ -299,7 +299,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
data_layout: &wgt::TextureDataLayout,
|
||||
size: &wgt::Extent3d,
|
||||
) -> Result<(), QueueWriteError> {
|
||||
span!(_guard, INFO, "Queue::write_texture");
|
||||
profiling::scope!("Queue::write_texture");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -324,7 +324,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
if size.width == 0 || size.height == 0 || size.depth_or_array_layers == 0 {
|
||||
tracing::trace!("Ignoring write_texture of size 0");
|
||||
log::trace!("Ignoring write_texture of size 0");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@ -609,7 +609,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
queue_id: id::QueueId,
|
||||
command_buffer_ids: &[id::CommandBufferId],
|
||||
) -> Result<(), QueueSubmitError> {
|
||||
span!(_guard, INFO, "Queue::submit");
|
||||
profiling::scope!("Queue::submit");
|
||||
|
||||
self.initialize_used_uninitialized_memory::<B>(queue_id, command_buffer_ids)?;
|
||||
|
||||
@ -686,7 +686,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
if !buffer.life_guard.use_at(submit_index) {
|
||||
if let BufferMapState::Active { .. } = buffer.map_state {
|
||||
tracing::warn!("Dropped buffer has a pending mapping.");
|
||||
log::warn!("Dropped buffer has a pending mapping.");
|
||||
super::unmap_buffer(&device.raw, buffer)?;
|
||||
}
|
||||
device.temp_suspected.buffers.push(id);
|
||||
@ -745,7 +745,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
transit
|
||||
.begin_primary(hal::command::CommandBufferFlags::ONE_TIME_SUBMIT);
|
||||
}
|
||||
tracing::trace!("Stitching command buffer {:?} before submission", cmb_id);
|
||||
log::trace!("Stitching command buffer {:?} before submission", cmb_id);
|
||||
CommandBuffer::insert_barriers(
|
||||
&mut transit,
|
||||
&mut *trackers,
|
||||
@ -759,7 +759,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
cmdbuf.raw.insert(0, transit);
|
||||
}
|
||||
|
||||
tracing::trace!("Device after submission {}: {:#?}", submit_index, trackers);
|
||||
log::trace!("Device after submission {}: {:#?}", submit_index, trackers);
|
||||
}
|
||||
|
||||
// now prepare the GPU submission
|
||||
@ -828,7 +828,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
&self,
|
||||
queue_id: id::QueueId,
|
||||
) -> Result<f32, InvalidQueue> {
|
||||
span!(_guard, INFO, "Queue::get_timestamp_period");
|
||||
profiling::scope!("Queue::get_timestamp_period");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
|
@ -175,7 +175,7 @@ pub struct Trace {
|
||||
#[cfg(feature = "trace")]
|
||||
impl Trace {
|
||||
pub fn new(path: &std::path::Path) -> Result<Self, std::io::Error> {
|
||||
tracing::info!("Tracing into '{:?}'", path);
|
||||
log::info!("Tracing into '{:?}'", path);
|
||||
let mut file = std::fs::File::create(path.join(FILE_NAME))?;
|
||||
file.write_all(b"[\n")?;
|
||||
Ok(Self {
|
||||
@ -199,7 +199,7 @@ impl Trace {
|
||||
let _ = writeln!(self.file, "{},", string);
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::warn!("RON serialization failure: {:?}", e);
|
||||
log::warn!("RON serialization failure: {:?}", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ use crate::{
|
||||
instance::{Adapter, Instance, Surface},
|
||||
pipeline::{ComputePipeline, RenderPipeline, ShaderModule},
|
||||
resource::{Buffer, Sampler, Texture, TextureView},
|
||||
span,
|
||||
swap_chain::SwapChain,
|
||||
Epoch, Index,
|
||||
};
|
||||
@ -761,7 +760,7 @@ pub struct Global<G: GlobalIdentityHandlerFactory> {
|
||||
|
||||
impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
pub fn new(name: &str, factory: G, backends: wgt::BackendBit) -> Self {
|
||||
span!(_guard, INFO, "Global::new");
|
||||
profiling::scope!("Global::new");
|
||||
Self {
|
||||
instance: Instance::new(name, 1, backends),
|
||||
surfaces: Registry::without_backend(&factory, "Surface"),
|
||||
@ -780,7 +779,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
impl<G: GlobalIdentityHandlerFactory> Drop for Global<G> {
|
||||
fn drop(&mut self) {
|
||||
if !thread::panicking() {
|
||||
tracing::info!("Dropping Global");
|
||||
log::info!("Dropping Global");
|
||||
let mut surface_guard = self.surfaces.data.write();
|
||||
|
||||
// destroy hubs
|
||||
|
@ -7,7 +7,7 @@ use crate::{
|
||||
device::{Device, DeviceDescriptor},
|
||||
hub::{GfxBackend, Global, GlobalIdentityHandlerFactory, Input, Token},
|
||||
id::{AdapterId, DeviceId, SurfaceId, Valid},
|
||||
span, LabelHelpers, LifeGuard, PrivateFeatures, Stored, MAX_BIND_GROUPS,
|
||||
LabelHelpers, LifeGuard, PrivateFeatures, Stored, MAX_BIND_GROUPS,
|
||||
};
|
||||
|
||||
use wgt::{Backend, BackendBit, PowerPreference, BIND_BUFFER_ALIGNMENT};
|
||||
@ -127,7 +127,7 @@ pub struct Adapter<B: hal::Backend> {
|
||||
|
||||
impl<B: GfxBackend> Adapter<B> {
|
||||
fn new(raw: hal::adapter::Adapter<B>) -> Self {
|
||||
span!(_guard, INFO, "Adapter::new");
|
||||
profiling::scope!("Adapter::new");
|
||||
|
||||
let adapter_features = raw.physical_device.features();
|
||||
let properties = raw.physical_device.properties();
|
||||
@ -287,7 +287,7 @@ impl<B: GfxBackend> Adapter<B> {
|
||||
&self,
|
||||
surface: &mut Surface,
|
||||
) -> Result<wgt::TextureFormat, GetSwapChainPreferredFormatError> {
|
||||
span!(_guard, INFO, "Adapter::get_swap_chain_preferred_format");
|
||||
profiling::scope!("Adapter::get_swap_chain_preferred_format");
|
||||
|
||||
let formats = {
|
||||
let surface = B::get_surface_mut(surface);
|
||||
@ -385,7 +385,7 @@ impl<B: GfxBackend> Adapter<B> {
|
||||
.contains(wgt::Features::MAPPABLE_PRIMARY_BUFFERS)
|
||||
&& self.raw.info.device_type == hal::adapter::DeviceType::DiscreteGpu
|
||||
{
|
||||
tracing::warn!("Feature MAPPABLE_PRIMARY_BUFFERS enabled on a discrete gpu. This is a massive performance footgun and likely not what you wanted");
|
||||
log::warn!("Feature MAPPABLE_PRIMARY_BUFFERS enabled on a discrete gpu. This is a massive performance footgun and likely not what you wanted");
|
||||
}
|
||||
|
||||
let phd = &self.raw.physical_device;
|
||||
@ -401,7 +401,7 @@ impl<B: GfxBackend> Adapter<B> {
|
||||
| hal::Features::IMAGE_CUBE_ARRAY;
|
||||
let mut enabled_features = available_features & wishful_features;
|
||||
if enabled_features != wishful_features {
|
||||
tracing::warn!(
|
||||
log::warn!(
|
||||
"Missing internal features: {:?}",
|
||||
wishful_features - enabled_features
|
||||
);
|
||||
@ -608,7 +608,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
handle: &impl raw_window_handle::HasRawWindowHandle,
|
||||
id_in: Input<G, SurfaceId>,
|
||||
) -> SurfaceId {
|
||||
span!(_guard, INFO, "Instance::create_surface");
|
||||
profiling::scope!("Instance::create_surface");
|
||||
|
||||
let surface = unsafe {
|
||||
backends_map! {
|
||||
@ -616,7 +616,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
inst
|
||||
.as_ref()
|
||||
.and_then(|inst| inst.create_surface(handle).map_err(|e| {
|
||||
tracing::warn!("Error: {:?}", e);
|
||||
log::warn!("Error: {:?}", e);
|
||||
}).ok())
|
||||
};
|
||||
|
||||
@ -646,7 +646,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
layer: *mut std::ffi::c_void,
|
||||
id_in: Input<G, SurfaceId>,
|
||||
) -> SurfaceId {
|
||||
span!(_guard, INFO, "Instance::instance_create_surface_metal");
|
||||
profiling::scope!("Instance::instance_create_surface_metal");
|
||||
|
||||
let surface = Surface {
|
||||
#[cfg(feature = "gfx-backend-vulkan")]
|
||||
@ -664,14 +664,14 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
pub fn surface_drop(&self, id: SurfaceId) {
|
||||
span!(_guard, INFO, "Surface::drop");
|
||||
profiling::scope!("Surface::drop");
|
||||
let mut token = Token::root();
|
||||
let (surface, _) = self.surfaces.unregister(id, &mut token);
|
||||
self.instance.destroy_surface(surface.unwrap());
|
||||
}
|
||||
|
||||
pub fn enumerate_adapters(&self, inputs: AdapterInputs<Input<G, AdapterId>>) -> Vec<AdapterId> {
|
||||
span!(_guard, INFO, "Instance::enumerate_adapters");
|
||||
profiling::scope!("Instance::enumerate_adapters");
|
||||
|
||||
let instance = &self.instance;
|
||||
let mut token = Token::root();
|
||||
@ -684,7 +684,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
if let Some(id_backend) = inputs.find(backend) {
|
||||
for raw in inst.enumerate_adapters() {
|
||||
let adapter = Adapter::new(raw);
|
||||
tracing::info!("Adapter {} {:?}", backend_info, adapter.raw.info);
|
||||
log::info!("Adapter {} {:?}", backend_info, adapter.raw.info);
|
||||
let id = hub.adapters
|
||||
.prepare(id_backend.clone())
|
||||
.assign(adapter, &mut token);
|
||||
@ -714,7 +714,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
desc: &RequestAdapterOptions,
|
||||
inputs: AdapterInputs<Input<G, AdapterId>>,
|
||||
) -> Result<AdapterId, RequestAdapterError> {
|
||||
span!(_guard, INFO, "Instance::pick_adapter");
|
||||
profiling::scope!("Instance::pick_adapter");
|
||||
|
||||
let instance = &self.instance;
|
||||
let mut token = Token::root();
|
||||
@ -832,7 +832,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let map = |(info_adapter, id_backend, mut adapters_backend, backend_hub)| {
|
||||
if selected < adapters_backend.len() {
|
||||
let adapter = Adapter::new(adapters_backend.swap_remove(selected));
|
||||
tracing::info!("Adapter {} {:?}", info_adapter, adapter.raw.info);
|
||||
log::info!("Adapter {} {:?}", info_adapter, adapter.raw.info);
|
||||
let id = backend_hub(self).adapters
|
||||
.prepare(id_backend.take().unwrap())
|
||||
.assign(adapter, &mut token);
|
||||
@ -861,7 +861,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
id_dx11.take(),
|
||||
id_gl.take(),
|
||||
);
|
||||
tracing::warn!("Some adapters are present, but enumerating them failed!");
|
||||
log::warn!("Some adapters are present, but enumerating them failed!");
|
||||
Err(RequestAdapterError::NotFound)
|
||||
}
|
||||
|
||||
@ -869,7 +869,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
&self,
|
||||
adapter_id: AdapterId,
|
||||
) -> Result<wgt::AdapterInfo, InvalidAdapter> {
|
||||
span!(_guard, INFO, "Adapter::get_info");
|
||||
profiling::scope!("Adapter::get_info");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -885,7 +885,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
adapter_id: AdapterId,
|
||||
format: wgt::TextureFormat,
|
||||
) -> Result<wgt::TextureFormatFeatures, InvalidAdapter> {
|
||||
span!(_guard, INFO, "Adapter::get_texture_format_features");
|
||||
profiling::scope!("Adapter::get_texture_format_features");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -900,7 +900,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
&self,
|
||||
adapter_id: AdapterId,
|
||||
) -> Result<wgt::Features, InvalidAdapter> {
|
||||
span!(_guard, INFO, "Adapter::features");
|
||||
profiling::scope!("Adapter::features");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -915,7 +915,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
&self,
|
||||
adapter_id: AdapterId,
|
||||
) -> Result<wgt::Limits, InvalidAdapter> {
|
||||
span!(_guard, INFO, "Adapter::limits");
|
||||
profiling::scope!("Adapter::limits");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -927,7 +927,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
pub fn adapter_drop<B: GfxBackend>(&self, adapter_id: AdapterId) {
|
||||
span!(_guard, INFO, "Adapter::drop");
|
||||
profiling::scope!("Adapter::drop");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -952,7 +952,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
trace_path: Option<&std::path::Path>,
|
||||
id_in: Input<G, DeviceId>,
|
||||
) -> (DeviceId, Option<RequestDeviceError>) {
|
||||
span!(_guard, INFO, "Adapter::request_device");
|
||||
profiling::scope!("Adapter::request_device");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
|
@ -258,18 +258,6 @@ macro_rules! gfx_select {
|
||||
};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! span {
|
||||
($guard_name:tt, $level:ident, $name:expr, $($fields:tt)*) => {
|
||||
let span = tracing::span!(tracing::Level::$level, $name, $($fields)*);
|
||||
let $guard_name = span.enter();
|
||||
};
|
||||
($guard_name:tt, $level:ident, $name:expr) => {
|
||||
let span = tracing::span!(tracing::Level::$level, $name);
|
||||
let $guard_name = span.enter();
|
||||
};
|
||||
}
|
||||
|
||||
/// Fast hash map used internally.
|
||||
type FastHashMap<K, V> =
|
||||
std::collections::HashMap<K, V, std::hash::BuildHasherDefault<fxhash::FxHasher>>;
|
||||
|
@ -121,7 +121,7 @@ unsafe impl Sync for BufferMapOperation {}
|
||||
|
||||
impl BufferMapOperation {
|
||||
pub(crate) fn call_error(self) {
|
||||
tracing::error!("wgpu_buffer_map_async failed: buffer mapping is pending");
|
||||
log::error!("wgpu_buffer_map_async failed: buffer mapping is pending");
|
||||
unsafe {
|
||||
(self.callback)(BufferMapAsyncStatus::Error, self.user_data);
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ use crate::{
|
||||
device::DeviceError,
|
||||
hub::{GfxBackend, Global, GlobalIdentityHandlerFactory, Input, Token},
|
||||
id::{DeviceId, SwapChainId, TextureViewId, Valid},
|
||||
resource, span,
|
||||
resource,
|
||||
track::TextureSelector,
|
||||
LifeGuard, PrivateFeatures, Stored, SubmissionIndex,
|
||||
};
|
||||
@ -139,7 +139,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
swap_chain_id: SwapChainId,
|
||||
view_id_in: Input<G, TextureViewId>,
|
||||
) -> Result<SwapChainOutput, SwapChainError> {
|
||||
span!(_guard, INFO, "SwapChain::get_next_texture");
|
||||
profiling::scope!("SwapChain::get_next_texture");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -242,7 +242,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
&self,
|
||||
swap_chain_id: SwapChainId,
|
||||
) -> Result<SwapChainStatus, SwapChainError> {
|
||||
span!(_guard, INFO, "SwapChain::present");
|
||||
profiling::scope!("SwapChain::present");
|
||||
|
||||
let hub = B::hub(self);
|
||||
let mut token = Token::root();
|
||||
@ -287,7 +287,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
let queue = &mut device.queue_group.queues[0];
|
||||
let result = unsafe { queue.present(B::get_surface_mut(surface), image, sem) };
|
||||
|
||||
tracing::debug!(trace = true, "Presented. End of Frame");
|
||||
log::debug!("Presented. End of Frame");
|
||||
|
||||
match result {
|
||||
Ok(None) => Ok(SwapChainStatus::Good),
|
||||
|
@ -130,7 +130,7 @@ impl PendingTransition<BufferState> {
|
||||
self,
|
||||
buf: &'a resource::Buffer<B>,
|
||||
) -> hal::memory::Barrier<'a, B> {
|
||||
tracing::trace!("\tbuffer -> {:?}", self);
|
||||
log::trace!("\tbuffer -> {:?}", self);
|
||||
let &(ref target, _) = buf.raw.as_ref().expect("Buffer is destroyed");
|
||||
hal::memory::Barrier::Buffer {
|
||||
states: conv::map_buffer_state(self.usage.start)
|
||||
@ -148,7 +148,7 @@ impl PendingTransition<TextureState> {
|
||||
self,
|
||||
tex: &'a resource::Texture<B>,
|
||||
) -> hal::memory::Barrier<'a, B> {
|
||||
tracing::trace!("\ttexture -> {:?}", self);
|
||||
log::trace!("\ttexture -> {:?}", self);
|
||||
let &(ref target, _) = tex.raw.as_ref().expect("Texture is destroyed");
|
||||
let aspects = tex.aspects;
|
||||
hal::memory::Barrier::Image {
|
||||
|
@ -661,7 +661,7 @@ impl Interface {
|
||||
return;
|
||||
}
|
||||
ref other => {
|
||||
tracing::error!("Unexpected varying type: {:?}", other);
|
||||
log::error!("Unexpected varying type: {:?}", other);
|
||||
return;
|
||||
}
|
||||
};
|
||||
@ -673,7 +673,7 @@ impl Interface {
|
||||
},
|
||||
Some(&naga::Binding::BuiltIn(built_in)) => Varying::BuiltIn(built_in),
|
||||
None => {
|
||||
tracing::error!("Missing binding for a varying");
|
||||
log::error!("Missing binding for a varying");
|
||||
return;
|
||||
}
|
||||
};
|
||||
@ -711,7 +711,7 @@ impl Interface {
|
||||
},
|
||||
naga::TypeInner::Sampler { comparison } => ResourceType::Sampler { comparison },
|
||||
ref other => {
|
||||
tracing::error!("Unexpected resource type: {:?}", other);
|
||||
log::error!("Unexpected resource type: {:?}", other);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user