1*8975f5c5SAndroid Build Coastguard WorkerName 2*8975f5c5SAndroid Build Coastguard Worker 3*8975f5c5SAndroid Build Coastguard Worker ANGLE_translated_shader_source 4*8975f5c5SAndroid Build Coastguard Worker 5*8975f5c5SAndroid Build Coastguard WorkerName Strings 6*8975f5c5SAndroid Build Coastguard Worker 7*8975f5c5SAndroid Build Coastguard Worker GL_ANGLE_translated_shader_source 8*8975f5c5SAndroid Build Coastguard Worker 9*8975f5c5SAndroid Build Coastguard WorkerContributors 10*8975f5c5SAndroid Build Coastguard Worker 11*8975f5c5SAndroid Build Coastguard Worker Daniel Koch, TransGaming Inc. 12*8975f5c5SAndroid Build Coastguard Worker Gregg Tavares, Google Inc. 13*8975f5c5SAndroid Build Coastguard Worker Kenneth Russell, Google Inc. 14*8975f5c5SAndroid Build Coastguard Worker Zhenyao Mo, Google Inc. 15*8975f5c5SAndroid Build Coastguard Worker 16*8975f5c5SAndroid Build Coastguard WorkerContact 17*8975f5c5SAndroid Build Coastguard Worker 18*8975f5c5SAndroid Build Coastguard Worker Zhenyao Mo, Google Inc. (zmo 'at' google 'dot' com) 19*8975f5c5SAndroid Build Coastguard Worker 20*8975f5c5SAndroid Build Coastguard WorkerStatus 21*8975f5c5SAndroid Build Coastguard Worker 22*8975f5c5SAndroid Build Coastguard Worker Implemented in ANGLE ES2 23*8975f5c5SAndroid Build Coastguard Worker 24*8975f5c5SAndroid Build Coastguard WorkerVersion 25*8975f5c5SAndroid Build Coastguard Worker 26*8975f5c5SAndroid Build Coastguard Worker Last Modified Date: October 5, 2011 27*8975f5c5SAndroid Build Coastguard Worker Author Revision: 2 28*8975f5c5SAndroid Build Coastguard Worker 29*8975f5c5SAndroid Build Coastguard WorkerNumber 30*8975f5c5SAndroid Build Coastguard Worker 31*8975f5c5SAndroid Build Coastguard Worker OpenGL ES Extension #113 32*8975f5c5SAndroid Build Coastguard Worker 33*8975f5c5SAndroid Build Coastguard WorkerDependencies 34*8975f5c5SAndroid Build Coastguard Worker 35*8975f5c5SAndroid Build Coastguard Worker OpenGL ES 2.0 is required. 36*8975f5c5SAndroid Build Coastguard Worker 37*8975f5c5SAndroid Build Coastguard Worker The extension is written against the OpenGL ES 2.0 specification. 38*8975f5c5SAndroid Build Coastguard Worker 39*8975f5c5SAndroid Build Coastguard WorkerOverview 40*8975f5c5SAndroid Build Coastguard Worker 41*8975f5c5SAndroid Build Coastguard Worker WebGL uses the GLSL ES 2.0 spec on all platforms, and translates these 42*8975f5c5SAndroid Build Coastguard Worker shaders to the host platform's native language (HLSL, GLSL, and even GLSL 43*8975f5c5SAndroid Build Coastguard Worker ES). For debugging purposes, it is useful to be able to examine the shader 44*8975f5c5SAndroid Build Coastguard Worker after translation. 45*8975f5c5SAndroid Build Coastguard Worker 46*8975f5c5SAndroid Build Coastguard Worker This extension addes a new function to query the translated shader source, 47*8975f5c5SAndroid Build Coastguard Worker and adds a new enum for GetShaderiv's <pname> parameter to query the 48*8975f5c5SAndroid Build Coastguard Worker translated shader source length. 49*8975f5c5SAndroid Build Coastguard Worker 50*8975f5c5SAndroid Build Coastguard WorkerIP Status 51*8975f5c5SAndroid Build Coastguard Worker 52*8975f5c5SAndroid Build Coastguard Worker No known IP claims. 53*8975f5c5SAndroid Build Coastguard Worker 54*8975f5c5SAndroid Build Coastguard WorkerNew Types 55*8975f5c5SAndroid Build Coastguard Worker 56*8975f5c5SAndroid Build Coastguard Worker None 57*8975f5c5SAndroid Build Coastguard Worker 58*8975f5c5SAndroid Build Coastguard WorkerNew Procedures and Functions 59*8975f5c5SAndroid Build Coastguard Worker 60*8975f5c5SAndroid Build Coastguard Worker void GetTranslatedShaderSourceANGLE(uint shader, sizei bufsize, 61*8975f5c5SAndroid Build Coastguard Worker sizei* length, char* source); 62*8975f5c5SAndroid Build Coastguard Worker 63*8975f5c5SAndroid Build Coastguard WorkerNew Tokens 64*8975f5c5SAndroid Build Coastguard Worker 65*8975f5c5SAndroid Build Coastguard Worker Accepted by the <pname> parameter of GetShaderiv: 66*8975f5c5SAndroid Build Coastguard Worker 67*8975f5c5SAndroid Build Coastguard Worker TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0 68*8975f5c5SAndroid Build Coastguard Worker 69*8975f5c5SAndroid Build Coastguard WorkerAdditions to Chapter 6 of the OpenGL ES 2.0 Specification (State and State 70*8975f5c5SAndroid Build Coastguard WorkerRequests) 71*8975f5c5SAndroid Build Coastguard Worker 72*8975f5c5SAndroid Build Coastguard Worker Append in the end of the fourth paragraph of section 6.1.8 (Shader and 73*8975f5c5SAndroid Build Coastguard Worker Program Queries): 74*8975f5c5SAndroid Build Coastguard Worker 75*8975f5c5SAndroid Build Coastguard Worker " If <pname> is TRANSLATED_SHADER_LENGTH_ANGLE, the length of the translated 76*8975f5c5SAndroid Build Coastguard Worker source string, including a null terminator, is returned. If no source has 77*8975f5c5SAndroid Build Coastguard Worker been defined, CompileShader has not been called, or the translation has 78*8975f5c5SAndroid Build Coastguard Worker failed for <shader>, zero is returned." 79*8975f5c5SAndroid Build Coastguard Worker 80*8975f5c5SAndroid Build Coastguard Worker Append after the last paragraph of section 6.1.8 (Shader and Program 81*8975f5c5SAndroid Build Coastguard Worker Queries): 82*8975f5c5SAndroid Build Coastguard Worker 83*8975f5c5SAndroid Build Coastguard Worker "The command 84*8975f5c5SAndroid Build Coastguard Worker 85*8975f5c5SAndroid Build Coastguard Worker void GetTranslatedShaderSourceANGLE( uint shader, sizei bufSize, 86*8975f5c5SAndroid Build Coastguard Worker sizei *length, char *source ); 87*8975f5c5SAndroid Build Coastguard Worker 88*8975f5c5SAndroid Build Coastguard Worker returns in <source> the string making up the translated source code for 89*8975f5c5SAndroid Build Coastguard Worker the shader object <shader>. The string <source> will be null terminated. 90*8975f5c5SAndroid Build Coastguard Worker The actual number of characters written into <source>, excluding the null 91*8975f5c5SAndroid Build Coastguard Worker terminator, is returned in <length>. If <length> is NULL, no length is 92*8975f5c5SAndroid Build Coastguard Worker returned. The maximum number of characters that may be written into 93*8975f5c5SAndroid Build Coastguard Worker <source>, including the null terminator, is specified by <bufSize>. The 94*8975f5c5SAndroid Build Coastguard Worker string <source> is the translated string of a concatenation of the strings 95*8975f5c5SAndroid Build Coastguard Worker passed to the GL using ShaderSource. The length of this translated string 96*8975f5c5SAndroid Build Coastguard Worker is given by TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE, which can be queried 97*8975f5c5SAndroid Build Coastguard Worker with GetShaderiv. 98*8975f5c5SAndroid Build Coastguard Worker 99*8975f5c5SAndroid Build Coastguard Worker If no source has been defined, CompileShader has not been called, or the 100*8975f5c5SAndroid Build Coastguard Worker translation has failed for <shader>, zero is returned for <length>, and 101*8975f5c5SAndroid Build Coastguard Worker an empty string is returned for <source>. 102*8975f5c5SAndroid Build Coastguard Worker 103*8975f5c5SAndroid Build Coastguard Worker If the value of SHADER_COMPILER is not TRUE, then the error INVALID_- 104*8975f5c5SAndroid Build Coastguard Worker OPERATION is generated." 105*8975f5c5SAndroid Build Coastguard Worker 106*8975f5c5SAndroid Build Coastguard WorkerIssues 107*8975f5c5SAndroid Build Coastguard Worker 108*8975f5c5SAndroid Build Coastguard Worker 1) What enum value should be used for TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE? 109*8975f5c5SAndroid Build Coastguard Worker 110*8975f5c5SAndroid Build Coastguard Worker RESOLVED: The first draft used a temporary enum value. This been replaced 111*8975f5c5SAndroid Build Coastguard Worker with a enum allocated from the ANGLE range of GL enums. 112*8975f5c5SAndroid Build Coastguard Worker 113*8975f5c5SAndroid Build Coastguard WorkerRevision History 114*8975f5c5SAndroid Build Coastguard Worker 115*8975f5c5SAndroid Build Coastguard Worker Revision 1, 2011/09/29, zmo 116*8975f5c5SAndroid Build Coastguard Worker - first draft 117*8975f5c5SAndroid Build Coastguard Worker Revision 2, 2011/10/05, dgkoch 118*8975f5c5SAndroid Build Coastguard Worker - assigned enum 119