diff options
author | Jordan Justen <[email protected]> | 2015-03-13 11:39:53 -0700 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2015-09-13 09:53:16 -0700 |
commit | c5743a5d7fa62a339222ceb96d568a525d77fe0c (patch) | |
tree | 684176d8cac57d67f8fb1c5dfd7dbd76d9315da1 /src/mesa/drivers | |
parent | 4e454cb7c6dd189b433acd98c9595e464e0432b4 (diff) |
i965/nir: Support gl_WorkGroupID variable
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Kristian Høgsberg <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 286ec283584..e4ddadc79a8 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -344,6 +344,13 @@ emit_system_values_block(nir_block *block, void *void_visitor) *reg = *v->emit_cs_local_invocation_id_setup(); break; + case nir_intrinsic_load_work_group_id: + assert(v->stage == MESA_SHADER_COMPUTE); + reg = &v->nir_system_values[SYSTEM_VALUE_WORK_GROUP_ID]; + if (reg->file == BAD_FILE) + *reg = *v->emit_cs_work_group_id_setup(); + break; + default: break; } @@ -1716,7 +1723,8 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr ((struct brw_cs_prog_data *) prog_data)->uses_barrier = true; break; - case nir_intrinsic_load_local_invocation_id: { + case nir_intrinsic_load_local_invocation_id: + case nir_intrinsic_load_work_group_id: { gl_system_value sv = nir_system_value_from_intrinsic(instr->intrinsic); fs_reg val = nir_system_values[sv]; assert(val.file != BAD_FILE); |