Clone of mesa.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

vk_ext_khr_swapchain.h 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. //
  2. // File: vk_ext_khr_swapchain.h
  3. //
  4. /*
  5. ** Copyright (c) 2015 The Khronos Group Inc.
  6. **
  7. ** Permission is hereby granted, free of charge, to any person obtaining a
  8. ** copy of this software and/or associated documentation files (the
  9. ** "Materials"), to deal in the Materials without restriction, including
  10. ** without limitation the rights to use, copy, modify, merge, publish,
  11. ** distribute, sublicense, and/or sell copies of the Materials, and to
  12. ** permit persons to whom the Materials are furnished to do so, subject to
  13. ** the following conditions:
  14. **
  15. ** The above copyright notice and this permission notice shall be included
  16. ** in all copies or substantial portions of the Materials.
  17. **
  18. ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  19. ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  20. ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  21. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  22. ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  23. ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  24. ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
  25. */
  26. #ifndef __VK_EXT_KHR_SWAPCHAIN_H__
  27. #define __VK_EXT_KHR_SWAPCHAIN_H__
  28. #include "vulkan.h"
  29. #define VK_EXT_KHR_SWAPCHAIN_REVISION 17
  30. #define VK_EXT_KHR_SWAPCHAIN_EXTENSION_NUMBER 1
  31. #define VK_EXT_KHR_SWAPCHAIN_EXTENSION_NAME "VK_EXT_KHR_swapchain"
  32. #ifdef __cplusplus
  33. extern "C"
  34. {
  35. #endif // __cplusplus
  36. // ------------------------------------------------------------------------------------------------
  37. // Objects
  38. // ------------------------------------------------------------------------------------------------
  39. // Enumeration constants
  40. #define VK_EXT_KHR_SWAPCHAIN_ENUM(type,id) ((type)((int)0xc0000000 - VK_EXT_KHR_SWAPCHAIN_EXTENSION_NUMBER * -1024 + (id)))
  41. #define VK_EXT_KHR_SWAPCHAIN_ENUM_POSITIVE(type,id) ((type)((int)0x40000000 + (VK_EXT_KHR_SWAPCHAIN_EXTENSION_NUMBER - 1) * 1024 + (id)))
  42. // Extend VkStructureType enum with extension specific constants
  43. #define VK_STRUCTURE_TYPE_SURFACE_DESCRIPTION_WINDOW_KHR VK_EXT_KHR_SWAPCHAIN_ENUM(VkStructureType, 0)
  44. // ------------------------------------------------------------------------------------------------
  45. // Enumerations
  46. typedef enum {
  47. VK_SURFACE_TRANSFORM_NONE_KHR = 0,
  48. VK_SURFACE_TRANSFORM_ROT90_KHR = 1,
  49. VK_SURFACE_TRANSFORM_ROT180_KHR = 2,
  50. VK_SURFACE_TRANSFORM_ROT270_KHR = 3,
  51. VK_SURFACE_TRANSFORM_HMIRROR_KHR = 4,
  52. VK_SURFACE_TRANSFORM_HMIRROR_ROT90_KHR = 5,
  53. VK_SURFACE_TRANSFORM_HMIRROR_ROT180_KHR = 6,
  54. VK_SURFACE_TRANSFORM_HMIRROR_ROT270_KHR = 7,
  55. VK_SURFACE_TRANSFORM_INHERIT_KHR = 8,
  56. } VkSurfaceTransformKHR;
  57. typedef enum {
  58. VK_SURFACE_TRANSFORM_NONE_BIT_KHR = 0x00000001,
  59. VK_SURFACE_TRANSFORM_ROT90_BIT_KHR = 0x00000002,
  60. VK_SURFACE_TRANSFORM_ROT180_BIT_KHR = 0x00000004,
  61. VK_SURFACE_TRANSFORM_ROT270_BIT_KHR = 0x00000008,
  62. VK_SURFACE_TRANSFORM_HMIRROR_BIT_KHR = 0x00000010,
  63. VK_SURFACE_TRANSFORM_HMIRROR_ROT90_BIT_KHR = 0x00000020,
  64. VK_SURFACE_TRANSFORM_HMIRROR_ROT180_BIT_KHR = 0x00000040,
  65. VK_SURFACE_TRANSFORM_HMIRROR_ROT270_BIT_KHR = 0x00000080,
  66. VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
  67. } VkSurfaceTransformFlagBitsKHR;
  68. typedef VkFlags VkSurfaceTransformFlagsKHR;
  69. typedef enum {
  70. VK_PLATFORM_WIN32_KHR = 0,
  71. VK_PLATFORM_X11_KHR = 1,
  72. VK_PLATFORM_XCB_KHR = 2,
  73. VK_PLATFORM_ANDROID_KHR = 3,
  74. VK_PLATFORM_WAYLAND_KHR = 4,
  75. VK_PLATFORM_MIR_KHR = 5,
  76. VK_PLATFORM_BEGIN_RANGE_KHR = VK_PLATFORM_WIN32_KHR,
  77. VK_PLATFORM_END_RANGE_KHR = VK_PLATFORM_MIR_KHR,
  78. VK_PLATFORM_NUM_KHR = (VK_PLATFORM_MIR_KHR - VK_PLATFORM_WIN32_KHR + 1),
  79. VK_PLATFORM_MAX_ENUM_KHR = 0x7FFFFFFF
  80. } VkPlatformKHR;
  81. // ------------------------------------------------------------------------------------------------
  82. // Flags
  83. // ------------------------------------------------------------------------------------------------
  84. // Structures
  85. // Placeholder structure header for the different types of surface description structures
  86. typedef struct {
  87. VkStructureType sType; // Can be any of the VK_STRUCTURE_TYPE_SURFACE_DESCRIPTION_XXX_KHR constants
  88. const void* pNext; // Pointer to next structure
  89. } VkSurfaceDescriptionKHR;
  90. // Surface description structure for a native platform window surface
  91. typedef struct {
  92. VkStructureType sType; // Must be VK_STRUCTURE_TYPE_SURFACE_DESCRIPTION_WINDOW_KHR
  93. const void* pNext; // Pointer to next structure
  94. VkPlatformKHR platform; // e.g. VK_PLATFORM_*_KHR
  95. void* pPlatformHandle;
  96. void* pPlatformWindow;
  97. } VkSurfaceDescriptionWindowKHR;
  98. // pPlatformHandle points to this struct when platform is VK_PLATFORM_X11_KHR
  99. #ifdef _X11_XLIB_H_
  100. typedef struct {
  101. Display* dpy; // Display connection to an X server
  102. Window root; // To identify the X screen
  103. } VkPlatformHandleX11KHR;
  104. #endif /* _X11_XLIB_H_ */
  105. // pPlatformHandle points to this struct when platform is VK_PLATFORM_XCB_KHR
  106. #ifdef __XCB_H__
  107. typedef struct {
  108. xcb_connection_t* connection; // XCB connection to an X server
  109. xcb_window_t root; // To identify the X screen
  110. } VkPlatformHandleXcbKHR;
  111. #endif /* __XCB_H__ */
  112. // ------------------------------------------------------------------------------------------------
  113. // Function types
  114. typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceSurfaceSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, const VkSurfaceDescriptionKHR* pSurfaceDescription, VkBool32* pSupported);
  115. // ------------------------------------------------------------------------------------------------
  116. // Function prototypes
  117. #ifdef VK_PROTOTYPES
  118. VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceSupportKHR(
  119. VkPhysicalDevice physicalDevice,
  120. uint32_t queueFamilyIndex,
  121. const VkSurfaceDescriptionKHR* pSurfaceDescription,
  122. VkBool32* pSupported);
  123. #endif // VK_PROTOTYPES
  124. #ifdef __cplusplus
  125. } // extern "C"
  126. #endif // __cplusplus
  127. #endif // __VK_EXT_KHR_SWAPCHAIN_H__