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

Method SyncToGPUBuff

vgpu/memory.go:291–308  ·  view source on GitHub ↗

SyncToGPUBuff syncs all modified Value regions from CPU to GPU device memory, for given buff

(bt BuffTypes)

Source from the content-addressed store, hash-verified

289
290// SyncToGPUBuff syncs all modified Value regions from CPU to GPU device memory, for given buff
291func (mm *Memory) SyncToGPUBuff(bt BuffTypes) {
292 switch bt {
293 case StorageBuff:
294 for i, stb := range mm.StorageBuffs {
295 mods := mm.Vars.ModRegsStorage(i, stb)
296 if len(mods) > 0 {
297 mm.TransferRegsToGPU(mods)
298 }
299 }
300 case TextureBuff:
301 mm.SyncValuesTextures(mm.Buffs[bt])
302 default:
303 mods := mm.Vars.ModRegs(bt)
304 if len(mods) > 0 {
305 mm.TransferRegsToGPU(mods)
306 }
307 }
308}
309
310// SyncRegionValueName returns memory region for syncing given value
311// from GPU device memory to CPU host memory,

Callers 1

SyncToGPUMethod · 0.95

Calls 4

TransferRegsToGPUMethod · 0.95
SyncValuesTexturesMethod · 0.95
ModRegsStorageMethod · 0.80
ModRegsMethod · 0.45

Tested by

no test coverage detected