KhronosGroup/WebGL

I receive a warning when using WEBGL_polygon_mode

Closed this issue · 3 comments

When using WEBGL_polygon_mode, I see this strange warning:

WebGL: this extension has very low support on mobile devices; do not rely on it for rendering effects without implementing a fallback path: WEBGL_polygon_mode

Yes, I know that it's going to be optionally supported; that's why it's an extension. I explicitly check for it, and don't support enabling wireframe mode in my application if it's not supported. Is there a way to prevent this from spamming my console?

Heya, sorry about the delay!

This sounds like something you'd want to take up with the browser in question!
If it's spamming, that's probably fixable both by the browser making this a once-per-context message, or by the app by caching the result of getExtension.

I will say that for Firefox, on the balance, I think having a message like this is the right amount of gentle encouragement not to ship something that relies on this to users. What we want to avoid is using this extension for rendering effects that only work on desktop, and having it just not work on mobile devices. This extension is a very tempting way to add wireframe effects in a way that causes applications not to run properly on mobile.

But also, even though it risks ecosystem fragmentation, this is a useful extension that we want to support. It's just very tempting and not otherwise obvious that support is fragmented.

Because the primary use-case is debugging, I feel that having a warning in this case is the right balance of supporting this feature while nudging against ecosystem fragmentation.

It seems that this has improved in Chrome, it appears to have switched to only emitting the warning when actually calling glPolygonMode(LINE).

This extension is a very tempting way to add wireframe effects in a way that causes applications not to run properly on mobile.

I mean, this could be said for pretty much any extension, no? If a user agent does not expose the extension, then it can't be relied upon.

After discussion in the WebGL working group, the Chromium team will consider removing the warning in crbug.com/368085772 .