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