I get occasional flickers in my renderer where part of the scene disappears for an instant. This should not happen, ever. I think it is due to memory being used as it is being written to.
I have data being uploaded in a few buffers and then accessed for indirect drawing instructions, vertex and index data, and object matrices. My memory barriers are set up with the following values:
memoryBarrier.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; memoryBarrier.dstAccessMask = VK_ACCESS_INDIRECT_COMMAND_READ_BIT | VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT; memoryBarriers.push_back(memoryBarrier);
And then they are submitted like this:
vkCmdPipelineBarrier(commandbuffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT | VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | VK_PIPELINE_STAGE_VERTEX_INPUT_BIT, 0, 0, nullptr, memoryBarriers.size(), memoryBarriers.data(), 0, nullptr);
Am I missing a mask or other value I need to add to make these work correctly?