From 647ca8165407fcdb2695917599a803f8b0c804bb Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Thu, 6 Apr 2023 15:57:43 -0700 Subject: [PATCH] anv: Only enable GPL if ANV_GPL=true, or if zink or DXVK are the engine. Since there are concerns that the VK_EXT_GPL implementation may have issues with mesh shading, disable it by default but give users a knob to turn it on to experiment. This doesn't automatically enable GPL use in zink, because we lack extendedDynamicState2PatchControlPoints, but it means that you only need to set ZINK_DEBUG=gpl and not both env vars. Reviewed-by: Lionel Landwerlin Part-of: --- docs/envvars.rst | 5 +++++ src/intel/ci/deqp-anv-tgl-vk.toml | 11 ++++++++++- src/intel/vulkan/anv_device.c | 16 ++++++++++++++-- src/intel/vulkan/anv_private.h | 1 + 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/docs/envvars.rst b/docs/envvars.rst index ef9dc7344b9..c607fc77a48 100644 --- a/docs/envvars.rst +++ b/docs/envvars.rst @@ -422,6 +422,11 @@ on Windows. Intel driver environment variables ---------------------------------------------------- +.. envvar:: ANV_GPL + + If set to 1, true, or yes, then VK_EXT_graphics_pipeline_library + will be exposed, which may be incompatible with mesh shaders. + .. envvar:: INTEL_BLACKHOLE_DEFAULT if set to 1, true or yes, then the OpenGL implementation will diff --git a/src/intel/ci/deqp-anv-tgl-vk.toml b/src/intel/ci/deqp-anv-tgl-vk.toml index 10ef564f850..2ddbf51ce59 100644 --- a/src/intel/ci/deqp-anv-tgl-vk.toml +++ b/src/intel/ci/deqp-anv-tgl-vk.toml @@ -3,4 +3,13 @@ deqp = "/deqp/external/vulkancts/modules/vulkan/deqp-vk" caselists = ["/deqp/mustpass/vk-master.txt"] fraction = 2 -renderer_check = "TGL GT2" \ No newline at end of file +renderer_check = "TGL GT2" + +[[deqp]] +deqp = "/deqp/external/vulkancts/modules/vulkan/deqp-vk" +caselists = ["/deqp/mustpass/vk-master.txt"] +fraction = 2 +include = ["dEQP-VK.pipeline.pipeline_library"] +prefix = "gpl-" +[deqp.env] +ANV_GPL = "true" diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 1ae6feb58d8..ee892d79468 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -308,7 +308,7 @@ get_device_extensions(const struct anv_physical_device *device, VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR, .EXT_global_priority_query = device->max_context_priority >= VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR, - .EXT_graphics_pipeline_library = true, + .EXT_graphics_pipeline_library = device->gpl_enabled, .EXT_host_query_reset = true, .EXT_image_2d_view_of_3d = true, .EXT_image_robustness = true, @@ -916,6 +916,18 @@ anv_physical_device_try_create(struct vk_instance *vk_instance, debug_get_bool_option("ANV_ENABLE_GENERATED_INDIRECT_DRAWS", true); + /* The GPL implementation is new, and may have issues in conjunction with + * mesh shading. Enable it by default for zink for performance reasons (where + * mesh shading is unused anyway), and have an env var for testing in CI or + * by end users. + * */ + if (debug_get_bool_option("ANV_GPL", + instance->vk.app_info.engine_name != NULL && + (strcmp(instance->vk.app_info.engine_name, "mesa zink") == 0 || + strcmp(instance->vk.app_info.engine_name, "DXVK") == 0))) { + device->gpl_enabled = true; + } + unsigned st_idx = 0; device->sync_syncobj_type = vk_drm_syncobj_get_type(fd); @@ -1384,7 +1396,7 @@ void anv_GetPhysicalDeviceFeatures2( /* VK_EXT_global_priority_query */ .globalPriorityQuery = true, - .graphicsPipelineLibrary = true, + .graphicsPipelineLibrary = pdevice->gpl_enabled, /* VK_KHR_fragment_shading_rate */ .pipelineFragmentShadingRate = true, diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 09fd9fb5825..6a3697e6a02 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -915,6 +915,7 @@ struct anv_physical_device { struct intel_device_info info; bool supports_48bit_addresses; bool video_decode_enabled; + bool gpl_enabled; struct brw_compiler * compiler; struct isl_device isl_dev;