diff options
author | Caio Marcelo de Oliveira Filho <[email protected]> | 2020-01-14 12:22:47 -0800 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-21 23:41:35 +0000 |
commit | ff5b74ef32ea0ccff265064017f8168a4b328a5a (patch) | |
tree | b3c205c139f1d668af301c6cd1bccd21f5ec3564 /src/intel | |
parent | 18e72ee2108a9388b8d1890311dd22f69886438a (diff) |
intel/fs: Add workgroup_size() helper
Reviewed-by: Francisco Jerez <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3226>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/compiler/brw_fs.cpp | 8 | ||||
-rw-r--r-- | src/intel/compiler/brw_fs.h | 2 |
2 files changed, 10 insertions, 0 deletions
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; }; /** |