anv: only emit CFE_STATE when scratch space increases

On Gen12.5+, we only need to emit CFE_STATE when scratch space
has changed, not on every pipeline binding. Also, only grow the
scratch space, never shrink it. Need to reset after secondary buf.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22179>
This commit is contained in:
Felix DeGrood
2023-03-28 17:04:32 +00:00
committed by Marge Bot
parent c88de6c18c
commit ecb709c853
5 changed files with 68 additions and 33 deletions

View File

@@ -817,6 +817,17 @@ cmd_build_acceleration_structures(
&data, sizeof(data));
}
if (anv_cmd_buffer_is_render_queue(cmd_buffer))
genX(flush_pipeline_select_gpgpu)(cmd_buffer);
/* Due to the nature of GRL and its heavy use of jumps/predication, we
* cannot tell exactly in what order the CFE_STATE we insert are going to
* be executed. So always use the largest possible size.
*/
genX(cmd_buffer_ensure_cfe_state)(
cmd_buffer,
cmd_buffer->device->physical->max_grl_scratch_size);
/* Round 1 : init_globals kernel */
genX(grl_misc_batched_init_globals)(
cmd_buffer,