michael@0: Name michael@0: michael@0: ANGLE_translated_shader_source michael@0: michael@0: Name Strings michael@0: michael@0: GL_ANGLE_translated_shader_source michael@0: michael@0: Contributors michael@0: michael@0: Daniel Koch, TransGaming Inc. michael@0: Gregg Tavares, Google Inc. michael@0: Kenneth Russell, Google Inc. michael@0: Zhenyao Mo, Google Inc. michael@0: michael@0: Contact michael@0: michael@0: Zhenyao Mo, Google Inc. (zmo 'at' google 'dot' com) michael@0: michael@0: Status michael@0: michael@0: Implemented in ANGLE ES2 michael@0: michael@0: Version michael@0: michael@0: Last Modified Date: October 5, 2011 michael@0: Author Revision: 2 michael@0: michael@0: Number michael@0: michael@0: OpenGL ES Extension #113 michael@0: michael@0: Dependencies michael@0: michael@0: OpenGL ES 2.0 is required. michael@0: michael@0: The extension is written against the OpenGL ES 2.0 specification. michael@0: michael@0: Overview michael@0: michael@0: WebGL uses the GLSL ES 2.0 spec on all platforms, and translates these michael@0: shaders to the host platform's native language (HLSL, GLSL, and even GLSL michael@0: ES). For debugging purposes, it is useful to be able to examine the shader michael@0: after translation. michael@0: michael@0: This extension addes a new function to query the translated shader source, michael@0: and adds a new enum for GetShaderiv's parameter to query the michael@0: translated shader source length. michael@0: michael@0: IP Status michael@0: michael@0: No known IP claims. michael@0: michael@0: New Types michael@0: michael@0: None michael@0: michael@0: New Procedures and Functions michael@0: michael@0: void GetTranslatedShaderSourceANGLE(uint shader, sizei bufsize, michael@0: sizei* length, char* source); michael@0: michael@0: New Tokens michael@0: michael@0: Accepted by the parameter of GetShaderiv: michael@0: michael@0: TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 michael@0: michael@0: Additions to Chapter 6 of the OpenGL ES 2.0 Specification (State and State michael@0: Requests) michael@0: michael@0: Append in the end of the fourth paragraph of section 6.1.8 (Shader and michael@0: Program Queries): michael@0: michael@0: " If is TRANSLATED_SHADER_LENGTH_ANGLE, the length of the translated michael@0: source string, including a null terminator, is returned. If no source has michael@0: been defined, CompileShader has not been called, or the translation has michael@0: failed for , zero is returned." michael@0: michael@0: Append after the last paragraph of section 6.1.8 (Shader and Program michael@0: Queries): michael@0: michael@0: "The command michael@0: michael@0: void GetTranslatedShaderSourceANGLE( uint shader, sizei bufSize, michael@0: sizei *length, char *source ); michael@0: michael@0: returns in the string making up the translated source code for michael@0: the shader object . The string will be null terminated. michael@0: The actual number of characters written into , excluding the null michael@0: terminator, is returned in . If is NULL, no length is michael@0: returned. The maximum number of characters that may be written into michael@0: , including the null terminator, is specified by . The michael@0: string is the translated string of a concatenation of the strings michael@0: passed to the GL using ShaderSource. The length of this translated string michael@0: is given by TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE, which can be queried michael@0: with GetShaderiv. michael@0: michael@0: If no source has been defined, CompileShader has not been called, or the michael@0: translation has failed for , zero is returned for , and michael@0: an empty string is returned for . michael@0: michael@0: If the value of SHADER_COMPILER is not TRUE, then the error INVALID_- michael@0: OPERATION is generated." michael@0: michael@0: Issues michael@0: michael@0: 1) What enum value should be used for TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE? michael@0: michael@0: RESOLVED: The first draft used a temporary enum value. This been replaced michael@0: with a enum allocated from the ANGLE range of GL enums. michael@0: michael@0: Revision History michael@0: michael@0: Revision 1, 2011/09/29, zmo michael@0: - first draft michael@0: Revision 2, 2011/10/05, dgkoch michael@0: - assigned enum