Re: [w3ctag/design-reviews] Review OffscreenCanvas, including ImageBitmapRenderingContext (#141)

> Preliminarily, I think that syncing to vsync in a Worker would be most ideally done using a mechanism that does not require intervention from other Workers or from the main thread.

I am a bit skeptical about your argument, at least I don't think it is that obvious that relaying WebGL commands would be better.  Today, at least in Chrome's implementation, the vsync signal already has to hop over several cross-thread and even cross-process channels before it reaches commit()/rAF(). Adding a simple semaphore to that chain is probably inconsequential IMHO. Of course, if you're relaying rAF from the main thread, things can get ugly because rAF on main can be delayed for all sorts of reasons, but rAF on a side-car Worker that has nothing else to do should be relatively clean unless the system has high CPU core contention (maybe that is a key issue, maybe not).  The propagation delay from postMessage for transferring the ImageBitmap to the `presentationWorker` is a couple hundred microseconds, but that delay is not likely to be on the critical path. It happens in parallel with the async rasterization of the WebGL frame's content.  I guess the only way we'll know for sure whether relayed WebGL commands is better than relayed vsync+ImageBitmap will be try them out.

On my side, I'll try to run some experiments to compare direct commit() vs. relayed vsync

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/141#issuecomment-344793545

Received on Thursday, 16 November 2017 02:15:16 UTC