1 #ifndef _VKTNATIVEOBJECTSUTIL_HPP
2 #define _VKTNATIVEOBJECTSUTIL_HPP
3 /*-------------------------------------------------------------------------
4 * Vulkan Conformance Tests
5 * ------------------------
7 * Copyright (c) 2019 The Khronos Group Inc.
8 * Copyright (c) 2019 Valve Corporation.
10 * Licensed under the Apache License, Version 2.0 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
24 * \brief WSI Native Objects utility class.
25 *//*--------------------------------------------------------------------*/
26 #include "vktTestCase.hpp"
29 #include "vkWsiPlatform.hpp"
31 #include "tcuMaybe.hpp"
32 #include "tcuVectorType.hpp"
43 using Extensions = std::vector<vk::VkExtensionProperties>;
45 NativeObjects (Context& context,
46 const Extensions& supportedExtensions,
47 vk::wsi::Type wsiType,
48 size_t windowCount = 1u,
49 const tcu::Maybe<tcu::UVec2>& initialWindowSize = tcu::nothing<tcu::UVec2>());
51 NativeObjects (NativeObjects&& other);
53 vk::wsi::Display& getDisplay () const;
55 vk::wsi::Window& getWindow (size_t index = 0u) const;
57 static de::MovePtr<vk::wsi::Window> createWindow (const vk::wsi::Display& display, const tcu::Maybe<tcu::UVec2>& initialSize);
59 static de::MovePtr<vk::wsi::Display> createDisplay (const vk::Platform& platform,
60 const Extensions& supportedExtensions,
61 vk::wsi::Type wsiType);
63 de::UniquePtr<vk::wsi::Display> display;
64 std::vector<de::MovePtr<vk::wsi::Window>> windows;
71 #endif // _VKTNATIVEOBJECTSUTIL_HPP