[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Public WebGL] WEBGL_debug_shader_precision extension proposal

I commented on implementing this as a JS library in my first message. Making it a WebGL extension is just the simplest way to expose this, since the functionality is easiest to implement by reusing the existing infrastructure in ANGLE. But if someone really wants the emulation as a JS library, they would be free to emscripten-compile the relevant parts of ANGLE and use it that way.

The toggle would affect the behavior of compileShader(), so emulation could be enabled on a shader-by-shader basis.


From: Florian Bösch <pyalot@gmail.com>
Sent: Thursday, November 6, 2014 3:04 PM
To: Olli Etuaho
Cc: public_webgl@khronos.org
Subject: Re: [Public WebGL] WEBGL_debug_shader_precision extension proposal
On Thu, Nov 6, 2014 at 1:58 PM, Olli Etuaho <oetuaho@nvidia.com> wrote:
The precision requirements for mediump and lowp are minimums, so a computation that a shader says should be performed at mediump precision is most often actually performed at the full 32-bit precision on desktop. Overall, anything in between 32-bit precision and 16-bit precision goes. And "anything in between" is not just a theoretical consideration - mobile devices have wildly different float formats and rounding behaviors, so testing on one spec-compliant mobile device does not even guarantee that a shader will work on other spec-compliant mobile devices.
I see, thanks for clearing that up.
The extension does not require any support from the GL drivers, so that's why I've submitted the proposal only to the WebGL registry at this point. It can be implemented purely as a transformation of the GLSL code. If there's a strong reason for adding it also as a native extension, I have nothing against that, of course.
That makes sense. Though doesn't this mean it could essentially be done as a JS library rather than an extension?
I'll submit an amendment to the proposal to add an enable/disable toggle. I'll make it so that the emulation is enabled by default once the extension is enabled, but can be toggled off.
Well toggled on/off for individual shaders. Or toggled on/off globally. I'd imagine what you'd do is 1) toggle it on for all 2) see an issue 3) toggle it on for some to track track down the issue.