break;
}
+ case nir_intrinsic_load_invocation_id:
+ ntq_store_dest(c, &instr->dest, 0, vir_IID(c));
+ break;
+
default:
fprintf(stderr, "Unknown intrinsic: ");
nir_print_instr(&instr->instr, stderr);
/* Output primitive type */
uint8_t out_prim_type;
+
+ /* Number of GS invocations */
+ uint8_t num_invocations;
};
struct v3d_fs_prog_data {
VIR_A_ALU2(LDVPMG_OUT)
VIR_A_ALU0(TMUWT)
+VIR_A_ALU0(IID)
VIR_A_ALU0(FXCD)
VIR_A_ALU0(XCD)
VIR_A_ALU0(FYCD)
prog_data->vpm_output_size = align(c->vpm_output_size, 8) / 8;
prog_data->out_prim_type = c->s->info.gs.output_primitive;
+ prog_data->num_invocations = c->s->info.gs.invocations;
}
static void
static void
v3d_emit_tes_gs_common_params(struct v3d_job *job,
- uint8_t gs_out_prim_type)
+ uint8_t gs_out_prim_type,
+ uint8_t gs_num_invocations)
{
/* This, and v3d_emit_tes_gs_shader_params below, fill in default
* values for tessellation fields even though we don't support
shader.geometry_shader_output_format =
v3d_gs_output_primitive(gs_out_prim_type);
- shader.geometry_shader_instances = 1; /* FIXME */
+ shader.geometry_shader_instances = gs_num_invocations & 0x1F;
}
}
struct v3d_gs_prog_data *gs = v3d->prog.gs->prog_data.gs;
struct v3d_gs_prog_data *gs_bin = v3d->prog.gs_bin->prog_data.gs;
- v3d_emit_tes_gs_common_params(v3d->job, gs->out_prim_type);
+ v3d_emit_tes_gs_common_params(v3d->job,
+ gs->out_prim_type,
+ gs->num_invocations);
v3d_emit_tes_gs_shader_params(v3d->job, gs_bin);
v3d_emit_tes_gs_shader_params(v3d->job, gs);
}