3 /*-------------------------------------------------------------------------
7 * Copyright (c) 2016 Google Inc.
9 * Licensed under the Apache License, Version 2.0 (the "License");
10 * you may not use this file except in compliance with the License.
11 * You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing, software
16 * distributed under the License is distributed on an "AS IS" BASIS,
17 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 * See the License for the specific language governing permissions and
19 * limitations under the License.
23 * \brief Windowing System Integration (WSI) Utilities.
24 *//*--------------------------------------------------------------------*/
27 #include "vkWsiPlatform.hpp"
37 struct PlatformProperties
41 FEATURE_INITIAL_WINDOW_SIZE = (1<<0), //!< Platform honors initial window size request
42 FEATURE_RESIZE_WINDOW = (1<<1), //!< Platform supports resizing window
47 SWAPCHAIN_EXTENT_MUST_MATCH_WINDOW_SIZE = 0, //!< Swapchain extent must match window size
48 SWAPCHAIN_EXTENT_SETS_WINDOW_SIZE, //!< Window will be resized to swapchain size when first image is presented
49 SWAPCHAIN_EXTENT_SCALED_TO_WINDOW_SIZE, //!< Presented image contents will be scaled to window size
55 SwapchainExtent swapchainExtent;
57 deUint32 maxWindowsPerDisplay;
60 const char* getName (Type wsiType);
61 const char* getExtensionName (Type wsiType);
63 const PlatformProperties& getPlatformProperties (Type wsiType);
65 VkResult createSurface (const InstanceInterface& vki,
68 const Display& nativeDisplay,
69 const Window& nativeWindow,
70 const VkAllocationCallbacks* pAllocator,
71 VkSurfaceKHR* pSurface);
73 Move<VkSurfaceKHR> createSurface (const InstanceInterface& vki,
76 const Display& nativeDisplay,
77 const Window& nativeWindow,
78 const VkAllocationCallbacks* pAllocator = DE_NULL);
80 VkBool32 getPhysicalDeviceSurfaceSupport (const InstanceInterface& vki,
81 VkPhysicalDevice physicalDevice,
82 deUint32 queueFamilyIndex,
83 VkSurfaceKHR surface);
85 VkSurfaceCapabilitiesKHR getPhysicalDeviceSurfaceCapabilities (const InstanceInterface& vki,
86 VkPhysicalDevice physicalDevice,
87 VkSurfaceKHR surface);
89 std::vector<VkSurfaceFormatKHR> getPhysicalDeviceSurfaceFormats (const InstanceInterface& vki,
90 VkPhysicalDevice physicalDevice,
91 VkSurfaceKHR surface);
93 std::vector<VkPresentModeKHR> getPhysicalDeviceSurfacePresentModes (const InstanceInterface& vki,
94 VkPhysicalDevice physicalDevice,
95 VkSurfaceKHR surface);
97 std::vector<VkImage> getSwapchainImages (const DeviceInterface& vkd,
99 VkSwapchainKHR swapchain);
104 #endif // _VKWSIUTIL_HPP