Commit a0eb54e
authored
feat: add more shader group diagnostics to compile_report (#2085)
When compile_report >= 1, report several new post-optimization stats for the shader group:
* Number of active (non-unused) layers
* Maximum connection depth of the shader network (node count along the longest layer-to-layer chain, so a single unconnected node = 1 and a chain A->B->C = 3)
* Number of texture ops (texture, environment, gettextureinfo, texture3d)
* Number of noise ops
Note that these stats (number of layers, texture ops, noise ops) are the total number in the post-optimized shader, but not the number that will be run on any particular execution of the shader. Trivial example: the noise calls may all be inside an "if" statement with a condition that is never true in practice, but that can't be known ahead of time. In the other direction, a loop with noise calls in the body will underestimate how many calls are made in each shader run. So take with a grain of salt -- these stats are related overall shader code complexity, but not necessarily to execution cost.
Coded via pair programming with Claude Code, using the Claude Sonnet 4.6 model.
---------
Signed-off-by: Larry Gritz <lg@larrygritz.com>1 parent 344fded commit a0eb54e
1 file changed
+38
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3278 | 3278 | | |
3279 | 3279 | | |
3280 | 3280 | | |
| 3281 | + | |
| 3282 | + | |
| 3283 | + | |
3281 | 3284 | | |
3282 | 3285 | | |
3283 | 3286 | | |
3284 | 3287 | | |
3285 | 3288 | | |
| 3289 | + | |
3286 | 3290 | | |
3287 | 3291 | | |
3288 | 3292 | | |
| |||
3355 | 3359 | | |
3356 | 3360 | | |
3357 | 3361 | | |
| 3362 | + | |
3358 | 3363 | | |
3359 | 3364 | | |
3360 | 3365 | | |
| |||
3364 | 3369 | | |
3365 | 3370 | | |
3366 | 3371 | | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
3367 | 3379 | | |
3368 | 3380 | | |
3369 | 3381 | | |
| |||
3445 | 3457 | | |
3446 | 3458 | | |
3447 | 3459 | | |
| 3460 | + | |
| 3461 | + | |
| 3462 | + | |
| 3463 | + | |
| 3464 | + | |
| 3465 | + | |
| 3466 | + | |
| 3467 | + | |
| 3468 | + | |
| 3469 | + | |
| 3470 | + | |
| 3471 | + | |
| 3472 | + | |
| 3473 | + | |
| 3474 | + | |
| 3475 | + | |
| 3476 | + | |
3448 | 3477 | | |
3449 | 3478 | | |
3450 | 3479 | | |
| |||
3468 | 3497 | | |
3469 | 3498 | | |
3470 | 3499 | | |
| 3500 | + | |
| 3501 | + | |
| 3502 | + | |
| 3503 | + | |
| 3504 | + | |
3471 | 3505 | | |
3472 | 3506 | | |
3473 | 3507 | | |
3474 | | - | |
| 3508 | + | |
3475 | 3509 | | |
3476 | | - | |
| 3510 | + | |
3477 | 3511 | | |
3478 | 3512 | | |
3479 | 3513 | | |
3480 | 3514 | | |
3481 | 3515 | | |
3482 | 3516 | | |
3483 | 3517 | | |
3484 | | - | |
| 3518 | + | |
3485 | 3519 | | |
3486 | 3520 | | |
3487 | 3521 | | |
3488 | 3522 | | |
3489 | 3523 | | |
3490 | | - | |
| 3524 | + | |
3491 | 3525 | | |
3492 | 3526 | | |
3493 | 3527 | | |
| |||
0 commit comments