A shader invocation always executes 16 channels together, so we often end
up multiplying things by this magic 16 number. Give it a name.
#ifndef V3D_LIMITS_H
#define V3D_LIMITS_H
+/* Number of channels a QPU thread executes in parallel. Also known as
+ * gl_SubGroupSizeARB.
+ */
+#define V3D_CHANNELS 16
+
#define V3D_MAX_FS_INPUTS 64
#define V3D_MAX_VS_INPUTS 64
* batches.
*/
assert(c->devinfo->vpm_size);
- int sector_size = 16 * sizeof(uint32_t) * 8;
+ int sector_size = V3D_CHANNELS * sizeof(uint32_t) * 8;
int vpm_size_in_sectors = c->devinfo->vpm_size / sector_size;
int half_vpm = vpm_size_in_sectors / 2;
int vpm_output_sectors = half_vpm - prog_data->vpm_input_size;
if (!is_uniform) {
uint32_t spill_offset = c->spill_size;
- c->spill_size += 16 * sizeof(uint32_t);
+ c->spill_size += V3D_CHANNELS * sizeof(uint32_t);
if (spill_offset == 0)
v3d_setup_spill_base(c);
* conformance tests to make sure that spilling works.
*/
int force_register_spills = 0;
- if (c->spill_size < 16 * sizeof(uint32_t) * force_register_spills) {
+ if (c->spill_size <
+ V3D_CHANNELS * sizeof(uint32_t) * force_register_spills) {
int node = v3d_choose_spill_node(c, g, temp_to_node);
if (node != -1) {
v3d_spill_reg(c, map[node].temp);