From: Jason Ekstrand Date: Wed, 8 Jul 2015 17:53:32 +0000 (-0700) Subject: vk/vulkan.h: Add command buffer levels X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e19d6be2a93104762bf5840456a695f708c56a57;p=mesa.git vk/vulkan.h: Add command buffer levels --- diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index 8d4c6a15250..b8e2b687bd0 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -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; diff --git a/src/vulkan/device.c b/src/vulkan/device.c index ebd04e205b5..38d922767bb 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -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)