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>
This commit is contained in:
Danylo Piliaiev
2021-03-05 19:58:25 +02:00
committed by Marge Bot
parent 360df6fbfe
commit f17b41ab4f
4 changed files with 130 additions and 0 deletions

View File

@@ -167,6 +167,7 @@ files_libnir = files(
'nir_lower_io_to_temporaries.c',
'nir_lower_io_to_scalar.c',
'nir_lower_io_to_vector.c',
'nir_lower_is_helper_invocation.c',
'nir_lower_multiview.c',
'nir_lower_mediump.c',
'nir_lower_memcpy.c',