This factored computeTypeLocationSize() out of needing the TIntermediate contents,
and uses it to show how to know how many locations an object needs.
However, it still does not do cross stage, or mixed location/no-location
analysis.
HLSL allows image and texture types to be templatized on sub-vec4 types,
or even structures. This was mostly handled already during creation of
sampling operations. However, for operator[] which can generate image
loads, this wasn't happening.
It also isn't very easy to do at that point in time, because operator[]
does not know where the results it produces will end up. They may be
an lvalue or an rvalue, and there's a post-process to convert loads to
stores. They may end up in atomic ops.
To bypass that difficulty, GlslangToSpv now looks for this case and
adds the appropriate conversion. LIMITATION: this only works for
cases for which a simple conversion opcode suffices. That is to say,
it will not work if the type is templatized on a struct.
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