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