intel/compiler: Add support for bindless shaders
The Intel bindless thread dispatch model is very simple. When a compute shader is to be used for bindless dispatch, it can request a set of stack IDs. These are allocated per-dual-subslice by the hardware and recycled automatically when the stack ID is returned. Passed to the bindless dispatch are a global argument address, a stack ID, and an address of the BINDLESS_SHADER_RECORD to invoke. When the bindless shader is dispatched, it is passed its stack ID as well as the global and local argument pointers. The local argument pointer is the address of the BINDLESS_SHADER_RECORD plus some offset which is specified as part of the BINDLESS_SHADER_RECORD. Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7356>
This commit is contained in:

committed by
Marge Bot

parent
27f44116fe
commit
7280b0911d
@@ -118,6 +118,9 @@ brw_compiler_create(void *mem_ctx, const struct gen_device_info *devinfo)
|
||||
i == MESA_SHADER_FRAGMENT || i == MESA_SHADER_COMPUTE;
|
||||
}
|
||||
|
||||
for (int i = MESA_SHADER_TASK; i < MESA_VULKAN_SHADER_STAGES; i++)
|
||||
compiler->scalar_stage[i] = true;
|
||||
|
||||
nir_lower_int64_options int64_options =
|
||||
nir_lower_imul64 |
|
||||
nir_lower_isign64 |
|
||||
@@ -230,13 +233,19 @@ unsigned
|
||||
brw_prog_data_size(gl_shader_stage stage)
|
||||
{
|
||||
static const size_t stage_sizes[] = {
|
||||
[MESA_SHADER_VERTEX] = sizeof(struct brw_vs_prog_data),
|
||||
[MESA_SHADER_TESS_CTRL] = sizeof(struct brw_tcs_prog_data),
|
||||
[MESA_SHADER_TESS_EVAL] = sizeof(struct brw_tes_prog_data),
|
||||
[MESA_SHADER_GEOMETRY] = sizeof(struct brw_gs_prog_data),
|
||||
[MESA_SHADER_FRAGMENT] = sizeof(struct brw_wm_prog_data),
|
||||
[MESA_SHADER_COMPUTE] = sizeof(struct brw_cs_prog_data),
|
||||
[MESA_SHADER_KERNEL] = sizeof(struct brw_cs_prog_data),
|
||||
[MESA_SHADER_VERTEX] = sizeof(struct brw_vs_prog_data),
|
||||
[MESA_SHADER_TESS_CTRL] = sizeof(struct brw_tcs_prog_data),
|
||||
[MESA_SHADER_TESS_EVAL] = sizeof(struct brw_tes_prog_data),
|
||||
[MESA_SHADER_GEOMETRY] = sizeof(struct brw_gs_prog_data),
|
||||
[MESA_SHADER_FRAGMENT] = sizeof(struct brw_wm_prog_data),
|
||||
[MESA_SHADER_COMPUTE] = sizeof(struct brw_cs_prog_data),
|
||||
[MESA_SHADER_RAYGEN] = sizeof(struct brw_bs_prog_data),
|
||||
[MESA_SHADER_ANY_HIT] = sizeof(struct brw_bs_prog_data),
|
||||
[MESA_SHADER_CLOSEST_HIT] = sizeof(struct brw_bs_prog_data),
|
||||
[MESA_SHADER_MISS] = sizeof(struct brw_bs_prog_data),
|
||||
[MESA_SHADER_INTERSECTION] = sizeof(struct brw_bs_prog_data),
|
||||
[MESA_SHADER_CALLABLE] = sizeof(struct brw_bs_prog_data),
|
||||
[MESA_SHADER_KERNEL] = sizeof(struct brw_cs_prog_data),
|
||||
};
|
||||
assert((int)stage >= 0 && stage < ARRAY_SIZE(stage_sizes));
|
||||
return stage_sizes[stage];
|
||||
@@ -246,13 +255,19 @@ unsigned
|
||||
brw_prog_key_size(gl_shader_stage stage)
|
||||
{
|
||||
static const size_t stage_sizes[] = {
|
||||
[MESA_SHADER_VERTEX] = sizeof(struct brw_vs_prog_key),
|
||||
[MESA_SHADER_TESS_CTRL] = sizeof(struct brw_tcs_prog_key),
|
||||
[MESA_SHADER_TESS_EVAL] = sizeof(struct brw_tes_prog_key),
|
||||
[MESA_SHADER_GEOMETRY] = sizeof(struct brw_gs_prog_key),
|
||||
[MESA_SHADER_FRAGMENT] = sizeof(struct brw_wm_prog_key),
|
||||
[MESA_SHADER_COMPUTE] = sizeof(struct brw_cs_prog_key),
|
||||
[MESA_SHADER_KERNEL] = sizeof(struct brw_cs_prog_key),
|
||||
[MESA_SHADER_VERTEX] = sizeof(struct brw_vs_prog_key),
|
||||
[MESA_SHADER_TESS_CTRL] = sizeof(struct brw_tcs_prog_key),
|
||||
[MESA_SHADER_TESS_EVAL] = sizeof(struct brw_tes_prog_key),
|
||||
[MESA_SHADER_GEOMETRY] = sizeof(struct brw_gs_prog_key),
|
||||
[MESA_SHADER_FRAGMENT] = sizeof(struct brw_wm_prog_key),
|
||||
[MESA_SHADER_COMPUTE] = sizeof(struct brw_cs_prog_key),
|
||||
[MESA_SHADER_RAYGEN] = sizeof(struct brw_bs_prog_key),
|
||||
[MESA_SHADER_ANY_HIT] = sizeof(struct brw_bs_prog_key),
|
||||
[MESA_SHADER_CLOSEST_HIT] = sizeof(struct brw_bs_prog_key),
|
||||
[MESA_SHADER_MISS] = sizeof(struct brw_bs_prog_key),
|
||||
[MESA_SHADER_INTERSECTION] = sizeof(struct brw_bs_prog_key),
|
||||
[MESA_SHADER_CALLABLE] = sizeof(struct brw_bs_prog_key),
|
||||
[MESA_SHADER_KERNEL] = sizeof(struct brw_cs_prog_key),
|
||||
};
|
||||
assert((int)stage >= 0 && stage < ARRAY_SIZE(stage_sizes));
|
||||
return stage_sizes[stage];
|
||||
|
Reference in New Issue
Block a user