layers:Validate bufferMemoryBarrierCount
authorTobin Ehlis <tobine@google.com>
Wed, 19 Jul 2017 16:41:29 +0000 (10:41 -0600)
committerTobin Ehlis <tobine@google.com>
Wed, 19 Jul 2017 21:25:08 +0000 (15:25 -0600)
This is VU VALIDATION_ERROR_1b800934.
For a barrier in renderPass, bufferMemoryBarrierCount must be zero.

layers/core_validation.cpp
layers/vk_validation_error_database.txt

index af91ef4cc2f236f3657d963f8b8043353beec90e..7c812082bb242e93d18bb93e3757fbffc98895cc 100644 (file)
@@ -6160,8 +6160,8 @@ static VkPipelineStageFlags ExpandPipelineStageFlags(VkPipelineStageFlags inflag
 static bool ValidateRenderPassPipelineBarriers(layer_data *device_data, const char *funcName, GLOBAL_CB_NODE const *cb_state,
                                                VkPipelineStageFlags src_stage_mask, VkPipelineStageFlags dst_stage_mask,
                                                VkDependencyFlags dependency_flags, uint32_t mem_barrier_count,
-                                               const VkMemoryBarrier *mem_barriers, uint32_t bufferBarrierCount,
-                                               const VkBufferMemoryBarrier *pBufferMemBarriers, uint32_t imageMemBarrierCount,
+                                               const VkMemoryBarrier *mem_barriers, uint32_t buffer_mem_barrier_count,
+                                               const VkBufferMemoryBarrier *pBufferMemBarriers, uint32_t image_mem_barrier_count,
                                                const VkImageMemoryBarrier *pImageMemBarriers) {
     bool skip = false;
     auto rp_state = cb_state->activeRenderPass;
@@ -6197,6 +6197,14 @@ static bool ValidateRenderPassPipelineBarriers(layer_data *device_data, const ch
         }
         const auto &sub_src_access_mask = sub_dep.srcAccessMask;
         const auto &sub_dst_access_mask = sub_dep.dstAccessMask;
+        if (0 != buffer_mem_barrier_count) {
+            skip |= log_msg(device_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT,
+                            rp_handle, __LINE__, VALIDATION_ERROR_1b800934, "CORE",
+                            "%s: bufferMemoryBarrierCount is non-zero (%d) for "
+                            "subpass %d of renderPass 0x%" PRIx64 ". %s",
+                            funcName, buffer_mem_barrier_count, cb_state->activeSubpass, rp_handle,
+                            validation_error_map[VALIDATION_ERROR_1b800934]);
+        }
         for (uint32_t i = 0; i < mem_barrier_count; ++i) {
             const auto &mb_src_access_mask = mem_barriers[i].srcAccessMask;
             if (mb_src_access_mask != (sub_src_access_mask & mb_src_access_mask)) {
index b7613f59a96639d29f33e7f691c93139f11a9383..4ebdd8c4bfa2b4944f6bca6a8eb9083206bd5f08 100644 (file)
@@ -2111,7 +2111,7 @@ VALIDATION_ERROR_1b80092c~^~Y~^~RenderPassBarrierConflicts~^~vkCmdPipelineBarrie
 VALIDATION_ERROR_1b80092e~^~Y~^~RenderPassBarrierConflicts~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-srcAccessMask-01175~^~core~^~The spec valid usage text states 'If vkCmdPipelineBarrier is called within a render pass instance, the srcAccessMask of any element of pMemoryBarriers or pImageMemoryBarriers must contain a subset of the bit values the srcAccessMask member of that instance of VkSubpassDependency' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-srcAccessMask-01175)~^~
 VALIDATION_ERROR_1b800930~^~Y~^~RenderPassBarrierConflicts~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-dstAccessMask-01176~^~core~^~The spec valid usage text states 'If vkCmdPipelineBarrier is called within a render pass instance, the dstAccessMask of any element of pMemoryBarriers or pImageMemoryBarriers must contain a subset of the bit values the dstAccessMask member of that instance of VkSubpassDependency' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-dstAccessMask-01176)~^~
 VALIDATION_ERROR_1b800932~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-dependencyFlags-01177~^~core~^~The spec valid usage text states 'If vkCmdPipelineBarrier is called within a render pass instance, dependencyFlags must be equal to the dependencyFlags member of that instance of VkSubpassDependency' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-dependencyFlags-01177)~^~
-VALIDATION_ERROR_1b800934~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-bufferMemoryBarrierCount-01178~^~core~^~The spec valid usage text states 'If vkCmdPipelineBarrier is called within a render pass instance, bufferMemoryBarrierCount must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-bufferMemoryBarrierCount-01178)~^~
+VALIDATION_ERROR_1b800934~^~Y~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-bufferMemoryBarrierCount-01178~^~core~^~The spec valid usage text states 'If vkCmdPipelineBarrier is called within a render pass instance, bufferMemoryBarrierCount must be 0' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-bufferMemoryBarrierCount-01178)~^~
 VALIDATION_ERROR_1b800936~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-image-01179~^~core~^~The spec valid usage text states 'If vkCmdPipelineBarrier is called within a render pass instance, the image member of any element of pImageMemoryBarriers must be equal to one of the elements of pAttachments that the current framebuffer was created with, that is also referred to by one of the elements of the pColorAttachments, pResolveAttachments or pDepthStencilAttachment members of the VkSubpassDescription instance that the current subpass was created with' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-image-01179)~^~
 VALIDATION_ERROR_1b800938~^~N~^~Unknown~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-oldLayout-01180~^~core~^~The spec valid usage text states 'If vkCmdPipelineBarrier is called within a render pass instance, the oldLayout and newLayout members of any element of pImageMemoryBarriers must be equal to the layout member of an element of the pColorAttachments, pResolveAttachments or pDepthStencilAttachment members of the VkSubpassDescription instance that the current subpass was created with, that refers to the same image' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-oldLayout-01180)~^~
 VALIDATION_ERROR_1b80093a~^~Y~^~InvalidBarriers~^~vkCmdPipelineBarrier~^~VUID-vkCmdPipelineBarrier-oldLayout-01181~^~core~^~The spec valid usage text states 'If vkCmdPipelineBarrier is called within a render pass instance, the oldLayout and newLayout members of an element of pImageMemoryBarriers must be equal' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-vkCmdPipelineBarrier-oldLayout-01181)~^~