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

Method TransferAllValuesTextures

vgpu/memory.go:617–642  ·  view source on GitHub ↗

TransferAllValuesTextures copies all vals images from host buffer to device memory

(buff *MemBuff)

Source from the content-addressed store, hash-verified

615
616// TransferAllValuesTextures copies all vals images from host buffer to device memory
617func (mm *Memory) TransferAllValuesTextures(buff *MemBuff) {
618 var imgs []*Image
619 vs := &mm.Vars
620 ns := vs.NSets()
621 for si := vs.StartSet(); si < ns; si++ {
622 st := vs.SetMap[si]
623 if st == nil || st.Set == PushSet {
624 continue
625 }
626 for _, vr := range st.Vars {
627 if vr.Role != TextureRole {
628 continue
629 }
630 vals := vr.Values.ActiveValues()
631 for _, vl := range vals {
632 if vl.Texture == nil {
633 continue
634 }
635 imgs = append(imgs, &vl.Texture.Image)
636 }
637 }
638 }
639 if len(imgs) > 0 {
640 mm.TransferTexturesToGPU(buff.Host, imgs...)
641 }
642}
643
644// SyncValuesTextures syncs all changed vals images from host buffer to device memory
645func (mm *Memory) SyncValuesTextures(buff *MemBuff) {

Callers 1

TransferToGPUBuffMethod · 0.95

Calls 4

TransferTexturesToGPUMethod · 0.95
NSetsMethod · 0.80
StartSetMethod · 0.80
ActiveValuesMethod · 0.80

Tested by

no test coverage detected