I've encountered a problem when resizing the window that the WGPU Validator complains the Texture didn't release properly.
But it turns out the Texture hadn't given to me in this case. I think the wrapper library takes responsibility to release the texture.
2026/09/22 21:20:37 INFO Window resize hwnd=461548 width=1125 height=612
2026/09/22 21:20:37 INFO Window resize hwnd=461548 width=1012 height=601
2026/09/22 21:20:37 INFO Window resize hwnd=461548 width=816 height=568
2026/09/22 21:20:37 INFO Window resize hwnd=461548 width=705 height=542
2026/09/22 21:20:37 INFO Window resize hwnd=461548 width=451 height=468
2026/09/22 21:20:37 INFO Window resize hwnd=461548 width=316 height=420
2026/09/22 21:20:37 INFO Window resize hwnd=461548 width=120 height=341
2026/09/22 21:20:37 INFO Window resize hwnd=461548 width=120 height=293
2026/09/22 21:20:37 INFO Window resize hwnd=461548 width=120 height=188
2026/09/22 21:20:37 INFO Window resize hwnd=461548 width=120 height=140
2026/09/22 21:20:37 ERROR Failed to get current texture of surface surface=1327791530976 err="wgpu: Surface.GetCurrentTexture: failed to get surface texture"
thread '<unnamed>' (13936) panicked at src\lib.rs:605:5:
Error in wgpuSurfaceGetCurrentTexture: Validation Error
Caused by:
Surface image is already acquired
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Exception 0xe06d7363 0x19930520 0x44bdff5a8 0x7ffe60ba41ca
PC=0x7ffe60ba41ca
runtime.cgocall(0x7ff7a8c217c0, 0x155f8f980358)
C:/Program Files/Go/src/runtime/cgocall.go:167 +0x3e fp=0x155f8f89d830 sp=0x155f8f89d7d0 pc=0x7ff7a8c8ef7e
syscall.syscalln(0x7ff7a8f5e4a0?, 0x7ff7a8d9ac3d?, {0x155f8fd9a750?2026/09/22 21:20:37 INFO Window resize hwnd=461548 width=120 height=68
, 0x8?, 0x7ff7a8d7503b?})
C:/Program Files/Go/src/runtime/syscall_windows.go:427 +0x48 fp=0x155f8f89d850 sp=0x155f8f89d830 pc=0x7ff7a8c948e8
syscall.SyscallN(0x135268ae3e0?, {0x155f8fd9a750?, 0x0?, 0x7ff7a8d8d073?})
C:/Program Files/Go/src/syscall/dll_windows.go:99 +0x1e fp=0x155f8f89d888 sp=0x155f8f89d850 pc=0x7ff7a8ca603e
syscall.(*Proc).Call(0x7ff7a8c2f213?, {0x155f8fd9a750?, 0x7ff7a8f1b500?, 0x7ff7a8daaee0?})
C:/Program Files/Go/src/syscall/dll_windows.go:256 +0x1c fp=0x155f8f89d8c8 sp=0x155f8f89d888 pc=0x7ff7a8ca657c
syscall.(*LazyProc).Call(0x155f8f892e40, {0x155f8fd9a750, 0x2, 0x2})
C:/Program Files/Go/src/syscall/dll_windows.go:376 +0x4a fp=0x155f8f89d8f8 sp=0x155f8f89d8c8 pc=0x7ff7a8ca68ea
github.com/go-webgpu/webgpu/wgpu.(*windowsProc).Call(0x02026/09/22 21:20:37 INFO Window resize hwnd=461548 width=120 height=44
?, {0x155f8fd9a750?, 0x0?, 0x2?})
C:/Users/Tnze/go/pkg/mod/github.com/go-webgpu/webgpu@v0.5.5/wgpu/loader_windows.go:43 +0x1b fp=0x155f8f89d928 sp=0x155f8f89d8f8 pc=0x7ff7a8d6593b
github.com/go-webgpu/webgpu/wgpu.(*Surface).GetCurrentTexture(0x155f8f874458)
I've encountered a problem when resizing the window that the WGPU Validator complains the Texture didn't release properly.
But it turns out the Texture hadn't given to me in this case. I think the wrapper library takes responsibility to release the texture.
webgpu/wgpu/surface.go
Lines 157 to 201 in 907b82e