vulkan: add vk_x11_strict_image_count option
[mesa.git] / src / amd / vulkan / radv_device.c
index d0de471594731040a91bb27e3c08e17412ff1df5..bdc38a555dedd44fc753211db19532c57c9576d9 100644 (file)
@@ -559,6 +559,7 @@ DRI_CONF_BEGIN
        DRI_CONF_SECTION_PERFORMANCE
                DRI_CONF_ADAPTIVE_SYNC("true")
                DRI_CONF_VK_X11_OVERRIDE_MIN_IMAGE_COUNT(0)
+               DRI_CONF_VK_X11_STRICT_IMAGE_COUNT("false")
        DRI_CONF_SECTION_END
 DRI_CONF_END;
 
@@ -567,7 +568,9 @@ static void  radv_init_dri_options(struct radv_instance *instance)
        driParseOptionInfo(&instance->available_dri_options, radv_dri_options_xml);
        driParseConfigFiles(&instance->dri_options,
                            &instance->available_dri_options,
-                           0, "radv", NULL);
+                           0, "radv", NULL,
+                           instance->engineName,
+                           instance->engineVersion);
 }
 
 VkResult radv_CreateInstance(
@@ -588,6 +591,13 @@ VkResult radv_CreateInstance(
                client_version = VK_API_VERSION_1_0;
        }
 
+       const char *engine_name = NULL;
+       uint32_t engine_version = 0;
+       if (pCreateInfo->pApplicationInfo) {
+               engine_name = pCreateInfo->pApplicationInfo->pEngineName;
+               engine_version = pCreateInfo->pApplicationInfo->engineVersion;
+       }
+
        instance = vk_zalloc2(&default_alloc, pAllocator, sizeof(*instance), 8,
                              VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
        if (!instance)
@@ -631,6 +641,10 @@ VkResult radv_CreateInstance(
                return vk_error(instance, result);
        }
 
+       instance->engineName = vk_strdup(&instance->alloc, engine_name,
+                                        VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);
+       instance->engineVersion = engine_version;
+
        _mesa_locale_init();
        glsl_type_singleton_init_or_ref();
 
@@ -657,6 +671,8 @@ void radv_DestroyInstance(
                radv_physical_device_finish(instance->physicalDevices + i);
        }
 
+       vk_free(&instance->alloc, instance->engineName);
+
        VG(VALGRIND_DESTROY_MEMPOOL(instance));
 
        glsl_type_singleton_decref();
@@ -1274,7 +1290,7 @@ void radv_GetPhysicalDeviceProperties2(
 
                        /* SGPR. */
                        properties->sgprsPerSimd =
-                               ac_get_num_physical_sgprs(pdevice->rad_info.chip_class);
+                               ac_get_num_physical_sgprs(&pdevice->rad_info);
                        properties->minSgprAllocation =
                                pdevice->rad_info.chip_class >= GFX8 ? 16 : 8;
                        properties->maxSgprAllocation =