vulkan: add a new vk_meta option to use the rect list pipeline path

RADV uses VK_PRIMITIVE_TOPOLOGY_META_RECT_LIST_MESA for some meta
operations but it doesn't need to use the existing path that draws
using VBOs.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32805>
This commit is contained in:
Samuel Pitoiset 2024-12-30 09:47:54 +01:00 committed by Marge Bot
parent 68c73f82ba
commit 6d3b2a6531
5 changed files with 8 additions and 3 deletions

View file

@ -59,6 +59,7 @@ hk_device_init_meta(struct hk_device *dev)
dev->meta.use_gs_for_layer = false;
dev->meta.use_stencil_export = true;
dev->meta.use_rect_list_pipeline = true;
dev->meta.cmd_bind_map_buffer = hk_cmd_bind_map_buffer;
dev->meta.max_bind_map_buffer_size_B = 64 * 1024;

View file

@ -44,7 +44,8 @@ nvk_device_init_meta(struct nvk_device *dev)
if (result != VK_SUCCESS)
return result;
dev->meta.use_gs_for_layer = pdev->info.cls_eng3d < MAXWELL_B,
dev->meta.use_gs_for_layer = pdev->info.cls_eng3d < MAXWELL_B;
dev->meta.use_rect_list_pipeline = true;
dev->meta.cmd_bind_map_buffer = nvk_cmd_bind_map_buffer;
dev->meta.max_bind_map_buffer_size_B = 64 * 1024; /* TODO */

View file

@ -133,6 +133,7 @@ panvk_meta_init(struct panvk_device *device)
return result;
device->meta.use_stencil_export = true;
device->meta.use_rect_list_pipeline = true;
device->meta.max_bind_map_buffer_size_B = 64 * 1024;
device->meta.cmd_bind_map_buffer = panvk_meta_cmd_bind_map_buffer;

View file

@ -457,8 +457,8 @@ vk_meta_create_graphics_pipeline(struct vk_device *device,
}
VkPipeline pipeline;
if (info_local.pInputAssemblyState->topology ==
VK_PRIMITIVE_TOPOLOGY_META_RECT_LIST_MESA) {
if (meta->use_rect_list_pipeline &&
info_local.pInputAssemblyState->topology == VK_PRIMITIVE_TOPOLOGY_META_RECT_LIST_MESA) {
result = create_rect_list_pipeline(device, meta,
&info_local,
&pipeline);

View file

@ -109,6 +109,8 @@ struct vk_meta_device {
bool use_gs_for_layer;
bool use_stencil_export;
bool use_rect_list_pipeline;
struct {
/* Optimal workgroup size for each possible chunk size. This should be
* chosen to keep things cache-friendly (something big enough to maximize