<div dir="ltr"><div>Thanks for the heads up. I just sent a patch which should fix it. Hooray for the CTS catching memory leaks.</div><div><br></div><div>--Jason<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 29, 2018 at 9:32 AM Andres Gomez <<a href="mailto:agomez@igalia.com">agomez@igalia.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Jason, this series (specifically, the patch 2/3), is causing<br>
regressions in VK-GL-CTS with mesa's 18.2 stable queue. I don't know if<br>
this is happening also in master, but it's quite possible.<br>
<br>
I've checked with the x11_egl target and the "vulkan-cts-1.1.2" branch:<br>
<a href="https://github.com/KhronosGroup/VK-GL-CTS/tree/vulkan-cts-1.1.2" rel="noreferrer" target="_blank">https://github.com/KhronosGroup/VK-GL-CTS/tree/vulkan-cts-1.1.2</a><br>
<br>
--<br>
<br>
$ ./deqp-vk --deqp-case="dEQP-VK.wsi.xlib.surface*"<br>
Writing test log into TestResults.qpa<br>
dEQP Core git-6140c85a76b7866db94aaf77bcd5dca80490e19b (0x6140c85a) starting..<br>
target implementation = 'X11 EGL'<br>
<br>
Test case 'dEQP-VK.wsi.xlib.surface.create'..<br>
Test case duration in microseconds = 5425 us<br>
Pass (Creating surface succeeded)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.surface.create_custom_allocator'..<br>
Test case duration in microseconds = 6497 us<br>
Fail (Detected invalid system allocation callback)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.surface.create_simulate_oom'..<br>
Test case duration in microseconds = 4048 us<br>
Fail (Detected invalid system allocation callback)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.surface.query_support'..<br>
Test case duration in microseconds = 6105 us<br>
Pass (Pass)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.surface.query_capabilities'..<br>
Test case duration in microseconds = 4290 us<br>
Pass (Pass)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.surface.query_capabilities2'..<br>
Test case duration in microseconds = 4052 us<br>
Pass (Pass)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.surface.query_formats'..<br>
Test case duration in microseconds = 4615 us<br>
Pass (Pass)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.surface.query_formats2'..<br>
Test case duration in microseconds = 4125 us<br>
Pass (Pass)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.surface.query_present_modes'..<br>
Test case duration in microseconds = 3999 us<br>
Pass (Pass)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.surface.destroy_null_handle'..<br>
Test case duration in microseconds = 533 us<br>
Pass (Destroying a VK_NULL_HANDLE surface has no effect)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.surface.initial_size'..<br>
Test case duration in microseconds = 4339 us<br>
Pass (Pass)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.surface.resize'..<br>
Test case duration in microseconds = 4323 us<br>
Pass (Pass)<br>
<br>
DONE!<br>
<br>
<br>
Test run totals:<br>
Passed: 10/12 (83.3%)<br>
Failed: 2/12 (16.7%)<br>
Not supported: 0/12 (0.0%)<br>
Warnings: 0/12 (0.0%)<br>
<br>
--<br>
<br>
$ ./deqp-vk --deqp-case="dEQP-VK.wsi.xlib.swapchain.simulate_oom*"<br>
Writing test log into TestResults.qpa<br>
dEQP Core git-6140c85a76b7866db94aaf77bcd5dca80490e19b (0x6140c85a) starting..<br>
target implementation = 'X11 EGL'<br>
<br>
Test case 'dEQP-VK.wsi.xlib.swapchain.simulate_oom.min_image_count'..<br>
Test case duration in microseconds = 208603 us<br>
Fail (Detected invalid system allocation callback)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.swapchain.simulate_oom.image_format'..<br>
Test case duration in microseconds = 8237 us<br>
Fail (Detected invalid system allocation callback)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.swapchain.simulate_oom.image_extent'..<br>
Test case duration in microseconds = 7118 us<br>
Fail (Detected invalid system allocation callback)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.swapchain.simulate_oom.image_array_layers'..<br>
Test case duration in microseconds = 7230 us<br>
Fail (Detected invalid system allocation callback)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.swapchain.simulate_oom.image_usage'..<br>
Test case duration in microseconds = 19784 us<br>
Fail (Detected invalid system allocation callback)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.swapchain.simulate_oom.image_sharing_mode'..<br>
Test case duration in microseconds = 7921 us<br>
Fail (Detected invalid system allocation callback)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.swapchain.simulate_oom.pre_transform'..<br>
Test case duration in microseconds = 6936 us<br>
Fail (Detected invalid system allocation callback)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.swapchain.simulate_oom.composite_alpha'..<br>
Test case duration in microseconds = 8021 us<br>
Fail (Detected invalid system allocation callback)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.swapchain.simulate_oom.present_mode'..<br>
Test case duration in microseconds = 8615 us<br>
Fail (Detected invalid system allocation callback)<br>
<br>
Test case 'dEQP-VK.wsi.xlib.swapchain.simulate_oom.clipped'..<br>
Test case duration in microseconds = 8362 us<br>
Fail (Detected invalid system allocation callback)<br>
<br>
DONE!<br>
<br>
Test run totals:<br>
Passed: 0/10 (0.0%)<br>
Failed: 10/10 (100.0%)<br>
Not supported: 0/10 (0.0%)<br>
Warnings: 0/10 (0.0%)<br>
<br>
--<br>
<br>
Therefore, although it is marked for the 18.2 stable queue, I'm leaving<br>
it out by now.<br>
<br>
<br>
On Thu, 2018-08-23 at 10:13 -0500, Jason Ekstrand wrote:<br>
> ---<br>
> src/intel/vulkan/anv_device.c | 27 ++++++++++++++++++++-------<br>
> src/intel/vulkan/anv_private.h | 11 ++++++++++-<br>
> 2 files changed, 30 insertions(+), 8 deletions(-)<br>
> <br>
> diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c<br>
> index d85615caaed..0357fc7c0ea 100644<br>
> --- a/src/intel/vulkan/anv_device.c<br>
> +++ b/src/intel/vulkan/anv_device.c<br>
> @@ -610,20 +610,33 @@ VkResult anv_CreateInstance(<br>
> else<br>
> instance->alloc = default_alloc;<br>
> <br>
> - if (pCreateInfo->pApplicationInfo &&<br>
> - pCreateInfo->pApplicationInfo->apiVersion != 0) {<br>
> - instance->apiVersion = pCreateInfo->pApplicationInfo->apiVersion;<br>
> - } else {<br>
> - anv_EnumerateInstanceVersion(&instance->apiVersion);<br>
> + instance->app_info = (struct anv_app_info) { .api_version = 0 };<br>
> + if (pCreateInfo->pApplicationInfo) {<br>
> + const VkApplicationInfo *app = pCreateInfo->pApplicationInfo;<br>
> +<br>
> + instance->app_info.app_name =<br>
> + vk_strdup(&instance->alloc, app->pApplicationName,<br>
> + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);<br>
> + instance->app_info.app_version = app->applicationVersion;<br>
> +<br>
> + instance->app_info.engine_name =<br>
> + vk_strdup(&instance->alloc, app->pEngineName,<br>
> + VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE);<br>
> + instance->app_info.engine_version = app->engineVersion;<br>
> +<br>
> + instance->app_info.api_version = app->apiVersion;<br>
> }<br>
> <br>
> + if (instance->app_info.api_version == 0)<br>
> + anv_EnumerateInstanceVersion(&instance->app_info.api_version);<br>
> +<br>
> instance->enabled_extensions = enabled_extensions;<br>
> <br>
> for (unsigned i = 0; i < ARRAY_SIZE(instance->dispatch.entrypoints); i++) {<br>
> /* Vulkan requires that entrypoints for extensions which have not been<br>
> * enabled must not be advertised.<br>
> */<br>
> - if (!anv_entrypoint_is_enabled(i, instance->apiVersion,<br>
> + if (!anv_entrypoint_is_enabled(i, instance->app_info.api_version,<br>
> &instance->enabled_extensions, NULL)) {<br>
> instance->dispatch.entrypoints[i] = NULL;<br>
> } else if (anv_dispatch_table.entrypoints[i] != NULL) {<br>
> @@ -1496,7 +1509,7 @@ anv_device_init_dispatch(struct anv_device *device)<br>
> /* Vulkan requires that entrypoints for extensions which have not been<br>
> * enabled must not be advertised.<br>
> */<br>
> - if (!anv_entrypoint_is_enabled(i, device->instance->apiVersion,<br>
> + if (!anv_entrypoint_is_enabled(i, device->instance->app_info.api_version,<br>
> &device->instance->enabled_extensions,<br>
> &device->enabled_extensions)) {<br>
> device->dispatch.entrypoints[i] = NULL;<br>
> diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h<br>
> index 2ced8afcabe..5537c8cab57 100644<br>
> --- a/src/intel/vulkan/anv_private.h<br>
> +++ b/src/intel/vulkan/anv_private.h<br>
> @@ -882,12 +882,21 @@ struct anv_physical_device {<br>
> int master_fd;<br>
> };<br>
> <br>
> +struct anv_app_info {<br>
> + const char* app_name;<br>
> + uint32_t app_version;<br>
> + const char* engine_name;<br>
> + uint32_t engine_version;<br>
> + uint32_t api_version;<br>
> +};<br>
> +<br>
> struct anv_instance {<br>
> VK_LOADER_DATA _loader_data;<br>
> <br>
> VkAllocationCallbacks alloc;<br>
> <br>
> - uint32_t apiVersion;<br>
> + struct anv_app_info app_info;<br>
> +<br>
> struct anv_instance_extension_table enabled_extensions;<br>
> struct anv_dispatch_table dispatch;<br>
> <br>
-- <br>
Br,<br>
<br>
Andres<br>
</blockquote></div>