Change unnamed enum VK_ constants to defines and update API
[platform/upstream/VK-GL-CTS.git] / external / vulkancts / framework / vulkan / vkDefs.hpp
index 5034f31..60a8295 100644 (file)
@@ -6,24 +6,17 @@
  *
  * Copyright (c) 2015 Google Inc.
  *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and/or associated documentation files (the
- * "Materials"), to deal in the Materials without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Materials, and to
- * permit persons to whom the Materials are furnished to do so, subject to
- * the following conditions:
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
  *
- * The above copyright notice(s) and this permission notice shall be
- * included in all copies or substantial portions of the Materials.
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  *
  *//*!
  * \file
 #define VK_DEFINE_HANDLE(NAME, TYPE)                                   typedef struct NAME##_s* NAME
 #define VK_DEFINE_NON_DISPATCHABLE_HANDLE(NAME, TYPE)  typedef Handle<TYPE> NAME
 
-#define VK_MAKE_VERSION(MAJOR, MINOR, PATCH)   ((MAJOR << 22) | (MINOR << 12) | PATCH)
-#define VK_BIT(NUM)                                                            (1<<NUM)
+#define VK_DEFINE_PLATFORM_TYPE(NAME, COMPATIBLE)              \
+namespace pt {                                                                                 \
+struct NAME {                                                                                  \
+       COMPATIBLE internal;                                                            \
+       explicit NAME (COMPATIBLE internal_)                            \
+               : internal(internal_) {}                                                \
+};                                                                                                             \
+} // pt
+
+#define VK_MAKE_VERSION(MAJOR, MINOR, PATCH)   (((deUint32)(MAJOR) << 22u) | ((deUint32)(MINOR) << 12u) | (deUint32)(PATCH))
+#define VK_BIT(NUM)                                                            (1u<<(deUint32)(NUM))
 
 #define VK_CHECK(EXPR)                                                 vk::checkResult((EXPR), #EXPR, __FILE__, __LINE__)
 #define VK_CHECK_MSG(EXPR, MSG)                                        vk::checkResult((EXPR), MSG, __FILE__, __LINE__)
@@ -91,23 +93,53 @@ private:
 
 #include "vkBasicTypes.inl"
 
-enum { VK_QUEUE_FAMILY_IGNORED         = 0xffffffff    };
-enum { VK_NO_ATTACHMENT                                = 0xffffffff    };
+namespace wsi
+{
 
-enum
+enum Type
 {
-       VK_FALSE                = 0,
-       VK_TRUE                 = 1,
-       VK_WHOLE_SIZE   = (~0ULL),
+       TYPE_XLIB = 0,
+       TYPE_XCB,
+       TYPE_WAYLAND,
+       TYPE_MIR,
+       TYPE_ANDROID,
+       TYPE_WIN32,
+
+       TYPE_LAST
 };
 
+} // wsi
+
 typedef VKAPI_ATTR void                (VKAPI_CALL* PFN_vkVoidFunction)                                        (void);
 
-typedef VKAPI_ATTR void*       (VKAPI_CALL* PFN_vkAllocationFunction)                          (void* pUserData, size_t size, size_t alignment, VkSystemAllocationScope allocationScope);
-typedef VKAPI_ATTR void*       (VKAPI_CALL* PFN_vkReallocationFunction)                        (void* pUserData, void* pOriginal, size_t size, size_t alignment, VkSystemAllocationScope allocationScope);
-typedef VKAPI_ATTR void                (VKAPI_CALL* PFN_vkFreeFunction)                                        (void* pUserData, void* pMem);
-typedef VKAPI_ATTR void                (VKAPI_CALL* PFN_vkInternalAllocationNotification)      (void* pUserData, size_t size, VkInternalAllocationType allocationType, VkSystemAllocationScope allocationScope);
-typedef VKAPI_ATTR void                (VKAPI_CALL* PFN_vkInternalFreeNotification)            (void* pUserData, size_t size, VkInternalAllocationType allocationType, VkSystemAllocationScope allocationScope);
+typedef VKAPI_ATTR void*       (VKAPI_CALL* PFN_vkAllocationFunction)                          (void*                                          pUserData,
+                                                                                                                                                                size_t                                         size,
+                                                                                                                                                                size_t                                         alignment,
+                                                                                                                                                                VkSystemAllocationScope        allocationScope);
+typedef VKAPI_ATTR void*       (VKAPI_CALL* PFN_vkReallocationFunction)                        (void*                                          pUserData,
+                                                                                                                                                                void*                                          pOriginal,
+                                                                                                                                                                size_t                                         size,
+                                                                                                                                                                size_t                                         alignment,
+                                                                                                                                                                VkSystemAllocationScope        allocationScope);
+typedef VKAPI_ATTR void                (VKAPI_CALL* PFN_vkFreeFunction)                                        (void*                                          pUserData,
+                                                                                                                                                                void*                                          pMem);
+typedef VKAPI_ATTR void                (VKAPI_CALL* PFN_vkInternalAllocationNotification)      (void*                                          pUserData,
+                                                                                                                                                                size_t                                         size,
+                                                                                                                                                                VkInternalAllocationType       allocationType,
+                                                                                                                                                                VkSystemAllocationScope        allocationScope);
+typedef VKAPI_ATTR void                (VKAPI_CALL* PFN_vkInternalFreeNotification)            (void*                                          pUserData,
+                                                                                                                                                                size_t                                         size,
+                                                                                                                                                                VkInternalAllocationType       allocationType,
+                                                                                                                                                                VkSystemAllocationScope        allocationScope);
+
+typedef VKAPI_ATTR VkBool32    (VKAPI_CALL* PFN_vkDebugReportCallbackEXT)                      (VkDebugReportFlagsEXT          flags,
+                                                                                                                                                                VkDebugReportObjectTypeEXT     objectType,
+                                                                                                                                                                deUint64                                       object,
+                                                                                                                                                                size_t                                         location,
+                                                                                                                                                                deInt32                                        messageCode,
+                                                                                                                                                                const char*                            pLayerPrefix,
+                                                                                                                                                                const char*                            pMessage,
+                                                                                                                                                                void*                                          pUserData);
 
 #include "vkStructTypes.inl"