| 22 | class PositiveThreading : public VkLayerTest {}; |
| 23 | |
| 24 | TEST_F(PositiveThreading, DisplayObjects) { |
| 25 | TEST_DESCRIPTION("Create and use VkDisplayKHR objects with GetPhysicalDeviceDisplayPropertiesKHR in thread-safety."); |
| 26 | |
| 27 | AddRequiredExtensions(VK_KHR_SURFACE_EXTENSION_NAME); |
| 28 | AddRequiredExtensions(VK_KHR_DISPLAY_EXTENSION_NAME); |
| 29 | RETURN_IF_SKIP(Init()); |
| 30 | |
| 31 | uint32_t prop_count = 0; |
| 32 | vk::GetPhysicalDeviceDisplayPropertiesKHR(Gpu(), &prop_count, nullptr); |
| 33 | if (prop_count == 0) { |
| 34 | GTEST_SKIP() << "No VkDisplayKHR properties to query"; |
| 35 | } |
| 36 | |
| 37 | std::vector<VkDisplayPropertiesKHR> display_props{prop_count}; |
| 38 | // Create a VkDisplayKHR object |
| 39 | vk::GetPhysicalDeviceDisplayPropertiesKHR(Gpu(), &prop_count, display_props.data()); |
| 40 | ASSERT_NE(prop_count, 0U); |
| 41 | |
| 42 | // Now use this new object in an API call that thread safety will track |
| 43 | prop_count = 0; |
| 44 | vk::GetDisplayModePropertiesKHR(Gpu(), display_props[0].display, &prop_count, nullptr); |
| 45 | } |
| 46 | |
| 47 | TEST_F(PositiveThreading, DisplayPlaneObjects) { |
| 48 | TEST_DESCRIPTION("Create and use VkDisplayKHR objects with GetPhysicalDeviceDisplayPlanePropertiesKHR in thread-safety."); |
nothing calls this directly
no test coverage detected