Skip to content

Fix issue with OOM CTS test

Fixes issues reported by the create_instance_device_intentional_alloc_fail.basic CTS test. One of the issues can happen if allocation fails at the time when dispatch table is allocated at device/instance creation time which can result in dispatch table being a null pointer which later is used to resolve Vulkan entrypoints.

This patch also makes sure that dispatch table is passed around the {instance/device}_private_data::associate functions as a value-type rather than a pointer which forces the user of the table to use the move operator as otherwise the ownership transfer from the user to the{instance/device}_private_data classes was not obvious and the user could continue to invoke dispatch table functions erroneously.

Fixes the issue of the layer making use of the dispatch table when its initialization has failed in the cases when calls to dispatch_table::populate returned an error.

Any calls to vkDestroyInstance within vkCreateInstance have been removed as the Vulkan loader handles the unloading of the instance which would otherwise result in a double-free exception being thrown.

Change-Id: I36bb7219db9d852bc31f09c8154b2f93776c162f Signed-off-by: Normunds Rieksts normunds.rieksts@arm.com

Merge request reports