intel/compiler: Combine nir_emit_{ssbo,shared}_atomic into one helper
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 10 Jan 2023 00:23:08 +0000 (16:23 -0800)
committerMarge Bot <emma+marge@anholt.net>
Thu, 19 Jan 2023 08:42:22 +0000 (08:42 +0000)
commit03ddde12308dde0a2bcfd5a774e5ec067f7b1d65
treea1e222a841442bc27b49882d6f49bbe7be6ccef4
parentb84939c678461e0f52d096dd1a7509f2a10a7cf5
intel/compiler: Combine nir_emit_{ssbo,shared}_atomic into one helper

These are basically identical save for:
- shared has surface hardcoded to SLM rather than an SSBO index
- shared has to handle adding the 'base' const_index (SSBO have none)
- the NIR source index for data is shifted by one

It's not worth copy and pasting the entire function for this.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
src/intel/compiler/brw_fs.h
src/intel/compiler/brw_fs_nir.cpp