WebGL
Khronos
 

WebGL WEBGL_debug_shaders Khronos Ratified Extension Specification

Name

WEBGL_debug_shaders

Contact

zmo@chromium.org

Contributors

Members of the WebGL working group

Version

Last modified date: May 15, 2013
Revision: 6

Number

WebGL extension #7

Dependencies

Written against the WebGL API 1.0 specification.

Overview

WebGL uses the GLSL ES 2.0 spec on all platforms, and translates these shaders to the host platform's native language (HLSL, GLSL, and even GLSL ES). For debugging purpose, it is useful to be able to examine the shader after translation. This extension exposes a new function getTranslatedShaderSource for such purposes.

IDL

interface WEBGL_debug_shaders {

      DOMString getTranslatedShaderSource(WebGLShader shader);

};
  

New Functions

DOMString getTranslatedShaderSource(WebGLShader shader)
If no source has been defined, compileShader() has not been called, or the translation has failed for shader, an empty string is returned; otherwise, return the translated source.

Security Considerations

Workarounds might be implemented in shader translation for driver bugs, and the pattern of the translation could be used to identify a specific GPU. Therefore, this extension has privacy implications and MUST NOT be available (see getSupportedExtensions()) to regular web content. The extension shall be available only to content determined to be privileged by some user agent specific means.

Revision History

Revision 1, 2011/10/03

Revision 2, 2011/10/14

Revision 3, 2011/10/18

Revision 4, 2011/12/07

Revision 5, 2012/01/03

Revision 6, 2013/05/15