nir: add lowering pass for helperInvocationEXT()
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Fri, 5 Mar 2021 17:58:25 +0000 (19:58 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 19 Apr 2021 17:11:36 +0000 (17:11 +0000)
commitf17b41ab4f017b562fdf7c388200e68c22105331
tree0e04d83d07240b66a5df7505a3734327593ded92
parent360df6fbfe175dd258852746e95333f51060f970
nir: add lowering pass for helperInvocationEXT()

Some hardware doesn't have a way to check if invocation was demoted,
in such case we have to track it ourselves.
OpIsHelperInvocationEXT is specified as:

 "An invocation is currently a helper invocation if it was originally
  invoked as a helper invocation or if it has been demoted to a helper
  invocation by OpDemoteToHelperInvocationEXT."

Therefore we:
- Set gl_IsHelperInvocationEXT = gl_HelperInvocation
- Add "gl_IsHelperInvocationEXT = true" right before each demote
- Add "gl_IsHelperInvocationEXT = gl_IsHelperInvocationEXT || condition"
  right before each demote_if

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9460>
src/compiler/Makefile.sources
src/compiler/nir/meson.build
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_is_helper_invocation.c [new file with mode: 0644]