Glad that you were able to figure it out! And yeah, that can be a non-obvious requirement of operating in a worker. I'll see if there's any sensible places for us to surface that to the rest of the community.
--Brandon On Wed, Aug 2, 2023 at 11:26 PM wenhan chong <wenhan....@gmail.com> wrote: > Hi Brandon, > > Thanks for looking at this. I compared you sample code against the code in > my app and saw that the render loop on my worker thread was causing the > issue. It seems that having a render loop on the worker prevents control > from returning to the ui thread, thus suppressing any errors thrown by > webgpu device. I was able to use the uncapturederror event listener after > removing the loop. > > Thanks, > Wen Han > > On Tuesday, 1 August 2023 at 02:50:15 UTC+8 Brandon Jones wrote: > >> Hi Wenhan! >> >> I [wrote a quick test](https://codepen.io/toji/pen/ZEmVypz) to try this >> out and I'm able to see the uncapturederror events in the worker and >> forward them on to the main thread for logging. >> >> Is there a reduced version of the code that's producing the issue that >> you could share? Because otherwise it looks like it's working in at least >> this trivial case. >> >> --Brandon >> >> On Sun, Jul 30, 2023 at 11:54 AM wenhan chong <wenha...@gmail.com> wrote: >> >>> Hi All, >>> >>> I am trying to use WebGPU uncapturederror listener to detect unexpected >>> errors that happen during render time. I notice that errors are suppressed >>> and not captured when I am rendering to an offscreen canvas on a worker. I >>> tested this by forcing a simple GPUValidationError in the shaders. On an >>> app that renders directly on the main thread, I am able to catch the error. >>> However, on an app that renders to an offscreen canvas on a worker thread >>> before transferring to main, the error is not captured. There is also no >>> console output indicating any errors without the use of the uncapturederror >>> listener. The canvas simply doesn't render. Is this a known issue and is >>> there a workaround? >>> >>> Thanks, >>> Wen Han >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "blink-dev" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to blink-dev+...@chromium.org. >>> To view this discussion on the web visit >>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/2ff4f166-182e-46bb-bedd-9145dd2b675dn%40chromium.org >>> <https://groups.google.com/a/chromium.org/d/msgid/blink-dev/2ff4f166-182e-46bb-bedd-9145dd2b675dn%40chromium.org?utm_medium=email&utm_source=footer> >>> . >>> >> -- You received this message because you are subscribed to the Google Groups "blink-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscr...@chromium.org. To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAEGwwi04tWvpcQEZM9SJri6j3r_YFtXGU2YQ0Gczc7BqE3GeTw%40mail.gmail.com.