From: Caio Marcelo de Oliveira Filho Date: Tue, 14 Jan 2020 20:22:47 +0000 (-0800) Subject: intel/fs: Add workgroup_size() helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ff5b74ef32ea0ccff265064017f8168a4b328a5a;p=mesa.git intel/fs: Add workgroup_size() helper Reviewed-by: Francisco Jerez Part-of: --- diff --git a/src/intel/compiler/brw_fs.cpp b/src/intel/compiler/brw_fs.cpp index 97f47ab92c2..b5f3bdd7698 100644 --- a/src/intel/compiler/brw_fs.cpp +++ b/src/intel/compiler/brw_fs.cpp @@ -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]; +} diff --git a/src/intel/compiler/brw_fs.h b/src/intel/compiler/brw_fs.h index a682fac9aa6..7fac6d51c9e 100644 --- a/src/intel/compiler/brw_fs.h +++ b/src/intel/compiler/brw_fs.h @@ -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; }; /**