diff --git a/src/microsoft/vulkan/dzn_device.c b/src/microsoft/vulkan/dzn_device.c index 10ecfb5184a..dedbaca1fb9 100644 --- a/src/microsoft/vulkan/dzn_device.c +++ b/src/microsoft/vulkan/dzn_device.c @@ -39,6 +39,8 @@ #include "util/mesa-sha1.h" #include "util/u_dl.h" +#include "util/driconf.h" + #include "glsl_types.h" #include "dxil_validator.h" @@ -1115,6 +1117,22 @@ dzn_enumerate_physical_devices(struct vk_instance *instance) return result; } +static const driOptionDescription dzn_dri_options[] = { + DRI_CONF_SECTION_DEBUG + DRI_CONF_DZN_CLAIM_WIDE_LINES(false) + DRI_CONF_SECTION_END +}; + +static void +dzn_init_dri_config(struct dzn_instance *instance) +{ + driParseOptionInfo(&instance->available_dri_options, dzn_dri_options, + ARRAY_SIZE(dzn_dri_options)); + driParseConfigFiles(&instance->dri_options, &instance->available_dri_options, 0, "dzn", NULL, NULL, + instance->vk.app_info.app_name, instance->vk.app_info.app_version, + instance->vk.app_info.engine_name, instance->vk.app_info.engine_version); +} + static VkResult dzn_instance_create(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, @@ -1198,6 +1216,7 @@ dzn_instance_create(const VkInstanceCreateInfo *pCreateInfo, d3d12_enable_gpu_validation(instance->d3d12_mod, instance->factory); instance->sync_binary_type = vk_sync_binary_get_type(&dzn_sync_type); + dzn_init_dri_config(instance); *out = dzn_instance_to_handle(instance); return VK_SUCCESS; @@ -1275,6 +1294,7 @@ dzn_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures2 *pFeatures) { VK_FROM_HANDLE(dzn_physical_device, pdev, physicalDevice); + struct dzn_instance *instance = container_of(pdev->vk.instance, struct dzn_instance, vk); pFeatures->features = (VkPhysicalDeviceFeatures) { .robustBufferAccess = true, /* This feature is mandatory */ @@ -1292,7 +1312,7 @@ dzn_GetPhysicalDeviceFeatures2(VkPhysicalDevice physicalDevice, .depthBiasClamp = true, .fillModeNonSolid = false, .depthBounds = dzn_physical_device_supports_depth_bounds(pdev), - .wideLines = false, + .wideLines = driQueryOptionb(&instance->dri_options, "dzn_claim_wide_lines"), .largePoints = false, .alphaToOne = false, .multiViewport = false, diff --git a/src/microsoft/vulkan/dzn_private.h b/src/microsoft/vulkan/dzn_private.h index 5fc9026db17..60c08d15018 100644 --- a/src/microsoft/vulkan/dzn_private.h +++ b/src/microsoft/vulkan/dzn_private.h @@ -48,6 +48,7 @@ #include "util/hash_table.h" #include "util/u_dynarray.h" #include "util/log.h" +#include "util/xmlconfig.h" #include "shader_enums.h" @@ -1127,6 +1128,9 @@ struct dzn_instance { uint32_t debug_flags; struct vk_sync_binary_type sync_binary_type; + + struct driOptionCache dri_options; + struct driOptionCache available_dri_options; }; struct dzn_event { diff --git a/src/microsoft/vulkan/meson.build b/src/microsoft/vulkan/meson.build index 9b4d601bfe8..998f0d06b15 100644 --- a/src/microsoft/vulkan/meson.build +++ b/src/microsoft/vulkan/meson.build @@ -84,7 +84,7 @@ libvulkan_dzn = shared_library( inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_compiler, inc_util ], - dependencies : [dzn_deps, idep_vulkan_wsi], + dependencies : [dzn_deps, idep_vulkan_wsi, idep_xmlconfig], c_args : dzn_flags, cpp_args : dzn_cpp_flags, gnu_symbol_visibility : 'hidden', diff --git a/src/util/00-mesa-defaults.conf b/src/util/00-mesa-defaults.conf index 22ccdbf32e7..5154d4f7571 100644 --- a/src/util/00-mesa-defaults.conf +++ b/src/util/00-mesa-defaults.conf @@ -1000,6 +1000,11 @@ TODO: document the other workarounds.