Khronos Public Bugzilla
Bug 570 - Demo of transferrable typed arrays with web workers for WebGL rendering
Demo of transferrable typed arrays with web workers for WebGL rendering
Status: NEW
Product: WebGL
Classification: Unclassified
Component: Sample Implementation
unspecified
PC All
: P3 normal
: ---
Assigned To: 3dweb Working Group email alias
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-27 21:07 PST by Tom Wiltzius
Modified: 2012-01-03 17:22 PST (History)
1 user (show)

See Also:


Attachments
WebGL demo with web workers and transferrable typed arrays (193.51 KB, patch)
2011-12-27 21:08 PST, Tom Wiltzius
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Wiltzius 2011-12-27 21:07:39 PST
Hey folks,

I've put together a demo of one of the existing WebGL demos (the nvidia vertex buffer object) running with web workers and transferrable typed arrays. This highlights the performance benefits of both using web workers to offload computation from the main JS thread and using transferrable typed arrays to transfer, rather than copy, typed arrays.

Transferrable typed arrays are implemented in the latest Chrome builds behind the webkit vendor prefix for postMessage (webkitPostMessage). The demo tries to fall back gracefully to using standard postMessage without transferrables if a version with transferrables is not available.

Because I adapted the existing demo, and that demo itself has been adapted a few times over the years, the code style is a little mixed. I'm happy to unify it if necessary.

An `svn diff` patch to the demo repository is attached. Comments welcome.
Comment 1 Tom Wiltzius 2011-12-27 21:08:37 PST
Created attachment 89 [details]
WebGL demo with web workers and transferrable typed arrays
Comment 2 Tom Wiltzius 2012-01-03 17:22:10 PST
For code review, uploaded a changelist to http://codereview.appspot.com/5504121/ (as per discussion with kbr).