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

Re: [Public WebGL] WEBGL_debug_shader_precision extension proposal



I think it's a bad idea to allow toggling after compilation. If you changed the setting afterwards and want it applied retroactively, we'd have to go back, re-translate, and recompile the shader. Shader recompilation is strongly out of vogue, so avoid it if possible.

----- Original Message -----
From: "Olli Etuaho" <oetuaho@nvidia.com>
To: "Jeff Gilbert" <jgilbert@mozilla.com>
Cc: "Mark Callow" <khronos@callow.im>, "Kenneth Russell" <kbr@google.com>, "Florian Bösch" <pyalot@gmail.com>, "public webgl" <public_webgl@khronos.org>
Sent: Tuesday, November 11, 2014 6:51:18 AM
Subject: RE: [Public WebGL] WEBGL_debug_shader_precision extension proposal

Jeff,

I don't see references to shaderMaxPrecision(WebGLShader* shader, GLenum maxPrecision) earlier in the thread, to clarify is that how you'd prefer toggling the emulation on and off per shader to be available in the API? In that case the name doesn't seem quite right, the maximum precision that the shader can compute at is always highp even if emulation is on. Having a reference to WebGLShader in the API call would be a good way to communicate that the toggle applies to a specific shader as opposed to a program, but on the other hand it would open other questions - can the emulation be toggled after compileShader is called, for example? So I do still think that a #pragma directive is the simplest and most preferable option.

Pref to force-enable this would definitely be a nice addition on top of the extension. The code is most likely going to be in ANGLE, so I'd imagine it would be quite easy for Firefox to expose this.

-Olli
________________________________________
From: Jeff Gilbert <jgilbert@mozilla.com>
Sent: Tuesday, November 11, 2014 6:21 AM
To: Olli Etuaho
Cc: Mark Callow; Kenneth Russell; Florian Bösch; public webgl
Subject: Re: [Public WebGL] WEBGL_debug_shader_precision extension proposal

An extension would be fine, in my opinion.
shaderMaxPrecision(WebGLShader* shader, GLenum maxPrecision) seems reasonable.

Regardless, if this is implemented in Firefox, there will definitely be a pref to force-enable this for all shaders for testing purposes.

-Jeff

----- Original Message -----
From: "Olli Etuaho" <oetuaho@nvidia.com>
To: "Mark Callow" <khronos@callow.im>, "Kenneth Russell" <kbr@google.com>
Cc: "Florian Bösch" <pyalot@gmail.com>, "public webgl" <public_webgl@khronos.org>
Sent: Monday, November 10, 2014 4:33:05 AM
Subject: RE: [Public WebGL] WEBGL_debug_shader_precision extension proposal


Thanks for the valuable feedback. It seems reasonable that since this does not add any new features to the language, #extension should not be used. #pragma might still be better than the enable/disable switch. From an implementation perspective, that encapsulates the functionality better inside the shader compiler. For the user, it's easier to understand - there can be no confusion regarding whether the flag should be set when linkProgram is called, for example. It's also more flexible. They can simply add the getExtension() call and then narrow down problems by only editing shaders if they wish, or they can add a parameter to their compileShader() code path that toggles inserting the pragma to shader code.

So I'll submit an amendment adding a #pragma webgl_debug_shader_precision directive, if you have strong objections to this please raise them.

-Olli
________________________________________
From: Mark Callow <khronos@callow.im>
Sent: Saturday, November 8, 2014 3:40 AM
To: Kenneth Russell
Cc: Florian Bösch; Olli Etuaho; public_webgl@khronos.org
Subject: Re: [Public WebGL] WEBGL_debug_shader_precision extension proposal

>
> t does seem better if the shaders
> don't have to be modified in order to take advantage of this
> extension.
>

I agree.

Another point is that #extension is intended for language extensions and this is arguably not a language extension. I think being able to enable and disable this in the API between calls to compileShader is the best approach.

Regards

    -Mark


-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------


-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------