intel/fs: Use ALIGN16 instructions for all derivatives on gen <= 7
authorJason Ekstrand <jason@jlekstrand.net>
Thu, 25 Jul 2019 23:28:44 +0000 (18:28 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Tue, 30 Jul 2019 22:38:19 +0000 (22:38 +0000)
commit499d760c6e8a81d87bc4ea37c3de2ee9b9da2aec
treeb1e7a67518c7751ae35e5760639f3186ed8f931d
parentbf8b5de6b9eae3e6fe3a56514ca984285b9b36c2
intel/fs: Use ALIGN16 instructions for all derivatives on gen <= 7

The issue here was discovered by a set of Vulkan CTS tests:

    dEQP-VK.glsl.derivate.*.dynamic_*

These tests use ballot ops to construct a branch condition that takes
the same path for each 2x2 quad but may not be uniform across the whole
subgroup.  They then tests that derivatives work and give the correct
value even when executed inside such a branch.  Because the derivative
isn't executed in uniform control-flow and the values coming into the
derivative aren't smooth (or worse, linear), they nicely catch bugs that
aren't uncovered by simpler derivative tests.

Unfortunately, these tests require Vulkan and the equivalent GL test
would require the GL_ARB_shader_ballot extension which requires int64.
Because the requirements for these tests are so high, it's not easy to
test on older hardware and the bug is only proven to exist on gen7;
gen4-6 are a conjecture.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/intel/compiler/brw_fs.cpp
src/intel/compiler/brw_fs_generator.cpp