intel/fs: Add support for compiling bindless shaders with resume shaders
Instead of depending on the driver to compile each resume shader separately, we compile them all in one go in the back-end and build an SBT as part of the shader program. Shader relocs are used to make the entries in the SBT point point to the correct resume shader. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8637>
This commit is contained in:

committed by
Marge Bot

parent
d055ac9bdf
commit
705395344d
@@ -2805,6 +2805,24 @@ fs_generator::add_const_data(void *data, unsigned size)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
fs_generator::add_resume_sbt(unsigned num_resume_shaders, uint64_t *sbt)
|
||||
{
|
||||
assert(brw_shader_stage_is_bindless(stage));
|
||||
struct brw_bs_prog_data *bs_prog_data = brw_bs_prog_data(prog_data);
|
||||
if (num_resume_shaders > 0) {
|
||||
bs_prog_data->resume_sbt_offset =
|
||||
brw_append_data(p, sbt, num_resume_shaders * sizeof(uint64_t), 32);
|
||||
for (unsigned i = 0; i < num_resume_shaders; i++) {
|
||||
size_t offset = bs_prog_data->resume_sbt_offset + i * sizeof(*sbt);
|
||||
assert(offset <= UINT32_MAX);
|
||||
brw_add_reloc(p, BRW_SHADER_RELOC_SHADER_START_OFFSET,
|
||||
BRW_SHADER_RELOC_TYPE_U32,
|
||||
(uint32_t)offset, (uint32_t)sbt[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const unsigned *
|
||||
fs_generator::get_assembly()
|
||||
{
|
||||
|
Reference in New Issue
Block a user