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.
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
- 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.
Also, only emit this XFB information where the SPIR-V spec says
it should be emitted: essentially, on objects.
This and the previous commit together fix#1185.
Some stage (e.g, hull shaders) have arrayed builtin outputs (e.g, position).
When copying from the internal structure to the split form, it is necessary
to propagate that indirection to the actual arrayed outputs. This was not
happening.
Addresses #1181