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 <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15637>
This commit is contained in:
Emma Anholt 2023-04-06 15:57:43 -07:00 committed by Marge Bot
parent 3d49cdb71e
commit 647ca81654
4 changed files with 30 additions and 3 deletions

View file

@ -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

View file

@ -3,4 +3,13 @@
deqp = "/deqp/external/vulkancts/modules/vulkan/deqp-vk"
caselists = ["/deqp/mustpass/vk-master.txt"]
fraction = 2
renderer_check = "TGL GT2"
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"

View file

@ -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,

View file

@ -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;