baldurk / renderdoc

RenderDoc is a stand-alone graphics debugging tool.
https://renderdoc.org
MIT License
8.88k stars 1.33k forks source link

Storage buffers not captured if uploaded during previous frames #3372

Closed Vitaljok closed 3 months ago

Vitaljok commented 3 months ago

Description

As suggested in Discord, opening the report here.

The other day I was investigating Vulkan bufferDeviceAddress feature and “vertex pulling” technique (basically followed Vulkan Guide). The results were as expected and application rendered fine on screen. However when I tried to capture frames using Renderdoc, it missed all the geometry.

Further investigation showed, that Renderdoc captures buffers only during the frame they are uploaded. Subsequent frames have buffers filled with zeros.

I have put together minimalistic repo that demonstrates the case: https://github.com/Vitaljok/buffer-device-address-bug

Note: code lacks proper checks, has a lot of hardcoded values.

The essential part in pseudo-code:

uploadBuffers();

while (true) {
    pushConstants(vertexBufferDeviceAddress);
    bindIndexBuffer();
    drawIndexed();
}

Steps to reproduce

The capture for frame 0 has "Copy/Clear Pass" and "Color Pass" properly shows the geometry and buffer contents. Frame 1 has only "Color pass" as expected, but vertex buffer is filled with zeros. Also added my capture files to the root of the repository.

Environment

Zorro666 commented 3 months ago

Thank you for the reproduction. If it helps this problem is specific to v1.33. RenderDoc v1.32 is capturing the storage buffers correctly in your reproduction

Zorro666 commented 3 months ago

Duplicate of #3346

Fixed in a recent nightly build