Browse Source

GPU diagnostics: describe a buffer UAV by its range, not as uav None

describe looked only for a host texture, so every UAV over a buffer printed 'uav None' in device-removed reports and drop traces, though the view is made. It now prints the buffer's title range, as a buffer shader view does.
Carlos Sant'Anna 3 ngày trước cách đây
mục cha
commit
d74558c4fc
1 tập tin đã thay đổi với 5 bổ sung và 1 xóa
  1. 5 1
      crates/victory-gpu/src/draw.rs

+ 5 - 1
crates/victory-gpu/src/draw.rs

@@ -1131,7 +1131,11 @@ fn describe(view: Option<&View>) -> String {
         None => "no view".into(),
         Some(v @ View::Shader(r, _)) => texture(*r as This)
             .unwrap_or_else(|| format!("buffer {:?}", crate::descriptor::host::buffer_range(v))),
-        Some(View::Unordered(r, ..)) => format!("uav {:?}", texture(*r as This)),
+        // A buffer has no host texture: its title range, as for a shader view.
+        Some(v @ View::Unordered(r, ..)) => texture(*r as This).map_or_else(
+            || format!("uav buffer {:?}", crate::descriptor::host::buffer_range(v)),
+            |t| format!("uav {t}"),
+        ),
         Some(View::Placed(u, r, d)) => format!(
             "placed uav={u} dim {} {}x{} f{} layout {:#x} at {:#x}",
             r[0],