Rémi Bernon (@rbernon) commented about dlls/win32u/tests/d3dkmt.c:
+ /* test shared resource handle lifetime */ + if (name) + { + IUnknown *import_d3d11 = NULL, *import_d3d12 = NULL; + struct vulkan_image *img_imp = NULL; + GLuint gl_img = 0; + NTSTATUS status; + + /* On AMD, export-VkDeviceMemory holds shared resource handle */ + if (vulkan_exp && img && + (opengl_imp->broken || winetest_platform_is_wine)) + { + destroy_vulkan_image( vulkan_exp, img ); + img = NULL; + }
vulkan_exp can't be NULL if img isn't, also I don't think we want to silently skip tests on Wine, please add todo_wine instead when necessary. Also, I'm not sure we need to implement vendor-specific differences very closely, if one of the vendor keeps a reference with exported memory and not the other and you want to make sure `handle` is the only reference owner before these tests, lets just close the exported vulkan memory unconditionally before them. ```suggestion:-14+0 /* test shared resource handle lifetime */ if (name) { IUnknown *import_d3d11 = NULL, *import_d3d12 = NULL; struct vulkan_image *img_imp = NULL; GLuint gl_img = 0; NTSTATUS status; /* On AMD, export-VkDeviceMemory holds a reference, make sure to only hold one with handle */ if (img) destroy_vulkan_image( vulkan_exp, img ); img = NULL; ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9526#note_122928