SPIRV-Cross/shaders
Hans-Kristian Arntzen acae607703 Register implied expression reads in OpLoad/OpAccessChain.
This is required to avoid relying on complex sub-expression elimination
in compilers, and generates cleaner code.

The problem case is if a complex expression is used in an access chain,
like:

Composite comp = buffer[texture(...)];
vec4 a = comp.a + comp.b + comp.c;

Before, we did not have common subexpression tracking for
OpLoad/OpAccessChain, so we easily ended up with code like:

vec4 a = buffer[texture(...)].a + buffer[texture(...)].b + buffer[texture(...)].c;

A good compiler will optimize this, but we should not rely on it, and
forcing texture(...) to a temporary also looks better.

The solution is to add a vector "implied_expression_reads", which works
similarly to expression_dependencies. We also need an extra mechanism in
to_expression which lets us skip expression read checking and do it
later. E.g. for expr -> access chain -> load, we should only trigger
a read of expr when using the loaded expression.
2019-01-04 14:56:12 +01:00
..
amd Rewrite everything to use Bitset rather than uint64_t. 2018-03-12 13:24:14 +01:00
asm Parser: Handle group decorations. 2018-11-15 10:51:52 +01:00
comp Support bitcasts of 16-bit types. 2018-11-05 14:56:36 -06:00
desktop-only GLSL: Support extended arithmetic opcodes. 2018-11-13 14:50:46 +01:00
flatten Update glslang and SPIRV-Tools. 2018-09-27 11:10:22 +02:00
frag Register implied expression reads in OpLoad/OpAccessChain. 2019-01-04 14:56:12 +01:00
geom Add explicit in/out locations everywhere. 2017-06-21 09:39:08 +02:00
legacy Rewrite everything to use Bitset rather than uint64_t. 2018-03-12 13:24:14 +01:00
tesc Add explicit in/out locations everywhere. 2017-06-21 09:39:08 +02:00
tese Add explicit in/out locations everywhere. 2017-06-21 09:39:08 +02:00
vert Handle invariant decoration more robustly. 2018-11-22 11:55:57 +01:00
vulkan Add support for 8- and 16-bit types to GLSL and MSL. 2018-11-01 10:20:57 -05:00