Browse Source

Merge pull request #654 from SantannaCarlos/fix/uav-describe

GPU diagnostics: describe a buffer UAV by its range, not as uav None
Marvis 2 days ago
parent
commit
b4b4110371
1 changed files with 5 additions and 1 deletions
  1. 5 1
      crates/victory-gpu/src/draw.rs

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

@@ -1156,7 +1156,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],