summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_nir.cpp16
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();