bifrost: Honor src swizzle in special math ops
authorChris Forbes <chrisforbes@google.com>
Tue, 28 Jul 2020 19:40:44 +0000 (12:40 -0700)
committerChris Forbes <chrisforbes@google.com>
Tue, 28 Jul 2020 20:45:20 +0000 (13:45 -0700)
commita618631f2dd708853a50a8ffd7e00bd100e19496
treef5aff1e30090cfcb6b22cb5f21075e67824ff988
parenta400c2ff2265dfabb1ed7b59c8b24aa38d0557d1
bifrost: Honor src swizzle in special math ops

Most ops use the common handling in emit_alu in order to convert NIR
sources to bifrost sources, but the "special" math op lowering handrolls
the conversion (due to needing to reference the same source multiple
times).

Unfortunately, that handrolled lowering did not consider that there
might be a non-identity swizzle on the source. In this case we would
reference the wrong component of the source and generate garbage.

Fixes all but two of the remaining failures on G31 in:
  dEQP-GLES2.functional.shaders.operator.exponential.*highp*

The following tests are still broken due to some other issue:
  dEQP-GLES2.functional.shaders.operator.exponential.exp2.highp_float_fragment
  dEQP-GLES2.functional.shaders.operator.exponential.exp2.highp_vec2_fragment

Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6108>
src/panfrost/bifrost/bi_special.c