SyncValuesTextures syncs all changed vals images from host buffer to device memory
(buff *MemBuff)
| 643 | |
| 644 | // SyncValuesTextures syncs all changed vals images from host buffer to device memory |
| 645 | func (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 | } |
no test coverage detected