The distutils package was removed in Python 3.12, however its only
usage in this script can easily be replaced with functionality available
in the builtin os package in Python 3.2 and later.
Fixes#3393
This one small change allows the update_glslang_sources.py script to operate correctly with Python 2 and Python 3.
Change the string literal type to "bytes" so that it matches the type returned by the subprocess calls. Otherwise, under Python 3, the search for "known-good" in the list of remotes always fails. This is OK for the first execution of update_glsang_sources, since the remote is not there on the first run. But on subsequent runs, the search still fails to match and the script stops when trying to create a remote that already exists.
- remove unused variable to pass pylint
- Use another approach to detect if known-good remote is already
present to avoid the need for "ignore following errors" message.
Also added known-good mechanism to fetch latest validated spirv-tools.
Also added -Od and -Os to disable optimizer and optimize for size.
Fetching spirv-tools is optional for both glsl and hlsl. Legalization
of hlsl is done by default if spirv-opt is present at cmake time.
Optimization for glsl is currently done through the option -Os.
Legalization testing is currently only done on four existing shaders.
A separate baseLegalResults directory holds those results. All previous
testing is done with the optimizer disabled.