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

Method SyncValuesTextures

vgpu/memory.go:645–671  ·  view source on GitHub ↗

SyncValuesTextures syncs all changed vals images from host buffer to device memory

(buff *MemBuff)

Source from the content-addressed store, hash-verified

643
644// SyncValuesTextures syncs all changed vals images from host buffer to device memory
645func (mm *Memory) SyncValuesTextures(buff *MemBuff) {
646 var imgs []*Image
647 vs := &mm.Vars
648 ns := vs.NSets()
649 for si := vs.StartSet(); si < ns; si++ {
650 st := vs.SetMap[si]
651 if st == nil || st.Set == PushSet {
652 continue
653 }
654 for _, vr := range st.Vars {
655 if vr.Role != TextureRole {
656 continue
657 }
658 vals := vr.Values.ActiveValues()
659 for _, vl := range vals {
660 if vl.Texture == nil || !vl.IsMod() {
661 continue
662 }
663 imgs = append(imgs, &vl.Texture.Image)
664 vl.ClearMod()
665 }
666 }
667 }
668 if len(imgs) > 0 {
669 mm.TransferTexturesToGPU(buff.Host, imgs...)
670 }
671}

Callers 1

SyncToGPUBuffMethod · 0.95

Calls 6

TransferTexturesToGPUMethod · 0.95
NSetsMethod · 0.80
StartSetMethod · 0.80
ActiveValuesMethod · 0.80
IsModMethod · 0.80
ClearModMethod · 0.80

Tested by

no test coverage detected