Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to read from CpuBufferPool/CpuBufferPoolChunk #867

Closed
Lukazoid opened this issue Oct 15, 2017 · 2 comments · Fixed by #2127
Closed

How to read from CpuBufferPool/CpuBufferPoolChunk #867

Lukazoid opened this issue Oct 15, 2017 · 2 comments · Fixed by #2127

Comments

@Lukazoid
Copy link

Lukazoid commented Oct 15, 2017

I am currently using a compute shader to write to a buffer, I was previously using a CpuAccessibleBuffer but from the documentation this may be removed from Vulkano in future so I am moving to using a CpuBufferPool.

I have a problem though, I cannot see any API methods which would allow me to read the data back out of the CpuBufferPoolChunk.

The documentation implies that reading from the CpuBufferPool on the CPU should be possible:

if a buffer is under constant access by the GPU but you need to read its content on the CPU from time to time, it may be a good idea to use a DeviceLocalBuffer as the main buffer and a CpuBufferPool for when you need to read it. Then whenever you need to read the main buffer, ask the GPU to copy from the device-local buffer to the CPU buffer pool, and read the CPU buffer pool instead.

@tomaka
Copy link
Member

tomaka commented Oct 16, 2017

That's unfortunately not implemented yet, because it's not trivial.

@nabajour
Copy link

Hi, any update on this question? I'm learning rust and vulkan and am trying to do exactly what the doc suggests: copy a DeviceLocalBuffer to a CpuBufferPool and download this one to the CPU to check my data. But I'm not sure how to do it.
All examples seem to be doing the opposite: allocate data in a CpuBufferPool by copying a cpu array and copy it to the device and use it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants