google / shaderc

A collection of tools, libraries, and tests for Vulkan shader compilation.
Other
1.86k stars 363 forks source link

Don't use friendly names for SPIR-V validation errors #1442

Closed dneto0 closed 2 months ago

dneto0 commented 2 months ago

Setting up friendly names requires parsing the entire module which costs a lot of time due to (1) scanning the whole module, and (2) creating string names for many IDs.

This is a followup to https://github.com/KhronosGroup/SPIRV-Tools/issues/5802 There, Blender was suffering long shader suite build times due to serialization on locale. But secondarily we noticed there was a lot of string manipulation when setting up the validator, all because the friendly name mapper is on by default for the optimizer.

Turn off friendly names in the optimizer's use of the validator. The validation errors are only emitted when there is a compiler bug, so they should be rare. Don't make every compilation pay the cost.