diff options
author | Chad Versace <chad.versace@intel.com> | 2015-07-09 16:22:18 -0700 |
---|---|---|
committer | Chad Versace <chad.versace@intel.com> | 2015-07-10 17:35:52 -0700 |
commit | 4422bd4cf61c4f05f853dc790c03ab04c138d7b0 (patch) | |
tree | a191000792b5119f138420f107d19a1c37751556 | |
parent | 7552e026da51846c8d8755dbd95b830f82086080 (diff) | |
download | mesa-4422bd4cf61c4f05f853dc790c03ab04c138d7b0.tar.gz |
vk/device: Add func anv_physical_device_finish()
Because in a follow-up patch I need to do some non-trival teardown on
anv_physical_device. Currently, however, anv_physical_device_finish() is
currently a no-op that's just called in the right place.
Also, rename function fill_physical_device -> anv_physical_device_init
for symmetry.
-rw-r--r-- | src/vulkan/device.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/vulkan/device.c b/src/vulkan/device.c index 25df95853ad..0856bcec400 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -41,10 +41,16 @@ anv_env_get_int(const char *name) return strtol(val, NULL, 0); } +static void +anv_physical_device_finish(struct anv_physical_device *device) +{ + /* Nothing to do */ +} + static VkResult -fill_physical_device(struct anv_physical_device *device, - struct anv_instance *instance, - const char *path) +anv_physical_device_init(struct anv_physical_device *device, + struct anv_instance *instance, + const char *path) { int fd; @@ -150,6 +156,10 @@ VkResult anv_DestroyInstance( { ANV_FROM_HANDLE(anv_instance, instance, _instance); + if (instance->physicalDeviceCount > 0) { + anv_physical_device_finish(&instance->physicalDevice); + } + instance->pfnFree(instance->pAllocUserData, instance); return VK_SUCCESS; @@ -164,8 +174,8 @@ VkResult anv_EnumeratePhysicalDevices( VkResult result; if (instance->physicalDeviceCount == 0) { - result = fill_physical_device(&instance->physicalDevice, - instance, "/dev/dri/renderD128"); + result = anv_physical_device_init(&instance->physicalDevice, + instance, "/dev/dri/renderD128"); if (result != VK_SUCCESS) return result; |