Commit 262e4ab9 authored by Georg Lehmann's avatar Georg Lehmann Committed by Alexandre Julliard

vulkan-1: Add test for VK_EXT_private_data.

parent 380b7f28
......@@ -387,6 +387,56 @@ static void test_unsupported_device_extensions(VkPhysicalDevice vk_physical_devi
}
}
static void test_private_data(VkPhysicalDevice vk_physical_device)
{
PFN_vkDestroyPrivateDataSlotEXT pfn_vkDestroyPrivateDataSlotEXT;
PFN_vkCreatePrivateDataSlotEXT pfn_vkCreatePrivateDataSlotEXT;
VkPrivateDataSlotCreateInfoEXT data_create_info;
PFN_vkGetPrivateDataEXT pfn_vkGetPrivateDataEXT;
PFN_vkSetPrivateDataEXT pfn_vkSetPrivateDataEXT;
VkPrivateDataSlotEXT data_slot;
VkDevice vk_device;
uint64_t data;
VkResult vr;
static const uint64_t data_value = 0x70AD;
static const char *ext_name = "VK_EXT_private_data";
if ((vr = create_device(vk_physical_device, 1, &ext_name, NULL, &vk_device)) < 0)
{
skip("Failed to create device with VK_EXT_private_data, VkResult %d.\n", vr);
return;
}
pfn_vkDestroyPrivateDataSlotEXT =
(void*) vkGetDeviceProcAddr(vk_device, "vkDestroyPrivateDataSlotEXT");
pfn_vkCreatePrivateDataSlotEXT =
(void*) vkGetDeviceProcAddr(vk_device, "vkCreatePrivateDataSlotEXT");
pfn_vkGetPrivateDataEXT =
(void*) vkGetDeviceProcAddr(vk_device, "vkGetPrivateDataEXT");
pfn_vkSetPrivateDataEXT =
(void*) vkGetDeviceProcAddr(vk_device, "vkSetPrivateDataEXT");
data_create_info.sType = VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT;
data_create_info.pNext = NULL;
data_create_info.flags = 0;
vr = pfn_vkCreatePrivateDataSlotEXT(vk_device, &data_create_info, NULL, &data_slot);
ok(vr == VK_SUCCESS, "Failed to create private data slot, VkResult %d.\n", vr);
vr = pfn_vkSetPrivateDataEXT(vk_device, VK_OBJECT_TYPE_DEVICE,
(uint64_t) (uintptr_t) vk_device, data_slot, data_value);
ok(vr == VK_SUCCESS, "Failed to set private data, VkResult %d.\n", vr);
pfn_vkGetPrivateDataEXT(vk_device, VK_OBJECT_TYPE_DEVICE,
(uint64_t) (uintptr_t) vk_device, data_slot, &data);
ok(data == data_value, "Got unexpected private data, %s.\n",
wine_dbgstr_longlong(data));
pfn_vkDestroyPrivateDataSlotEXT(vk_device, data_slot, NULL);
vkDestroyDevice(vk_device, NULL);
}
static void for_each_device(void (*test_func)(VkPhysicalDevice))
{
VkPhysicalDevice *vk_physical_devices;
......@@ -430,4 +480,5 @@ START_TEST(vulkan)
for_each_device(test_destroy_command_pool);
test_unsupported_instance_extensions();
for_each_device(test_unsupported_device_extensions);
for_each_device(test_private_data);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment