11 Brian Paul
(brian.paul 'at' tungstengraphics.com
)
12 Michal Krol
(mjkrol 'at' gmail.com
)
20 Last Modified Date
: July
30, 2006
29 OpenGL
1.0 is required.
31 The ARB_shader_objects extension is required.
33 The ARB_shading_language_100 extension is required.
35 The extension is written against the OpenGL
1.5 specification.
37 The extension is written against the OpenGL Shading Language
1.10
42 This extension introduces a debug object that can be attached to
43 a program object to
enable debugging. Vertex and
/or fragment shader
,
44 during execution
, issue diagnostic
function calls that are logged
45 to the debug object's log. A separate debug log
for each shader
type
46 is maintained. A debug object can be attached
, detached and queried
47 at any
time outside the Begin
/End pair. Multiple debug objects can
48 be attached to a single program object.
58 New Procedures and Functions
60 handleARB CreateDebugObjectMESA
(void
)
61 void ClearDebugLogMESA
(handleARB obj
, enum logType
, enum shaderType
)
62 void GetDebugLogMESA
(handleARB obj
, enum logType
, enum shaderType
,
63 sizei maxLength
, sizei
*length
,
65 sizei GetDebugLogLengthMESA
(handleARB obj
, enum logType
,
74 Returned by the
<params
> parameter of GetObjectParameter
{fi}vARB
:
76 DEBUG_OBJECT_MESA
0x8759
78 Accepted by the
<logType
> argument of ClearDebugLogMESA
,
79 GetDebugLogLengthMESA and GetDebugLogMESA
:
81 DEBUG_PRINT_MESA
0x875A
82 DEBUG_ASSERT_MESA
0x875B
84 Additions to Chapter
2 of the OpenGL
1.5 Specification
89 Additions to Chapter
3 of the OpenGL
1.5 Specification
(Rasterization
)
93 Additions to Chapter
4 of the OpenGL
1.5 Specification
(Per
-Fragment
94 Operations and the Frame Buffer
)
98 Additions to Chapter
5 of the OpenGL
1.5 Specification
103 Additions to Chapter
6 of the OpenGL
1.5 Specification
(State and State
108 Additions to Appendix A of the OpenGL
1.5 Specification
(Invariance
)
112 Additions to Chapter
1 of the OpenGL Shading Language
1.10 Specification
117 Additions to Chapter
2 of the OpenGL Shading Language
1.10 Specification
118 (Overview of OpenGL Shading
)
122 Additions to Chapter
3 of the OpenGL Shading Language
1.10 Specification
127 Additions to Chapter
4 of the OpenGL Shading Language
1.10 Specification
128 (Variables and Types
)
132 Additions to Chapter
5 of the OpenGL Shading Language
1.10 Specification
133 (Operators and Expressions
)
137 Additions to Chapter
6 of the OpenGL Shading Language
1.10 Specification
138 (Statements and Structure
)
142 Additions to Chapter
7 of the OpenGL Shading Language
1.10 Specification
147 Additions to Chapter
8 of the OpenGL Shading Language
1.10 Specification
150 Add a new section
8.10 "Debug Functions"
:
152 Debug functions are available to both fragment and vertex shaders.
153 They are used to track the execution of a shader by logging
154 passed
-in arguments to the debug object's log. Those values can be
155 retrieved by the application
for inspection after shader execution
158 The text
, if any
, produced by any of these functions is appended
159 to each debug object that is attached to the program object.
160 There are different debug log types
162 Add a new section
8.10.1 "Print Function"
:
164 The following printMESA prototypes are available.
166 void printMESA
(const float value
)
167 void printMESA
(const int value
)
168 void printMESA
(const bool value
)
169 void printMESA
(const vec2 value
)
170 void printMESA
(const vec3 value
)
171 void printMESA
(const vec4 value
)
172 void printMESA
(const ivec2 value
)
173 void printMESA
(const ivec3 value
)
174 void printMESA
(const ivec4 value
)
175 void printMESA
(const bvec2 value
)
176 void printMESA
(const bvec3 value
)
177 void printMESA
(const bvec4 value
)
178 void printMESA
(const mat2 value
)
179 void printMESA
(const mat3 value
)
180 void printMESA
(const mat4 value
)
181 void printMESA
(const sampler1D value
)
182 void printMESA
(const sampler2D value
)
183 void printMESA
(const sampler3D value
)
184 void printMESA
(const samplerCube value
)
185 void printMESA
(const sampler1DShadow value
)
186 void printMESA
(const sampler2DShadow value
)
188 The printMESA
function writes the argument
<value
> to the "debug
189 print log"
(XXX DEBUG_PRINT_MESA?
). Each component is written
in
190 text format
(XXX format
!) and is delimited by a white space
(XXX
1
193 Add a new section
8.10.2 "Assert Function"
:
195 The following assertMESA prototypes are available.
197 void assertMESA
(const bool condition
)
198 void assertMESA
(const bool condition
, const int cookie
)
199 void assertMESA
(const bool condition
, const int cookie
,
200 const int file
, const int line
)
202 The assertMESA
function checks
if the argument
<condition
> is
203 true or false. If it is true
, nothing happens. If it is false
,
204 a diagnostic message is written to the "debug assert log".
205 The message contains the argument
<file
>, <line
>, <cookie
> and
206 implementation dependent double
-quoted string
, each of this
207 delimited by a white space. If the argument
<cookie
> is not present
,
208 it is meant as
if it was of value
0. If the arguments
<file
> and
209 <line
> are not present
, they are meant as
if they were of values
210 __FILE__ and __LINE__
, respectively. The following three calls
211 produce the same output
, assuming they were issued from the same
215 assertMESA
(false
, 0);
216 assertMESA
(false
, 0, __FILE__
, __LINE__
);
218 The diagnostic message examples follow.
221 1 45 333 "all
(lessThanEqual
(fragColor
, vec4
(1.0)))"
222 1 66 1 "assertion failed
in file
1, line
66, cookie
1"
224 Additions to Chapter
9 of the OpenGL Shading Language
1.10 Specification
225 (Shading Language Grammar
)
229 Additions to Chapter
10 of the OpenGL Shading Language
1.10
230 Specification
(Issues
)
234 Additions to the AGL
/EGL
/GLX
/WGL Specifications
250 New Implementation Dependent State
261 Initial draft.
(Michal Krol
)
263 Add Overview
, New Procedures and Functions
, New Tokens sections.
264 Add sections
8.10.1, 8.10.2 to GLSL spec.