Module: Mesa Branch: master Commit: ff5b74ef32ea0ccff265064017f8168a4b328a5a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ff5b74ef32ea0ccff265064017f8168a4b328a5a
Author: Caio Marcelo de Oliveira Filho <[email protected]> Date: Tue Jan 14 12:22:47 2020 -0800 intel/fs: Add workgroup_size() helper Reviewed-by: Francisco Jerez <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3226> --- src/intel/compiler/brw_fs.cpp | 8 ++++++++ src/intel/compiler/brw_fs.h | 2 ++ 2 files changed, 10 insertions(+) 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; }; /** _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
