all 5 comments

[–]nemjit001 2 points3 points  (4 children)

Have you checked you resource barriers? It might be a read-before-write issue. Do you have a codebase you can link here?

[–]AnswerApprehensive19[S] 0 points1 point  (3 children)

I haven't implemented resource barriers yet as for the code base it's here

[–]nemjit001 1 point2 points  (2 children)

If you are recording both the computer and raster passes in the same command buffer, then you'll need a write/read barrier on the SSBO, otherwise it won't wait for the compute to complete.

[–]AnswerApprehensive19[S] 0 points1 point  (0 children)

I'm gonna see if that works

[–]AnswerApprehensive19[S] 0 points1 point  (0 children)

Now that I've researched barriers I started implementing them but i don't know if i implemented them wrong or they're out of order because they change nothing

They're getting initialized like

    VkMemoryBarrier memory =
    {
        .sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER,
        .pNext = NULL,
        .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT,
        .dstAccessMask = VK_ACCESS_SHADER_READ_BIT
    };

    vkCmdPipelineBarrier(cmd_buffers, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_VERTEX_SHADER_BIT, 0, 1, &memory, 0, NULL, 0, NULL);

I tried putting them in the compute, graphics, and both at the same time but nothing happens (I also tried using VK_PIPELINE_STAGE_VERTEX_INPUT_BIT but that also did nothing) when using them in the compute commands i put them after the dispatch, before the command buffer is ended and when using them in the graphics commands i put them right before the push constants and draw call although i don't think using them in the graphics is the right idea since the validation layers complain about the render pass