perf(shader): skip friendly names when validating SPIR-V #1752
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1752"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-08T18:32:28Z.
What
Turns off friendly names in the SPIRV-Tools validator (
ValidatorOptions::SetFriendlyNames(false)) inValidateAndOptimizeSpirv, the function every build withANYPS5_ENABLE_SPIRV_TOOLSuses.Since #639, a specialized module turns every
OpSpecConstantinto anOpConstant, which leaves thousands of constants with the same type and value. On eachValidate, SPIRV-Tools'FriendlyNameMappergives every one of them a name. They all start from the same name (uint_5), soSaveNametries the suffixes_0,_1, ... one by one, and the cost is quadratic.perfonagc_driver_buffer_format: 72 % inunordered_set<string>::emplacefromFriendlyNameMapper::SaveName. The names are only used in validation error messages, which now show%ids. The tests only check the message prefix.Measured, one compute shader in
agc_driver_buffer_format(RADV, no shader cache):ValidatecallFull ctest on CI's lavapipe (Mesa 25.2.8),
--repeat until-fail:3 --parallel 4, same build otherwise. Slowest run of each test:agc_driver_flat_storeagc_driver_buffer_formatagc_driver_global_vcc_baseagc_driver_sdwa_move_selectorsagc_driver_global_load_addtidThis is what has been timing out the Linux job since #639 (#1701 and other PRs). Titles built with SPIRV-Tools paid the same cost on every specialized shader at registration.
Tested
Linux, CachyOS: full ctest on CI's lavapipe, 483/483 passed (table above), and
agc_driver_buffer_formaton RADV (gfx1035).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)