Module: Mesa Branch: staging/19.2 Commit: 9dec9da93dc9a4dd1d49d0440feda7ec1d24b1c9 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9dec9da93dc9a4dd1d49d0440feda7ec1d24b1c9
Author: Lionel Landwerlin <[email protected]> Date: Sun Sep 8 12:57:16 2019 +0300 radv: store engine name We'll use this later for a new driconfig matching parameter. v2: Avoid leak in device creation error case (Bas) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Cc: 19.2 <[email protected]> (cherry picked from commit 6d5f11ab345b05759c22acbcd2f79928311689e3) --- src/amd/vulkan/radv_device.c | 13 +++++++++++++ src/amd/vulkan/radv_private.h | 3 +++ 2 files changed, 16 insertions(+) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 3a10117f68c..f0a18bd10db 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -621,6 +621,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) @@ -664,6 +671,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(); @@ -690,6 +701,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(); diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 7d7704f69aa..e41a484f448 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -329,6 +329,9 @@ struct radv_instance { int physicalDeviceCount; struct radv_physical_device physicalDevices[RADV_MAX_DRM_DEVICES]; + char * engineName; + uint32_t engineVersion; + uint64_t debug_flags; uint64_t perftest_flags; _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
