i965/cs: Initialize gl_WorkGroupID variable from payload
authorJordan Justen <jordan.l.justen@intel.com>
Fri, 10 Oct 2014 15:28:24 +0000 (08:28 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Sun, 13 Sep 2015 16:53:16 +0000 (09:53 -0700)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
src/mesa/drivers/dri/i965/brw_cs.cpp
src/mesa/drivers/dri/i965/brw_fs.h

index 9ee5ae52798f0416054a7e36a1e11f8a6a25a59d..04f3e5884367ab90bbf94ec7442a901325f56487 100644 (file)
@@ -643,3 +643,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;
+}
index 6bfc29002a331973b48dd1827eeec366a4b261bb..5880f690ef1acd878c83c6d5345cb5497c89fe27 100644 (file)
@@ -276,6 +276,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();