summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>2020-01-14 12:22:47 -0800
committerMarge Bot <eric+marge@anholt.net>2020-01-21 23:41:35 +0000
commitff5b74ef32ea0ccff265064017f8168a4b328a5a (patch)
treeb3c205c139f1d668af301c6cd1bccd21f5ec3564 /src
parent18e72ee2108a9388b8d1890311dd22f69886438a (diff)
intel/fs: Add workgroup_size() helper
Reviewed-by: Francisco Jerez <currojerez@riseup.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3226>
Diffstat (limited to 'src')
-rw-r--r--src/intel/compiler/brw_fs.cpp8
-rw-r--r--src/intel/compiler/brw_fs.h2
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;
};
/**