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:
@@ -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
|
||||
|
Reference in New Issue
Block a user