Repository: deno
Issue: Deno Panic: SurfaceSemaphores and SurfaceTexture
Labels: bug,needs investigation,webgpu

Platform: windows x86_64
Version: Deno 1.45.5
Args: ["C:\\Program Files\\Deno\\deno.exe", "run", "--env", "--allow-read", "--allow-ffi", "--unstable-ffi", "--unstable-temporal", "--unstable-webgpu", "./src/main.ts"]

thread 'main' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\wgpu-hal-0.21.1\src\vulkan\instance.rs:186:58:
Trying to destroy a SurfaceSemaphores that is still in use by a SurfaceTexture

stack backtrace:
   0:     0x7ff63522c6cd - onig_get_string_end_by_callout_args
   1:     0x7ff633bba899 - onig_get_start_by_callout_args
   2:     0x7ff635209741 - onig_get_string_end_by_callout_args
   3:     0x7ff635230586 - onig_get_string_end_by_callout_args
   4:     0x7ff63522fe4a - onig_get_string_end_by_callout_args
   5:     0x7ff63522fa01 - onig_get_string_end_by_callout_args
   6:     0x7ff6339f0d04 - onig_get_capture_tree
   7:     0x7ff635230927 - onig_get_string_end_by_callout_args
   8:     0x7ff6352307c7 - onig_get_string_end_by_callout_args
   9:     0x7ff63523070f - onig_get_string_end_by_callout_args
  10:     0x7ff6352306f8 - onig_get_string_end_by_callout_args
  11:     0x7ff636c85a44 - onig_unicode_define_user_property
  12:     0x7ff636c8607c - onig_unicode_define_user_property
  13:     0x7ff63558c8e3 - onig_get_string_end_by_callout_args
  14:     0x7ff63558c9fe - onig_get_string_end_by_callout_args
  15:     0x7ff635527731 - onig_get_string_end_by_callout_args
  16:     0x7ff634b1f349 - onig_builtin_fail
  17:     0x7ff634b1f308 - onig_builtin_fail
  18:     0x7ff633d525b9 - onig_get_start_by_callout_args
  19:     0x7ff633d874a6 - onig_get_start_by_callout_args
  20:     0x7ff6334808a9 - onig_get_regex_by_callout_args
  21:     0x7ff633477e06 - onig_get_regex_by_callout_args
  22:     0x7ff633471901 - onig_get_regex_by_callout_args
  23:     0x7ff633962e77 - onig_get_capture_tree
  24:     0x7ff6339da08a - onig_get_capture_tree
  25:     0x7ff6333fb8f0 - onig_get_regex_by_callout_args
  26:     0x7ff633ac06e5 - node_api_get_module_file_name
  27:     0x7ff63351a51b - onig_get_regex_by_callout_args
  28:     0x7ff6339f2f76 - onig_get_capture_tree
  29:     0x7ff6333c0075 - onig_get_regex_by_callout_args
  30:     0x7ff633ac07c6 - node_api_get_module_file_name
  31:     0x7ff636c28f6c - onig_unicode_define_user_property
  32:     0x7ff98be57374 - BaseThreadInitThunk
  33:     0x7ff98c7fcc91 - RtlUserThreadStart

In a SDL_PollEvent Generator I'm calling a render method that passes a Window object with the stored Surface and Context
```ts
for await (const [code, e] of SDL_PollEvent()) {
            if (e.type == SDL_EventType.Draw) {

                this.renderer.Render(this.window)

                SDL_Delay(1)
            }
        }


Render(window: Window) {
        const commandEncoder = this.device.createCommandEncoder();
        const textureView = window.context.getCurrentTexture().createView();

        const renderPassDescriptor: GPURenderPassDescriptor = {
            colorAttachments: [
                {
                    view: textureView,
                    clearValue: [0, 0, 0, 1],
                    loadOp: 'clear',
                    storeOp: 'store',
                },
            ],
        };

        const passEncoder = commandEncoder.beginRenderPass(renderPassDescriptor);
        passEncoder.setPipeline(this.pipeline);
        passEncoder.draw(3);
        passEncoder.end();

        this.device.queue.submit([commandEncoder.finish()]);
        window.surface.present()
    }
```