Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MESA_shader_debug.spec 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. Name
  2. MESA_shader_debug
  3. Name Strings
  4. GL_MESA_shader_debug
  5. Contact
  6. Brian Paul (brian.paul 'at' tungstengraphics.com)
  7. Michal Krol (mjkrol 'at' gmail.com)
  8. Status
  9. XXX - Not complete yet!!!
  10. Version
  11. Last Modified Date: July 30, 2006
  12. Author Revision: 0.2
  13. Number
  14. TBD
  15. Dependencies
  16. OpenGL 1.0 is required.
  17. The ARB_shader_objects extension is required.
  18. The ARB_shading_language_100 extension is required.
  19. The extension is written against the OpenGL 1.5 specification.
  20. The extension is written against the OpenGL Shading Language 1.10
  21. Specification.
  22. Overview
  23. This extension introduces a debug object that can be attached to
  24. a program object to enable debugging. Vertex and/or fragment shader,
  25. during execution, issue diagnostic function calls that are logged
  26. to the debug object's log. A separate debug log for each shader type
  27. is maintained. A debug object can be attached, detached and queried
  28. at any time outside the Begin/End pair. Multiple debug objects can
  29. be attached to a single program object.
  30. IP Status
  31. None
  32. Issues
  33. None
  34. New Procedures and Functions
  35. handleARB CreateDebugObjectMESA(void)
  36. void ClearDebugLogMESA(handleARB obj, enum logType, enum shaderType)
  37. void GetDebugLogMESA(handleARB obj, enum logType, enum shaderType,
  38. sizei maxLength, sizei *length,
  39. charARB *debugLog)
  40. sizei GetDebugLogLengthMESA(handleARB obj, enum logType,
  41. enum shaderType)
  42. New Types
  43. None
  44. New Tokens
  45. Returned by the <params> parameter of GetObjectParameter{fi}vARB:
  46. DEBUG_OBJECT_MESA 0x8759
  47. Accepted by the <logType> argument of ClearDebugLogMESA,
  48. GetDebugLogLengthMESA and GetDebugLogMESA:
  49. DEBUG_PRINT_MESA 0x875A
  50. DEBUG_ASSERT_MESA 0x875B
  51. Additions to Chapter 2 of the OpenGL 1.5 Specification
  52. (OpenGL Operation)
  53. None
  54. Additions to Chapter 3 of the OpenGL 1.5 Specification (Rasterization)
  55. None
  56. Additions to Chapter 4 of the OpenGL 1.5 Specification (Per-Fragment
  57. Operations and the Frame Buffer)
  58. None
  59. Additions to Chapter 5 of the OpenGL 1.5 Specification
  60. (Special Functions)
  61. None
  62. Additions to Chapter 6 of the OpenGL 1.5 Specification (State and State
  63. Requests)
  64. None
  65. Additions to Appendix A of the OpenGL 1.5 Specification (Invariance)
  66. None
  67. Additions to Chapter 1 of the OpenGL Shading Language 1.10 Specification
  68. (Introduction)
  69. None
  70. Additions to Chapter 2 of the OpenGL Shading Language 1.10 Specification
  71. (Overview of OpenGL Shading)
  72. None
  73. Additions to Chapter 3 of the OpenGL Shading Language 1.10 Specification
  74. (Basics)
  75. None
  76. Additions to Chapter 4 of the OpenGL Shading Language 1.10 Specification
  77. (Variables and Types)
  78. None
  79. Additions to Chapter 5 of the OpenGL Shading Language 1.10 Specification
  80. (Operators and Expressions)
  81. None
  82. Additions to Chapter 6 of the OpenGL Shading Language 1.10 Specification
  83. (Statements and Structure)
  84. None
  85. Additions to Chapter 7 of the OpenGL Shading Language 1.10 Specification
  86. (Built-in Variables)
  87. None
  88. Additions to Chapter 8 of the OpenGL Shading Language 1.10 Specification
  89. (Built-in Functions)
  90. Add a new section 8.10 "Debug Functions":
  91. Debug functions are available to both fragment and vertex shaders.
  92. They are used to track the execution of a shader by logging
  93. passed-in arguments to the debug object's log. Those values can be
  94. retrieved by the application for inspection after shader execution
  95. is complete.
  96. The text, if any, produced by any of these functions is appended
  97. to each debug object that is attached to the program object.
  98. There are different debug log types
  99. Add a new section 8.10.1 "Print Function":
  100. The following printMESA prototypes are available.
  101. void printMESA(const float value)
  102. void printMESA(const int value)
  103. void printMESA(const bool value)
  104. void printMESA(const vec2 value)
  105. void printMESA(const vec3 value)
  106. void printMESA(const vec4 value)
  107. void printMESA(const ivec2 value)
  108. void printMESA(const ivec3 value)
  109. void printMESA(const ivec4 value)
  110. void printMESA(const bvec2 value)
  111. void printMESA(const bvec3 value)
  112. void printMESA(const bvec4 value)
  113. void printMESA(const mat2 value)
  114. void printMESA(const mat3 value)
  115. void printMESA(const mat4 value)
  116. void printMESA(const sampler1D value)
  117. void printMESA(const sampler2D value)
  118. void printMESA(const sampler3D value)
  119. void printMESA(const samplerCube value)
  120. void printMESA(const sampler1DShadow value)
  121. void printMESA(const sampler2DShadow value)
  122. The printMESA function writes the argument <value> to the "debug
  123. print log" (XXX DEBUG_PRINT_MESA?). Each component is written in
  124. text format (XXX format!) and is delimited by a white space (XXX 1
  125. or more?).
  126. Add a new section 8.10.2 "Assert Function":
  127. The following assertMESA prototypes are available.
  128. void assertMESA(const bool condition)
  129. void assertMESA(const bool condition, const int cookie)
  130. void assertMESA(const bool condition, const int cookie,
  131. const int file, const int line)
  132. The assertMESA function checks if the argument <condition> is
  133. true or false. If it is true, nothing happens. If it is false,
  134. a diagnostic message is written to the "debug assert log".
  135. The message contains the argument <file>, <line>, <cookie> and
  136. implementation dependent double-quoted string, each of this
  137. delimited by a white space. If the argument <cookie> is not present,
  138. it is meant as if it was of value 0. If the arguments <file> and
  139. <line> are not present, they are meant as if they were of values
  140. __FILE__ and __LINE__, respectively. The following three calls
  141. produce the same output, assuming they were issued from the same
  142. file and line.
  143. assertMESA (false);
  144. assertMESA (false, 0);
  145. assertMESA (false, 0, __FILE__, __LINE__);
  146. The diagnostic message examples follow.
  147. 1 89 0 ""
  148. 1 45 333 "all (lessThanEqual (fragColor, vec4 (1.0)))"
  149. 1 66 1 "assertion failed in file 1, line 66, cookie 1"
  150. Additions to Chapter 9 of the OpenGL Shading Language 1.10 Specification
  151. (Shading Language Grammar)
  152. None
  153. Additions to Chapter 10 of the OpenGL Shading Language 1.10
  154. Specification (Issues)
  155. None
  156. Additions to the AGL/EGL/GLX/WGL Specifications
  157. None
  158. GLX Protocol
  159. None
  160. Errors
  161. TBD
  162. New State
  163. TBD
  164. New Implementation Dependent State
  165. TBD
  166. Sample Code
  167. TBD
  168. Revision History
  169. 29 May 2006
  170. Initial draft. (Michal Krol)
  171. 30 July 2006
  172. Add Overview, New Procedures and Functions, New Tokens sections.
  173. Add sections 8.10.1, 8.10.2 to GLSL spec.