TransferAllValuesTextures copies all vals images from host buffer to device memory
(buff *MemBuff)
| 615 | |
| 616 | // TransferAllValuesTextures copies all vals images from host buffer to device memory |
| 617 | func (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 |
| 645 | func (mm *Memory) SyncValuesTextures(buff *MemBuff) { |
no test coverage detected