1
0
mirror of https://github.com/fumiama/gozel.git synced 2026-06-09 18:40:28 +08:00

feat(examples): add image_scale (#7)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
fumiama
2026-03-29 17:11:22 +08:00
committed by GitHub
parent 68ca8b5e2e
commit 6522bde914
123 changed files with 1074 additions and 163 deletions

View File

@@ -148,3 +148,31 @@ func (h CommandListHandle) HostSynchronize(timeout uint64) error {
_, err := gozel.ZeCommandListHostSynchronize(gozel.ZeCommandListHandle(h), timeout)
return err
}
// AppendImageCopyFromMemory Copies to an image from device or shared memory.
func (h CommandListHandle) AppendImageCopyFromMemory(
hDstImage ImageHandle, srcptr unsafe.Pointer, pDstRegion *gozel.ZeImageRegion,
hSignalEvent EventHandle, waitEvents ...EventHandle,
) error {
_, err := gozel.ZeCommandListAppendImageCopyFromMemory(
gozel.ZeCommandListHandle(h), gozel.ZeImageHandle(hDstImage), srcptr, pDstRegion,
gozel.ZeEventHandle(hSignalEvent), uint32(len(waitEvents)),
(*gozel.ZeEventHandle)(unsafe.SliceData(waitEvents)),
)
runtime.KeepAlive(waitEvents)
return err
}
// AppendImageCopyToMemory Copies from an image to device or shared memory.
func (h CommandListHandle) AppendImageCopyToMemory(
dstptr unsafe.Pointer, hSrcImage ImageHandle, pSrcRegion *gozel.ZeImageRegion,
hSignalEvent EventHandle, waitEvents ...EventHandle,
) error {
_, err := gozel.ZeCommandListAppendImageCopyToMemory(
gozel.ZeCommandListHandle(h), dstptr, gozel.ZeImageHandle(hSrcImage), pSrcRegion,
gozel.ZeEventHandle(hSignalEvent), uint32(len(waitEvents)),
(*gozel.ZeEventHandle)(unsafe.SliceData(waitEvents)),
)
runtime.KeepAlive(waitEvents)
return err
}