v3d: Add support for CS workgroup/invocation id intrinsics.

We get a payload for the ivec3 workgroup and an int local invocation
index, and we use the core lowering to turn into the global invocation id
and the local invocation id ivec3s.
This commit is contained in:
Eric Anholt
2018-12-07 15:47:18 -08:00
parent 6281f26f06
commit 01d913cf90
5 changed files with 67 additions and 1 deletions

View File

@@ -259,6 +259,11 @@ enum quniform_contents {
QUNIFORM_ALPHA_REF,
/* Number of workgroups passed to glDispatchCompute in the dimension
* selected by the data value.
*/
QUNIFORM_NUM_WORK_GROUPS,
/**
* Returns the the offset of the scratch buffer for register spilling.
*/
@@ -540,6 +545,9 @@ struct v3d_compile {
/* Fragment shader payload regs. */
struct qreg payload_w, payload_w_centroid, payload_z;
struct qreg cs_payload[2];
int local_invocation_index_bits;
uint8_t vattr_sizes[V3D_MAX_VS_INPUTS];
uint32_t num_vpm_writes;