upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/scripts/shader_stats.py
diff options
context:
space:
mode:
authorSolthodox <100046219+Solthodox@users.noreply.github.com>2026-11-23 16:58:37 +0100
committerGitHub <noreply@github.com>2026-11-23 09:58:37 -0600
commita67f8bf3b949a3e968d0fca4467af78ef6ed617d (patch)
treec3f3a60d5247c1c8070ba6d42cf91131c7958624 /scripts/shader_stats.py
parent35b4a8e00d6ce1e1d02e18a2fd8c57fe8e4fbefc (diff)
shader_stats: omit growth ratios with zero original instructions (#6771)
Squash-merged after diff review of PR #6771 - shader_stats: omit growth ratios with zero original instructions
Diffstat (limited to 'scripts/shader_stats.py')
-rw-r--r--scripts/shader_stats.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/shader_stats.py b/scripts/shader_stats.py
index d325b9fc4..fb95a1843 100644
--- a/scripts/shader_stats.py
+++ b/scripts/shader_stats.py
@@ -8,6 +8,7 @@ the driver's instruction count with the original one (code growth) and its VGPRs
8code uses, and it flags scratch memory and spills: a register file that didn't fit in registers and went to memory, 8code uses, and it flags scratch memory and spills: a register file that didn't fit in registers and went to memory,
9which is the expensive case (relative VGPR indexing, v_movrels/v_movreld, forces it). It prints a summary per stage and, 9which is the expensive case (relative VGPR indexing, v_movrels/v_movreld, forces it). It prints a summary per stage and,
10with --details, one line per shader. 10with --details, one line per shader.
11Growth is unavailable when the original listing has no parsed instructions; its driver counters are still shown.
11 12
12Metrics are read only where the driver emits these exact RADV/ACO statistic names with a numeric value: Instructions, 13Metrics are read only where the driver emits these exact RADV/ACO statistic names with a numeric value: Instructions,
13VGPRs, SGPRs, Scratch size, Spilled VGPRs, Spilled SGPRs, Subgroups per SIMD. No equivalence is claimed for other 14VGPRs, SGPRs, Scratch size, Spilled VGPRs, Spilled SGPRs, Subgroups per SIMD. No equivalence is claimed for other
@@ -98,7 +99,7 @@ def shader_row(name, stage, st, src):
98 r = {"name": name, "stage": stage, "orig": n_orig, "v_orig": v_orig} 99 r = {"name": name, "stage": stage, "orig": n_orig, "v_orig": v_orig}
99 for key, stat in METRICS: 100 for key, stat in METRICS:
100 r[key] = number(st.get(stat)) 101 r[key] = number(st.get(stat))
101 r["growth"] = None if r["aco"] is None else r["aco"] / max(n_orig, 1) 102 r["growth"] = r["aco"] / n_orig if n_orig and r["aco"] is not None else None
102 103
103 spill_counts = [number(st.get(stat)) for stat in SPILLS] 104 spill_counts = [number(st.get(stat)) for stat in SPILLS]
104 known_spills = [v for v in spill_counts if v is not None] 105 known_spills = [v for v in spill_counts if v is not None]