vk/vulkan.h: Add command buffer levels
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 8 Jul 2015 17:53:32 +0000 (10:53 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 8 Jul 2015 17:53:32 +0000 (10:53 -0700)
include/vulkan/vulkan.h
src/vulkan/device.c

index 8d4c6a15250150964486d7750d41fb2cf2706e4a..b8e2b687bd007004e8a74314ecc495ceaa654d38 100644 (file)
@@ -818,6 +818,15 @@ typedef enum {
     VK_ATTACHMENT_STORE_OP_MAX_ENUM = 0x7FFFFFFF
 } VkAttachmentStoreOp;
 
+typedef enum {
+    VK_CMD_BUFFER_LEVEL_PRIMARY = 0,
+    VK_CMD_BUFFER_LEVEL_SECONDARY = 1,
+    VK_CMD_BUFFER_LEVEL_BEGIN_RANGE = VK_CMD_BUFFER_LEVEL_PRIMARY,
+    VK_CMD_BUFFER_LEVEL_END_RANGE = VK_CMD_BUFFER_LEVEL_SECONDARY,
+    VK_CMD_BUFFER_LEVEL_NUM = (VK_CMD_BUFFER_LEVEL_SECONDARY - VK_CMD_BUFFER_LEVEL_PRIMARY + 1),
+    VK_CMD_BUFFER_LEVEL_MAX_ENUM = 0x7FFFFFFF
+} VkCmdBufferLevel;
+
 typedef enum {
     VK_PIPELINE_BIND_POINT_COMPUTE = 0,
     VK_PIPELINE_BIND_POINT_GRAPHICS = 1,
@@ -1029,6 +1038,7 @@ typedef enum {
     VK_CMD_BUFFER_OPTIMIZE_PIPELINE_SWITCH_BIT = 0x00000002,
     VK_CMD_BUFFER_OPTIMIZE_ONE_TIME_SUBMIT_BIT = 0x00000004,
     VK_CMD_BUFFER_OPTIMIZE_DESCRIPTOR_SET_SWITCH_BIT = 0x00000008,
+    VK_CMD_BUFFER_OPTIMIZE_NO_SIMULTANEOUS_USE_BIT = 0x00000010,
 } VkCmdBufferOptimizeFlagBits;
 typedef VkFlags VkCmdBufferOptimizeFlags;
 
@@ -1680,6 +1690,7 @@ typedef struct {
     VkStructureType                             sType;
     const void*                                 pNext;
     uint32_t                                    queueNodeIndex;
+    VkCmdBufferLevel                            level;
     VkCmdBufferCreateFlags                      flags;
 } VkCmdBufferCreateInfo;
 
index ebd04e205b58d8f5e53a6df68662506626d71ba6..38d922767bbac8a16bbb890f2df1723531651bfb 100644 (file)
@@ -2155,6 +2155,8 @@ VkResult anv_CreateCommandBuffer(
    struct anv_cmd_buffer *cmd_buffer;
    VkResult result;
 
+   assert(pCreateInfo->level == VK_CMD_BUFFER_LEVEL_PRIMARY);
+
    cmd_buffer = anv_device_alloc(device, sizeof(*cmd_buffer), 8,
                                  VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
    if (cmd_buffer == NULL)