From: Marcin Ślusarz Date: Wed, 12 Apr 2023 14:17:52 +0000 (+0200) Subject: intel: split URB space between task and mesh proportionally to entry sizes X-Git-Tag: upstream/23.3.3~10001 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf90be90aded3ce82d3acda5f63cd59614d662bb;p=platform%2Fupstream%2Fmesa.git intel: split URB space between task and mesh proportionally to entry sizes Improves performance by 0.5-2.5% in vk_meshlet_cadscene depending on the model. Reviewed-by: José Roberto de Souza Part-of: --- diff --git a/src/intel/common/intel_urb_config.c b/src/intel/common/intel_urb_config.c index be9c68f..d19645c 100644 --- a/src/intel/common/intel_urb_config.c +++ b/src/intel/common/intel_urb_config.c @@ -323,19 +323,24 @@ intel_get_mesh_urb_config(const struct intel_device_info *devinfo, float task_urb_share = 0.0f; if (r.task_entry_size_64b > 0) { - /* By default, assign 10% to TASK and 90% to MESH, since we expect MESH - * to use larger URB entries since it contains all the vertex and - * primitive data. Environment variable allow us to tweak it. + /* By default, split memory between TASK and MESH proportionally to + * their entry sizes. Environment variable allow us to tweak it. * * TODO(mesh): Re-evaluate if this is a good default once there are more * workloads. */ static int task_urb_share_percentage = -1; - if (task_urb_share_percentage < 0) { + if (task_urb_share_percentage == -1) { task_urb_share_percentage = - MIN2(debug_get_num_option("INTEL_MESH_TASK_URB_SHARE", 10), 100); + MIN2(debug_get_num_option("INTEL_MESH_TASK_URB_SHARE", -2), 100); + } + + if (task_urb_share_percentage >= 0) { + task_urb_share = task_urb_share_percentage / 100.0f; + } else { + task_urb_share = 1.0f * r.task_entry_size_64b / + (r.task_entry_size_64b + r.mesh_entry_size_64b); } - task_urb_share = task_urb_share_percentage / 100.0f; } const unsigned one_task_urb_kb = ALIGN(r.task_entry_size_64b * 64, 1024) / 1024;