intel: Add helper to calculate GPGPU_WALKER::RightExecutionMask

Suggested by Jason.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5142>
This commit is contained in:
Caio Marcelo de Oliveira Filho
2020-05-27 08:05:41 -07:00
parent 78e400d4a5
commit bccf2a25a8
4 changed files with 18 additions and 18 deletions

View File

@@ -1529,6 +1529,19 @@ brw_cs_simd_size_for_group_size(const struct gen_device_info *devinfo,
const struct brw_cs_prog_data *cs_prog_data,
unsigned group_size);
/**
* Calculate the RightExecutionMask field used in GPGPU_WALKER.
*/
static inline unsigned
brw_cs_right_mask(unsigned group_size, unsigned simd_size)
{
const uint32_t remainder = group_size & (simd_size - 1);
if (remainder > 0)
return ~0u >> (32 - remainder);
else
return ~0u >> (32 - simd_size);
}
/**
* Return true if the given shader stage is dispatched contiguously by the
* relevant fixed function starting from channel 0 of the SIMD thread, which