https://www.reddit.com/r/vulkan/comments/7yhvep/retrieve_depth_attachment_from_framebuffer/ https://pastebin.com/33MxSNmh have to copy to a buffer then sync that back down create the buffer as the GrabDepth item ConfigGrabDepth configures the GrabDepth for copying depth image back to host memory. U
(dev vk.Device)
| 317 | // ConfigGrabDepth configures the GrabDepth for copying depth image |
| 318 | // back to host memory. Uses format of current Depth image. |
| 319 | func (rp *Render) ConfigGrabDepth(dev vk.Device) { |
| 320 | bsz := rp.Format.Size.X * rp.Format.Size.Y * 4 // 32 bit = 4 bytes per pixel |
| 321 | if rp.GrabDepth.Active { |
| 322 | if rp.GrabDepth.Size == bsz { |
| 323 | return |
| 324 | } |
| 325 | rp.GrabDepth.Free(dev) |
| 326 | } |
| 327 | rp.GrabDepth.GPU = rp.Sys.GPU |
| 328 | rp.GrabDepth.Type = StorageBuff |
| 329 | rp.GrabDepth.AllocHost(dev, bsz) |
| 330 | } |
| 331 | |
| 332 | // GrabDepthImage grabs the current render depth image, using given command buffer |
| 333 | // which must have the cmdBegin called already. Uses the GrabDepth Storage Buffer. |
no test coverage detected