From 244c6d08c5377655292d55e4d5b70a07b2ef227e Mon Sep 17 00:00:00 2001 From: Jon Ashburn Date: Wed, 30 Dec 2015 16:42:50 -0700 Subject: misc: Add pipeline stage flags to wait upon for queueSubmit semaphores; v216 --- demos/cube.c | 3 +++ demos/tri.c | 4 +++- include/vulkan/vulkan.h | 43 ++++++++++++++++++++++--------------------- layers/screenshot.cpp | 1 + 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/demos/cube.c b/demos/cube.c index 46e0446c..be6d8866 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -460,6 +460,7 @@ static void demo_flush_init_cmd(struct demo *demo) .pNext = NULL, .waitSemaphoreCount = 0, .pWaitSemaphores = NULL, + .pWaitDstStageMask = NULL, .commandBufferCount = 1, .pCommandBuffers = cmd_bufs, .signalSemaphoreCount = 0, @@ -705,11 +706,13 @@ static void demo_draw(struct demo *demo) // okay to render to the image. // FIXME/TODO: DEAL WITH VK_IMAGE_LAYOUT_PRESENT_SRC_KHR + VkPipelineStageFlags pipe_stage_flags = VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT; VkSubmitInfo submit_info = { .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, .pNext = NULL, .waitSemaphoreCount = 1, .pWaitSemaphores = &presentCompleteSemaphore, + .pWaitDstStageMask = &pipe_stage_flags, .commandBufferCount = 1, .pCommandBuffers = &demo->buffers[demo->current_buffer].cmd, .signalSemaphoreCount = 0, diff --git a/demos/tri.c b/demos/tri.c index 30a988bd..9a380bb6 100644 --- a/demos/tri.c +++ b/demos/tri.c @@ -283,6 +283,7 @@ static void demo_flush_init_cmd(struct demo *demo) .pNext = NULL, .waitSemaphoreCount = 0, .pWaitSemaphores = NULL, + .pWaitDstStageMask = NULL, .commandBufferCount = 1, .pCommandBuffers = cmd_bufs, .signalSemaphoreCount = 0, @@ -507,12 +508,13 @@ static void demo_draw(struct demo *demo) // FIXME/TODO: DEAL WITH VK_IMAGE_LAYOUT_PRESENT_SRC_KHR demo_draw_build_cmd(demo); VkFence nullFence = VK_NULL_HANDLE; - + VkPipelineStageFlags pipe_stage_flags = VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT; VkSubmitInfo submit_info = { .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, .pNext = NULL, .waitSemaphoreCount = 1, .pWaitSemaphores = &presentCompleteSemaphore, + .pWaitDstStageMask = &pipe_stage_flags, .commandBufferCount = 1, .pCommandBuffers = &demo->draw_cmd, .signalSemaphoreCount = 0, diff --git a/include/vulkan/vulkan.h b/include/vulkan/vulkan.h index 79306c54..85fe96d3 100644 --- a/include/vulkan/vulkan.h +++ b/include/vulkan/vulkan.h @@ -41,7 +41,7 @@ extern "C" { ((major << 22) | (minor << 12) | patch) // Vulkan API version supported by this file -#define VK_API_VERSION VK_MAKE_VERSION(0, 215, 1) +#define VK_API_VERSION VK_MAKE_VERSION(0, 216, 1) #define VK_NULL_HANDLE 0 @@ -852,6 +852,26 @@ typedef enum VkMemoryHeapFlagBits { typedef VkFlags VkMemoryHeapFlags; typedef VkFlags VkDeviceCreateFlags; typedef VkFlags VkDeviceQueueCreateFlags; + +typedef enum VkPipelineStageFlagBits { + VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, + VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, + VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, + VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, + VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, + VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, + VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, + VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, + VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, + VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, + VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, + VK_PIPELINE_STAGE_HOST_BIT = 0x00002000, + VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00004000, + VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00008000, +} VkPipelineStageFlagBits; +typedef VkFlags VkPipelineStageFlags; typedef VkFlags VkMemoryMapFlags; typedef enum VkImageAspectFlagBits { @@ -991,26 +1011,6 @@ typedef enum VkAttachmentDescriptionFlagBits { typedef VkFlags VkAttachmentDescriptionFlags; typedef VkFlags VkSubpassDescriptionFlags; -typedef enum VkPipelineStageFlagBits { - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, - VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, - VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, - VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, - VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, - VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, - VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, - VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, - VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, - VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, - VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, - VK_PIPELINE_STAGE_HOST_BIT = 0x00002000, - VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00004000, - VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00008000, -} VkPipelineStageFlagBits; -typedef VkFlags VkPipelineStageFlags; - typedef enum VkAccessFlagBits { VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001, VK_ACCESS_INDEX_READ_BIT = 0x00000002, @@ -1402,6 +1402,7 @@ typedef struct VkSubmitInfo { const void* pNext; uint32_t waitSemaphoreCount; const VkSemaphore* pWaitSemaphores; + const VkPipelineStageFlags* pWaitDstStageMask; uint32_t commandBufferCount; const VkCommandBuffer* pCommandBuffers; uint32_t signalSemaphoreCount; diff --git a/layers/screenshot.cpp b/layers/screenshot.cpp index fe4b770f..edccb856 100644 --- a/layers/screenshot.cpp +++ b/layers/screenshot.cpp @@ -252,6 +252,7 @@ static void writePPM( const char *filename, VkImage image1) submit_info.pNext = NULL; submit_info.waitSemaphoreCount = 0; submit_info.pWaitSemaphores = NULL; + submit_info.pWaitDstStageMask = NULL; submit_info.commandBufferCount = 1; submit_info.pCommandBuffers = &commandBuffer; submit_info.signalSemaphoreCount = 0; -- cgit v1.2.3