Raikiri / LegitEngine

A rendergraph-based graphical framework for Vulkan
MIT License
657 stars 28 forks source link

Possible buffer usage bug (may affect synchronization) #7

Closed Panzerschrek closed 7 months ago

Panzerschrek commented 7 months ago

See RenderGraph.hpp, line 1010.

            for (auto srcBufferProxy : transferPassDesc.srcBufferProxies)
            {
              auto storageBuffer = GetResolvedBuffer(taskIndex, srcBufferProxy);
              AddBufferBarriers(storageBuffer, BufferUsageTypes::TransferSrc, taskIndex, srcStage, dstStage, bufferBarriers);
            }

            for (auto dstBufferProxy : transferPassDesc.dstBufferProxies)
            {
              auto storageBuffer = GetResolvedBuffer(taskIndex, dstBufferProxy);
              AddBufferBarriers(storageBuffer, BufferUsageTypes::TransferSrc, taskIndex, srcStage, dstStage, bufferBarriers);
            }

I assume BufferUsageTypes::TransferDst should be used in the second AddBufferBarriers.

Raikiri commented 7 months ago

Hmm... I wonder how come I never got a validation error here. Definitely a bug, thanks. Will be fixed once I finally decide to update this repo (I have 4 years worth of local changes that I never bothered to push here).