SPIRV-Cross/shaders/frag
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
..
16bit-constants.frag Support constants of 16-bit integral type in GLSL and MSL. 2018-11-02 14:39:55 -05:00
array-lut-no-loop-variable.frag Disallow arrays and structs from becoming loop variables. 2018-03-07 14:54:11 +01:00
basic.frag Add explicit in/out locations everywhere. 2017-06-21 09:39:08 +02:00
complex-expression-in-access-chain.frag Register implied expression reads in OpLoad/OpAccessChain. 2019-01-04 14:56:12 +01:00
composite-extract-forced-temporary.frag Only split expression in OpCompositeExtract if we forward the temporary. 2016-06-23 12:13:41 +02:00
constant-array.frag Initial commit. 2016-03-11 16:30:27 +01:00
constant-composites.frag Do not declare constant composites inline in HLSL. 2018-02-02 10:12:26 +01:00
false-loop-init.frag Add test for false loop init. 2018-01-23 21:15:09 +01:00
flush_params.frag Initial commit. 2016-03-11 16:30:27 +01:00
for-loop-init.frag Improve debuggability of Travis CI when things go wrong. 2016-12-16 13:48:30 +01:00
frexp-modf.frag Support FrexpStruct/ModfStruct. 2017-09-04 10:27:08 +02:00
front-facing.frag Add IsFrontFace support to HLSL. 2018-02-15 12:42:56 +01:00
gather-dref.frag Fix GatherDref on GLSL. 2018-04-30 12:45:23 +02:00
ground.frag Initial commit. 2016-03-11 16:30:27 +01:00
helper-invocation.frag Support gl_HelperInvocation on GLSL and MSL. 2018-11-28 15:18:43 +01:00
hoisted-temporary-use-continue-block-as-value.frag Fix case where hoisted temporaries were used before being declared. 2018-02-15 10:52:56 +01:00
image-load-store-uint-coord.asm.frag Make sure image integer coords are int, not uint. 2017-12-01 15:02:50 +01:00
loop-dominator-and-switch-default.frag Add test case for continue out of switch default block. 2018-09-18 11:01:15 +02:00
lut-promotion.frag Add some tests for LUT promotion. 2018-07-05 14:14:18 +02:00
mix.frag Initial commit. 2016-03-11 16:30:27 +01:00
partial-write-preserve.frag Preserve arguments with inout unless complete writes are made. 2017-08-09 17:06:41 +02:00
pls.frag Add explicit in/out locations everywhere. 2017-06-21 09:39:08 +02:00
sample-parameter.frag Add support for SampleId/SampleMask/SamplePosition builtins. 2017-07-24 10:07:31 +02:00
sampler-ms.frag Fix issue with new glslang behavior for samplers as parameters. 2016-07-05 13:21:26 +02:00
sampler-proj.frag Always make a copy when handling OpCompositeInsert 2017-06-26 18:32:53 +01:00
sampler.frag Add explicit in/out locations everywhere. 2017-06-21 09:39:08 +02:00
switch-unsigned-case.frag Fix unsigned switch case selectors. 2018-11-26 10:36:50 +01:00
swizzle.frag Rewrite everything to use Bitset rather than uint64_t. 2018-03-12 13:24:14 +01:00
texel-fetch-offset.frag MSL: Fix support for texelFetchOffset. 2018-08-07 15:28:04 +02:00
ubo_layout.frag Initial commit. 2016-03-11 16:30:27 +01:00
unary-enclose.frag Fix unary enclosures. 2017-07-24 10:17:19 +02:00