std::stringstream has a measurable overhead for preprocessing - it
appears that operator<< does a tiny bit of extra work for appending
chars/strings and also can't be inlined in most cases on VS2015;
additionally, std::endl triggers a stream flush which also adds up.
Replacing this with std::string buffer gets the preprocessing time down
from 180ms to 135ms in one case, making it 1.33x faster.
Note that integer-to-string conversion is using std::to_string; in
theory this could be slower than sprintf or manual conversion, but I
haven't found these cases to affect preprocessing time in practice
(std::to_string would always use the short string buffer for
line/version numbers, and the number of calls is not too significant).
Update SPIRV-Tools. Relevant functional changes:
- Optimizer enhancements:
- ADCE now removes OpSwitch
- Block merging occurs in more cases
- Optimizer fixes:
- Constant propagation (CCP): support matrix constants
- #1199: Optimizer: Fix CCP: don't propagate spec constants.
- #1203: Optimizer: Fix common uniform elim bug introduced by refactoring.
- #1210: Optimizer: Aggressive dead code elimination: Fix 'break' identification.
- #1212: Optimizer: Aggressive dead code elimination: Was skipping too many instructions.
- #1214: Optimizer: Aggressive dead code elimination: Fix infinite loop.
- #1228: Optimizer: Fix CCP: Handling of varying Phi nodes; was resulting in infinite loop.
- #1245: Optimizer: Dead branch elimination: Avoid a null pointer dereference.
- #1250: Optimizer: Dead branch elimination: Avoid spuriously reporting a change.
- #1262: Support building on VisualStudio 2013 again
Update SPIRV-Headers, with "unified1" directory.
Updated one Glslang legalization test base result due to better block merging.
- make it sharable with GLSL
- correct the case insensitivity
- remove the map; queries are not needed, all entries need processing
- make it easier to build bottom up (will help GLSL parsing)
- support semantic checking and reporting
- allow front-end dependent semantics and attribute name mapping
TGlslangToSpvTraverser::getExtBuiltins is only used when AMD_EXTENSIONS
is defined, so only define it in that case to avoid an unused function
warning.
- correct inheritence (or not) of the right XFB buffer
- compute implicit stride (fixes#1212)
- semantic check block-member redeclarations
- inherit stride from a member
- fixes#1209, addresses most of #1187
- only query feature availability on seeing the feature
(was doing it for every single token)
- correct case-sensitive checks for multi-character suffixes
- partially addresses #1209 and #1187
- only query 64-bit extension on seeing use of a 64-bit literal
(was doing it for every single token)
- correct HLSL acceptance of 64-bit literal syntax (still an int though)
- error on overflow of 32-bit literal type
The grammar for no semicolon and no object name for cbuffer/tbuffer
was correct, but the production still skipped the anonymous declarations
if an identifier followed.
Set type to r-value resulting from indexing vector, to prevent
float->uint conversion when source is already uint. Resulting
OpConvertFToU would otherwise fail validation because source is
already uint.
For LoadN, incorrect uint->float->uint can be avoided; fixing
potential truncation of big integer values.