SPIRV-Cross/reference/opt/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 Update glslang and SPIRV-Tools. 2018-09-27 11:10:22 +02:00
basic.frag Add reference output for --opt. 2017-11-23 09:50:11 +01: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 Add reference output for --opt. 2017-11-23 09:50:11 +01:00
constant-array.frag Add some tests for LUT promotion. 2018-07-05 14:14:18 +02:00
constant-composites.frag Update glslang and SPIRV-Tools. 2018-09-27 11:10:22 +02:00
false-loop-init.frag Update glslang and SPIRV-Tools. 2018-09-27 11:10:22 +02:00
flush_params.frag Update tests for latest SPIRV-Tools and glslang. 2018-03-12 15:11:55 +01:00
for-loop-init.frag Update glslang and SPIRV-Tools. 2018-09-27 11:10:22 +02:00
frexp-modf.frag Add reference output for --opt. 2017-11-23 09:50:11 +01: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 Update tests for latest SPIRV-Tools and glslang. 2018-03-12 15:11:55 +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 Update glslang and SPIRV-Tools. 2018-09-27 11:10:22 +02: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 Update glslang and SPIRV-Tools. 2018-09-27 11:10:22 +02:00
lut-promotion.frag Update glslang and SPIRV-Tools. 2018-09-27 11:10:22 +02:00
mix.frag Update tests for latest SPIRV-Tools and glslang. 2018-03-12 15:11:55 +01:00
partial-write-preserve.frag Update tests for latest SPIRV-Tools and glslang. 2018-03-12 15:11:55 +01:00
pls.frag Add reference output for --opt. 2017-11-23 09:50:11 +01:00
sample-parameter.frag Add reference output for --opt. 2017-11-23 09:50:11 +01:00
sampler-ms.frag Add reference output for --opt. 2017-11-23 09:50:11 +01:00
sampler-proj.frag Add reference output for --opt. 2017-11-23 09:50:11 +01:00
sampler.frag Add reference output for --opt. 2017-11-23 09:50:11 +01:00
switch-unsigned-case.frag Fix unsigned switch case selectors. 2018-11-26 10:36:50 +01:00
swizzle.frag Update tests for latest SPIRV-Tools and glslang. 2018-03-12 15:11:55 +01:00
texel-fetch-offset.frag MSL: Fix support for texelFetchOffset. 2018-08-07 15:28:04 +02:00
ubo_layout.frag Update tests. 2018-03-05 16:34:42 +01:00
unary-enclose.frag Update tests for latest SPIRV-Tools and glslang. 2018-03-12 15:11:55 +01:00