aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_cs.c
diff options
context:
space:
mode:
authorCaio Marcelo de Oliveira Filho <[email protected]>2020-05-21 00:51:44 -0700
committerCaio Marcelo de Oliveira Filho <[email protected]>2020-05-27 18:16:31 -0700
commitee0fc0f6dcf6093f4e3ff0796ace3cb1590a72ea (patch)
tree7bd430709094b264ca6cafa67892a6d94fbee170 /src/mesa/drivers/dri/i965/brw_cs.c
parentcb26d9c3119e089a0e0c6b0bf6cfc90193c70326 (diff)
i965: Use new helper functions to pick SIMD variant for CS
Also expand the existing i965 helper to return the other CS related paramters. Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5142>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_cs.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_cs.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_cs.c b/src/mesa/drivers/dri/i965/brw_cs.c
index d6aceccd9f0..ef6b80edf62 100644
--- a/src/mesa/drivers/dri/i965/brw_cs.c
+++ b/src/mesa/drivers/dri/i965/brw_cs.c
@@ -32,25 +32,34 @@
#include "brw_program.h"
#include "compiler/glsl/ir_uniform.h"
-uint32_t
-brw_cs_group_size(const struct brw_context *brw)
+struct brw_cs_parameters
+brw_cs_get_parameters(const struct brw_context *brw)
{
assert(brw->cs.base.prog_data);
struct brw_cs_prog_data *cs_prog_data =
brw_cs_prog_data(brw->cs.base.prog_data);
+ struct brw_cs_parameters params = {};
+
if (brw->compute.group_size) {
/* With ARB_compute_variable_group_size the group size is set at
* dispatch time, so we can't use the one provided by the compiler.
*/
- return brw->compute.group_size[0] *
- brw->compute.group_size[1] *
- brw->compute.group_size[2];
+ params.group_size = brw->compute.group_size[0] *
+ brw->compute.group_size[1] *
+ brw->compute.group_size[2];
} else {
- return cs_prog_data->local_size[0] *
- cs_prog_data->local_size[1] *
- cs_prog_data->local_size[2];
+ params.group_size = cs_prog_data->local_size[0] *
+ cs_prog_data->local_size[1] *
+ cs_prog_data->local_size[2];
}
+
+ params.simd_size =
+ brw_cs_simd_size_for_group_size(&brw->screen->devinfo,
+ cs_prog_data, params.group_size);
+ params.threads = DIV_ROUND_UP(params.group_size, params.simd_size);
+
+ return params;
}
static void