diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2015-03-13 11:39:53 -0700 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2015-08-04 10:36:11 -0700 |
commit | ce581d1fa0f6f4d9ec795b89f33f8d6f6ad6ea2c (patch) | |
tree | e9d828e8280c8f2fef17edb94eeec81b567cc225 | |
parent | 05bbede659dfdfa6277313ff7d9db7f87a527d8b (diff) |
i965/nir: Support gl_WorkGroupID variablei965-workgroup-id-v1
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_nir.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp index 711ace66ff..a0b20c41e5 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_nir.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_nir.cpp @@ -347,6 +347,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; } @@ -1581,6 +1588,15 @@ fs_visitor::nir_emit_intrinsic(const fs_builder &bld, nir_intrinsic_instr *instr break; } + case nir_intrinsic_load_work_group_id: { + fs_reg work_group_id = nir_system_values[SYSTEM_VALUE_WORK_GROUP_ID]; + assert(work_group_id.file != BAD_FILE); + dest.type = work_group_id.type; + for (unsigned i = 0; i < 3; i++) + bld.MOV(offset(dest, bld, i), offset(work_group_id, bld, i)); + break; + } + case nir_intrinsic_barrier: assert(stage == MESA_SHADER_COMPUTE); emit_barrier(); |