intel/fs: fix subgroup invocation read bounds checking
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Fri, 10 Mar 2023 20:57:36 +0000 (22:57 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 14 Mar 2023 12:15:48 +0000 (12:15 +0000)
commit56474fae937e5cd75ed26f3ea352e7347191416d
treec41b6c48da95aedd1623b16186131301fadd2480
parentf6a36190a1c2b723f107c29df3b87e4edd400696
intel/fs: fix subgroup invocation read bounds checking

nir->info.subgroup_size can be set to an enum :
  SUBGROUP_SIZE_VARYING = 0
  SUBGROUP_SIZE_UNIFORM = 1
  SUBGROUP_SIZE_API_CONSTANT = 2
  SUBGROUP_SIZE_FULL_SUBGROUPS = 3

So compute the API subgroup size value and compare it to the dispatch
size to determine whether we need some bound checking.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9ac192d79d ("intel/fs: bound subgroup invocation read to dispatch size")
Reviewed-by: Marcin Ĺšlusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21856>
src/intel/compiler/brw_fs.h
src/intel/compiler/brw_fs_nir.cpp
src/intel/compiler/brw_fs_visitor.cpp
src/intel/compiler/brw_nir.c
src/intel/compiler/brw_nir.h