mirror of
https://github.com/EmbarkStudios/rust-gpu.git
synced 2024-11-21 22:34:34 +00:00
Fix off-by-one in column numbers in panic debugPrintf
traces.
This commit is contained in:
parent
88457ae249
commit
779951bc8d
@ -342,6 +342,15 @@ pub fn convert_custom_aborts_to_unstructured_returns_in_entry_points(
|
|||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
let fmt_dbg_src_loc = |(file, line, col)| {
|
let fmt_dbg_src_loc = |(file, line, col)| {
|
||||||
|
// FIXME(eddyb) figure out what is going on with
|
||||||
|
// these column number conventions, below is a
|
||||||
|
// related comment from `spirt::print`:
|
||||||
|
// > // HACK(eddyb) Rust-GPU's column numbers seem
|
||||||
|
// > // off-by-one wrt what e.g. VSCode expects
|
||||||
|
// > // for `:line:col` syntax, but it's hard to
|
||||||
|
// > // tell from the spec and `glslang` doesn't
|
||||||
|
// > // even emit column numbers at all!
|
||||||
|
let col = col + 1;
|
||||||
format!("{file}:{line}:{col}").replace('%', "%%")
|
format!("{file}:{line}:{col}").replace('%', "%%")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user