MCPcopy Create free account
hub / github.com/cogentcore/core / ConfigGrabDepth

Method ConfigGrabDepth

vgpu/render.go:319–330  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

317// ConfigGrabDepth configures the GrabDepth for copying depth image
318// back to host memory. Uses format of current Depth image.
319func (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.

Callers 1

GrabDepthImageMethod · 0.95

Calls 2

FreeMethod · 0.45
AllocHostMethod · 0.45

Tested by

no test coverage detected