Suggested by Jason.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5142>
}
}
- uint32_t remainder = group_size & (simd_size - 1);
- uint32_t right_mask;
-
- if (remainder > 0)
- right_mask = ~0u >> (32 - remainder);
- else
- right_mask = ~0u >> (32 - simd_size);
-
#define GPGPU_DISPATCHDIMX 0x2500
#define GPGPU_DISPATCHDIMY 0x2504
#define GPGPU_DISPATCHDIMZ 0x2508
}
}
+ const uint32_t right_mask = brw_cs_right_mask(group_size, simd_size);
+
iris_emit_cmd(batch, GENX(GPGPU_WALKER), ggw) {
ggw.IndirectParameterEnable = grid->indirect != NULL;
ggw.SIMDSize = simd_size / 16;
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
anv_pipeline_setup_l3_config(&pipeline->base, cs_prog_data->base.total_shared > 0);
const struct anv_cs_parameters cs_params = anv_cs_parameters(pipeline);
- uint32_t remainder = cs_params.group_size & (cs_params.simd_size - 1);
- if (remainder > 0)
- pipeline->cs_right_mask = ~0u >> (32 - remainder);
- else
- pipeline->cs_right_mask = ~0u >> (32 - cs_params.simd_size);
+ pipeline->cs_right_mask = brw_cs_right_mask(cs_params.group_size, cs_params.simd_size);
const uint32_t vfe_curbe_allocation =
ALIGN(cs_prog_data->push.per_thread.regs * cs_params.threads +
const struct brw_cs_parameters cs_params = brw_cs_get_parameters(brw);
- uint32_t right_mask = 0xffffffffu >> (32 - cs_params.simd_size);
- const unsigned right_non_aligned =
- cs_params.group_size & (cs_params.simd_size - 1);
- if (right_non_aligned != 0)
- right_mask >>= (cs_params.simd_size - right_non_aligned);
+ const uint32_t right_mask =
+ brw_cs_right_mask(cs_params.group_size, cs_params.simd_size);
brw_batch_emit(brw, GENX(GPGPU_WALKER), ggw) {
ggw.IndirectParameterEnable = indirect;