Path: blob/main_old/extensions/ANGLE_translated_shader_source.txt
1693 views
Name12ANGLE_translated_shader_source34Name Strings56GL_ANGLE_translated_shader_source78Contributors910Daniel Koch, TransGaming Inc.11Gregg Tavares, Google Inc.12Kenneth Russell, Google Inc.13Zhenyao Mo, Google Inc.1415Contact1617Zhenyao Mo, Google Inc. (zmo 'at' google 'dot' com)1819Status2021Implemented in ANGLE ES22223Version2425Last Modified Date: October 5, 201126Author Revision: 22728Number2930OpenGL ES Extension #1133132Dependencies3334OpenGL ES 2.0 is required.3536The extension is written against the OpenGL ES 2.0 specification.3738Overview3940WebGL uses the GLSL ES 2.0 spec on all platforms, and translates these41shaders to the host platform's native language (HLSL, GLSL, and even GLSL42ES). For debugging purposes, it is useful to be able to examine the shader43after translation.4445This extension addes a new function to query the translated shader source,46and adds a new enum for GetShaderiv's <pname> parameter to query the47translated shader source length.4849IP Status5051No known IP claims.5253New Types5455None5657New Procedures and Functions5859void GetTranslatedShaderSourceANGLE(uint shader, sizei bufsize,60sizei* length, char* source);6162New Tokens6364Accepted by the <pname> parameter of GetShaderiv:6566TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A06768Additions to Chapter 6 of the OpenGL ES 2.0 Specification (State and State69Requests)7071Append in the end of the fourth paragraph of section 6.1.8 (Shader and72Program Queries):7374" If <pname> is TRANSLATED_SHADER_LENGTH_ANGLE, the length of the translated75source string, including a null terminator, is returned. If no source has76been defined, CompileShader has not been called, or the translation has77failed for <shader>, zero is returned."7879Append after the last paragraph of section 6.1.8 (Shader and Program80Queries):8182"The command8384void GetTranslatedShaderSourceANGLE( uint shader, sizei bufSize,85sizei *length, char *source );8687returns in <source> the string making up the translated source code for88the shader object <shader>. The string <source> will be null terminated.89The actual number of characters written into <source>, excluding the null90terminator, is returned in <length>. If <length> is NULL, no length is91returned. The maximum number of characters that may be written into92<source>, including the null terminator, is specified by <bufSize>. The93string <source> is the translated string of a concatenation of the strings94passed to the GL using ShaderSource. The length of this translated string95is given by TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE, which can be queried96with GetShaderiv.9798If no source has been defined, CompileShader has not been called, or the99translation has failed for <shader>, zero is returned for <length>, and100an empty string is returned for <source>.101102If the value of SHADER_COMPILER is not TRUE, then the error INVALID_-103OPERATION is generated."104105Issues1061071) What enum value should be used for TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE?108109RESOLVED: The first draft used a temporary enum value. This been replaced110with a enum allocated from the ANGLE range of GL enums.111112Revision History113114Revision 1, 2011/09/29, zmo115- first draft116Revision 2, 2011/10/05, dgkoch117- assigned enum118119120