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

Method ConfigGrab

vgpu/render.go:295–310  ·  view source on GitHub ↗

ConfigGrab configures the Grab for copying rendered image back to host memory. Uses format of current Image.

(dev vk.Device)

Source from the content-addressed store, hash-verified

293// ConfigGrab configures the Grab for copying rendered image
294// back to host memory. Uses format of current Image.
295func (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

Callers 1

GrabImageMethod · 0.80

Calls 6

IsActiveMethod · 0.80
SetMultisampleMethod · 0.80
AllocImageMethod · 0.80
SetSizeMethod · 0.65
DefaultsMethod · 0.65
SetFlagMethod · 0.65

Tested by

no test coverage detected