diff options
author | Timothy Arceri <[email protected]> | 2018-04-09 14:40:40 +1000 |
---|---|---|
committer | Matt Turner <[email protected]> | 2019-01-09 16:42:40 -0800 |
commit | 76c27e47b90647df047e785d6b3ab5d0d979a1ee (patch) | |
tree | a71f2a7343e3c1fc06f632647dd61649c90a6ece /src/compiler/glsl/glsl_parser.yy | |
parent | 63f6d7afd6fab91ec3ef6b8fec61401d8faf5587 (diff) |
glsl: Copy function out to temp if we don't directly ref a variable
Otherwise we can end up with IR that looks like this:
(
(declare (temporary ) vec4 f@8)
(assign (xyzw) (var_ref f@8) (var_ref f) )
(call f16 ((swiz y (var_ref f@8) )))
(assign (xyzw) (var_ref f) (var_ref f@8) )
))
When we really need:
(declare (temporary ) float inout_tmp)
(assign (x) (var_ref inout_tmp) (swiz y (var_ref f) ))
(call f16 ((var_ref inout_tmp) ))
(assign (y) (var_ref f) (swiz y (swiz xxxx (var_ref inout_tmp) )))
(declare (temporary ) void void_var)
The GLSL IR function inlining code seemed to produce correct code
even without this but we need the correct IR for GLSL IR -> NIR to
be able to understand whats going on.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/glsl/glsl_parser.yy')
0 files changed, 0 insertions, 0 deletions