diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2014-10-10 08:28:24 -0700 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2015-08-04 10:36:11 -0700 |
commit | 05bbede659dfdfa6277313ff7d9db7f87a527d8b (patch) | |
tree | f6d0937dc18d5af46e6ad86c8d7fe2bf3cdbd12e | |
parent | 45871fcd4d4eedaefdd4c88f91a7bcddc1915ce2 (diff) |
i965/cs: Initialize gl_WorkGroupID variable from payload
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_cs.cpp | 19 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_cs.cpp b/src/mesa/drivers/dri/i965/brw_cs.cpp index 3e683270d1..14c69a258c 100644 --- a/src/mesa/drivers/dri/i965/brw_cs.cpp +++ b/src/mesa/drivers/dri/i965/brw_cs.cpp @@ -627,3 +627,22 @@ const struct brw_tracked_state gen7_cs_push_constants = { }, /* .emit = */ gen7_upload_cs_push_constants, }; + + +fs_reg * +fs_visitor::emit_cs_work_group_id_setup() +{ + assert(stage == MESA_SHADER_COMPUTE); + + fs_reg *reg = new(this->mem_ctx) fs_reg(vgrf(glsl_type::uvec3_type)); + + struct brw_reg r0_1(retype(brw_vec1_grf(0, 1), BRW_REGISTER_TYPE_UD)); + struct brw_reg r0_6(retype(brw_vec1_grf(0, 6), BRW_REGISTER_TYPE_UD)); + struct brw_reg r0_7(retype(brw_vec1_grf(0, 7), BRW_REGISTER_TYPE_UD)); + + bld.MOV(*reg, r0_1); + bld.MOV(offset(*reg, bld, 1), r0_6); + bld.MOV(offset(*reg, bld, 2), r0_7); + + return reg; +} diff --git a/src/mesa/drivers/dri/i965/brw_fs.h b/src/mesa/drivers/dri/i965/brw_fs.h index 1e1974f092..60c4dfa9cd 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.h +++ b/src/mesa/drivers/dri/i965/brw_fs.h @@ -278,6 +278,7 @@ public: void emit_urb_writes(); void emit_cs_terminate(); fs_reg *emit_cs_local_invocation_id_setup(); + fs_reg *emit_cs_work_group_id_setup(); void emit_barrier(); |