-
Notifications
You must be signed in to change notification settings - Fork 670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing WebGL types in a worker? #2571
Comments
This sounds like an oversight to me, but I haven't worked on OffscreenCanvas myself. In Chrome, it looks like it's just a matter of adding cc @junov |
This will have to be fixed in the specs as well. As of whatwg/webidl#423 |
This extended attribute has been required by Web IDL since whatwg/webidl#423 . In order for WebGL to be accessible by web workers using OffscreenCanvas, the attribute being added to all WebGL interfaces is: [Exposed=(Window,Worker)] Fixes KhronosGroup#2571 .
Chromium's implementation has been fixed to expose these interfaces on workers as of https://chromium-review.googlesource.com/1142292 . |
Addresses KhronosGroup/WebGL#2571 . Bug: none Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel Change-Id: I2e84b89bb2d9b46e5c7094419681d38a377dcbb1 Reviewed-on: https://chromium-review.googlesource.com/1142292 Reviewed-by: Philip Jägenstedt <[email protected]> Commit-Queue: Kenneth Russell <[email protected]> Cr-Commit-Position: refs/heads/master@{#576627}
This extended attribute has been required by Web IDL since whatwg/webidl#423 . In order for WebGL to be accessible by web workers using OffscreenCanvas, the attribute being added to all WebGL interfaces is: [Exposed=(Window,Worker)] Fixes KhronosGroup#2571 .
* Add [Exposed] Web IDL attribute to all WebGL interfaces. This extended attribute has been required by Web IDL since whatwg/webidl#423 . In order for WebGL to be accessible by web workers using OffscreenCanvas, the attribute being added to all WebGL interfaces is: [Exposed=(Window,Worker)] Fixes #2571 . * Address review feedback from jgilbert
I'm probably just missing this somewhere but, I have some semi-generic WebGL code that needs to check if an object is
WebGLTexture
or aWebGLRenderbuffer
. For the last several years I've had code like thisBut now I'm trying to run this code in a worker and AFAICT
WebGLTexture
does not exist inside a worker even though WebGL itself is running viaOffscreenCanvas
.As it is a few workarounds which seem unclean (some wishy washy feeling I know but ...)
call
gl.isTexture
which requires aWebGLTexture
but throws if it's not. Seems pretty heavy to generate an exception just to check this stuff. In other wordscall
representative = gl.createTexture()
somewhere then useobjectInQuestion instanceOf representative.constructor
. ugh but it works and at least it's fast and doesn't generate garbage every check as 1 above does but it does generate a bogus object.???
The text was updated successfully, but these errors were encountered: