diff --git a/main.cpp b/main.cpp index c09464b..d29aa18 100644 --- a/main.cpp +++ b/main.cpp @@ -262,6 +262,12 @@ TextureView Application::GetNextSurfaceTextureView() { viewDescriptor.aspect = TextureAspect::All; TextureView targetView = texture.createView(viewDescriptor); +#ifndef WEBGPU_BACKEND_WGPU + // We no longer need the texture, only its view + // (NB: with wgpu-native, surface textures must not be manually released) + Texture(surfaceTexture.texture).release(); +#endif // WEBGPU_BACKEND_WGPU + return targetView; }