intel/fs: Add workgroup_size() helper
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tue, 14 Jan 2020 20:22:47 +0000 (12:22 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 21 Jan 2020 23:41:35 +0000 (23:41 +0000)
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3226>

src/intel/compiler/brw_fs.cpp
src/intel/compiler/brw_fs.h

index 97f47ab92c2e9f081d9bba8980a98817304ddac9..b5f3bdd7698d52072a18db075b4f622fce93df19 100644 (file)
@@ -8721,3 +8721,11 @@ brw_fs_test_dispatch_packing(const fs_builder &bld)
       set_predicate(BRW_PREDICATE_NORMAL, bld.emit(BRW_OPCODE_WHILE));
    }
 }
+
+unsigned
+fs_visitor::workgroup_size() const
+{
+   assert(stage == MESA_SHADER_COMPUTE);
+   const struct brw_cs_prog_data *cs = brw_cs_prog_data(prog_data);
+   return cs->local_size[0] * cs->local_size[1] * cs->local_size[2];
+}
index a682fac9aa611bba76e99685412c075f86f7db6e..7fac6d51c9e47f55c73de045a7f1b8a080401857 100644 (file)
@@ -411,6 +411,8 @@ private:
    void lower_mul_dword_inst(fs_inst *inst, bblock_t *block);
    void lower_mul_qword_inst(fs_inst *inst, bblock_t *block);
    void lower_mulh_inst(fs_inst *inst, bblock_t *block);
+
+   unsigned workgroup_size() const;
 };
 
 /**