intel/fs: Implement "demote to helper invocation"
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Sat, 8 Jun 2019 06:06:27 +0000 (23:06 -0700)
committerCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Mon, 8 Jul 2019 15:57:25 +0000 (08:57 -0700)
commit45f5db5a84ae6fe5d4a4d1cd8b62b48d70629fc9
tree82e41bac2b94d02f70eb5bc622f631dbdcd60790
parenta42e8f0ed1d1aa1b38282be28e4f55e246b55685
intel/fs: Implement "demote to helper invocation"

The "demote" intrinsic works like "discard" but don't change the
control flow, allowing derivative operations to work.  This is the
semantics of D3D discard.

The "is_helper_invocation" intrinsic will return true for helper
invocations -- both the ones that started as helpers and the ones that
where demoted.  This is needed to avoid changing the behavior of
gl_HelperInvocation which is an input (so not expected to change
during shader execution).

v2: Emit the discard jump and comment why it is safe.  (Jason)
    Rework the is_helper_invocation() that was stomping f0.1.  (Jason)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/compiler/brw_fs_nir.cpp