ConfigGrab configures the Grab for copying rendered image back to host memory. Uses format of current Image.
(dev vk.Device)
| 293 | // ConfigGrab configures the Grab for copying rendered image |
| 294 | // back to host memory. Uses format of current Image. |
| 295 | func (rp *Render) ConfigGrab(dev vk.Device) { |
| 296 | if rp.Grab.IsActive() { |
| 297 | if rp.Grab.Format.Size == rp.Format.Size { |
| 298 | return |
| 299 | } |
| 300 | rp.Grab.SetSize(rp.Format.Size) |
| 301 | return |
| 302 | } |
| 303 | rp.Grab.Format.Defaults() |
| 304 | rp.Grab.Format = rp.Format |
| 305 | rp.Grab.Format.SetMultisample(1) // can't have for grabs |
| 306 | rp.Grab.SetFlag(true, ImageOnHostOnly) |
| 307 | rp.Grab.Dev = dev |
| 308 | rp.Grab.GPU = rp.Sys.GPU |
| 309 | rp.Grab.AllocImage() |
| 310 | } |
| 311 | |
| 312 | // https://www.reddit.com/r/vulkan/comments/7yhvep/retrieve_depth_attachment_from_framebuffer/ |
| 313 | // https://pastebin.com/33MxSNmh |
no test coverage detected