buffer_barriers.reserve(buffer_accesses.size());
for(BufferAccess &b: buffer_accesses)
{
+ if(b.pending_write==b.was_written)
+ continue;
+
buffer_barriers.emplace_back(VkBufferMemoryBarrier{ });
VkBufferMemoryBarrier &barrier = buffer_barriers.back();
image_barriers.reserve(image_accesses.size());
for(const ImageAccess &i: image_accesses)
{
+ if(i.pending_layout==i.current_layout)
+ continue;
+
image_barriers.emplace_back(VkImageMemoryBarrier{ });
VkImageMemoryBarrier &barrier = image_barriers.back();
dst_stage |= (is_write_layout(i.pending_layout) ? image_write_stages : image_read_stages);
}
+ if(buffer_barriers.empty() && image_barriers.empty())
+ return;
+
if(!src_stage)
src_stage = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT;
if(!dst_stage)