Commit 000ec78
authored
Replace
Partially modeled on a subset of the
[`NonSemantic.Shader.DebugInfo.100`](https://htmlpreview.github.io/?https://github.com/KhronosGroup/SPIRV-Registry/blob/main/nonsemantic/NonSemantic.Shader.DebugInfo.100.html)
SPIR-V extended instruction set, but more with Rust-GPU's needs in mind,
this extends the existing `file:line:col` debuginfo to support both:
- ranges (within a single file - comparable to rustc's internal `Span`)
- "inlined at" debuginfo (call site debug location + callee name)
- more expressive than `NonSemantic.Shader.DebugInfo.100` in one key
way: for some reason, that extension only seems to allow distinguishing
call sites *by line number* which seems borderline incorrect (wrt DWARF)
There is nothing in the `spirt` library itself that can create such
extended debuginfo (even though in theory e.g.
`NonSemantic.Shader.DebugInfo.100` support could do that), and instead
Rust-GPU is expected to produce it by converting its own custom
instructions.
The Rust-GPU side of this already exists since it's part of the
polaris/lodestar demo branches (IIRC this specifically happened for
recursion emulation, where `FuncCall` being outside `Block`s meant).
---
Example from a relatively messy inlining stack:

Ideally large amounts of deduplication could be done by having a "debug
context tracker" in `print` that only needs to show *changes* (i.e.
entering/leaving a group of inlined instructions, and individual
location debuginfo that could still differ between instructions), but
that's not done in this PR.
The status quo on the Rust-GPU side was already quite verbose, and
arguably worse than this at times (or at least more "syntaxful"), so
this will do for the time being.Attr::SpvDebugLine with a better basic debug source location attribute. (#9)6 files changed
Lines changed: 260 additions & 86 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| 290 | + | |
290 | 291 | | |
291 | 292 | | |
292 | 293 | | |
| |||
298 | 299 | | |
299 | 300 | | |
300 | 301 | | |
301 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
302 | 330 | | |
303 | 331 | | |
304 | 332 | | |
| |||
307 | 335 | | |
308 | 336 | | |
309 | 337 | | |
310 | | - | |
| 338 | + | |
311 | 339 | | |
312 | 340 | | |
313 | 341 | | |
314 | 342 | | |
315 | 343 | | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
321 | 350 | | |
322 | 351 | | |
323 | 352 | | |
324 | 353 | | |
325 | 354 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
330 | 382 | | |
331 | 383 | | |
332 | 384 | | |
333 | | - | |
| 385 | + | |
334 | 386 | | |
335 | 387 | | |
336 | 388 | | |
| |||
342 | 394 | | |
343 | 395 | | |
344 | 396 | | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
345 | 401 | | |
346 | 402 | | |
347 | 403 | | |
348 | 404 | | |
349 | 405 | | |
350 | 406 | | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | 407 | | |
358 | 408 | | |
359 | 409 | | |
| |||
363 | 413 | | |
364 | 414 | | |
365 | 415 | | |
366 | | - | |
367 | | - | |
| 416 | + | |
| 417 | + | |
368 | 418 | | |
369 | 419 | | |
370 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
371 | 439 | | |
372 | 440 | | |
373 | 441 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
2111 | 2111 | | |
2112 | 2112 | | |
2113 | 2113 | | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
2114 | 2207 | | |
2115 | 2208 | | |
2116 | 2209 | | |
| |||
2250 | 2343 | | |
2251 | 2344 | | |
2252 | 2345 | | |
2253 | | - | |
2254 | | - | |
2255 | | - | |
2256 | | - | |
2257 | | - | |
2258 | | - | |
2259 | | - | |
2260 | | - | |
2261 | | - | |
2262 | | - | |
2263 | | - | |
2264 | | - | |
2265 | | - | |
2266 | | - | |
2267 | | - | |
2268 | | - | |
2269 | | - | |
2270 | | - | |
2271 | 2346 | | |
2272 | 2347 | | |
2273 | 2348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
211 | | - | |
| 210 | + | |
| 211 | + | |
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| |||
1508 | 1508 | | |
1509 | 1509 | | |
1510 | 1510 | | |
1511 | | - | |
| 1511 | + | |
| 1512 | + | |
1512 | 1513 | | |
1513 | | - | |
1514 | 1514 | | |
1515 | 1515 | | |
1516 | 1516 | | |
| |||
1718 | 1718 | | |
1719 | 1719 | | |
1720 | 1720 | | |
1721 | | - | |
1722 | | - | |
1723 | | - | |
1724 | | - | |
1725 | | - | |
| 1721 | + | |
| 1722 | + | |
1726 | 1723 | | |
1727 | 1724 | | |
1728 | 1725 | | |
1729 | | - | |
| 1726 | + | |
1730 | 1727 | | |
1731 | 1728 | | |
1732 | 1729 | | |
| |||
0 commit comments