Counter Strike : Global Offensive Source Code
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.

4640 lines
146 KiB

  1. //============ Copyright (c) Valve Corporation, All rights reserved. ============
  2. //
  3. // glmgrbasics.cpp
  4. //
  5. //===============================================================================
  6. #include "togl/rendermechanism.h"
  7. #include "tier0/icommandline.h"
  8. #include "tier1/utlhash.h"
  9. #include "tier1/utlmap.h"
  10. #include "tier0/vprof.h"
  11. #ifdef OSX
  12. #include <OpenGL/OpenGL.h>
  13. #endif
  14. #include "tier0/valve_minmax_off.h"
  15. #include <algorithm>
  16. // memdbgon -must- be the last include file in a .cpp file.
  17. #include "tier0/memdbgon.h"
  18. //===============================================================================
  19. // decoding tables for debug
  20. typedef struct
  21. {
  22. unsigned long value;
  23. const char *name;
  24. } GLMValueEntry_t;
  25. #define TERMVALUE 0x31415926
  26. // terminator for value tables
  27. #define VE( x ) { x, #x }
  28. // "value entry"
  29. const GLMValueEntry_t g_d3d_devtypes[] =
  30. {
  31. VE( D3DDEVTYPE_HAL ),
  32. VE( D3DDEVTYPE_REF ),
  33. VE( TERMVALUE )
  34. };
  35. const GLMValueEntry_t g_d3d_formats[] =
  36. {
  37. VE( D3DFMT_INDEX16 ),
  38. VE( D3DFMT_D16 ),
  39. VE( D3DFMT_D24S8 ),
  40. VE( D3DFMT_A8R8G8B8 ),
  41. VE( D3DFMT_A4R4G4B4 ),
  42. VE( D3DFMT_X8R8G8B8 ),
  43. VE( D3DFMT_R5G6R5 ),
  44. VE( D3DFMT_X1R5G5B5 ),
  45. VE( D3DFMT_A1R5G5B5 ),
  46. VE( D3DFMT_L8 ),
  47. VE( D3DFMT_A8L8 ),
  48. VE( D3DFMT_A ),
  49. VE( D3DFMT_DXT1 ),
  50. VE( D3DFMT_DXT3 ),
  51. VE( D3DFMT_DXT5 ),
  52. VE( D3DFMT_V8U8 ),
  53. VE( D3DFMT_Q8W8V8U8 ),
  54. VE( D3DFMT_X8L8V8U8 ),
  55. VE( D3DFMT_A16B16G16R16F ),
  56. VE( D3DFMT_A16B16G16R16 ),
  57. VE( D3DFMT_R32F ),
  58. VE( D3DFMT_A32B32G32R32F ),
  59. VE( D3DFMT_R8G8B8 ),
  60. VE( D3DFMT_D24X4S4 ),
  61. VE( D3DFMT_A8 ),
  62. VE( D3DFMT_R5G6B5 ),
  63. VE( D3DFMT_D15S1 ),
  64. VE( D3DFMT_D24X8 ),
  65. VE( D3DFMT_VERTEXDATA ),
  66. VE( D3DFMT_INDEX32 ),
  67. // vendor specific formats (fourcc's)
  68. VE( D3DFMT_NV_INTZ ),
  69. VE( D3DFMT_NV_RAWZ ),
  70. VE( D3DFMT_NV_NULL ),
  71. VE( D3DFMT_ATI_D16 ),
  72. VE( D3DFMT_ATI_D24S8 ),
  73. VE( D3DFMT_ATI_2N ),
  74. VE( D3DFMT_ATI_1N ),
  75. VE( D3DFMT_UNKNOWN ),
  76. VE( TERMVALUE )
  77. };
  78. const GLMValueEntry_t g_d3d_rtypes[] =
  79. {
  80. VE( D3DRTYPE_SURFACE ),
  81. VE( D3DRTYPE_TEXTURE ),
  82. VE( D3DRTYPE_VOLUMETEXTURE ),
  83. VE( D3DRTYPE_CUBETEXTURE ),
  84. VE( D3DRTYPE_VERTEXBUFFER ),
  85. VE( D3DRTYPE_INDEXBUFFER ),
  86. VE( TERMVALUE )
  87. };
  88. const GLMValueEntry_t g_d3d_usages[] =
  89. {
  90. VE( D3DUSAGE_RENDERTARGET ),
  91. VE( D3DUSAGE_DEPTHSTENCIL ),
  92. VE( D3DUSAGE_DYNAMIC ),
  93. VE( D3DUSAGE_AUTOGENMIPMAP ),
  94. //VE( D3DUSAGE_DMAP ),
  95. //VE( D3DUSAGE_QUERY_LEGACYBUMPMAP ),
  96. VE( D3DUSAGE_QUERY_SRGBREAD ),
  97. VE( D3DUSAGE_QUERY_FILTER ),
  98. VE( D3DUSAGE_QUERY_SRGBWRITE ),
  99. VE( D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING ),
  100. VE( D3DUSAGE_QUERY_VERTEXTEXTURE ),
  101. //VE( D3DUSAGE_QUERY_WRAPANDMIP ),
  102. VE( D3DUSAGE_WRITEONLY ),
  103. VE( D3DUSAGE_SOFTWAREPROCESSING ),
  104. VE( D3DUSAGE_DONOTCLIP ),
  105. VE( D3DUSAGE_POINTS ),
  106. VE( D3DUSAGE_RTPATCHES ),
  107. VE( D3DUSAGE_NPATCHES ),
  108. VE( TERMVALUE )
  109. };
  110. const GLMValueEntry_t g_d3d_rstates[] =
  111. {
  112. VE( D3DRS_ZENABLE ),
  113. VE( D3DRS_FILLMODE ),
  114. VE( D3DRS_SHADEMODE ),
  115. VE( D3DRS_ZWRITEENABLE ),
  116. VE( D3DRS_ALPHATESTENABLE ),
  117. VE( D3DRS_LASTPIXEL ),
  118. VE( D3DRS_SRCBLEND ),
  119. VE( D3DRS_DESTBLEND ),
  120. VE( D3DRS_CULLMODE ),
  121. VE( D3DRS_ZFUNC ),
  122. VE( D3DRS_ALPHAREF ),
  123. VE( D3DRS_ALPHAFUNC ),
  124. VE( D3DRS_DITHERENABLE ),
  125. VE( D3DRS_ALPHABLENDENABLE ),
  126. VE( D3DRS_FOGENABLE ),
  127. VE( D3DRS_SPECULARENABLE ),
  128. VE( D3DRS_FOGCOLOR ),
  129. VE( D3DRS_FOGTABLEMODE ),
  130. VE( D3DRS_FOGSTART ),
  131. VE( D3DRS_FOGEND ),
  132. VE( D3DRS_FOGDENSITY ),
  133. VE( D3DRS_RANGEFOGENABLE ),
  134. VE( D3DRS_STENCILENABLE ),
  135. VE( D3DRS_STENCILFAIL ),
  136. VE( D3DRS_STENCILZFAIL ),
  137. VE( D3DRS_STENCILPASS ),
  138. VE( D3DRS_STENCILFUNC ),
  139. VE( D3DRS_STENCILREF ),
  140. VE( D3DRS_STENCILMASK ),
  141. VE( D3DRS_STENCILWRITEMASK ),
  142. VE( D3DRS_TEXTUREFACTOR ),
  143. VE( D3DRS_WRAP0 ),
  144. VE( D3DRS_WRAP1 ),
  145. VE( D3DRS_WRAP2 ),
  146. VE( D3DRS_WRAP3 ),
  147. VE( D3DRS_WRAP4 ),
  148. VE( D3DRS_WRAP5 ),
  149. VE( D3DRS_WRAP6 ),
  150. VE( D3DRS_WRAP7 ),
  151. VE( D3DRS_CLIPPING ),
  152. VE( D3DRS_LIGHTING ),
  153. VE( D3DRS_AMBIENT ),
  154. VE( D3DRS_FOGVERTEXMODE ),
  155. VE( D3DRS_COLORVERTEX ),
  156. VE( D3DRS_LOCALVIEWER ),
  157. VE( D3DRS_NORMALIZENORMALS ),
  158. VE( D3DRS_DIFFUSEMATERIALSOURCE ),
  159. VE( D3DRS_SPECULARMATERIALSOURCE ),
  160. VE( D3DRS_AMBIENTMATERIALSOURCE ),
  161. VE( D3DRS_EMISSIVEMATERIALSOURCE ),
  162. VE( D3DRS_VERTEXBLEND ),
  163. VE( D3DRS_CLIPPLANEENABLE ),
  164. VE( D3DRS_POINTSIZE ),
  165. VE( D3DRS_POINTSIZE_MIN ),
  166. VE( D3DRS_POINTSPRITEENABLE ),
  167. VE( D3DRS_POINTSCALEENABLE ),
  168. VE( D3DRS_POINTSCALE_A ),
  169. VE( D3DRS_POINTSCALE_B ),
  170. VE( D3DRS_POINTSCALE_C ),
  171. VE( D3DRS_MULTISAMPLEANTIALIAS ),
  172. VE( D3DRS_MULTISAMPLEMASK ),
  173. VE( D3DRS_PATCHEDGESTYLE ),
  174. VE( D3DRS_DEBUGMONITORTOKEN ),
  175. VE( D3DRS_POINTSIZE_MAX ),
  176. VE( D3DRS_INDEXEDVERTEXBLENDENABLE ),
  177. VE( D3DRS_COLORWRITEENABLE ),
  178. VE( D3DRS_TWEENFACTOR ),
  179. VE( D3DRS_BLENDOP ),
  180. VE( D3DRS_POSITIONDEGREE ),
  181. VE( D3DRS_NORMALDEGREE ),
  182. VE( D3DRS_SCISSORTESTENABLE ),
  183. VE( D3DRS_SLOPESCALEDEPTHBIAS ),
  184. VE( D3DRS_ANTIALIASEDLINEENABLE ),
  185. VE( D3DRS_MINTESSELLATIONLEVEL ),
  186. VE( D3DRS_MAXTESSELLATIONLEVEL ),
  187. VE( D3DRS_ADAPTIVETESS_X ),
  188. VE( D3DRS_ADAPTIVETESS_Y ),
  189. VE( D3DRS_ADAPTIVETESS_Z ),
  190. VE( D3DRS_ADAPTIVETESS_W ),
  191. VE( D3DRS_ENABLEADAPTIVETESSELLATION ),
  192. VE( D3DRS_TWOSIDEDSTENCILMODE ),
  193. VE( D3DRS_CCW_STENCILFAIL ),
  194. VE( D3DRS_CCW_STENCILZFAIL ),
  195. VE( D3DRS_CCW_STENCILPASS ),
  196. VE( D3DRS_CCW_STENCILFUNC ),
  197. VE( D3DRS_COLORWRITEENABLE1 ),
  198. VE( D3DRS_COLORWRITEENABLE2 ),
  199. VE( D3DRS_COLORWRITEENABLE3 ),
  200. VE( D3DRS_BLENDFACTOR ),
  201. VE( D3DRS_SRGBWRITEENABLE ),
  202. VE( D3DRS_DEPTHBIAS ),
  203. VE( D3DRS_WRAP8 ),
  204. VE( D3DRS_WRAP9 ),
  205. VE( D3DRS_WRAP10 ),
  206. VE( D3DRS_WRAP11 ),
  207. VE( D3DRS_WRAP12 ),
  208. VE( D3DRS_WRAP13 ),
  209. VE( D3DRS_WRAP14 ),
  210. VE( D3DRS_WRAP15 ),
  211. VE( D3DRS_SEPARATEALPHABLENDENABLE ),
  212. VE( D3DRS_SRCBLENDALPHA ),
  213. VE( D3DRS_DESTBLENDALPHA ),
  214. VE( D3DRS_BLENDOPALPHA ),
  215. VE( TERMVALUE )
  216. };
  217. const GLMValueEntry_t g_d3d_opcodes[] =
  218. {
  219. VE( D3DSIO_NOP ),
  220. VE( D3DSIO_PHASE ),
  221. VE( D3DSIO_RET ),
  222. VE( D3DSIO_ELSE ),
  223. VE( D3DSIO_ENDIF ),
  224. VE( D3DSIO_ENDLOOP ),
  225. VE( D3DSIO_ENDREP ),
  226. VE( D3DSIO_BREAK ),
  227. VE( D3DSIO_TEXDEPTH ),
  228. VE( D3DSIO_TEXKILL ),
  229. VE( D3DSIO_BEM ),
  230. VE( D3DSIO_TEXBEM ),
  231. VE( D3DSIO_TEXBEML ),
  232. VE( D3DSIO_TEXDP3 ),
  233. VE( D3DSIO_TEXDP3TEX ),
  234. VE( D3DSIO_TEXM3x2DEPTH ),
  235. VE( D3DSIO_TEXM3x2TEX ),
  236. VE( D3DSIO_TEXM3x3 ),
  237. VE( D3DSIO_TEXM3x3PAD ),
  238. VE( D3DSIO_TEXM3x3TEX ),
  239. VE( D3DSIO_TEXM3x3VSPEC ),
  240. VE( D3DSIO_TEXREG2AR ),
  241. VE( D3DSIO_TEXREG2GB ),
  242. VE( D3DSIO_TEXREG2RGB ),
  243. VE( D3DSIO_LABEL ),
  244. VE( D3DSIO_CALL ),
  245. VE( D3DSIO_IF ),
  246. VE( D3DSIO_LOOP ),
  247. VE( D3DSIO_REP ),
  248. VE( D3DSIO_BREAKP ),
  249. VE( D3DSIO_DSX ),
  250. VE( D3DSIO_DSY ),
  251. VE( D3DSIO_NRM ),
  252. VE( D3DSIO_MOVA ),
  253. VE( D3DSIO_MOV ),
  254. VE( D3DSIO_RCP ),
  255. VE( D3DSIO_RSQ ),
  256. VE( D3DSIO_EXP ),
  257. VE( D3DSIO_EXPP ),
  258. VE( D3DSIO_LOG ),
  259. VE( D3DSIO_LOGP ),
  260. VE( D3DSIO_FRC ),
  261. VE( D3DSIO_LIT ),
  262. VE( D3DSIO_ABS ),
  263. VE( D3DSIO_TEXM3x3SPEC ),
  264. VE( D3DSIO_M4x4 ),
  265. VE( D3DSIO_M4x3 ),
  266. VE( D3DSIO_M3x4 ),
  267. VE( D3DSIO_M3x3 ),
  268. VE( D3DSIO_M3x2 ),
  269. VE( D3DSIO_CALLNZ ),
  270. VE( D3DSIO_IFC ),
  271. VE( D3DSIO_BREAKC ),
  272. VE( D3DSIO_SETP ),
  273. VE( D3DSIO_TEXLDL ),
  274. VE( D3DSIO_ADD ),
  275. VE( D3DSIO_SUB ),
  276. VE( D3DSIO_MUL ),
  277. VE( D3DSIO_DP3 ),
  278. VE( D3DSIO_DP4 ),
  279. VE( D3DSIO_MIN ),
  280. VE( D3DSIO_MAX ),
  281. VE( D3DSIO_DST ),
  282. VE( D3DSIO_SLT ),
  283. VE( D3DSIO_SGE ),
  284. VE( D3DSIO_CRS ),
  285. VE( D3DSIO_POW ),
  286. VE( D3DSIO_DP2ADD ),
  287. VE( D3DSIO_LRP ),
  288. VE( D3DSIO_SGN ),
  289. VE( D3DSIO_CND ),
  290. VE( D3DSIO_CMP ),
  291. VE( D3DSIO_SINCOS ),
  292. VE( D3DSIO_MAD ),
  293. VE( D3DSIO_TEXLDD ),
  294. VE( D3DSIO_TEXCOORD ),
  295. VE( D3DSIO_TEX ),
  296. VE( D3DSIO_DCL ),
  297. VE( D3DSTT_UNKNOWN ),
  298. VE( D3DSTT_2D ),
  299. VE( D3DSTT_CUBE ),
  300. VE( D3DSTT_VOLUME ),
  301. VE( D3DSIO_DEFB ),
  302. VE( D3DSIO_DEFI ),
  303. VE( D3DSIO_DEF ),
  304. VE( D3DSIO_COMMENT ),
  305. VE( D3DSIO_END ),
  306. };
  307. const GLMValueEntry_t g_d3d_vtxdeclusages[] =
  308. {
  309. { D3DDECLUSAGE_POSITION ,"POSN" }, // P
  310. { D3DDECLUSAGE_BLENDWEIGHT ,"BLWT" }, // W
  311. { D3DDECLUSAGE_BLENDINDICES ,"BLIX" }, // I
  312. { D3DDECLUSAGE_NORMAL ,"NORM" }, // N
  313. { D3DDECLUSAGE_PSIZE ,"PSIZ" }, // S
  314. { D3DDECLUSAGE_TEXCOORD ,"TEXC" }, // T
  315. { D3DDECLUSAGE_TANGENT ,"TANG" }, // G
  316. { D3DDECLUSAGE_BINORMAL ,"BINO" }, // B
  317. { D3DDECLUSAGE_TESSFACTOR ,"TESS" }, // S
  318. { D3DDECLUSAGE_PLUGH ,"????" }, // ?
  319. { D3DDECLUSAGE_COLOR ,"COLR" }, // C
  320. { D3DDECLUSAGE_FOG ,"FOG " }, // F
  321. { D3DDECLUSAGE_DEPTH ,"DEPT" }, // D
  322. { D3DDECLUSAGE_SAMPLE ,"SAMP" } // M
  323. };
  324. const GLMValueEntry_t g_d3d_vtxdeclusages_short[] =
  325. {
  326. { D3DDECLUSAGE_POSITION ,"P" },
  327. { D3DDECLUSAGE_BLENDWEIGHT ,"W" },
  328. { D3DDECLUSAGE_BLENDINDICES ,"I" },
  329. { D3DDECLUSAGE_NORMAL ,"N" },
  330. { D3DDECLUSAGE_PSIZE ,"S" },
  331. { D3DDECLUSAGE_TEXCOORD ,"T" },
  332. { D3DDECLUSAGE_TANGENT ,"G" },
  333. { D3DDECLUSAGE_BINORMAL ,"B" },
  334. { D3DDECLUSAGE_TESSFACTOR ,"S" },
  335. { D3DDECLUSAGE_PLUGH ,"?" },
  336. { D3DDECLUSAGE_COLOR ,"C" },
  337. { D3DDECLUSAGE_FOG ,"F" },
  338. { D3DDECLUSAGE_DEPTH ,"D" },
  339. { D3DDECLUSAGE_SAMPLE ,"M" }
  340. };
  341. const GLMValueEntry_t g_cgl_rendids[] = // need to mask with 0xFFFFFF00 to match on these (ex: 8800GT == 0x00022608
  342. {
  343. #ifdef OSX
  344. VE( kCGLRendererGenericID ),
  345. VE( kCGLRendererGenericFloatID ),
  346. VE( kCGLRendererAppleSWID ),
  347. VE( kCGLRendererATIRage128ID ),
  348. VE( kCGLRendererATIRadeonID ),
  349. VE( kCGLRendererATIRageProID ),
  350. VE( kCGLRendererATIRadeon8500ID ),
  351. VE( kCGLRendererATIRadeon9700ID ),
  352. VE( kCGLRendererATIRadeonX1000ID ),
  353. VE( kCGLRendererATIRadeonX2000ID ),
  354. VE( kCGLRendererGeForce2MXID ),
  355. VE( kCGLRendererGeForce3ID ),
  356. VE( kCGLRendererGeForceFXID ), // also for GF6 and GF7
  357. VE( kCGLRendererGeForce8xxxID ),
  358. VE( kCGLRendererVTBladeXP2ID ),
  359. VE( kCGLRendererIntel900ID ),
  360. VE( kCGLRendererMesa3DFXID ),
  361. #endif
  362. VE( TERMVALUE )
  363. };
  364. const GLMValueEntry_t g_gl_errors[] =
  365. {
  366. VE( GL_INVALID_ENUM ),
  367. VE( GL_INVALID_VALUE ),
  368. VE( GL_INVALID_OPERATION ),
  369. VE( GL_STACK_OVERFLOW ),
  370. VE( GL_STACK_UNDERFLOW ),
  371. VE( GL_OUT_OF_MEMORY ),
  372. VE( GL_INVALID_FRAMEBUFFER_OPERATION_EXT ),
  373. VE( GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT ),
  374. VE( GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT ),
  375. VE( GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT ),
  376. VE( GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT ),
  377. VE( GL_FRAMEBUFFER_UNSUPPORTED_EXT ),
  378. VE( GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT ),
  379. VE( GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT )
  380. };
  381. // there are some ARB/EXT dupes in this table but that doesn't matter too much
  382. const GLMValueEntry_t g_gl_enums[] =
  383. {
  384. { 0x0000, "GL_ZERO" },
  385. { 0x0001, "GL_ONE" },
  386. { 0x0004, "GL_TRIANGLES" },
  387. { 0x0005, "GL_TRIANGLE_STRIP" },
  388. { 0x0006, "GL_TRIANGLE_FAN" },
  389. { 0x0007, "GL_QUADS" },
  390. { 0x0008, "GL_QUAD_STRIP" },
  391. { 0x0009, "GL_POLYGON" },
  392. { 0x0200, "GL_NEVER" },
  393. { 0x0201, "GL_LESS" },
  394. { 0x0202, "GL_EQUAL" },
  395. { 0x0203, "GL_LEQUAL" },
  396. { 0x0204, "GL_GREATER" },
  397. { 0x0205, "GL_NOTEQUAL" },
  398. { 0x0206, "GL_GEQUAL" },
  399. { 0x0207, "GL_ALWAYS" },
  400. { 0x0300, "GL_SRC_COLOR" },
  401. { 0x0301, "GL_ONE_MINUS_SRC_COLOR" },
  402. { 0x0302, "GL_SRC_ALPHA" },
  403. { 0x0303, "GL_ONE_MINUS_SRC_ALPHA" },
  404. { 0x0304, "GL_DST_ALPHA" },
  405. { 0x0305, "GL_ONE_MINUS_DST_ALPHA" },
  406. { 0x0306, "GL_DST_COLOR" },
  407. { 0x0307, "GL_ONE_MINUS_DST_COLOR" },
  408. { 0x0308, "GL_SRC_ALPHA_SATURATE" },
  409. { 0x0400, "GL_FRONT_LEFT" },
  410. { 0x0401, "GL_FRONT_RIGHT" },
  411. { 0x0402, "GL_BACK_LEFT" },
  412. { 0x0403, "GL_BACK_RIGHT" },
  413. { 0x0404, "GL_FRONT" },
  414. { 0x0405, "GL_BACK" },
  415. { 0x0406, "GL_LEFT" },
  416. { 0x0407, "GL_RIGHT" },
  417. { 0x0408, "GL_FRONT_AND_BACK" },
  418. { 0x0409, "GL_AUX0" },
  419. { 0x040A, "GL_AUX1" },
  420. { 0x040B, "GL_AUX2" },
  421. { 0x040C, "GL_AUX3" },
  422. { 0x0500, "GL_INVALID_ENUM" },
  423. { 0x0501, "GL_INVALID_VALUE" },
  424. { 0x0502, "GL_INVALID_OPERATION" },
  425. { 0x0503, "GL_STACK_OVERFLOW" },
  426. { 0x0504, "GL_STACK_UNDERFLOW" },
  427. { 0x0505, "GL_OUT_OF_MEMORY" },
  428. { 0x0506, "GL_INVALID_FRAMEBUFFER_OPERATION" },
  429. { 0x0600, "GL_2D" },
  430. { 0x0601, "GL_3D" },
  431. { 0x0602, "GL_3D_COLOR" },
  432. { 0x0603, "GL_3D_COLOR_TEXTURE" },
  433. { 0x0604, "GL_4D_COLOR_TEXTURE" },
  434. { 0x0700, "GL_PASS_THROUGH_TOKEN" },
  435. { 0x0701, "GL_POINT_TOKEN" },
  436. { 0x0702, "GL_LINE_TOKEN" },
  437. { 0x0703, "GL_POLYGON_TOKEN" },
  438. { 0x0704, "GL_BITMAP_TOKEN" },
  439. { 0x0705, "GL_DRAW_PIXEL_TOKEN" },
  440. { 0x0706, "GL_COPY_PIXEL_TOKEN" },
  441. { 0x0707, "GL_LINE_RESET_TOKEN" },
  442. { 0x0800, "GL_EXP" },
  443. { 0x0801, "GL_EXP2" },
  444. { 0x0900, "GL_CW" },
  445. { 0x0901, "GL_CCW" },
  446. { 0x0A00, "GL_COEFF" },
  447. { 0x0A01, "GL_ORDER" },
  448. { 0x0A02, "GL_DOMAIN" },
  449. { 0x0B00, "GL_CURRENT_COLOR" },
  450. { 0x0B01, "GL_CURRENT_INDEX" },
  451. { 0x0B02, "GL_CURRENT_NORMAL" },
  452. { 0x0B03, "GL_CURRENT_TEXTURE_COORDS" },
  453. { 0x0B04, "GL_CURRENT_RASTER_COLOR" },
  454. { 0x0B05, "GL_CURRENT_RASTER_INDEX" },
  455. { 0x0B06, "GL_CURRENT_RASTER_TEXTURE_COORDS" },
  456. { 0x0B07, "GL_CURRENT_RASTER_POSITION" },
  457. { 0x0B08, "GL_CURRENT_RASTER_POSITION_VALID" },
  458. { 0x0B09, "GL_CURRENT_RASTER_DISTANCE" },
  459. { 0x0B10, "GL_POINT_SMOOTH" },
  460. { 0x0B11, "GL_POINT_SIZE" },
  461. { 0x0B12, "GL_POINT_SIZE_RANGE" },
  462. { 0x0B12, "GL_SMOOTH_POINT_SIZE_RANGE" },
  463. { 0x0B13, "GL_POINT_SIZE_GRANULARITY" },
  464. { 0x0B13, "GL_SMOOTH_POINT_SIZE_GRANULARITY" },
  465. { 0x0B20, "GL_LINE_SMOOTH" },
  466. { 0x0B21, "GL_LINE_WIDTH" },
  467. { 0x0B22, "GL_LINE_WIDTH_RANGE" },
  468. { 0x0B22, "GL_SMOOTH_LINE_WIDTH_RANGE" },
  469. { 0x0B23, "GL_LINE_WIDTH_GRANULARITY" },
  470. { 0x0B23, "GL_SMOOTH_LINE_WIDTH_GRANULARITY" },
  471. { 0x0B24, "GL_LINE_STIPPLE" },
  472. { 0x0B25, "GL_LINE_STIPPLE_PATTERN" },
  473. { 0x0B26, "GL_LINE_STIPPLE_REPEAT" },
  474. { 0x0B30, "GL_LIST_MODE" },
  475. { 0x0B31, "GL_MAX_LIST_NESTING" },
  476. { 0x0B32, "GL_LIST_BASE" },
  477. { 0x0B33, "GL_LIST_INDEX" },
  478. { 0x0B40, "GL_POLYGON_MODE" },
  479. { 0x0B41, "GL_POLYGON_SMOOTH" },
  480. { 0x0B42, "GL_POLYGON_STIPPLE" },
  481. { 0x0B43, "GL_EDGE_FLAG" },
  482. { 0x0B44, "GL_CULL_FACE" },
  483. { 0x0B45, "GL_CULL_FACE_MODE" },
  484. { 0x0B46, "GL_FRONT_FACE" },
  485. { 0x0B50, "GL_LIGHTING" },
  486. { 0x0B51, "GL_LIGHT_MODEL_LOCAL_VIEWER" },
  487. { 0x0B52, "GL_LIGHT_MODEL_TWO_SIDE" },
  488. { 0x0B53, "GL_LIGHT_MODEL_AMBIENT" },
  489. { 0x0B54, "GL_SHADE_MODEL" },
  490. { 0x0B55, "GL_COLOR_MATERIAL_FACE" },
  491. { 0x0B56, "GL_COLOR_MATERIAL_PARAMETER" },
  492. { 0x0B57, "GL_COLOR_MATERIAL" },
  493. { 0x0B60, "GL_FOG" },
  494. { 0x0B61, "GL_FOG_INDEX" },
  495. { 0x0B62, "GL_FOG_DENSITY" },
  496. { 0x0B63, "GL_FOG_START" },
  497. { 0x0B64, "GL_FOG_END" },
  498. { 0x0B65, "GL_FOG_MODE" },
  499. { 0x0B66, "GL_FOG_COLOR" },
  500. { 0x0B70, "GL_DEPTH_RANGE" },
  501. { 0x0B71, "GL_DEPTH_TEST" },
  502. { 0x0B72, "GL_DEPTH_WRITEMASK" },
  503. { 0x0B73, "GL_DEPTH_CLEAR_VALUE" },
  504. { 0x0B74, "GL_DEPTH_FUNC" },
  505. { 0x0B80, "GL_ACCUM_CLEAR_VALUE" },
  506. { 0x0B90, "GL_STENCIL_TEST" },
  507. { 0x0B91, "GL_STENCIL_CLEAR_VALUE" },
  508. { 0x0B92, "GL_STENCIL_FUNC" },
  509. { 0x0B93, "GL_STENCIL_VALUE_MASK" },
  510. { 0x0B94, "GL_STENCIL_FAIL" },
  511. { 0x0B95, "GL_STENCIL_PASS_DEPTH_FAIL" },
  512. { 0x0B96, "GL_STENCIL_PASS_DEPTH_PASS" },
  513. { 0x0B97, "GL_STENCIL_REF" },
  514. { 0x0B98, "GL_STENCIL_WRITEMASK" },
  515. { 0x0BA0, "GL_MATRIX_MODE" },
  516. { 0x0BA1, "GL_NORMALIZE" },
  517. { 0x0BA2, "GL_VIEWPORT" },
  518. { 0x0BA3, "GL_MODELVIEW_STACK_DEPTH" },
  519. { 0x0BA4, "GL_PROJECTION_STACK_DEPTH" },
  520. { 0x0BA5, "GL_TEXTURE_STACK_DEPTH" },
  521. { 0x0BA6, "GL_MODELVIEW_MATRIX" },
  522. { 0x0BA7, "GL_PROJECTION_MATRIX" },
  523. { 0x0BA8, "GL_TEXTURE_MATRIX" },
  524. { 0x0BB0, "GL_ATTRIB_STACK_DEPTH" },
  525. { 0x0BB1, "GL_CLIENT_ATTRIB_STACK_DEPTH" },
  526. { 0x0BC0, "GL_ALPHA_TEST" },
  527. { 0x0BC1, "GL_ALPHA_TEST_FUNC" },
  528. { 0x0BC2, "GL_ALPHA_TEST_REF" },
  529. { 0x0BD0, "GL_DITHER" },
  530. { 0x0BE0, "GL_BLEND_DST" },
  531. { 0x0BE1, "GL_BLEND_SRC" },
  532. { 0x0BE2, "GL_BLEND" },
  533. { 0x0BF0, "GL_LOGIC_OP_MODE" },
  534. { 0x0BF1, "GL_INDEX_LOGIC_OP" },
  535. { 0x0BF2, "GL_COLOR_LOGIC_OP" },
  536. { 0x0C00, "GL_AUX_BUFFERS" },
  537. { 0x0C01, "GL_DRAW_BUFFER" },
  538. { 0x0C02, "GL_READ_BUFFER" },
  539. { 0x0C10, "GL_SCISSOR_BOX" },
  540. { 0x0C11, "GL_SCISSOR_TEST" },
  541. { 0x0C20, "GL_INDEX_CLEAR_VALUE" },
  542. { 0x0C21, "GL_INDEX_WRITEMASK" },
  543. { 0x0C22, "GL_COLOR_CLEAR_VALUE" },
  544. { 0x0C23, "GL_COLOR_WRITEMASK" },
  545. { 0x0C30, "GL_INDEX_MODE" },
  546. { 0x0C31, "GL_RGBA_MODE" },
  547. { 0x0C32, "GL_DOUBLEBUFFER" },
  548. { 0x0C33, "GL_STEREO" },
  549. { 0x0C40, "GL_RENDER_MODE" },
  550. { 0x0C50, "GL_PERSPECTIVE_CORRECTION_HINT" },
  551. { 0x0C51, "GL_POINT_SMOOTH_HINT" },
  552. { 0x0C52, "GL_LINE_SMOOTH_HINT" },
  553. { 0x0C53, "GL_POLYGON_SMOOTH_HINT" },
  554. { 0x0C54, "GL_FOG_HINT" },
  555. { 0x0C60, "GL_TEXTURE_GEN_S" },
  556. { 0x0C61, "GL_TEXTURE_GEN_T" },
  557. { 0x0C62, "GL_TEXTURE_GEN_R" },
  558. { 0x0C63, "GL_TEXTURE_GEN_Q" },
  559. { 0x0C70, "GL_PIXEL_MAP_I_TO_I" },
  560. { 0x0C71, "GL_PIXEL_MAP_S_TO_S" },
  561. { 0x0C72, "GL_PIXEL_MAP_I_TO_R" },
  562. { 0x0C73, "GL_PIXEL_MAP_I_TO_G" },
  563. { 0x0C74, "GL_PIXEL_MAP_I_TO_B" },
  564. { 0x0C75, "GL_PIXEL_MAP_I_TO_A" },
  565. { 0x0C76, "GL_PIXEL_MAP_R_TO_R" },
  566. { 0x0C77, "GL_PIXEL_MAP_G_TO_G" },
  567. { 0x0C78, "GL_PIXEL_MAP_B_TO_B" },
  568. { 0x0C79, "GL_PIXEL_MAP_A_TO_A" },
  569. { 0x0CB0, "GL_PIXEL_MAP_I_TO_I_SIZE" },
  570. { 0x0CB1, "GL_PIXEL_MAP_S_TO_S_SIZE" },
  571. { 0x0CB2, "GL_PIXEL_MAP_I_TO_R_SIZE" },
  572. { 0x0CB3, "GL_PIXEL_MAP_I_TO_G_SIZE" },
  573. { 0x0CB4, "GL_PIXEL_MAP_I_TO_B_SIZE" },
  574. { 0x0CB5, "GL_PIXEL_MAP_I_TO_A_SIZE" },
  575. { 0x0CB6, "GL_PIXEL_MAP_R_TO_R_SIZE" },
  576. { 0x0CB7, "GL_PIXEL_MAP_G_TO_G_SIZE" },
  577. { 0x0CB8, "GL_PIXEL_MAP_B_TO_B_SIZE" },
  578. { 0x0CB9, "GL_PIXEL_MAP_A_TO_A_SIZE" },
  579. { 0x0CF0, "GL_UNPACK_SWAP_BYTES" },
  580. { 0x0CF1, "GL_UNPACK_LSB_FIRST" },
  581. { 0x0CF2, "GL_UNPACK_ROW_LENGTH" },
  582. { 0x0CF3, "GL_UNPACK_SKIP_ROWS" },
  583. { 0x0CF4, "GL_UNPACK_SKIP_PIXELS" },
  584. { 0x0CF5, "GL_UNPACK_ALIGNMENT" },
  585. { 0x0D00, "GL_PACK_SWAP_BYTES" },
  586. { 0x0D01, "GL_PACK_LSB_FIRST" },
  587. { 0x0D02, "GL_PACK_ROW_LENGTH" },
  588. { 0x0D03, "GL_PACK_SKIP_ROWS" },
  589. { 0x0D04, "GL_PACK_SKIP_PIXELS" },
  590. { 0x0D05, "GL_PACK_ALIGNMENT" },
  591. { 0x0D10, "GL_MAP_COLOR" },
  592. { 0x0D11, "GL_MAP_STENCIL" },
  593. { 0x0D12, "GL_INDEX_SHIFT" },
  594. { 0x0D13, "GL_INDEX_OFFSET" },
  595. { 0x0D14, "GL_RED_SCALE" },
  596. { 0x0D15, "GL_RED_BIAS" },
  597. { 0x0D16, "GL_ZOOM_X" },
  598. { 0x0D17, "GL_ZOOM_Y" },
  599. { 0x0D18, "GL_GREEN_SCALE" },
  600. { 0x0D19, "GL_GREEN_BIAS" },
  601. { 0x0D1A, "GL_BLUE_SCALE" },
  602. { 0x0D1B, "GL_BLUE_BIAS" },
  603. { 0x0D1C, "GL_ALPHA_SCALE" },
  604. { 0x0D1D, "GL_ALPHA_BIAS" },
  605. { 0x0D1E, "GL_DEPTH_SCALE" },
  606. { 0x0D1F, "GL_DEPTH_BIAS" },
  607. { 0x0D30, "GL_MAX_EVAL_ORDER" },
  608. { 0x0D31, "GL_MAX_LIGHTS" },
  609. { 0x0D32, "GL_MAX_CLIP_PLANES" },
  610. { 0x0D33, "GL_MAX_TEXTURE_SIZE" },
  611. { 0x0D34, "GL_MAX_PIXEL_MAP_TABLE" },
  612. { 0x0D35, "GL_MAX_ATTRIB_STACK_DEPTH" },
  613. { 0x0D36, "GL_MAX_MODELVIEW_STACK_DEPTH" },
  614. { 0x0D37, "GL_MAX_NAME_STACK_DEPTH" },
  615. { 0x0D38, "GL_MAX_PROJECTION_STACK_DEPTH" },
  616. { 0x0D39, "GL_MAX_TEXTURE_STACK_DEPTH" },
  617. { 0x0D3A, "GL_MAX_VIEWPORT_DIMS" },
  618. { 0x0D3B, "GL_MAX_CLIENT_ATTRIB_STACK_DEPTH" },
  619. { 0x0D50, "GL_SUBPIXEL_BITS" },
  620. { 0x0D51, "GL_INDEX_BITS" },
  621. { 0x0D52, "GL_RED_BITS" },
  622. { 0x0D53, "GL_GREEN_BITS" },
  623. { 0x0D54, "GL_BLUE_BITS" },
  624. { 0x0D55, "GL_ALPHA_BITS" },
  625. { 0x0D56, "GL_DEPTH_BITS" },
  626. { 0x0D57, "GL_STENCIL_BITS" },
  627. { 0x0D58, "GL_ACCUM_RED_BITS" },
  628. { 0x0D59, "GL_ACCUM_GREEN_BITS" },
  629. { 0x0D5A, "GL_ACCUM_BLUE_BITS" },
  630. { 0x0D5B, "GL_ACCUM_ALPHA_BITS" },
  631. { 0x0D70, "GL_NAME_STACK_DEPTH" },
  632. { 0x0D80, "GL_AUTO_NORMAL" },
  633. { 0x0D90, "GL_MAP1_COLOR_4" },
  634. { 0x0D91, "GL_MAP1_INDEX" },
  635. { 0x0D92, "GL_MAP1_NORMAL" },
  636. { 0x0D93, "GL_MAP1_TEXTURE_COORD_1" },
  637. { 0x0D94, "GL_MAP1_TEXTURE_COORD_2" },
  638. { 0x0D95, "GL_MAP1_TEXTURE_COORD_3" },
  639. { 0x0D96, "GL_MAP1_TEXTURE_COORD_4" },
  640. { 0x0D97, "GL_MAP1_VERTEX_3" },
  641. { 0x0D98, "GL_MAP1_VERTEX_4" },
  642. { 0x0DB0, "GL_MAP2_COLOR_4" },
  643. { 0x0DB1, "GL_MAP2_INDEX" },
  644. { 0x0DB2, "GL_MAP2_NORMAL" },
  645. { 0x0DB3, "GL_MAP2_TEXTURE_COORD_1" },
  646. { 0x0DB4, "GL_MAP2_TEXTURE_COORD_2" },
  647. { 0x0DB5, "GL_MAP2_TEXTURE_COORD_3" },
  648. { 0x0DB6, "GL_MAP2_TEXTURE_COORD_4" },
  649. { 0x0DB7, "GL_MAP2_VERTEX_3" },
  650. { 0x0DB8, "GL_MAP2_VERTEX_4" },
  651. { 0x0DD0, "GL_MAP1_GRID_DOMAIN" },
  652. { 0x0DD1, "GL_MAP1_GRID_SEGMENTS" },
  653. { 0x0DD2, "GL_MAP2_GRID_DOMAIN" },
  654. { 0x0DD3, "GL_MAP2_GRID_SEGMENTS" },
  655. { 0x0DE0, "GL_TEXTURE_1D" },
  656. { 0x0DE1, "GL_TEXTURE_2D" },
  657. { 0x0DF0, "GL_FEEDBACK_BUFFER_POINTER" },
  658. { 0x0DF1, "GL_FEEDBACK_BUFFER_SIZE" },
  659. { 0x0DF2, "GL_FEEDBACK_BUFFER_TYPE" },
  660. { 0x0DF3, "GL_SELECTION_BUFFER_POINTER" },
  661. { 0x0DF4, "GL_SELECTION_BUFFER_SIZE" },
  662. { 0x1000, "GL_TEXTURE_WIDTH" },
  663. { 0x1001, "GL_TEXTURE_HEIGHT" },
  664. { 0x1003, "GL_TEXTURE_INTERNAL_FORMAT" },
  665. { 0x1004, "GL_TEXTURE_BORDER_COLOR" },
  666. { 0x1005, "GL_TEXTURE_BORDER" },
  667. { 0x1100, "GL_DONT_CARE" },
  668. { 0x1101, "GL_FASTEST" },
  669. { 0x1102, "GL_NICEST" },
  670. { 0x1200, "GL_AMBIENT" },
  671. { 0x1201, "GL_DIFFUSE" },
  672. { 0x1202, "GL_SPECULAR" },
  673. { 0x1203, "GL_POSITION" },
  674. { 0x1204, "GL_SPOT_DIRECTION" },
  675. { 0x1205, "GL_SPOT_EXPONENT" },
  676. { 0x1206, "GL_SPOT_CUTOFF" },
  677. { 0x1207, "GL_CONSTANT_ATTENUATION" },
  678. { 0x1208, "GL_LINEAR_ATTENUATION" },
  679. { 0x1209, "GL_QUADRATIC_ATTENUATION" },
  680. { 0x1300, "GL_COMPILE" },
  681. { 0x1301, "GL_COMPILE_AND_EXECUTE" },
  682. { 0x1400, "GL_BYTE " },
  683. { 0x1401, "GL_UBYTE" },
  684. { 0x1402, "GL_SHORT" },
  685. { 0x1403, "GL_USHRT" },
  686. { 0x1404, "GL_INT " },
  687. { 0x1405, "GL_UINT " },
  688. { 0x1406, "GL_FLOAT" },
  689. { 0x1407, "GL_2_BYTES" },
  690. { 0x1408, "GL_3_BYTES" },
  691. { 0x1409, "GL_4_BYTES" },
  692. { 0x140A, "GL_DOUBLE" },
  693. { 0x140B, "GL_HALF_FLOAT" },
  694. { 0x1500, "GL_CLEAR" },
  695. { 0x1501, "GL_AND" },
  696. { 0x1502, "GL_AND_REVERSE" },
  697. { 0x1503, "GL_COPY" },
  698. { 0x1504, "GL_AND_INVERTED" },
  699. { 0x1505, "GL_NOOP" },
  700. { 0x1506, "GL_XOR" },
  701. { 0x1507, "GL_OR" },
  702. { 0x1508, "GL_NOR" },
  703. { 0x1509, "GL_EQUIV" },
  704. { 0x150A, "GL_INVERT" },
  705. { 0x150B, "GL_OR_REVERSE" },
  706. { 0x150C, "GL_COPY_INVERTED" },
  707. { 0x150D, "GL_OR_INVERTED" },
  708. { 0x150E, "GL_NAND" },
  709. { 0x150F, "GL_SET" },
  710. { 0x1600, "GL_EMISSION" },
  711. { 0x1601, "GL_SHININESS" },
  712. { 0x1602, "GL_AMBIENT_AND_DIFFUSE" },
  713. { 0x1603, "GL_COLOR_INDEXES" },
  714. { 0x1700, "GL_MODELVIEW" },
  715. { 0x1700, "GL_MODELVIEW0_ARB" },
  716. { 0x1701, "GL_PROJECTION" },
  717. { 0x1702, "GL_TEXTURE" },
  718. { 0x1800, "GL_COLOR" },
  719. { 0x1801, "GL_DEPTH" },
  720. { 0x1802, "GL_STENCIL" },
  721. { 0x1900, "GL_COLOR_INDEX" },
  722. { 0x1901, "GL_STENCIL_INDEX" },
  723. { 0x1902, "GL_DEPTH_COMPONENT" },
  724. { 0x1903, "GL_RED" },
  725. { 0x1904, "GL_GREEN" },
  726. { 0x1905, "GL_BLUE" },
  727. { 0x1906, "GL_ALPHA" },
  728. { 0x1907, "GL_RGB" },
  729. { 0x1908, "GL_RGBA" },
  730. { 0x1909, "GL_LUMINANCE" },
  731. { 0x190A, "GL_LUMINANCE_ALPHA" },
  732. { 0x1A00, "GL_BITMAP" },
  733. { 0x1B00, "GL_POINT" },
  734. { 0x1B01, "GL_LINE" },
  735. { 0x1B02, "GL_FILL" },
  736. { 0x1C00, "GL_RENDER" },
  737. { 0x1C01, "GL_FEEDBACK" },
  738. { 0x1C02, "GL_SELECT" },
  739. { 0x1D00, "GL_FLAT" },
  740. { 0x1D01, "GL_SMOOTH" },
  741. { 0x1E00, "GL_KEEP" },
  742. { 0x1E01, "GL_REPLACE" },
  743. { 0x1E02, "GL_INCR" },
  744. { 0x1E03, "GL_DECR" },
  745. { 0x1F00, "GL_VENDOR" },
  746. { 0x1F01, "GL_RENDERER" },
  747. { 0x1F02, "GL_VERSION" },
  748. { 0x1F03, "GL_EXTENSIONS" },
  749. { 0x2000, "GL_S" },
  750. { 0x2001, "GL_T" },
  751. { 0x2002, "GL_R" },
  752. { 0x2003, "GL_Q" },
  753. { 0x2100, "GL_MODULATE" },
  754. { 0x2101, "GL_DECAL" },
  755. { 0x2200, "GL_TEXTURE_ENV_MODE" },
  756. { 0x2201, "GL_TEXTURE_ENV_COLOR" },
  757. { 0x2300, "GL_TEXTURE_ENV" },
  758. { 0x2400, "GL_EYE_LINEAR" },
  759. { 0x2401, "GL_OBJECT_LINEAR" },
  760. { 0x2402, "GL_SPHERE_MAP" },
  761. { 0x2500, "GL_TEXTURE_GEN_MODE" },
  762. { 0x2501, "GL_OBJECT_PLANE" },
  763. { 0x2502, "GL_EYE_PLANE" },
  764. { 0x2600, "GL_NEAREST" },
  765. { 0x2601, "GL_LINEAR" },
  766. { 0x2700, "GL_NEAREST_MIPMAP_NEAREST" },
  767. { 0x2701, "GL_LINEAR_MIPMAP_NEAREST" },
  768. { 0x2702, "GL_NEAREST_MIPMAP_LINEAR" },
  769. { 0x2703, "GL_LINEAR_MIPMAP_LINEAR" },
  770. { 0x2800, "GL_TEXTURE_MAG_FILTER" },
  771. { 0x2801, "GL_TEXTURE_MIN_FILTER" },
  772. { 0x2802, "GL_TEXTURE_WRAP_S" },
  773. { 0x2803, "GL_TEXTURE_WRAP_T" },
  774. { 0x2900, "GL_CLAMP" },
  775. { 0x2901, "GL_REPEAT" },
  776. { 0x2A00, "GL_POLYGON_OFFSET_UNITS" },
  777. { 0x2A01, "GL_POLYGON_OFFSET_POINT" },
  778. { 0x2A02, "GL_POLYGON_OFFSET_LINE" },
  779. { 0x2A10, "GL_R3_G3_B2" },
  780. { 0x2A20, "GL_V2F" },
  781. { 0x2A21, "GL_V3F" },
  782. { 0x2A22, "GL_C4UB_V2F" },
  783. { 0x2A23, "GL_C4UB_V3F" },
  784. { 0x2A24, "GL_C3F_V3F" },
  785. { 0x2A25, "GL_N3F_V3F" },
  786. { 0x2A26, "GL_C4F_N3F_V3F" },
  787. { 0x2A27, "GL_T2F_V3F" },
  788. { 0x2A28, "GL_T4F_V4F" },
  789. { 0x2A29, "GL_T2F_C4UB_V3F" },
  790. { 0x2A2A, "GL_T2F_C3F_V3F" },
  791. { 0x2A2B, "GL_T2F_N3F_V3F" },
  792. { 0x2A2C, "GL_T2F_C4F_N3F_V3F" },
  793. { 0x2A2D, "GL_T4F_C4F_N3F_V4F" },
  794. { 0x3000, "GL_CLIP_PLANE0" },
  795. { 0x3001, "GL_CLIP_PLANE1" },
  796. { 0x3002, "GL_CLIP_PLANE2" },
  797. { 0x3003, "GL_CLIP_PLANE3" },
  798. { 0x3004, "GL_CLIP_PLANE4" },
  799. { 0x3005, "GL_CLIP_PLANE5" },
  800. { 0x4000, "GL_LIGHT0" },
  801. { 0x4001, "GL_LIGHT1" },
  802. { 0x4002, "GL_LIGHT2" },
  803. { 0x4003, "GL_LIGHT3" },
  804. { 0x4004, "GL_LIGHT4" },
  805. { 0x4005, "GL_LIGHT5" },
  806. { 0x4006, "GL_LIGHT6" },
  807. { 0x4007, "GL_LIGHT7" },
  808. { 0x8000, "GL_ABGR_EXT" },
  809. { 0x8001, "GL_CONSTANT_COLOR" },
  810. { 0x8002, "GL_ONE_MINUS_CONSTANT_COLOR" },
  811. { 0x8003, "GL_CONSTANT_ALPHA" },
  812. { 0x8004, "GL_ONE_MINUS_CONSTANT_ALPHA" },
  813. { 0x8005, "GL_BLEND_COLOR" },
  814. { 0x8006, "GL_FUNC_ADD" },
  815. { 0x8007, "GL_MIN" },
  816. { 0x8008, "GL_MAX" },
  817. { 0x8009, "GL_BLEND_EQUATION_RGB" },
  818. { 0x8009, "GL_BLEND_EQUATION" },
  819. { 0x800A, "GL_FUNC_SUBTRACT" },
  820. { 0x800B, "GL_FUNC_REVERSE_SUBTRACT" },
  821. { 0x8010, "GL_CONVOLUTION_1D" },
  822. { 0x8011, "GL_CONVOLUTION_2D" },
  823. { 0x8012, "GL_SEPARABLE_2D" },
  824. { 0x8013, "GL_CONVOLUTION_BORDER_MODE" },
  825. { 0x8014, "GL_CONVOLUTION_FILTER_SCALE" },
  826. { 0x8015, "GL_CONVOLUTION_FILTER_BIAS" },
  827. { 0x8016, "GL_REDUCE" },
  828. { 0x8017, "GL_CONVOLUTION_FORMAT" },
  829. { 0x8018, "GL_CONVOLUTION_WIDTH" },
  830. { 0x8019, "GL_CONVOLUTION_HEIGHT" },
  831. { 0x801A, "GL_MAX_CONVOLUTION_WIDTH" },
  832. { 0x801B, "GL_MAX_CONVOLUTION_HEIGHT" },
  833. { 0x801C, "GL_POST_CONVOLUTION_RED_SCALE" },
  834. { 0x801D, "GL_POST_CONVOLUTION_GREEN_SCALE" },
  835. { 0x801E, "GL_POST_CONVOLUTION_BLUE_SCALE" },
  836. { 0x801F, "GL_POST_CONVOLUTION_ALPHA_SCALE" },
  837. { 0x8020, "GL_POST_CONVOLUTION_RED_BIAS" },
  838. { 0x8021, "GL_POST_CONVOLUTION_GREEN_BIAS" },
  839. { 0x8022, "GL_POST_CONVOLUTION_BLUE_BIAS" },
  840. { 0x8023, "GL_POST_CONVOLUTION_ALPHA_BIAS" },
  841. { 0x8024, "GL_HISTOGRAM" },
  842. { 0x8025, "GL_PROXY_HISTOGRAM" },
  843. { 0x8026, "GL_HISTOGRAM_WIDTH" },
  844. { 0x8027, "GL_HISTOGRAM_FORMAT" },
  845. { 0x8028, "GL_HISTOGRAM_RED_SIZE" },
  846. { 0x8029, "GL_HISTOGRAM_GREEN_SIZE" },
  847. { 0x802A, "GL_HISTOGRAM_BLUE_SIZE" },
  848. { 0x802B, "GL_HISTOGRAM_ALPHA_SIZE" },
  849. { 0x802C, "GL_HISTOGRAM_LUMINANCE_SIZE" },
  850. { 0x802D, "GL_HISTOGRAM_SINK" },
  851. { 0x802E, "GL_MINMAX" },
  852. { 0x802F, "GL_MINMAX_FORMAT" },
  853. { 0x8030, "GL_MINMAX_SINK" },
  854. { 0x8031, "GL_TABLE_TOO_LARGE" },
  855. { 0x8032, "GL_UNSIGNED_BYTE_3_3_2" },
  856. { 0x8033, "GL_UNSIGNED_SHORT_4_4_4_4" },
  857. { 0x8034, "GL_UNSIGNED_SHORT_5_5_5_1" },
  858. { 0x8035, "GL_UNSIGNED_INT_8_8_8_8" },
  859. { 0x8036, "GL_UNSIGNED_INT_10_10_10_2" },
  860. { 0x8037, "GL_POLYGON_OFFSET_FILL" },
  861. { 0x8038, "GL_POLYGON_OFFSET_FACTOR" },
  862. { 0x803A, "GL_RESCALE_NORMAL" },
  863. { 0x803B, "GL_ALPHA4" },
  864. { 0x803C, "GL_ALPHA8" },
  865. { 0x803D, "GL_ALPHA12" },
  866. { 0x803E, "GL_ALPHA16" },
  867. { 0x803F, "GL_LUMINANCE4" },
  868. { 0x8040, "GL_LUMINANCE8" },
  869. { 0x8041, "GL_LUMINANCE12" },
  870. { 0x8042, "GL_LUMINANCE16" },
  871. { 0x8043, "GL_LUMINANCE4_ALPHA4" },
  872. { 0x8044, "GL_LUMINANCE6_ALPHA2" },
  873. { 0x8045, "GL_LUMINANCE8_ALPHA8" },
  874. { 0x8046, "GL_LUMINANCE12_ALPHA4" },
  875. { 0x8047, "GL_LUMINANCE12_ALPHA12" },
  876. { 0x8048, "GL_LUMINANCE16_ALPHA16" },
  877. { 0x8049, "GL_INTENSITY" },
  878. { 0x804A, "GL_INTENSITY4" },
  879. { 0x804B, "GL_INTENSITY8" },
  880. { 0x804C, "GL_INTENSITY12" },
  881. { 0x804D, "GL_INTENSITY16" },
  882. { 0x804F, "GL_RGB4" },
  883. { 0x8050, "GL_RGB5" },
  884. { 0x8051, "GL_RGB8" },
  885. { 0x8052, "GL_RGB10" },
  886. { 0x8053, "GL_RGB12" },
  887. { 0x8054, "GL_RGB16" },
  888. { 0x8055, "GL_RGBA2" },
  889. { 0x8056, "GL_RGBA4" },
  890. { 0x8057, "GL_RGB5_A1" },
  891. { 0x8058, "GL_RGBA8" },
  892. { 0x8059, "GL_RGB10_A2" },
  893. { 0x805A, "GL_RGBA12" },
  894. { 0x805B, "GL_RGBA16" },
  895. { 0x805C, "GL_TEXTURE_RED_SIZE" },
  896. { 0x805D, "GL_TEXTURE_GREEN_SIZE" },
  897. { 0x805E, "GL_TEXTURE_BLUE_SIZE" },
  898. { 0x805F, "GL_TEXTURE_ALPHA_SIZE" },
  899. { 0x8060, "GL_TEXTURE_LUMINANCE_SIZE" },
  900. { 0x8061, "GL_TEXTURE_INTENSITY_SIZE" },
  901. { 0x8063, "GL_PROXY_TEXTURE_1D" },
  902. { 0x8064, "GL_PROXY_TEXTURE_2D" },
  903. { 0x8066, "GL_TEXTURE_PRIORITY" },
  904. { 0x8067, "GL_TEXTURE_RESIDENT" },
  905. { 0x8068, "GL_TEXTURE_BINDING_1D" },
  906. { 0x8069, "GL_TEXTURE_BINDING_2D" },
  907. { 0x806A, "GL_TEXTURE_BINDING_3D" },
  908. { 0x806B, "GL_PACK_SKIP_IMAGES" },
  909. { 0x806C, "GL_PACK_IMAGE_HEIGHT" },
  910. { 0x806D, "GL_UNPACK_SKIP_IMAGES" },
  911. { 0x806E, "GL_UNPACK_IMAGE_HEIGHT" },
  912. { 0x806F, "GL_TEXTURE_3D" },
  913. { 0x8070, "GL_PROXY_TEXTURE_3D" },
  914. { 0x8071, "GL_TEXTURE_DEPTH" },
  915. { 0x8072, "GL_TEXTURE_WRAP_R" },
  916. { 0x8073, "GL_MAX_3D_TEXTURE_SIZE" },
  917. { 0x8074, "GL_VERTEX_ARRAY" },
  918. { 0x8075, "GL_NORMAL_ARRAY" },
  919. { 0x8076, "GL_COLOR_ARRAY" },
  920. { 0x8077, "GL_INDEX_ARRAY" },
  921. { 0x8078, "GL_TEXTURE_COORD_ARRAY" },
  922. { 0x8079, "GL_EDGE_FLAG_ARRAY" },
  923. { 0x807A, "GL_VERTEX_ARRAY_SIZE" },
  924. { 0x807B, "GL_VERTEX_ARRAY_TYPE" },
  925. { 0x807C, "GL_VERTEX_ARRAY_STRIDE" },
  926. { 0x807E, "GL_NORMAL_ARRAY_TYPE" },
  927. { 0x807F, "GL_NORMAL_ARRAY_STRIDE" },
  928. { 0x8081, "GL_COLOR_ARRAY_SIZE" },
  929. { 0x8082, "GL_COLOR_ARRAY_TYPE" },
  930. { 0x8083, "GL_COLOR_ARRAY_STRIDE" },
  931. { 0x8085, "GL_INDEX_ARRAY_TYPE" },
  932. { 0x8086, "GL_INDEX_ARRAY_STRIDE" },
  933. { 0x8088, "GL_TEXTURE_COORD_ARRAY_SIZE" },
  934. { 0x8089, "GL_TEXTURE_COORD_ARRAY_TYPE" },
  935. { 0x808A, "GL_TEXTURE_COORD_ARRAY_STRIDE" },
  936. { 0x808C, "GL_EDGE_FLAG_ARRAY_STRIDE" },
  937. { 0x808E, "GL_VERTEX_ARRAY_POINTER" },
  938. { 0x808F, "GL_NORMAL_ARRAY_POINTER" },
  939. { 0x8090, "GL_COLOR_ARRAY_POINTER" },
  940. { 0x8091, "GL_INDEX_ARRAY_POINTER" },
  941. { 0x8092, "GL_TEXTURE_COORD_ARRAY_POINTER" },
  942. { 0x8093, "GL_EDGE_FLAG_ARRAY_POINTER" },
  943. { 0x809D, "GL_MULTISAMPLE_ARB" },
  944. { 0x809D, "GL_MULTISAMPLE" },
  945. { 0x809E, "GL_SAMPLE_ALPHA_TO_COVERAGE_ARB" },
  946. { 0x809E, "GL_SAMPLE_ALPHA_TO_COVERAGE" },
  947. { 0x809F, "GL_SAMPLE_ALPHA_TO_ONE_ARB" },
  948. { 0x809F, "GL_SAMPLE_ALPHA_TO_ONE" },
  949. { 0x80A0, "GL_SAMPLE_COVERAGE_ARB" },
  950. { 0x80A0, "GL_SAMPLE_COVERAGE" },
  951. { 0x80A0, "GL_SAMPLE_MASK_EXT" },
  952. { 0x80A1, "GL_1PASS_EXT" },
  953. { 0x80A2, "GL_2PASS_0_EXT" },
  954. { 0x80A3, "GL_2PASS_1_EXT" },
  955. { 0x80A4, "GL_4PASS_0_EXT" },
  956. { 0x80A5, "GL_4PASS_1_EXT" },
  957. { 0x80A6, "GL_4PASS_2_EXT" },
  958. { 0x80A7, "GL_4PASS_3_EXT" },
  959. { 0x80A8, "GL_SAMPLE_BUFFERS" },
  960. { 0x80A9, "GL_SAMPLES" },
  961. { 0x80AA, "GL_SAMPLE_COVERAGE_VALUE" },
  962. { 0x80AB, "GL_SAMPLE_COVERAGE_INVERT" },
  963. { 0x80AC, "GL_SAMPLE_PATTERN_EXT" },
  964. { 0x80B1, "GL_COLOR_MATRIX" },
  965. { 0x80B2, "GL_COLOR_MATRIX_STACK_DEPTH" },
  966. { 0x80B3, "GL_MAX_COLOR_MATRIX_STACK_DEPTH" },
  967. { 0x80B4, "GL_POST_COLOR_MATRIX_RED_SCALE" },
  968. { 0x80B5, "GL_POST_COLOR_MATRIX_GREEN_SCALE" },
  969. { 0x80B6, "GL_POST_COLOR_MATRIX_BLUE_SCALE" },
  970. { 0x80B7, "GL_POST_COLOR_MATRIX_ALPHA_SCALE" },
  971. { 0x80B8, "GL_POST_COLOR_MATRIX_RED_BIAS" },
  972. { 0x80B9, "GL_POST_COLOR_MATRIX_GREEN_BIAS" },
  973. { 0x80BA, "GL_POST_COLOR_MATRIX_BLUE_BIAS" },
  974. { 0x80BB, "GL_POST_COLOR_MATRIX_ALPHA_BIAS" },
  975. { 0x80BF, "GL_TEXTURE_COMPARE_FAIL_VALUE_ARB" },
  976. { 0x80C8, "GL_BLEND_DST_RGB" },
  977. { 0x80C9, "GL_BLEND_SRC_RGB" },
  978. { 0x80CA, "GL_BLEND_DST_ALPHA" },
  979. { 0x80CB, "GL_BLEND_SRC_ALPHA" },
  980. { 0x80CC, "GL_422_EXT" },
  981. { 0x80CD, "GL_422_REV_EXT" },
  982. { 0x80CE, "GL_422_AVERAGE_EXT" },
  983. { 0x80CF, "GL_422_REV_AVERAGE_EXT" },
  984. { 0x80D0, "GL_COLOR_TABLE" },
  985. { 0x80D1, "GL_POST_CONVOLUTION_COLOR_TABLE" },
  986. { 0x80D2, "GL_POST_COLOR_MATRIX_COLOR_TABLE" },
  987. { 0x80D3, "GL_PROXY_COLOR_TABLE" },
  988. { 0x80D4, "GL_PROXY_POST_CONVOLUTION_COLOR_TABLE" },
  989. { 0x80D5, "GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE" },
  990. { 0x80D6, "GL_COLOR_TABLE_SCALE" },
  991. { 0x80D7, "GL_COLOR_TABLE_BIAS" },
  992. { 0x80D8, "GL_COLOR_TABLE_FORMAT" },
  993. { 0x80D9, "GL_COLOR_TABLE_WIDTH" },
  994. { 0x80DA, "GL_COLOR_TABLE_RED_SIZE" },
  995. { 0x80DB, "GL_COLOR_TABLE_GREEN_SIZE" },
  996. { 0x80DC, "GL_COLOR_TABLE_BLUE_SIZE" },
  997. { 0x80DD, "GL_COLOR_TABLE_ALPHA_SIZE" },
  998. { 0x80DE, "GL_COLOR_TABLE_LUMINANCE_SIZE" },
  999. { 0x80DF, "GL_COLOR_TABLE_INTENSITY_SIZE" },
  1000. { 0x80E0, "GL_BGR_EXT" },
  1001. { 0x80E0, "GL_BGR" },
  1002. { 0x80E1, "GL_BGRA_EXT" },
  1003. { 0x80E1, "GL_BGRA" },
  1004. { 0x80E1, "GL_BGRA" },
  1005. { 0x80E2, "GL_COLOR_INDEX1_EXT" },
  1006. { 0x80E3, "GL_COLOR_INDEX2_EXT" },
  1007. { 0x80E4, "GL_COLOR_INDEX4_EXT" },
  1008. { 0x80E5, "GL_COLOR_INDEX8_EXT" },
  1009. { 0x80E6, "GL_COLOR_INDEX12_EXT" },
  1010. { 0x80E7, "GL_COLOR_INDEX16_EXT" },
  1011. { 0x80E8, "GL_MAX_ELEMENTS_VERTICES_EXT" },
  1012. { 0x80E8, "GL_MAX_ELEMENTS_VERTICES" },
  1013. { 0x80E9, "GL_MAX_ELEMENTS_INDICES_EXT" },
  1014. { 0x80E9, "GL_MAX_ELEMENTS_INDICES" },
  1015. { 0x80ED, "GL_TEXTURE_INDEX_SIZE_EXT" },
  1016. { 0x80F0, "GL_CLIP_VOLUME_CLIPPING_HINT_EXT" },
  1017. { 0x8126, "GL_POINT_SIZE_MIN_ARB" },
  1018. { 0x8126, "GL_POINT_SIZE_MIN" },
  1019. { 0x8127, "GL_POINT_SIZE_MAX_ARB" },
  1020. { 0x8127, "GL_POINT_SIZE_MAX" },
  1021. { 0x8128, "GL_POINT_FADE_THRESHOLD_SIZE_ARB" },
  1022. { 0x8128, "GL_POINT_FADE_THRESHOLD_SIZE" },
  1023. { 0x8129, "GL_POINT_DISTANCE_ATTENUATION_ARB" },
  1024. { 0x8129, "GL_POINT_DISTANCE_ATTENUATION" },
  1025. { 0x812D, "GL_CLAMP_TO_BORDER_ARB" },
  1026. { 0x812D, "GL_CLAMP_TO_BORDER" },
  1027. { 0x812F, "GL_CLAMP_TO_EDGE" },
  1028. { 0x813A, "GL_TEXTURE_MIN_LOD" },
  1029. { 0x813B, "GL_TEXTURE_MAX_LOD" },
  1030. { 0x813C, "GL_TEXTURE_BASE_LEVEL" },
  1031. { 0x813D, "GL_TEXTURE_MAX_LEVEL" },
  1032. { 0x8151, "GL_CONSTANT_BORDER" },
  1033. { 0x8153, "GL_REPLICATE_BORDER" },
  1034. { 0x8154, "GL_CONVOLUTION_BORDER_COLOR" },
  1035. { 0x8191, "GL_GENERATE_MIPMAP" },
  1036. { 0x8192, "GL_GENERATE_MIPMAP_HINT" },
  1037. { 0x81A5, "GL_DEPTH_COMPONENT16_ARB" },
  1038. { 0x81A5, "GL_DEPTH_COMPONENT16" },
  1039. { 0x81A6, "GL_DEPTH_COMPONENT24_ARB" },
  1040. { 0x81A6, "GL_DEPTH_COMPONENT24" },
  1041. { 0x81A7, "GL_DEPTH_COMPONENT32_ARB" },
  1042. { 0x81A7, "GL_DEPTH_COMPONENT32" },
  1043. { 0x81A8, "GL_ARRAY_ELEMENT_LOCK_FIRST_EXT" },
  1044. { 0x81A9, "GL_ARRAY_ELEMENT_LOCK_COUNT_EXT" },
  1045. { 0x81AA, "GL_CULL_VERTEX_EXT" },
  1046. { 0x81AB, "GL_CULL_VERTEX_EYE_POSITION_EXT" },
  1047. { 0x81AC, "GL_CULL_VERTEX_OBJECT_POSITION_EXT" },
  1048. { 0x81AD, "GL_IUI_V2F_EXT" },
  1049. { 0x81AE, "GL_IUI_V3F_EXT" },
  1050. { 0x81AF, "GL_IUI_N3F_V2F_EXT" },
  1051. { 0x81B0, "GL_IUI_N3F_V3F_EXT" },
  1052. { 0x81B1, "GL_T2F_IUI_V2F_EXT" },
  1053. { 0x81B2, "GL_T2F_IUI_V3F_EXT" },
  1054. { 0x81B3, "GL_T2F_IUI_N3F_V2F_EXT" },
  1055. { 0x81B4, "GL_T2F_IUI_N3F_V3F_EXT" },
  1056. { 0x81B5, "GL_INDEX_TEST_EXT" },
  1057. { 0x81B6, "GL_INDEX_TEST_FUNC_EXT" },
  1058. { 0x81B7, "GL_INDEX_TEST_REF_EXT" },
  1059. { 0x81B8, "GL_INDEX_MATERIAL_EXT" },
  1060. { 0x81B9, "GL_INDEX_MATERIAL_PARAMETER_EXT" },
  1061. { 0x81BA, "GL_INDEX_MATERIAL_FACE_EXT" },
  1062. { 0x81F8, "GL_LIGHT_MODEL_COLOR_CONTROL_EXT" },
  1063. { 0x81F8, "GL_LIGHT_MODEL_COLOR_CONTROL" },
  1064. { 0x81F9, "GL_SINGLE_COLOR_EXT" },
  1065. { 0x81F9, "GL_SINGLE_COLOR" },
  1066. { 0x81FA, "GL_SEPARATE_SPECULAR_COLOR_EXT" },
  1067. { 0x81FA, "GL_SEPARATE_SPECULAR_COLOR" },
  1068. { 0x81FB, "GL_SHARED_TEXTURE_PALETTE_EXT" },
  1069. { 0x8210, "GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING" },
  1070. { 0x8211, "GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE" },
  1071. { 0x8212, "GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE" },
  1072. { 0x8213, "GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE" },
  1073. { 0x8214, "GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE" },
  1074. { 0x8215, "GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE" },
  1075. { 0x8216, "GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE" },
  1076. { 0x8217, "GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE" },
  1077. { 0x8218, "GL_FRAMEBUFFER_DEFAULT" },
  1078. { 0x8219, "GL_FRAMEBUFFER_UNDEFINED" },
  1079. { 0x821A, "GL_DEPTH_STENCIL_ATTACHMENT" },
  1080. { 0x8225, "GL_COMPRESSED_RED" },
  1081. { 0x8226, "GL_COMPRESSED_RG" },
  1082. { 0x8227, "GL_RG" },
  1083. { 0x8228, "GL_RG_INTEGER" },
  1084. { 0x8229, "GL_R8" },
  1085. { 0x822A, "GL_R16" },
  1086. { 0x822B, "GL_RG8" },
  1087. { 0x822C, "GL_RG16" },
  1088. { 0x822D, "GL_R16F" },
  1089. { 0x822E, "GL_R32F" },
  1090. { 0x822F, "GL_RG16F" },
  1091. { 0x8230, "GL_RG32F" },
  1092. { 0x8231, "GL_R8I" },
  1093. { 0x8232, "GL_R8UI" },
  1094. { 0x8233, "GL_R16I" },
  1095. { 0x8234, "GL_R16UI" },
  1096. { 0x8235, "GL_R32I" },
  1097. { 0x8236, "GL_R32UI" },
  1098. { 0x8237, "GL_RG8I" },
  1099. { 0x8238, "GL_RG8UI" },
  1100. { 0x8239, "GL_RG16I" },
  1101. { 0x823A, "GL_RG16UI" },
  1102. { 0x823B, "GL_RG32I" },
  1103. { 0x823C, "GL_RG32UI" },
  1104. { 0x8330, "GL_PIXEL_TRANSFORM_2D_EXT" },
  1105. { 0x8331, "GL_PIXEL_MAG_FILTER_EXT" },
  1106. { 0x8332, "GL_PIXEL_MIN_FILTER_EXT" },
  1107. { 0x8333, "GL_PIXEL_CUBIC_WEIGHT_EXT" },
  1108. { 0x8334, "GL_CUBIC_EXT" },
  1109. { 0x8335, "GL_AVERAGE_EXT" },
  1110. { 0x8336, "GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT" },
  1111. { 0x8337, "GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT" },
  1112. { 0x8338, "GL_PIXEL_TRANSFORM_2D_MATRIX_EXT" },
  1113. { 0x8349, "GL_FRAGMENT_MATERIAL_EXT" },
  1114. { 0x834A, "GL_FRAGMENT_NORMAL_EXT" },
  1115. { 0x834C, "GL_FRAGMENT_COLOR_EXT" },
  1116. { 0x834D, "GL_ATTENUATION_EXT" },
  1117. { 0x834E, "GL_SHADOW_ATTENUATION_EXT" },
  1118. { 0x834F, "GL_TEXTURE_APPLICATION_MODE_EXT" },
  1119. { 0x8350, "GL_TEXTURE_LIGHT_EXT" },
  1120. { 0x8351, "GL_TEXTURE_MATERIAL_FACE_EXT" },
  1121. { 0x8352, "GL_TEXTURE_MATERIAL_PARAMETER_EXT" },
  1122. { 0x8362, "GL_UNSIGNED_BYTE_2_3_3_REV" },
  1123. { 0x8363, "GL_UNSIGNED_SHORT_5_6_5" },
  1124. { 0x8364, "GL_UNSIGNED_SHORT_5_6_5_REV" },
  1125. { 0x8365, "GL_UNSIGNED_SHORT_4_4_4_4_REV" },
  1126. { 0x8366, "GL_UNSIGNED_SHORT_1_5_5_5_REV" },
  1127. { 0x8367, "GL_UNSIGNED_INT_8_8_8_8_REV" },
  1128. { 0x8368, "GL_UNSIGNED_INT_2_10_10_10_REV" },
  1129. { 0x8370, "GL_MIRRORED_REPEAT_ARB" },
  1130. { 0x8370, "GL_MIRRORED_REPEAT" },
  1131. { 0x83F0, "GL_COMPRESSED_RGB_S3TC_DXT1_EXT" },
  1132. { 0x83F1, "GL_COMPRESSED_RGBA_S3TC_DXT1_EXT" },
  1133. { 0x83F2, "GL_COMPRESSED_RGBA_S3TC_DXT3_EXT" },
  1134. { 0x83F3, "GL_COMPRESSED_RGBA_S3TC_DXT5_EXT" },
  1135. { 0x8439, "GL_TANGENT_ARRAY_EXT" },
  1136. { 0x843A, "GL_BINORMAL_ARRAY_EXT" },
  1137. { 0x843B, "GL_CURRENT_TANGENT_EXT" },
  1138. { 0x843C, "GL_CURRENT_BINORMAL_EXT" },
  1139. { 0x843E, "GL_TANGENT_ARRAY_TYPE_EXT" },
  1140. { 0x843F, "GL_TANGENT_ARRAY_STRIDE_EXT" },
  1141. { 0x8440, "GL_BINORMAL_ARRAY_TYPE_EXT" },
  1142. { 0x8441, "GL_BINORMAL_ARRAY_STRIDE_EXT" },
  1143. { 0x8442, "GL_TANGENT_ARRAY_POINTER_EXT" },
  1144. { 0x8443, "GL_BINORMAL_ARRAY_POINTER_EXT" },
  1145. { 0x8444, "GL_MAP1_TANGENT_EXT" },
  1146. { 0x8445, "GL_MAP2_TANGENT_EXT" },
  1147. { 0x8446, "GL_MAP1_BINORMAL_EXT" },
  1148. { 0x8447, "GL_MAP2_BINORMAL_EXT" },
  1149. { 0x8450, "GL_FOG_COORD_SRC" },
  1150. { 0x8450, "GL_FOG_COORDINATE_SOURCE_EXT" },
  1151. { 0x8450, "GL_FOG_COORDINATE_SOURCE" },
  1152. { 0x8451, "GL_FOG_COORD" },
  1153. { 0x8451, "GL_FOG_COORDINATE_EXT" },
  1154. { 0x8451, "GL_FOG_COORDINATE" },
  1155. { 0x8452, "GL_FRAGMENT_DEPTH_EXT" },
  1156. { 0x8452, "GL_FRAGMENT_DEPTH" },
  1157. { 0x8453 , "GL_CURRENT_FOG_COORD" },
  1158. { 0x8453 , "GL_CURRENT_FOG_COORDINATE" },
  1159. { 0x8453, "GL_CURRENT_FOG_COORDINATE_EXT" },
  1160. { 0x8454, "GL_FOG_COORD_ARRAY_TYPE" },
  1161. { 0x8454, "GL_FOG_COORDINATE_ARRAY_TYPE_EXT" },
  1162. { 0x8454, "GL_FOG_COORDINATE_ARRAY_TYPE" },
  1163. { 0x8455, "GL_FOG_COORD_ARRAY_STRIDE" },
  1164. { 0x8455, "GL_FOG_COORDINATE_ARRAY_STRIDE_EXT" },
  1165. { 0x8455, "GL_FOG_COORDINATE_ARRAY_STRIDE" },
  1166. { 0x8456, "GL_FOG_COORD_ARRAY_POINTER" },
  1167. { 0x8456, "GL_FOG_COORDINATE_ARRAY_POINTER_EXT" },
  1168. { 0x8456, "GL_FOG_COORDINATE_ARRAY_POINTER" },
  1169. { 0x8457, "GL_FOG_COORD_ARRAY" },
  1170. { 0x8457, "GL_FOG_COORDINATE_ARRAY_EXT" },
  1171. { 0x8457, "GL_FOG_COORDINATE_ARRAY" },
  1172. { 0x8458, "GL_COLOR_SUM_ARB" },
  1173. { 0x8458, "GL_COLOR_SUM_EXT" },
  1174. { 0x8458, "GL_COLOR_SUM" },
  1175. { 0x8459, "GL_CURRENT_SECONDARY_COLOR_EXT" },
  1176. { 0x8459, "GL_CURRENT_SECONDARY_COLOR" },
  1177. { 0x845A, "GL_SECONDARY_COLOR_ARRAY_SIZE_EXT" },
  1178. { 0x845A, "GL_SECONDARY_COLOR_ARRAY_SIZE" },
  1179. { 0x845B, "GL_SECONDARY_COLOR_ARRAY_TYPE_EXT" },
  1180. { 0x845B, "GL_SECONDARY_COLOR_ARRAY_TYPE" },
  1181. { 0x845C, "GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT" },
  1182. { 0x845C, "GL_SECONDARY_COLOR_ARRAY_STRIDE" },
  1183. { 0x845D, "GL_SECONDARY_COLOR_ARRAY_POINTER_EXT" },
  1184. { 0x845D, "GL_SECONDARY_COLOR_ARRAY_POINTER" },
  1185. { 0x845E, "GL_SECONDARY_COLOR_ARRAY_EXT" },
  1186. { 0x845E, "GL_SECONDARY_COLOR_ARRAY" },
  1187. { 0x845F, "GL_CURRENT_RASTER_SECONDARY_COLOR" },
  1188. { 0x846D, "GL_ALIASED_POINT_SIZE_RANGE" },
  1189. { 0x846E, "GL_ALIASED_LINE_WIDTH_RANGE" },
  1190. { 0x84C0, "GL_TEXTURE0" },
  1191. { 0x84C1, "GL_TEXTURE1" },
  1192. { 0x84C2, "GL_TEXTURE2" },
  1193. { 0x84C3, "GL_TEXTURE3" },
  1194. { 0x84C4, "GL_TEXTURE4" },
  1195. { 0x84C5, "GL_TEXTURE5" },
  1196. { 0x84C6, "GL_TEXTURE6" },
  1197. { 0x84C7, "GL_TEXTURE7" },
  1198. { 0x84C8, "GL_TEXTURE8" },
  1199. { 0x84C9, "GL_TEXTURE9" },
  1200. { 0x84CA, "GL_TEXTURE10" },
  1201. { 0x84CB, "GL_TEXTURE11" },
  1202. { 0x84CC, "GL_TEXTURE12" },
  1203. { 0x84CD, "GL_TEXTURE13" },
  1204. { 0x84CE, "GL_TEXTURE14" },
  1205. { 0x84CF, "GL_TEXTURE15" },
  1206. { 0x84D0, "GL_TEXTURE16" },
  1207. { 0x84D1, "GL_TEXTURE17" },
  1208. { 0x84D2, "GL_TEXTURE18" },
  1209. { 0x84D3, "GL_TEXTURE19" },
  1210. { 0x84D4, "GL_TEXTURE20" },
  1211. { 0x84D5, "GL_TEXTURE21" },
  1212. { 0x84D6, "GL_TEXTURE22" },
  1213. { 0x84D7, "GL_TEXTURE23" },
  1214. { 0x84D8, "GL_TEXTURE24" },
  1215. { 0x84D9, "GL_TEXTURE25" },
  1216. { 0x84DA, "GL_TEXTURE26" },
  1217. { 0x84DB, "GL_TEXTURE27" },
  1218. { 0x84DC, "GL_TEXTURE28" },
  1219. { 0x84DD, "GL_TEXTURE29" },
  1220. { 0x84DE, "GL_TEXTURE30" },
  1221. { 0x84DF, "GL_TEXTURE31" },
  1222. { 0x84E0, "GL_ACTIVE_TEXTURE" },
  1223. { 0x84E1, "GL_CLIENT_ACTIVE_TEXTURE" },
  1224. { 0x84E2, "GL_MAX_TEXTURE_UNITS" },
  1225. { 0x84E3, "GL_TRANSPOSE_MODELVIEW_MATRIX" },
  1226. { 0x84E4, "GL_TRANSPOSE_PROJECTION_MATRIX" },
  1227. { 0x84E5, "GL_TRANSPOSE_TEXTURE_MATRIX" },
  1228. { 0x84E6, "GL_TRANSPOSE_COLOR_MATRIX" },
  1229. { 0x84E7, "GL_SUBTRACT" },
  1230. { 0x84E8, "GL_MAX_RENDERBUFFER_SIZE" },
  1231. { 0x84E9, "GL_COMPRESSED_ALPHA" },
  1232. { 0x84EA, "GL_COMPRESSED_LUMINANCE" },
  1233. { 0x84EB, "GL_COMPRESSED_LUMINANCE_ALPHA" },
  1234. { 0x84EC, "GL_COMPRESSED_INTENSITY" },
  1235. { 0x84ED, "GL_COMPRESSED_RGB" },
  1236. { 0x84EE, "GL_COMPRESSED_RGBA" },
  1237. { 0x84EF, "GL_TEXTURE_COMPRESSION_HINT" },
  1238. { 0x84F5, "GL_TEXTURE_RECTANGLE_EXT" },
  1239. { 0x84F6, "GL_TEXTURE_BINDING_RECTANGLE_EXT" },
  1240. { 0x84F7, "GL_PROXY_TEXTURE_RECTANGLE_EXT" },
  1241. { 0x84F8, "GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT" },
  1242. { 0x84F9, "GL_DEPTH_STENCIL" },
  1243. { 0x84FA, "GL_UNSIGNED_INT_24_8" },
  1244. { 0x84FD, "GL_MAX_TEXTURE_LOD_BIAS" },
  1245. { 0x84FE, "GL_TEXTURE_MAX_ANISOTROPY_EXT" },
  1246. { 0x84FF, "GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT" },
  1247. { 0x8500, "GL_TEXTURE_FILTER_CONTROL" },
  1248. { 0x8501, "GL_TEXTURE_LOD_BIAS" },
  1249. { 0x8502, "GL_MODELVIEW1_STACK_DEPTH_EXT" },
  1250. { 0x8506, "GL_MODELVIEW_MATRIX1_EXT" },
  1251. { 0x8507, "GL_INCR_WRAP" },
  1252. { 0x8508, "GL_DECR_WRAP" },
  1253. { 0x8509, "GL_VERTEX_WEIGHTING_EXT" },
  1254. { 0x850A, "GL_MODELVIEW1_ARB" },
  1255. { 0x850B, "GL_CURRENT_VERTEX_WEIGHT_EXT" },
  1256. { 0x850C, "GL_VERTEX_WEIGHT_ARRAY_EXT" },
  1257. { 0x850D, "GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT" },
  1258. { 0x850E, "GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT" },
  1259. { 0x850F, "GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT" },
  1260. { 0x8510, "GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT" },
  1261. { 0x8511, "GL_NORMAL_MAP_ARB" },
  1262. { 0x8511, "GL_NORMAL_MAP_EXT" },
  1263. { 0x8511, "GL_NORMAL_MAP" },
  1264. { 0x8512, "GL_REFLECTION_MAP_ARB" },
  1265. { 0x8512, "GL_REFLECTION_MAP_EXT" },
  1266. { 0x8512, "GL_REFLECTION_MAP" },
  1267. { 0x8513, "GL_TEXTURE_CUBE_MAP_ARB" },
  1268. { 0x8513, "GL_TEXTURE_CUBE_MAP_EXT" },
  1269. { 0x8513, "GL_TEXTURE_CUBE_MAP" },
  1270. { 0x8514, "GL_TEXTURE_BINDING_CUBE_MAP_ARB" },
  1271. { 0x8514, "GL_TEXTURE_BINDING_CUBE_MAP_EXT" },
  1272. { 0x8514, "GL_TEXTURE_BINDING_CUBE_MAP" },
  1273. { 0x8515, "GL_TEXTURE_CUBE_MAP_POSITIVE_X" },
  1274. { 0x8516, "GL_TEXTURE_CUBE_MAP_NEGATIVE_X" },
  1275. { 0x8517, "GL_TEXTURE_CUBE_MAP_POSITIVE_Y" },
  1276. { 0x8518, "GL_TEXTURE_CUBE_MAP_NEGATIVE_Y" },
  1277. { 0x8519, "GL_TEXTURE_CUBE_MAP_POSITIVE_Z" },
  1278. { 0x851A, "GL_TEXTURE_CUBE_MAP_NEGATIVE_Z" },
  1279. { 0x851B, "GL_PROXY_TEXTURE_CUBE_MAP" },
  1280. { 0x851C, "GL_MAX_CUBE_MAP_TEXTURE_SIZE" },
  1281. { 0x851D, "GL_VERTEX_ARRAY_RANGE_APPLE" },
  1282. { 0x851E, "GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE" },
  1283. { 0x851F, "GL_VERTEX_ARRAY_STORAGE_HINT_APPLE" },
  1284. { 0x8520, "GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE" },
  1285. { 0x8521, "GL_VERTEX_ARRAY_RANGE_POINTER_APPLE" },
  1286. { 0x8570, "GL_COMBINE_ARB" },
  1287. { 0x8570, "GL_COMBINE_EXT" },
  1288. { 0x8570, "GL_COMBINE" },
  1289. { 0x8571, "GL_COMBINE_RGB_ARB" },
  1290. { 0x8571, "GL_COMBINE_RGB_EXT" },
  1291. { 0x8571, "GL_COMBINE_RGB" },
  1292. { 0x8572, "GL_COMBINE_ALPHA_ARB" },
  1293. { 0x8572, "GL_COMBINE_ALPHA_EXT" },
  1294. { 0x8572, "GL_COMBINE_ALPHA" },
  1295. { 0x8573, "GL_RGB_SCALE_ARB" },
  1296. { 0x8573, "GL_RGB_SCALE_EXT" },
  1297. { 0x8573, "GL_RGB_SCALE" },
  1298. { 0x8574, "GL_ADD_SIGNED_ARB" },
  1299. { 0x8574, "GL_ADD_SIGNED_EXT" },
  1300. { 0x8574, "GL_ADD_SIGNED" },
  1301. { 0x8575, "GL_INTERPOLATE_ARB" },
  1302. { 0x8575, "GL_INTERPOLATE_EXT" },
  1303. { 0x8575, "GL_INTERPOLATE" },
  1304. { 0x8576, "GL_CONSTANT_ARB" },
  1305. { 0x8576, "GL_CONSTANT_EXT" },
  1306. { 0x8576, "GL_CONSTANT" },
  1307. { 0x8577, "GL_PRIMARY_COLOR_ARB" },
  1308. { 0x8577, "GL_PRIMARY_COLOR_EXT" },
  1309. { 0x8577, "GL_PRIMARY_COLOR" },
  1310. { 0x8578, "GL_PREVIOUS_ARB" },
  1311. { 0x8578, "GL_PREVIOUS_EXT" },
  1312. { 0x8578, "GL_PREVIOUS" },
  1313. { 0x8580, "GL_SOURCE0_RGB_ARB" },
  1314. { 0x8580, "GL_SOURCE0_RGB_EXT" },
  1315. { 0x8580, "GL_SOURCE0_RGB" },
  1316. { 0x8580, "GL_SRC0_RGB" },
  1317. { 0x8581, "GL_SOURCE1_RGB_ARB" },
  1318. { 0x8581, "GL_SOURCE1_RGB_EXT" },
  1319. { 0x8581, "GL_SOURCE1_RGB" },
  1320. { 0x8581, "GL_SRC1_RGB" },
  1321. { 0x8582, "GL_SOURCE2_RGB_ARB" },
  1322. { 0x8582, "GL_SOURCE2_RGB_EXT" },
  1323. { 0x8582, "GL_SOURCE2_RGB" },
  1324. { 0x8582, "GL_SRC2_RGB" },
  1325. { 0x8583, "GL_SOURCE3_RGB_ARB" },
  1326. { 0x8583, "GL_SOURCE3_RGB_EXT" },
  1327. { 0x8583, "GL_SOURCE3_RGB" },
  1328. { 0x8583, "GL_SRC3_RGB" },
  1329. { 0x8584, "GL_SOURCE4_RGB_ARB" },
  1330. { 0x8584, "GL_SOURCE4_RGB_EXT" },
  1331. { 0x8584, "GL_SOURCE4_RGB" },
  1332. { 0x8584, "GL_SRC4_RGB" },
  1333. { 0x8585, "GL_SOURCE5_RGB_ARB" },
  1334. { 0x8585, "GL_SOURCE5_RGB_EXT" },
  1335. { 0x8585, "GL_SOURCE5_RGB" },
  1336. { 0x8585, "GL_SRC5_RGB" },
  1337. { 0x8586, "GL_SOURCE6_RGB_ARB" },
  1338. { 0x8586, "GL_SOURCE6_RGB_EXT" },
  1339. { 0x8586, "GL_SOURCE6_RGB" },
  1340. { 0x8586, "GL_SRC6_RGB" },
  1341. { 0x8587, "GL_SOURCE7_RGB_ARB" },
  1342. { 0x8587, "GL_SOURCE7_RGB_EXT" },
  1343. { 0x8587, "GL_SOURCE7_RGB" },
  1344. { 0x8587, "GL_SRC7_RGB" },
  1345. { 0x8588, "GL_SOURCE0_ALPHA_ARB" },
  1346. { 0x8588, "GL_SOURCE0_ALPHA_EXT" },
  1347. { 0x8588, "GL_SOURCE0_ALPHA" },
  1348. { 0x8588, "GL_SRC0_ALPHA" },
  1349. { 0x8589, "GL_SOURCE1_ALPHA_ARB" },
  1350. { 0x8589, "GL_SOURCE1_ALPHA_EXT" },
  1351. { 0x8589, "GL_SOURCE1_ALPHA" },
  1352. { 0x8589, "GL_SRC1_ALPHA" },
  1353. { 0x858A, "GL_SOURCE2_ALPHA_ARB" },
  1354. { 0x858A, "GL_SOURCE2_ALPHA_EXT" },
  1355. { 0x858A, "GL_SOURCE2_ALPHA" },
  1356. { 0x858A, "GL_SRC2_ALPHA" },
  1357. { 0x858B, "GL_SOURCE3_ALPHA_ARB" },
  1358. { 0x858B, "GL_SOURCE3_ALPHA_EXT" },
  1359. { 0x858B, "GL_SOURCE3_ALPHA" },
  1360. { 0x858B, "GL_SRC3_ALPHA" },
  1361. { 0x858C, "GL_SOURCE4_ALPHA_ARB" },
  1362. { 0x858C, "GL_SOURCE4_ALPHA_EXT" },
  1363. { 0x858C, "GL_SOURCE4_ALPHA" },
  1364. { 0x858C, "GL_SRC4_ALPHA" },
  1365. { 0x858D, "GL_SOURCE5_ALPHA_ARB" },
  1366. { 0x858D, "GL_SOURCE5_ALPHA_EXT" },
  1367. { 0x858D, "GL_SOURCE5_ALPHA" },
  1368. { 0x858D, "GL_SRC5_ALPHA" },
  1369. { 0x858E, "GL_SOURCE6_ALPHA_ARB" },
  1370. { 0x858E, "GL_SOURCE6_ALPHA_EXT" },
  1371. { 0x858E, "GL_SOURCE6_ALPHA" },
  1372. { 0x858E, "GL_SRC6_ALPHA" },
  1373. { 0x858F, "GL_SOURCE7_ALPHA_ARB" },
  1374. { 0x858F, "GL_SOURCE7_ALPHA_EXT" },
  1375. { 0x858F, "GL_SOURCE7_ALPHA" },
  1376. { 0x858F, "GL_SRC7_ALPHA" },
  1377. { 0x8590, "GL_OPERAND0_RGB_ARB" },
  1378. { 0x8590, "GL_OPERAND0_RGB_EXT" },
  1379. { 0x8590, "GL_OPERAND0_RGB" },
  1380. { 0x8591, "GL_OPERAND1_RGB_ARB" },
  1381. { 0x8591, "GL_OPERAND1_RGB_EXT" },
  1382. { 0x8591, "GL_OPERAND1_RGB" },
  1383. { 0x8592, "GL_OPERAND2_RGB_ARB" },
  1384. { 0x8592, "GL_OPERAND2_RGB_EXT" },
  1385. { 0x8592, "GL_OPERAND2_RGB" },
  1386. { 0x8593, "GL_OPERAND3_RGB_ARB" },
  1387. { 0x8593, "GL_OPERAND3_RGB_EXT" },
  1388. { 0x8593, "GL_OPERAND3_RGB" },
  1389. { 0x8594, "GL_OPERAND4_RGB_ARB" },
  1390. { 0x8594, "GL_OPERAND4_RGB_EXT" },
  1391. { 0x8594, "GL_OPERAND4_RGB" },
  1392. { 0x8595, "GL_OPERAND5_RGB_ARB" },
  1393. { 0x8595, "GL_OPERAND5_RGB_EXT" },
  1394. { 0x8595, "GL_OPERAND5_RGB" },
  1395. { 0x8596, "GL_OPERAND6_RGB_ARB" },
  1396. { 0x8596, "GL_OPERAND6_RGB_EXT" },
  1397. { 0x8596, "GL_OPERAND6_RGB" },
  1398. { 0x8597, "GL_OPERAND7_RGB_ARB" },
  1399. { 0x8597, "GL_OPERAND7_RGB_EXT" },
  1400. { 0x8597, "GL_OPERAND7_RGB" },
  1401. { 0x8598, "GL_OPERAND0_ALPHA_ARB" },
  1402. { 0x8598, "GL_OPERAND0_ALPHA_EXT" },
  1403. { 0x8598, "GL_OPERAND0_ALPHA" },
  1404. { 0x8599, "GL_OPERAND1_ALPHA_ARB" },
  1405. { 0x8599, "GL_OPERAND1_ALPHA_EXT" },
  1406. { 0x8599, "GL_OPERAND1_ALPHA" },
  1407. { 0x859A, "GL_OPERAND2_ALPHA_ARB" },
  1408. { 0x859A, "GL_OPERAND2_ALPHA_EXT" },
  1409. { 0x859A, "GL_OPERAND2_ALPHA" },
  1410. { 0x859B, "GL_OPERAND3_ALPHA_ARB" },
  1411. { 0x859B, "GL_OPERAND3_ALPHA_EXT" },
  1412. { 0x859B, "GL_OPERAND3_ALPHA" },
  1413. { 0x859C, "GL_OPERAND4_ALPHA_ARB" },
  1414. { 0x859C, "GL_OPERAND4_ALPHA_EXT" },
  1415. { 0x859C, "GL_OPERAND4_ALPHA" },
  1416. { 0x859D, "GL_OPERAND5_ALPHA_ARB" },
  1417. { 0x859D, "GL_OPERAND5_ALPHA_EXT" },
  1418. { 0x859D, "GL_OPERAND5_ALPHA" },
  1419. { 0x859E, "GL_OPERAND6_ALPHA_ARB" },
  1420. { 0x859E, "GL_OPERAND6_ALPHA_EXT" },
  1421. { 0x859E, "GL_OPERAND6_ALPHA" },
  1422. { 0x859F, "GL_OPERAND7_ALPHA_ARB" },
  1423. { 0x859F, "GL_OPERAND7_ALPHA_EXT" },
  1424. { 0x859F, "GL_OPERAND7_ALPHA" },
  1425. { 0x85AE, "GL_PERTURB_EXT" },
  1426. { 0x85AF, "GL_TEXTURE_NORMAL_EXT" },
  1427. { 0x85B4, "GL_STORAGE_CLIENT_APPLE" },
  1428. { 0x85B5, "GL_VERTEX_ARRAY_BINDING_APPLE" },
  1429. { 0x85BD, "GL_STORAGE_PRIVATE_APPLE" },
  1430. { 0x85BE, "GL_STORAGE_CACHED_APPLE" },
  1431. { 0x85BF, "GL_STORAGE_SHARED_APPLE" },
  1432. { 0x8620, "GL_VERTEX_PROGRAM_ARB" },
  1433. { 0x8620, "GL_VERTEX_PROGRAM_NV" },
  1434. { 0x8621, "GL_VERTEX_STATE_PROGRAM_NV" },
  1435. { 0x8622, "GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB" },
  1436. { 0x8622, "GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB" },
  1437. { 0x8622, "GL_VERTEX_ATTRIB_ARRAY_ENABLED" },
  1438. { 0x8623, "GL_ATTRIB_ARRAY_SIZE_NV" },
  1439. { 0x8623, "GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB" },
  1440. { 0x8623, "GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB" },
  1441. { 0x8623, "GL_VERTEX_ATTRIB_ARRAY_SIZE" },
  1442. { 0x8624, "GL_ATTRIB_ARRAY_STRIDE_NV" },
  1443. { 0x8624, "GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB" },
  1444. { 0x8624, "GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB" },
  1445. { 0x8624, "GL_VERTEX_ATTRIB_ARRAY_STRIDE" },
  1446. { 0x8625, "GL_ATTRIB_ARRAY_TYPE_NV" },
  1447. { 0x8625, "GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB" },
  1448. { 0x8625, "GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB" },
  1449. { 0x8625, "GL_VERTEX_ATTRIB_ARRAY_TYPE" },
  1450. { 0x8626, "GL_CURRENT_ATTRIB_NV" },
  1451. { 0x8626, "GL_CURRENT_VERTEX_ATTRIB_ARB" },
  1452. { 0x8626, "GL_CURRENT_VERTEX_ATTRIB_ARB" },
  1453. { 0x8626, "GL_CURRENT_VERTEX_ATTRIB" },
  1454. { 0x8627, "GL_PROGRAM_LENGTH_ARB" },
  1455. { 0x8627, "GL_PROGRAM_LENGTH_NV" },
  1456. { 0x8628, "GL_PROGRAM_STRING_ARB" },
  1457. { 0x8628, "GL_PROGRAM_STRING_NV" },
  1458. { 0x8629, "GL_MODELVIEW_PROJECTION_NV" },
  1459. { 0x862A, "GL_IDENTITY_NV" },
  1460. { 0x862B, "GL_INVERSE_NV" },
  1461. { 0x862C, "GL_TRANSPOSE_NV" },
  1462. { 0x862D, "GL_INVERSE_TRANSPOSE_NV" },
  1463. { 0x862E, "GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB" },
  1464. { 0x862E, "GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV" },
  1465. { 0x862F, "GL_MAX_PROGRAM_MATRICES_ARB" },
  1466. { 0x862F, "GL_MAX_TRACK_MATRICES_NV" },
  1467. { 0x8630, "GL_MATRIX0_NV" },
  1468. { 0x8631, "GL_MATRIX1_NV" },
  1469. { 0x8632, "GL_MATRIX2_NV" },
  1470. { 0x8633, "GL_MATRIX3_NV" },
  1471. { 0x8634, "GL_MATRIX4_NV" },
  1472. { 0x8635, "GL_MATRIX5_NV" },
  1473. { 0x8636, "GL_MATRIX6_NV" },
  1474. { 0x8637, "GL_MATRIX7_NV" },
  1475. { 0x8640, "GL_CURRENT_MATRIX_STACK_DEPTH_ARB" },
  1476. { 0x8640, "GL_CURRENT_MATRIX_STACK_DEPTH_NV" },
  1477. { 0x8641, "GL_CURRENT_MATRIX_ARB" },
  1478. { 0x8641, "GL_CURRENT_MATRIX_NV" },
  1479. { 0x8642, "GL_PROGRAM_POINT_SIZE_EXT" },
  1480. { 0x8642, "GL_VERTEX_PROGRAM_POINT_SIZE_ARB" },
  1481. { 0x8642, "GL_VERTEX_PROGRAM_POINT_SIZE_ARB" },
  1482. { 0x8642, "GL_VERTEX_PROGRAM_POINT_SIZE_NV" },
  1483. { 0x8642, "GL_VERTEX_PROGRAM_POINT_SIZE" },
  1484. { 0x8643, "GL_VERTEX_PROGRAM_TWO_SIDE_ARB" },
  1485. { 0x8643, "GL_VERTEX_PROGRAM_TWO_SIDE_ARB" },
  1486. { 0x8643, "GL_VERTEX_PROGRAM_TWO_SIDE_NV" },
  1487. { 0x8643, "GL_VERTEX_PROGRAM_TWO_SIDE" },
  1488. { 0x8644, "GL_PROGRAM_PARAMETER_NV" },
  1489. { 0x8645, "GL_ATTRIB_ARRAY_POINTER_NV" },
  1490. { 0x8645, "GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB" },
  1491. { 0x8645, "GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB" },
  1492. { 0x8645, "GL_VERTEX_ATTRIB_ARRAY_POINTER" },
  1493. { 0x8646, "GL_PROGRAM_TARGET_NV" },
  1494. { 0x8647, "GL_PROGRAM_RESIDENT_NV" },
  1495. { 0x8648, "GL_TRACK_MATRIX_NV" },
  1496. { 0x8649, "GL_TRACK_MATRIX_TRANSFORM_NV" },
  1497. { 0x864A, "GL_VERTEX_PROGRAM_BINDING_NV" },
  1498. { 0x864B, "GL_PROGRAM_ERROR_POSITION_ARB" },
  1499. { 0x864B, "GL_PROGRAM_ERROR_POSITION_NV" },
  1500. { 0x8650, "GL_VERTEX_ATTRIB_ARRAY0_NV" },
  1501. { 0x8651, "GL_VERTEX_ATTRIB_ARRAY1_NV" },
  1502. { 0x8652, "GL_VERTEX_ATTRIB_ARRAY2_NV" },
  1503. { 0x8653, "GL_VERTEX_ATTRIB_ARRAY3_NV" },
  1504. { 0x8654, "GL_VERTEX_ATTRIB_ARRAY4_NV" },
  1505. { 0x8655, "GL_VERTEX_ATTRIB_ARRAY5_NV" },
  1506. { 0x8656, "GL_VERTEX_ATTRIB_ARRAY6_NV" },
  1507. { 0x8657, "GL_VERTEX_ATTRIB_ARRAY7_NV" },
  1508. { 0x8658, "GL_VERTEX_ATTRIB_ARRAY8_NV" },
  1509. { 0x8659, "GL_VERTEX_ATTRIB_ARRAY9_NV" },
  1510. { 0x865A, "GL_VERTEX_ATTRIB_ARRAY10_NV" },
  1511. { 0x865B, "GL_VERTEX_ATTRIB_ARRAY11_NV" },
  1512. { 0x865C, "GL_VERTEX_ATTRIB_ARRAY12_NV" },
  1513. { 0x865D, "GL_VERTEX_ATTRIB_ARRAY13_NV" },
  1514. { 0x865E, "GL_VERTEX_ATTRIB_ARRAY14_NV" },
  1515. { 0x865F, "GL_VERTEX_ATTRIB_ARRAY15_NV" },
  1516. { 0x8660, "GL_MAP1_VERTEX_ATTRIB0_4_NV" },
  1517. { 0x8661, "GL_MAP1_VERTEX_ATTRIB1_4_NV" },
  1518. { 0x8662, "GL_MAP1_VERTEX_ATTRIB2_4_NV" },
  1519. { 0x8663, "GL_MAP1_VERTEX_ATTRIB3_4_NV" },
  1520. { 0x8664, "GL_MAP1_VERTEX_ATTRIB4_4_NV" },
  1521. { 0x8665, "GL_MAP1_VERTEX_ATTRIB5_4_NV" },
  1522. { 0x8666, "GL_MAP1_VERTEX_ATTRIB6_4_NV" },
  1523. { 0x8667, "GL_MAP1_VERTEX_ATTRIB7_4_NV" },
  1524. { 0x8668, "GL_MAP1_VERTEX_ATTRIB8_4_NV" },
  1525. { 0x8669, "GL_MAP1_VERTEX_ATTRIB9_4_NV" },
  1526. { 0x866A, "GL_MAP1_VERTEX_ATTRIB10_4_NV" },
  1527. { 0x866B, "GL_MAP1_VERTEX_ATTRIB11_4_NV" },
  1528. { 0x866C, "GL_MAP1_VERTEX_ATTRIB12_4_NV" },
  1529. { 0x866D, "GL_MAP1_VERTEX_ATTRIB13_4_NV" },
  1530. { 0x866E, "GL_MAP1_VERTEX_ATTRIB14_4_NV" },
  1531. { 0x866F, "GL_MAP1_VERTEX_ATTRIB15_4_NV" },
  1532. { 0x8670, "GL_MAP2_VERTEX_ATTRIB0_4_NV" },
  1533. { 0x8671, "GL_MAP2_VERTEX_ATTRIB1_4_NV" },
  1534. { 0x8672, "GL_MAP2_VERTEX_ATTRIB2_4_NV" },
  1535. { 0x8673, "GL_MAP2_VERTEX_ATTRIB3_4_NV" },
  1536. { 0x8674, "GL_MAP2_VERTEX_ATTRIB4_4_NV" },
  1537. { 0x8675, "GL_MAP2_VERTEX_ATTRIB5_4_NV" },
  1538. { 0x8676, "GL_MAP2_VERTEX_ATTRIB6_4_NV" },
  1539. { 0x8677, "GL_MAP2_VERTEX_ATTRIB7_4_NV" },
  1540. { 0x8677, "GL_PROGRAM_BINDING_ARB" },
  1541. { 0x8677, "GL_PROGRAM_NAME_ARB" },
  1542. { 0x8678, "GL_MAP2_VERTEX_ATTRIB8_4_NV" },
  1543. { 0x8679, "GL_MAP2_VERTEX_ATTRIB9_4_NV" },
  1544. { 0x867A, "GL_MAP2_VERTEX_ATTRIB10_4_NV" },
  1545. { 0x867B, "GL_MAP2_VERTEX_ATTRIB11_4_NV" },
  1546. { 0x867C, "GL_MAP2_VERTEX_ATTRIB12_4_NV" },
  1547. { 0x867D, "GL_MAP2_VERTEX_ATTRIB13_4_NV" },
  1548. { 0x867E, "GL_MAP2_VERTEX_ATTRIB14_4_NV" },
  1549. { 0x867F, "GL_MAP2_VERTEX_ATTRIB15_4_NV" },
  1550. { 0x86A0, "GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB" },
  1551. { 0x86A0, "GL_TEXTURE_COMPRESSED_IMAGE_SIZE" },
  1552. { 0x86A1, "GL_TEXTURE_COMPRESSED_ARB" },
  1553. { 0x86A1, "GL_TEXTURE_COMPRESSED" },
  1554. { 0x86A2, "GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB" },
  1555. { 0x86A2, "GL_NUM_COMPRESSED_TEXTURE_FORMATS" },
  1556. { 0x86A3, "GL_COMPRESSED_TEXTURE_FORMATS_ARB" },
  1557. { 0x86A3, "GL_COMPRESSED_TEXTURE_FORMATS" },
  1558. { 0x86A4, "GL_MAX_VERTEX_UNITS_ARB" },
  1559. { 0x86A5, "GL_ACTIVE_VERTEX_UNITS_ARB" },
  1560. { 0x86A6, "GL_WEIGHT_SUM_UNITY_ARB" },
  1561. { 0x86A7, "GL_VERTEX_BLEND_ARB" },
  1562. { 0x86A8, "GL_CURRENT_WEIGHT_ARB" },
  1563. { 0x86A9, "GL_WEIGHT_ARRAY_TYPE_ARB" },
  1564. { 0x86AA, "GL_WEIGHT_ARRAY_STRIDE_ARB" },
  1565. { 0x86AB, "GL_WEIGHT_ARRAY_SIZE_ARB" },
  1566. { 0x86AC, "GL_WEIGHT_ARRAY_POINTER_ARB" },
  1567. { 0x86AD, "GL_WEIGHT_ARRAY_ARB" },
  1568. { 0x86AE, "GL_DOT3_RGB_ARB" },
  1569. { 0x86AE, "GL_DOT3_RGB" },
  1570. { 0x86AF, "GL_DOT3_RGBA_ARB" },
  1571. { 0x86AF, "GL_DOT3_RGBA" },
  1572. { 0x8722, "GL_MODELVIEW2_ARB" },
  1573. { 0x8723, "GL_MODELVIEW3_ARB" },
  1574. { 0x8724, "GL_MODELVIEW4_ARB" },
  1575. { 0x8725, "GL_MODELVIEW5_ARB" },
  1576. { 0x8726, "GL_MODELVIEW6_ARB" },
  1577. { 0x8727, "GL_MODELVIEW7_ARB" },
  1578. { 0x8728, "GL_MODELVIEW8_ARB" },
  1579. { 0x8729, "GL_MODELVIEW9_ARB" },
  1580. { 0x872A, "GL_MODELVIEW10_ARB" },
  1581. { 0x872B, "GL_MODELVIEW11_ARB" },
  1582. { 0x872C, "GL_MODELVIEW12_ARB" },
  1583. { 0x872D, "GL_MODELVIEW13_ARB" },
  1584. { 0x872E, "GL_MODELVIEW14_ARB" },
  1585. { 0x872F, "GL_MODELVIEW15_ARB" },
  1586. { 0x8730, "GL_MODELVIEW16_ARB" },
  1587. { 0x8731, "GL_MODELVIEW17_ARB" },
  1588. { 0x8732, "GL_MODELVIEW18_ARB" },
  1589. { 0x8733, "GL_MODELVIEW19_ARB" },
  1590. { 0x8734, "GL_MODELVIEW20_ARB" },
  1591. { 0x8735, "GL_MODELVIEW21_ARB" },
  1592. { 0x8736, "GL_MODELVIEW22_ARB" },
  1593. { 0x8737, "GL_MODELVIEW23_ARB" },
  1594. { 0x8738, "GL_MODELVIEW24_ARB" },
  1595. { 0x8739, "GL_MODELVIEW25_ARB" },
  1596. { 0x873A, "GL_MODELVIEW26_ARB" },
  1597. { 0x873B, "GL_MODELVIEW27_ARB" },
  1598. { 0x873C, "GL_MODELVIEW28_ARB" },
  1599. { 0x873D, "GL_MODELVIEW29_ARB" },
  1600. { 0x873E, "GL_MODELVIEW30_ARB" },
  1601. { 0x873F, "GL_MODELVIEW31_ARB" },
  1602. { 0x8742, "GL_MIRROR_CLAMP_EXT" },
  1603. { 0x8743, "GL_MIRROR_CLAMP_TO_EDGE_EXT" },
  1604. { 0x8764, "GL_BUFFER_SIZE_ARB" },
  1605. { 0x8764, "GL_BUFFER_SIZE" },
  1606. { 0x8765, "GL_BUFFER_USAGE_ARB" },
  1607. { 0x8765, "GL_BUFFER_USAGE" },
  1608. { 0x8780, "GL_VERTEX_SHADER_EXT" },
  1609. { 0x8781, "GL_VERTEX_SHADER_BINDING_EXT" },
  1610. { 0x8782, "GL_OP_INDEX_EXT" },
  1611. { 0x8783, "GL_OP_NEGATE_EXT" },
  1612. { 0x8784, "GL_OP_DOT3_EXT" },
  1613. { 0x8785, "GL_OP_DOT4_EXT" },
  1614. { 0x8786, "GL_OP_MUL_EXT" },
  1615. { 0x8787, "GL_OP_ADD_EXT" },
  1616. { 0x8788, "GL_OP_MADD_EXT" },
  1617. { 0x8789, "GL_OP_FRAC_EXT" },
  1618. { 0x878A, "GL_OP_MAX_EXT" },
  1619. { 0x878B, "GL_OP_MIN_EXT" },
  1620. { 0x878C, "GL_OP_SET_GE_EXT" },
  1621. { 0x878D, "GL_OP_SET_LT_EXT" },
  1622. { 0x878E, "GL_OP_CLAMP_EXT" },
  1623. { 0x878F, "GL_OP_FLOOR_EXT" },
  1624. { 0x8790, "GL_OP_ROUND_EXT" },
  1625. { 0x8791, "GL_OP_EXP_BASE_2_EXT" },
  1626. { 0x8792, "GL_OP_LOG_BASE_2_EXT" },
  1627. { 0x8793, "GL_OP_POWER_EXT" },
  1628. { 0x8794, "GL_OP_RECIP_EXT" },
  1629. { 0x8795, "GL_OP_RECIP_SQRT_EXT" },
  1630. { 0x8796, "GL_OP_SUB_EXT" },
  1631. { 0x8797, "GL_OP_CROSS_PRODUCT_EXT" },
  1632. { 0x8798, "GL_OP_MULTIPLY_MATRIX_EXT" },
  1633. { 0x8799, "GL_OP_MOV_EXT" },
  1634. { 0x879A, "GL_OUTPUT_VERTEX_EXT" },
  1635. { 0x879B, "GL_OUTPUT_COLOR0_EXT" },
  1636. { 0x879C, "GL_OUTPUT_COLOR1_EXT" },
  1637. { 0x879D, "GL_OUTPUT_TEXTURE_COORD0_EXT" },
  1638. { 0x879E, "GL_OUTPUT_TEXTURE_COORD1_EXT" },
  1639. { 0x879F, "GL_OUTPUT_TEXTURE_COORD2_EXT" },
  1640. { 0x87A0, "GL_OUTPUT_TEXTURE_COORD3_EXT" },
  1641. { 0x87A1, "GL_OUTPUT_TEXTURE_COORD4_EXT" },
  1642. { 0x87A2, "GL_OUTPUT_TEXTURE_COORD5_EXT" },
  1643. { 0x87A3, "GL_OUTPUT_TEXTURE_COORD6_EXT" },
  1644. { 0x87A4, "GL_OUTPUT_TEXTURE_COORD7_EXT" },
  1645. { 0x87A5, "GL_OUTPUT_TEXTURE_COORD8_EXT" },
  1646. { 0x87A6, "GL_OUTPUT_TEXTURE_COORD9_EXT" },
  1647. { 0x87A7, "GL_OUTPUT_TEXTURE_COORD10_EXT" },
  1648. { 0x87A8, "GL_OUTPUT_TEXTURE_COORD11_EXT" },
  1649. { 0x87A9, "GL_OUTPUT_TEXTURE_COORD12_EXT" },
  1650. { 0x87AA, "GL_OUTPUT_TEXTURE_COORD13_EXT" },
  1651. { 0x87AB, "GL_OUTPUT_TEXTURE_COORD14_EXT" },
  1652. { 0x87AC, "GL_OUTPUT_TEXTURE_COORD15_EXT" },
  1653. { 0x87AD, "GL_OUTPUT_TEXTURE_COORD16_EXT" },
  1654. { 0x87AE, "GL_OUTPUT_TEXTURE_COORD17_EXT" },
  1655. { 0x87AF, "GL_OUTPUT_TEXTURE_COORD18_EXT" },
  1656. { 0x87B0, "GL_OUTPUT_TEXTURE_COORD19_EXT" },
  1657. { 0x87B1, "GL_OUTPUT_TEXTURE_COORD20_EXT" },
  1658. { 0x87B2, "GL_OUTPUT_TEXTURE_COORD21_EXT" },
  1659. { 0x87B3, "GL_OUTPUT_TEXTURE_COORD22_EXT" },
  1660. { 0x87B4, "GL_OUTPUT_TEXTURE_COORD23_EXT" },
  1661. { 0x87B5, "GL_OUTPUT_TEXTURE_COORD24_EXT" },
  1662. { 0x87B6, "GL_OUTPUT_TEXTURE_COORD25_EXT" },
  1663. { 0x87B7, "GL_OUTPUT_TEXTURE_COORD26_EXT" },
  1664. { 0x87B8, "GL_OUTPUT_TEXTURE_COORD27_EXT" },
  1665. { 0x87B9, "GL_OUTPUT_TEXTURE_COORD28_EXT" },
  1666. { 0x87BA, "GL_OUTPUT_TEXTURE_COORD29_EXT" },
  1667. { 0x87BB, "GL_OUTPUT_TEXTURE_COORD30_EXT" },
  1668. { 0x87BC, "GL_OUTPUT_TEXTURE_COORD31_EXT" },
  1669. { 0x87BD, "GL_OUTPUT_FOG_EXT" },
  1670. { 0x87BE, "GL_SCALAR_EXT" },
  1671. { 0x87BF, "GL_VECTOR_EXT" },
  1672. { 0x87C0, "GL_MATRIX_EXT" },
  1673. { 0x87C1, "GL_VARIANT_EXT" },
  1674. { 0x87C2, "GL_INVARIANT_EXT" },
  1675. { 0x87C3, "GL_LOCAL_CONSTANT_EXT" },
  1676. { 0x87C4, "GL_LOCAL_EXT" },
  1677. { 0x87C5, "GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT" },
  1678. { 0x87C6, "GL_MAX_VERTEX_SHADER_VARIANTS_EXT" },
  1679. { 0x87C7, "GL_MAX_VERTEX_SHADER_INVARIANTS_EXT" },
  1680. { 0x87C8, "GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT" },
  1681. { 0x87C9, "GL_MAX_VERTEX_SHADER_LOCALS_EXT" },
  1682. { 0x87CA, "GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT" },
  1683. { 0x87CB, "GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT" },
  1684. { 0x87CC, "GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT" },
  1685. { 0x87CD, "GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT" },
  1686. { 0x87CE, "GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT" },
  1687. { 0x87CF, "GL_VERTEX_SHADER_INSTRUCTIONS_EXT" },
  1688. { 0x87D0, "GL_VERTEX_SHADER_VARIANTS_EXT" },
  1689. { 0x87D1, "GL_VERTEX_SHADER_INVARIANTS_EXT" },
  1690. { 0x87D2, "GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT" },
  1691. { 0x87D3, "GL_VERTEX_SHADER_LOCALS_EXT" },
  1692. { 0x87D4, "GL_VERTEX_SHADER_OPTIMIZED_EXT" },
  1693. { 0x87D5, "GL_X_EXT" },
  1694. { 0x87D6, "GL_Y_EXT" },
  1695. { 0x87D7, "GL_Z_EXT" },
  1696. { 0x87D8, "GL_W_EXT" },
  1697. { 0x87D9, "GL_NEGATIVE_X_EXT" },
  1698. { 0x87DA, "GL_NEGATIVE_Y_EXT" },
  1699. { 0x87DB, "GL_NEGATIVE_Z_EXT" },
  1700. { 0x87DC, "GL_NEGATIVE_W_EXT" },
  1701. { 0x87DF, "GL_NEGATIVE_ONE_EXT" },
  1702. { 0x87E0, "GL_NORMALIZED_RANGE_EXT" },
  1703. { 0x87E1, "GL_FULL_RANGE_EXT" },
  1704. { 0x87E2, "GL_CURRENT_VERTEX_EXT" },
  1705. { 0x87E3, "GL_MVP_MATRIX_EXT" },
  1706. { 0x87E4, "GL_VARIANT_VALUE_EXT" },
  1707. { 0x87E5, "GL_VARIANT_DATATYPE_EXT" },
  1708. { 0x87E6, "GL_VARIANT_ARRAY_STRIDE_EXT" },
  1709. { 0x87E7, "GL_VARIANT_ARRAY_TYPE_EXT" },
  1710. { 0x87E8, "GL_VARIANT_ARRAY_EXT" },
  1711. { 0x87E9, "GL_VARIANT_ARRAY_POINTER_EXT" },
  1712. { 0x87EA, "GL_INVARIANT_VALUE_EXT" },
  1713. { 0x87EB, "GL_INVARIANT_DATATYPE_EXT" },
  1714. { 0x87EC, "GL_LOCAL_CONSTANT_VALUE_EXT" },
  1715. { 0x87Ed, "GL_LOCAL_CONSTANT_DATATYPE_EXT" },
  1716. { 0x8800, "GL_STENCIL_BACK_FUNC_ATI" },
  1717. { 0x8800, "GL_STENCIL_BACK_FUNC" },
  1718. { 0x8801, "GL_STENCIL_BACK_FAIL_ATI" },
  1719. { 0x8801, "GL_STENCIL_BACK_FAIL" },
  1720. { 0x8802, "GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI" },
  1721. { 0x8802, "GL_STENCIL_BACK_PASS_DEPTH_FAIL" },
  1722. { 0x8803, "GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI" },
  1723. { 0x8803, "GL_STENCIL_BACK_PASS_DEPTH_PASS" },
  1724. { 0x8804, "GL_FRAGMENT_PROGRAM_ARB" },
  1725. { 0x8805, "GL_PROGRAM_ALU_INSTRUCTIONS_ARB" },
  1726. { 0x8806, "GL_PROGRAM_TEX_INSTRUCTIONS_ARB" },
  1727. { 0x8807, "GL_PROGRAM_TEX_INDIRECTIONS_ARB" },
  1728. { 0x8808, "GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB" },
  1729. { 0x8809, "GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB" },
  1730. { 0x880A, "GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB" },
  1731. { 0x880B, "GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB" },
  1732. { 0x880C, "GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB" },
  1733. { 0x880D, "GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB" },
  1734. { 0x880E, "GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB" },
  1735. { 0x880F, "GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB" },
  1736. { 0x8810, "GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB" },
  1737. { 0x8814, "GL_RGBA_FLOAT32_APPLE" },
  1738. { 0x8814, "GL_RGBA_FLOAT32_ATI" },
  1739. { 0x8814, "GL_RGBA32F_ARB" },
  1740. { 0x8815, "GL_RGB_FLOAT32_APPLE" },
  1741. { 0x8815, "GL_RGB_FLOAT32_ATI" },
  1742. { 0x8815, "GL_RGB32F_ARB" },
  1743. { 0x8816, "GL_ALPHA_FLOAT32_APPLE" },
  1744. { 0x8816, "GL_ALPHA_FLOAT32_ATI" },
  1745. { 0x8816, "GL_ALPHA32F_ARB" },
  1746. { 0x8817, "GL_INTENSITY_FLOAT32_APPLE" },
  1747. { 0x8817, "GL_INTENSITY_FLOAT32_ATI" },
  1748. { 0x8817, "GL_INTENSITY32F_ARB" },
  1749. { 0x8818, "GL_LUMINANCE_FLOAT32_APPLE" },
  1750. { 0x8818, "GL_LUMINANCE_FLOAT32_ATI" },
  1751. { 0x8818, "GL_LUMINANCE32F_ARB" },
  1752. { 0x8819, "GL_LUMINANCE_ALPHA_FLOAT32_APPLE" },
  1753. { 0x8819, "GL_LUMINANCE_ALPHA_FLOAT32_ATI" },
  1754. { 0x8819, "GL_LUMINANCE_ALPHA32F_ARB" },
  1755. { 0x881A, "GL_RGBA_FLOAT16_APPLE" },
  1756. { 0x881A, "GL_RGBA_FLOAT16_ATI" },
  1757. { 0x881A, "GL_RGBA16F_ARB" },
  1758. { 0x881B, "GL_RGB_FLOAT16_APPLE" },
  1759. { 0x881B, "GL_RGB_FLOAT16_ATI" },
  1760. { 0x881B, "GL_RGB16F_ARB" },
  1761. { 0x881C, "GL_ALPHA_FLOAT16_APPLE" },
  1762. { 0x881C, "GL_ALPHA_FLOAT16_ATI" },
  1763. { 0x881C, "GL_ALPHA16F_ARB" },
  1764. { 0x881D, "GL_INTENSITY_FLOAT16_APPLE" },
  1765. { 0x881D, "GL_INTENSITY_FLOAT16_ATI" },
  1766. { 0x881D, "GL_INTENSITY16F_ARB" },
  1767. { 0x881E, "GL_LUMINANCE_FLOAT16_APPLE" },
  1768. { 0x881E, "GL_LUMINANCE_FLOAT16_ATI" },
  1769. { 0x881E, "GL_LUMINANCE16F_ARB" },
  1770. { 0x881F, "GL_LUMINANCE_ALPHA_FLOAT16_APPLE" },
  1771. { 0x881F, "GL_LUMINANCE_ALPHA_FLOAT16_ATI" },
  1772. { 0x881F, "GL_LUMINANCE_ALPHA16F_ARB" },
  1773. { 0x8820, "GL_RGBA_FLOAT_MODE_ARB" },
  1774. { 0x8824, "GL_MAX_DRAW_BUFFERS_ARB" },
  1775. { 0x8824, "GL_MAX_DRAW_BUFFERS" },
  1776. { 0x8825, "GL_DRAW_BUFFER0_ARB" },
  1777. { 0x8825, "GL_DRAW_BUFFER0" },
  1778. { 0x8826, "GL_DRAW_BUFFER1_ARB" },
  1779. { 0x8826, "GL_DRAW_BUFFER1" },
  1780. { 0x8827, "GL_DRAW_BUFFER2_ARB" },
  1781. { 0x8827, "GL_DRAW_BUFFER2" },
  1782. { 0x8828, "GL_DRAW_BUFFER3_ARB" },
  1783. { 0x8828, "GL_DRAW_BUFFER3" },
  1784. { 0x8829, "GL_DRAW_BUFFER4_ARB" },
  1785. { 0x8829, "GL_DRAW_BUFFER4" },
  1786. { 0x882A, "GL_DRAW_BUFFER5_ARB" },
  1787. { 0x882A, "GL_DRAW_BUFFER5" },
  1788. { 0x882B, "GL_DRAW_BUFFER6_ARB" },
  1789. { 0x882B, "GL_DRAW_BUFFER6" },
  1790. { 0x882C, "GL_DRAW_BUFFER7_ARB" },
  1791. { 0x882C, "GL_DRAW_BUFFER7" },
  1792. { 0x882D, "GL_DRAW_BUFFER8_ARB" },
  1793. { 0x882D, "GL_DRAW_BUFFER8" },
  1794. { 0x882E, "GL_DRAW_BUFFER9_ARB" },
  1795. { 0x882E, "GL_DRAW_BUFFER9" },
  1796. { 0x882F, "GL_DRAW_BUFFER10_ARB" },
  1797. { 0x882F, "GL_DRAW_BUFFER10" },
  1798. { 0x8830, "GL_DRAW_BUFFER11_ARB" },
  1799. { 0x8830, "GL_DRAW_BUFFER11" },
  1800. { 0x8831, "GL_DRAW_BUFFER12_ARB" },
  1801. { 0x8831, "GL_DRAW_BUFFER12" },
  1802. { 0x8832, "GL_DRAW_BUFFER13_ARB" },
  1803. { 0x8832, "GL_DRAW_BUFFER13" },
  1804. { 0x8833, "GL_DRAW_BUFFER14_ARB" },
  1805. { 0x8833, "GL_DRAW_BUFFER14" },
  1806. { 0x8834, "GL_DRAW_BUFFER15_ARB" },
  1807. { 0x8834, "GL_DRAW_BUFFER15" },
  1808. { 0x883D, "GL_ALPHA_BLEND_EQUATION_ATI" },
  1809. { 0x883D, "GL_BLEND_EQUATION_ALPHA_EXT" },
  1810. { 0x883D, "GL_BLEND_EQUATION_ALPHA" },
  1811. { 0x884A, "GL_TEXTURE_DEPTH_SIZE_ARB" },
  1812. { 0x884A, "GL_TEXTURE_DEPTH_SIZE" },
  1813. { 0x884B, "GL_DEPTH_TEXTURE_MODE_ARB" },
  1814. { 0x884B, "GL_DEPTH_TEXTURE_MODE" },
  1815. { 0x884C, "GL_TEXTURE_COMPARE_MODE_ARB" },
  1816. { 0x884C, "GL_TEXTURE_COMPARE_MODE" },
  1817. { 0x884D, "GL_TEXTURE_COMPARE_FUNC_ARB" },
  1818. { 0x884D, "GL_TEXTURE_COMPARE_FUNC" },
  1819. { 0x884E, "GL_COMPARE_R_TO_TEXTURE_ARB" },
  1820. { 0x884E, "GL_COMPARE_R_TO_TEXTURE" },
  1821. { 0x884E, "GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT" },
  1822. { 0x8861, "GL_POINT_SPRITE_ARB" },
  1823. { 0x8861, "GL_POINT_SPRITE" },
  1824. { 0x8862, "GL_COORD_REPLACE_ARB" },
  1825. { 0x8862, "GL_COORD_REPLACE" },
  1826. { 0x8864, "GL_QUERY_COUNTER_BITS_ARB" },
  1827. { 0x8864, "GL_QUERY_COUNTER_BITS" },
  1828. { 0x8865, "GL_CURRENT_QUERY_ARB" },
  1829. { 0x8865, "GL_CURRENT_QUERY" },
  1830. { 0x8866, "GL_QUERY_RESULT_ARB" },
  1831. { 0x8866, "GL_QUERY_RESULT" },
  1832. { 0x8867, "GL_QUERY_RESULT_AVAILABLE_ARB" },
  1833. { 0x8867, "GL_QUERY_RESULT_AVAILABLE" },
  1834. { 0x8869, "GL_MAX_VERTEX_ATTRIBS_ARB" },
  1835. { 0x8869, "GL_MAX_VERTEX_ATTRIBS_ARB" },
  1836. { 0x8869, "GL_MAX_VERTEX_ATTRIBS" },
  1837. { 0x886A, "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB" },
  1838. { 0x886A, "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB" },
  1839. { 0x886A, "GL_VERTEX_ATTRIB_ARRAY_NORMALIZED" },
  1840. { 0x8871, "GL_MAX_TEXTURE_COORDS_ARB" },
  1841. { 0x8871, "GL_MAX_TEXTURE_COORDS_ARB" },
  1842. { 0x8871, "GL_MAX_TEXTURE_COORDS_ARB" },
  1843. { 0x8871, "GL_MAX_TEXTURE_COORDS" },
  1844. { 0x8872, "GL_MAX_TEXTURE_IMAGE_UNITS_ARB" },
  1845. { 0x8872, "GL_MAX_TEXTURE_IMAGE_UNITS_ARB" },
  1846. { 0x8872, "GL_MAX_TEXTURE_IMAGE_UNITS_ARB" },
  1847. { 0x8872, "GL_MAX_TEXTURE_IMAGE_UNITS" },
  1848. { 0x8874, "GL_PROGRAM_ERROR_STRING_ARB" },
  1849. { 0x8875, "GL_PROGRAM_FORMAT_ASCII_ARB" },
  1850. { 0x8876, "GL_PROGRAM_FORMAT_ARB" },
  1851. { 0x8890, "GL_DEPTH_BOUNDS_TEST_EXT" },
  1852. { 0x8891, "GL_DEPTH_BOUNDS_EXT" },
  1853. { 0x8892, "GL_ARRAY_BUFFER_ARB" },
  1854. { 0x8892, "GL_ARRAY_BUFFER" },
  1855. { 0x8893, "GL_ELEMENT_ARRAY_BUFFER_ARB" },
  1856. { 0x8893, "GL_ELEMENT_ARRAY_BUFFER" },
  1857. { 0x8894, "GL_ARRAY_BUFFER_BINDING_ARB" },
  1858. { 0x8894, "GL_ARRAY_BUFFER_BINDING" },
  1859. { 0x8895, "GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB" },
  1860. { 0x8895, "GL_ELEMENT_ARRAY_BUFFER_BINDING" },
  1861. { 0x8896, "GL_VERTEX_ARRAY_BUFFER_BINDING_ARB" },
  1862. { 0x8896, "GL_VERTEX_ARRAY_BUFFER_BINDING" },
  1863. { 0x8897, "GL_NORMAL_ARRAY_BUFFER_BINDING_ARB" },
  1864. { 0x8897, "GL_NORMAL_ARRAY_BUFFER_BINDING" },
  1865. { 0x8898, "GL_COLOR_ARRAY_BUFFER_BINDING_ARB" },
  1866. { 0x8898, "GL_COLOR_ARRAY_BUFFER_BINDING" },
  1867. { 0x8899, "GL_INDEX_ARRAY_BUFFER_BINDING_ARB" },
  1868. { 0x8899, "GL_INDEX_ARRAY_BUFFER_BINDING" },
  1869. { 0x889A, "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB" },
  1870. { 0x889A, "GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING" },
  1871. { 0x889B, "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB" },
  1872. { 0x889B, "GL_EDGE_FLAG_ARRAY_BUFFER_BINDING" },
  1873. { 0x889C, "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB" },
  1874. { 0x889C, "GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING" },
  1875. { 0x889D, "GL_FOG_COORD_ARRAY_BUFFER_BINDING_ARB" },
  1876. { 0x889D, "GL_FOG_COORD_ARRAY_BUFFER_BINDING" },
  1877. { 0x889D, "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB" },
  1878. { 0x889D, "GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING" },
  1879. { 0x889E, "GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB" },
  1880. { 0x889E, "GL_WEIGHT_ARRAY_BUFFER_BINDING" },
  1881. { 0x889F, "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB" },
  1882. { 0x889F, "GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING" },
  1883. { 0x88A0, "GL_PROGRAM_INSTRUCTIONS_ARB" },
  1884. { 0x88A1, "GL_MAX_PROGRAM_INSTRUCTIONS_ARB" },
  1885. { 0x88A2, "GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB" },
  1886. { 0x88A3, "GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB" },
  1887. { 0x88A4, "GL_PROGRAM_TEMPORARIES_ARB" },
  1888. { 0x88A5, "GL_MAX_PROGRAM_TEMPORARIES_ARB" },
  1889. { 0x88A6, "GL_PROGRAM_NATIVE_TEMPORARIES_ARB" },
  1890. { 0x88A7, "GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB" },
  1891. { 0x88A8, "GL_PROGRAM_PARAMETERS_ARB" },
  1892. { 0x88A9, "GL_MAX_PROGRAM_PARAMETERS_ARB" },
  1893. { 0x88AA, "GL_PROGRAM_NATIVE_PARAMETERS_ARB" },
  1894. { 0x88AB, "GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB" },
  1895. { 0x88AC, "GL_PROGRAM_ATTRIBS_ARB" },
  1896. { 0x88AD, "GL_MAX_PROGRAM_ATTRIBS_ARB" },
  1897. { 0x88AE, "GL_PROGRAM_NATIVE_ATTRIBS_ARB" },
  1898. { 0x88AF, "GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB" },
  1899. { 0x88B0, "GL_PROGRAM_ADDRESS_REGISTERS_ARB" },
  1900. { 0x88B1, "GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB" },
  1901. { 0x88B2, "GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB" },
  1902. { 0x88B3, "GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB" },
  1903. { 0x88B4, "GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB" },
  1904. { 0x88B5, "GL_MAX_PROGRAM_ENV_PARAMETERS_ARB" },
  1905. { 0x88B6, "GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB" },
  1906. { 0x88B7, "GL_TRANSPOSE_CURRENT_MATRIX_ARB" },
  1907. { 0x88B8, "GL_READ_ONLY_ARB" },
  1908. { 0x88B8, "GL_READ_ONLY" },
  1909. { 0x88B9, "GL_WRITE_ONLY_ARB" },
  1910. { 0x88B9, "GL_WRITE_ONLY" },
  1911. { 0x88BA, "GL_READ_WRITE_ARB" },
  1912. { 0x88BA, "GL_READ_WRITE" },
  1913. { 0x88BB, "GL_BUFFER_ACCESS_ARB" },
  1914. { 0x88BB, "GL_BUFFER_ACCESS" },
  1915. { 0x88BC, "GL_BUFFER_MAPPED_ARB" },
  1916. { 0x88BC, "GL_BUFFER_MAPPED" },
  1917. { 0x88BD, "GL_BUFFER_MAP_POINTER_ARB" },
  1918. { 0x88BD, "GL_BUFFER_MAP_POINTER" },
  1919. { 0x88C0, "GL_MATRIX0_ARB" },
  1920. { 0x88C1, "GL_MATRIX1_ARB" },
  1921. { 0x88C2, "GL_MATRIX2_ARB" },
  1922. { 0x88C3, "GL_MATRIX3_ARB" },
  1923. { 0x88C4, "GL_MATRIX4_ARB" },
  1924. { 0x88C5, "GL_MATRIX5_ARB" },
  1925. { 0x88C6, "GL_MATRIX6_ARB" },
  1926. { 0x88C7, "GL_MATRIX7_ARB" },
  1927. { 0x88C8, "GL_MATRIX8_ARB" },
  1928. { 0x88C9, "GL_MATRIX9_ARB" },
  1929. { 0x88CA, "GL_MATRIX10_ARB" },
  1930. { 0x88CB, "GL_MATRIX11_ARB" },
  1931. { 0x88CC, "GL_MATRIX12_ARB" },
  1932. { 0x88CD, "GL_MATRIX13_ARB" },
  1933. { 0x88CE, "GL_MATRIX14_ARB" },
  1934. { 0x88CF, "GL_MATRIX15_ARB" },
  1935. { 0x88D0, "GL_MATRIX16_ARB" },
  1936. { 0x88D1, "GL_MATRIX17_ARB" },
  1937. { 0x88D2, "GL_MATRIX18_ARB" },
  1938. { 0x88D3, "GL_MATRIX19_ARB" },
  1939. { 0x88D4, "GL_MATRIX20_ARB" },
  1940. { 0x88D5, "GL_MATRIX21_ARB" },
  1941. { 0x88D6, "GL_MATRIX22_ARB" },
  1942. { 0x88D7, "GL_MATRIX23_ARB" },
  1943. { 0x88D8, "GL_MATRIX24_ARB" },
  1944. { 0x88D9, "GL_MATRIX25_ARB" },
  1945. { 0x88DA, "GL_MATRIX26_ARB" },
  1946. { 0x88DB, "GL_MATRIX27_ARB" },
  1947. { 0x88DC, "GL_MATRIX28_ARB" },
  1948. { 0x88DD, "GL_MATRIX29_ARB" },
  1949. { 0x88DE, "GL_MATRIX30_ARB" },
  1950. { 0x88DF, "GL_MATRIX31_ARB" },
  1951. { 0x88E0, "GL_STREAM_DRAW_ARB" },
  1952. { 0x88E0, "GL_STREAM_DRAW" },
  1953. { 0x88E1, "GL_STREAM_READ_ARB" },
  1954. { 0x88E1, "GL_STREAM_READ" },
  1955. { 0x88E2, "GL_STREAM_COPY_ARB" },
  1956. { 0x88E2, "GL_STREAM_COPY" },
  1957. { 0x88E4, "GL_STATIC_DRAW_ARB" },
  1958. { 0x88E4, "GL_STATIC_DRAW" },
  1959. { 0x88E5, "GL_STATIC_READ_ARB" },
  1960. { 0x88E5, "GL_STATIC_READ" },
  1961. { 0x88E6, "GL_STATIC_COPY_ARB" },
  1962. { 0x88E6, "GL_STATIC_COPY" },
  1963. { 0x88E8, "GL_DYNAMIC_DRAW_ARB" },
  1964. { 0x88E8, "GL_DYNAMIC_DRAW" },
  1965. { 0x88E9, "GL_DYNAMIC_READ_ARB" },
  1966. { 0x88E9, "GL_DYNAMIC_READ" },
  1967. { 0x88EA, "GL_DYNAMIC_COPY_ARB" },
  1968. { 0x88EA, "GL_DYNAMIC_COPY" },
  1969. { 0x88EB, "GL_PIXEL_PACK_BUFFER_ARB" },
  1970. { 0x88EB, "GL_PIXEL_PACK_BUFFER" },
  1971. { 0x88EC, "GL_PIXEL_UNPACK_BUFFER_ARB" },
  1972. { 0x88EC, "GL_PIXEL_UNPACK_BUFFER" },
  1973. { 0x88ED, "GL_PIXEL_PACK_BUFFER_BINDING_ARB" },
  1974. { 0x88ED, "GL_PIXEL_PACK_BUFFER_BINDING" },
  1975. { 0x88EF, "GL_PIXEL_UNPACK_BUFFER_BINDING_ARB" },
  1976. { 0x88EF, "GL_PIXEL_UNPACK_BUFFER_BINDING" },
  1977. { 0x88F0, "GL_DEPTH24_STENCIL8_EXT" },
  1978. { 0x88F0, "GL_DEPTH24_STENCIL8" },
  1979. { 0x88F1, "GL_TEXTURE_STENCIL_SIZE_EXT" },
  1980. { 0x88F1, "GL_TEXTURE_STENCIL_SIZE" },
  1981. { 0x88FD, "GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT" },
  1982. { 0x88FE, "GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB" },
  1983. { 0x88FF, "GL_MAX_ARRAY_TEXTURE_LAYERS_EXT" },
  1984. { 0x8904, "GL_MIN_PROGRAM_TEXEL_OFFSET_EXT" },
  1985. { 0x8905, "GL_MAX_PROGRAM_TEXEL_OFFSET_EXT" },
  1986. { 0x8910, "GL_STENCIL_TEST_TWO_SIDE_EXT" },
  1987. { 0x8911, "GL_ACTIVE_STENCIL_FACE_EXT" },
  1988. { 0x8912, "GL_MIRROR_CLAMP_TO_BORDER_EXT" },
  1989. { 0x8914, "GL_SAMPLES_PASSED_ARB" },
  1990. { 0x8914, "GL_SAMPLES_PASSED" },
  1991. { 0x891A, "GL_CLAMP_VERTEX_COLOR_ARB" },
  1992. { 0x891B, "GL_CLAMP_FRAGMENT_COLOR_ARB" },
  1993. { 0x891C, "GL_CLAMP_READ_COLOR_ARB" },
  1994. { 0x891D, "GL_FIXED_ONLY_ARB" },
  1995. { 0x8920, "GL_FRAGMENT_SHADER_EXT" },
  1996. { 0x896D, "GL_SECONDARY_INTERPOLATOR_EXT" },
  1997. { 0x896E, "GL_NUM_FRAGMENT_REGISTERS_EXT" },
  1998. { 0x896F, "GL_NUM_FRAGMENT_CONSTANTS_EXT" },
  1999. { 0x8A0C, "GL_ELEMENT_ARRAY_APPLE" },
  2000. { 0x8A0D, "GL_ELEMENT_ARRAY_TYPE_APPLE" },
  2001. { 0x8A0E, "GL_ELEMENT_ARRAY_POINTER_APPLE" },
  2002. { 0x8A0F, "GL_COLOR_FLOAT_APPLE" },
  2003. { 0x8A11, "GL_UNIFORM_BUFFER" },
  2004. { 0x8A28, "GL_UNIFORM_BUFFER_BINDING" },
  2005. { 0x8A29, "GL_UNIFORM_BUFFER_START" },
  2006. { 0x8A2A, "GL_UNIFORM_BUFFER_SIZE" },
  2007. { 0x8A2B, "GL_MAX_VERTEX_UNIFORM_BLOCKS" },
  2008. { 0x8A2C, "GL_MAX_GEOMETRY_UNIFORM_BLOCKS" },
  2009. { 0x8A2D, "GL_MAX_FRAGMENT_UNIFORM_BLOCKS" },
  2010. { 0x8A2E, "GL_MAX_COMBINED_UNIFORM_BLOCKS" },
  2011. { 0x8A2F, "GL_MAX_UNIFORM_BUFFER_BINDINGS" },
  2012. { 0x8A30, "GL_MAX_UNIFORM_BLOCK_SIZE" },
  2013. { 0x8A31, "GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS" },
  2014. { 0x8A32, "GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS" },
  2015. { 0x8A33, "GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS" },
  2016. { 0x8A34, "GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT" },
  2017. { 0x8A35, "GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH" },
  2018. { 0x8A36, "GL_ACTIVE_UNIFORM_BLOCKS" },
  2019. { 0x8A37, "GL_UNIFORM_TYPE" },
  2020. { 0x8A38, "GL_UNIFORM_SIZE" },
  2021. { 0x8A39, "GL_UNIFORM_NAME_LENGTH" },
  2022. { 0x8A3A, "GL_UNIFORM_BLOCK_INDEX" },
  2023. { 0x8A3B, "GL_UNIFORM_OFFSET" },
  2024. { 0x8A3C, "GL_UNIFORM_ARRAY_STRIDE" },
  2025. { 0x8A3D, "GL_UNIFORM_MATRIX_STRIDE" },
  2026. { 0x8A3E, "GL_UNIFORM_IS_ROW_MAJOR" },
  2027. { 0x8A3F, "GL_UNIFORM_BLOCK_BINDING" },
  2028. { 0x8A40, "GL_UNIFORM_BLOCK_DATA_SIZE" },
  2029. { 0x8A41, "GL_UNIFORM_BLOCK_NAME_LENGTH" },
  2030. { 0x8A42, "GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS" },
  2031. { 0x8A43, "GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES" },
  2032. { 0x8A44, "GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER" },
  2033. { 0x8A45, "GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER" },
  2034. { 0x8A46, "GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER" },
  2035. { 0x8B30, "GL_FRAGMENT_SHADER_ARB" },
  2036. { 0x8B30, "GL_FRAGMENT_SHADER" },
  2037. { 0x8B31, "GL_VERTEX_SHADER_ARB" },
  2038. { 0x8B31, "GL_VERTEX_SHADER" },
  2039. { 0x8B40, "GL_PROGRAM_OBJECT_ARB" },
  2040. { 0x8B48, "GL_SHADER_OBJECT_ARB" },
  2041. { 0x8B49, "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB" },
  2042. { 0x8B49, "GL_MAX_FRAGMENT_UNIFORM_COMPONENTS" },
  2043. { 0x8B4A, "GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB" },
  2044. { 0x8B4A, "GL_MAX_VERTEX_UNIFORM_COMPONENTS" },
  2045. { 0x8B4B, "GL_MAX_VARYING_COMPONENTS_EXT" },
  2046. { 0x8B4B, "GL_MAX_VARYING_FLOATS_ARB" },
  2047. { 0x8B4B, "GL_MAX_VARYING_FLOATS" },
  2048. { 0x8B4C, "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB" },
  2049. { 0x8B4C, "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS" },
  2050. { 0x8B4D, "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB" },
  2051. { 0x8B4D, "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS" },
  2052. { 0x8B4E, "GL_OBJECT_TYPE_ARB" },
  2053. { 0x8B4F, "GL_OBJECT_SUBTYPE_ARB" },
  2054. { 0x8B4F, "GL_SHADER_TYPE" },
  2055. { 0x8B50, "GL_FLOAT_VEC2_ARB" },
  2056. { 0x8B50, "GL_FLOAT_VEC2" },
  2057. { 0x8B51, "GL_FLOAT_VEC3_ARB" },
  2058. { 0x8B51, "GL_FLOAT_VEC3" },
  2059. { 0x8B52, "GL_FLOAT_VEC4_ARB" },
  2060. { 0x8B52, "GL_FLOAT_VEC4" },
  2061. { 0x8B53, "GL_INT_VEC2_ARB" },
  2062. { 0x8B53, "GL_INT_VEC2" },
  2063. { 0x8B54, "GL_INT_VEC3_ARB" },
  2064. { 0x8B54, "GL_INT_VEC3" },
  2065. { 0x8B55, "GL_INT_VEC4_ARB" },
  2066. { 0x8B55, "GL_INT_VEC4" },
  2067. { 0x8B56, "GL_BOOL_ARB" },
  2068. { 0x8B56, "GL_BOOL" },
  2069. { 0x8B57, "GL_BOOL_VEC2_ARB" },
  2070. { 0x8B57, "GL_BOOL_VEC2" },
  2071. { 0x8B58, "GL_BOOL_VEC3_ARB" },
  2072. { 0x8B58, "GL_BOOL_VEC3" },
  2073. { 0x8B59, "GL_BOOL_VEC4_ARB" },
  2074. { 0x8B59, "GL_BOOL_VEC4" },
  2075. { 0x8B5A, "GL_FLOAT_MAT2_ARB" },
  2076. { 0x8B5A, "GL_FLOAT_MAT2" },
  2077. { 0x8B5B, "GL_FLOAT_MAT3_ARB" },
  2078. { 0x8B5B, "GL_FLOAT_MAT3" },
  2079. { 0x8B5C, "GL_FLOAT_MAT4_ARB" },
  2080. { 0x8B5C, "GL_FLOAT_MAT4" },
  2081. { 0x8B5D, "GL_SAMPLER_1D_ARB" },
  2082. { 0x8B5D, "GL_SAMPLER_1D" },
  2083. { 0x8B5E, "GL_SAMPLER_2D_ARB" },
  2084. { 0x8B5E, "GL_SAMPLER_2D" },
  2085. { 0x8B5F, "GL_SAMPLER_3D_ARB" },
  2086. { 0x8B5F, "GL_SAMPLER_3D" },
  2087. { 0x8B60, "GL_SAMPLER_CUBE_ARB" },
  2088. { 0x8B60, "GL_SAMPLER_CUBE" },
  2089. { 0x8B61, "GL_SAMPLER_1D_SHADOW_ARB" },
  2090. { 0x8B61, "GL_SAMPLER_1D_SHADOW" },
  2091. { 0x8B62, "GL_SAMPLER_2D_SHADOW_ARB" },
  2092. { 0x8B62, "GL_SAMPLER_2D_SHADOW" },
  2093. { 0x8B63, "GL_SAMPLER_2D_RECT_ARB" },
  2094. { 0x8B64, "GL_SAMPLER_2D_RECT_SHADOW_ARB" },
  2095. { 0x8B65, "GL_FLOAT_MAT2x3" },
  2096. { 0x8B66, "GL_FLOAT_MAT2x4" },
  2097. { 0x8B67, "GL_FLOAT_MAT3x2" },
  2098. { 0x8B68, "GL_FLOAT_MAT3x4" },
  2099. { 0x8B69, "GL_FLOAT_MAT4x2" },
  2100. { 0x8B6A, "GL_FLOAT_MAT4x3" },
  2101. { 0x8B80, "GL_DELETE_STATUS" },
  2102. { 0x8B80, "GL_OBJECT_DELETE_STATUS_ARB" },
  2103. { 0x8B81, "GL_COMPILE_STATUS" },
  2104. { 0x8B81, "GL_OBJECT_COMPILE_STATUS_ARB" },
  2105. { 0x8B82, "GL_LINK_STATUS" },
  2106. { 0x8B82, "GL_OBJECT_LINK_STATUS_ARB" },
  2107. { 0x8B83, "GL_OBJECT_VALIDATE_STATUS_ARB" },
  2108. { 0x8B83, "GL_VALIDATE_STATUS" },
  2109. { 0x8B84, "GL_INFO_LOG_LENGTH" },
  2110. { 0x8B84, "GL_OBJECT_INFO_LOG_LENGTH_ARB" },
  2111. { 0x8B85, "GL_ATTACHED_SHADERS" },
  2112. { 0x8B85, "GL_OBJECT_ATTACHED_OBJECTS_ARB" },
  2113. { 0x8B86, "GL_ACTIVE_UNIFORMS" },
  2114. { 0x8B86, "GL_OBJECT_ACTIVE_UNIFORMS_ARB" },
  2115. { 0x8B87, "GL_ACTIVE_UNIFORM_MAX_LENGTH" },
  2116. { 0x8B87, "GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB" },
  2117. { 0x8B88, "GL_OBJECT_SHADER_SOURCE_LENGTH_ARB" },
  2118. { 0x8B88, "GL_SHADER_SOURCE_LENGTH" },
  2119. { 0x8B89, "GL_ACTIVE_ATTRIBUTES" },
  2120. { 0x8B89, "GL_OBJECT_ACTIVE_ATTRIBUTES_ARB" },
  2121. { 0x8B8A, "GL_ACTIVE_ATTRIBUTE_MAX_LENGTH" },
  2122. { 0x8B8A, "GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB" },
  2123. { 0x8B8B, "GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB" },
  2124. { 0x8B8B, "GL_FRAGMENT_SHADER_DERIVATIVE_HINT" },
  2125. { 0x8B8C, "GL_SHADING_LANGUAGE_VERSION_ARB" },
  2126. { 0x8B8C, "GL_SHADING_LANGUAGE_VERSION" },
  2127. { 0x8B8D, "GL_CURRENT_PROGRAM" },
  2128. { 0x8C10, "GL_TEXTURE_RED_TYPE_ARB" },
  2129. { 0x8C10, "GL_TEXTURE_RED_TYPE" },
  2130. { 0x8C11, "GL_TEXTURE_GREEN_TYPE_ARB" },
  2131. { 0x8C11, "GL_TEXTURE_GREEN_TYPE" },
  2132. { 0x8C12, "GL_TEXTURE_BLUE_TYPE_ARB" },
  2133. { 0x8C12, "GL_TEXTURE_BLUE_TYPE" },
  2134. { 0x8C13, "GL_TEXTURE_ALPHA_TYPE_ARB" },
  2135. { 0x8C13, "GL_TEXTURE_ALPHA_TYPE" },
  2136. { 0x8C14, "GL_TEXTURE_LUMINANCE_TYPE_ARB" },
  2137. { 0x8C15, "GL_TEXTURE_INTENSITY_TYPE_ARB" },
  2138. { 0x8C16, "GL_TEXTURE_DEPTH_TYPE_ARB" },
  2139. { 0x8C16, "GL_TEXTURE_DEPTH_TYPE" },
  2140. { 0x8C17, "GL_UNSIGNED_NORMALIZED_ARB" },
  2141. { 0x8C17, "GL_UNSIGNED_NORMALIZED" },
  2142. { 0x8C18, "GL_TEXTURE_1D_ARRAY_EXT" },
  2143. { 0x8C19, "GL_PROXY_TEXTURE_1D_ARRAY_EXT" },
  2144. { 0x8C1A, "GL_TEXTURE_2D_ARRAY_EXT" },
  2145. { 0x8C1B, "GL_PROXY_TEXTURE_2D_ARRAY_EXT" },
  2146. { 0x8C1C, "GL_TEXTURE_BINDING_1D_ARRAY_EXT" },
  2147. { 0x8C1D, "GL_TEXTURE_BINDING_2D_ARRAY_EXT" },
  2148. { 0x8C29, "GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT" },
  2149. { 0x8C3A, "GL_R11F_G11F_B10F_EXT" },
  2150. { 0x8C3B, "GL_UNSIGNED_INT_10F_11F_11F_REV_EXT" },
  2151. { 0x8C3C, "GL_RGBA_SIGNED_COMPONENTS_EXT" },
  2152. { 0x8C3D, "GL_RGB9_E5_EXT" },
  2153. { 0x8C3E, "GL_UNSIGNED_INT_5_9_9_9_REV_EXT" },
  2154. { 0x8C3F, "GL_TEXTURE_SHARED_SIZE_EXT" },
  2155. { 0x8C40, "GL_SRGB_EXT" },
  2156. { 0x8C40, "GL_SRGB" },
  2157. { 0x8C41, "GL_SRGB8_EXT" },
  2158. { 0x8C41, "GL_SRGB8" },
  2159. { 0x8C42, "GL_SRGB_ALPHA_EXT" },
  2160. { 0x8C42, "GL_SRGB_ALPHA" },
  2161. { 0x8C43, "GL_SRGB8_ALPHA8_EXT" },
  2162. { 0x8C43, "GL_SRGB8_ALPHA8" },
  2163. { 0x8C44, "GL_SLUMINANCE_ALPHA_EXT" },
  2164. { 0x8C44, "GL_SLUMINANCE_ALPHA" },
  2165. { 0x8C45, "GL_SLUMINANCE8_ALPHA8_EXT" },
  2166. { 0x8C45, "GL_SLUMINANCE8_ALPHA8" },
  2167. { 0x8C46, "GL_SLUMINANCE_EXT" },
  2168. { 0x8C46, "GL_SLUMINANCE" },
  2169. { 0x8C47, "GL_SLUMINANCE8_EXT" },
  2170. { 0x8C47, "GL_SLUMINANCE8" },
  2171. { 0x8C48, "GL_COMPRESSED_SRGB_EXT" },
  2172. { 0x8C48, "GL_COMPRESSED_SRGB" },
  2173. { 0x8C49, "GL_COMPRESSED_SRGB_ALPHA_EXT" },
  2174. { 0x8C49, "GL_COMPRESSED_SRGB_ALPHA" },
  2175. { 0x8C4A, "GL_COMPRESSED_SLUMINANCE_EXT" },
  2176. { 0x8C4A, "GL_COMPRESSED_SLUMINANCE" },
  2177. { 0x8C4B, "GL_COMPRESSED_SLUMINANCE_ALPHA_EXT" },
  2178. { 0x8C4B, "GL_COMPRESSED_SLUMINANCE_ALPHA" },
  2179. { 0x8C4C, "GL_COMPRESSED_SRGB_S3TC_DXT1_EXT" },
  2180. { 0x8C4D, "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT" },
  2181. { 0x8C4E, "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT" },
  2182. { 0x8C4F, "GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT" },
  2183. { 0x8C76, "GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT" },
  2184. { 0x8C7F, "GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT" },
  2185. { 0x8C80, "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT" },
  2186. { 0x8C83, "GL_TRANSFORM_FEEDBACK_VARYINGS_EXT" },
  2187. { 0x8C84, "GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT" },
  2188. { 0x8C85, "GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT" },
  2189. { 0x8C87, "GL_PRIMITIVES_GENERATED_EXT" },
  2190. { 0x8C88, "GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT" },
  2191. { 0x8C89, "GL_RASTERIZER_DISCARD_EXT" },
  2192. { 0x8C8A, "GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT" },
  2193. { 0x8C8B, "GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT" },
  2194. { 0x8C8C, "GL_INTERLEAVED_ATTRIBS_EXT" },
  2195. { 0x8C8D, "GL_SEPARATE_ATTRIBS_EXT" },
  2196. { 0x8C8E, "GL_TRANSFORM_FEEDBACK_BUFFER_EXT" },
  2197. { 0x8C8F, "GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT" },
  2198. { 0x8CA0, "GL_POINT_SPRITE_COORD_ORIGIN" },
  2199. { 0x8CA1, "GL_LOWER_LEFT" },
  2200. { 0x8CA2, "GL_UPPER_LEFT" },
  2201. { 0x8CA3, "GL_STENCIL_BACK_REF" },
  2202. { 0x8CA4, "GL_STENCIL_BACK_VALUE_MASK" },
  2203. { 0x8CA5, "GL_STENCIL_BACK_WRITEMASK" },
  2204. { 0x8CA6, "GL_DRAW_FRAMEBUFFER_BINDING_EXT" },
  2205. { 0x8CA6, "GL_FRAMEBUFFER_BINDING_EXT" },
  2206. { 0x8CA6, "GL_FRAMEBUFFER_BINDING" },
  2207. { 0x8CA7, "GL_RENDERBUFFER_BINDING_EXT" },
  2208. { 0x8CA7, "GL_RENDERBUFFER_BINDING" },
  2209. { 0x8CA8, "GL_READ_FRAMEBUFFER_EXT" },
  2210. { 0x8CA8, "GL_READ_FRAMEBUFFER" },
  2211. { 0x8CA9, "GL_DRAW_FRAMEBUFFER_EXT" },
  2212. { 0x8CA9, "GL_DRAW_FRAMEBUFFER" },
  2213. { 0x8CAA, "GL_READ_FRAMEBUFFER_BINDING_EXT" },
  2214. { 0x8CAA, "GL_READ_FRAMEBUFFER_BINDING" },
  2215. { 0x8CAB, "GL_RENDERBUFFER_SAMPLES_EXT" },
  2216. { 0x8CAB, "GL_RENDERBUFFER_SAMPLES" },
  2217. { 0x8CAC, "GL_DEPTH_COMPONENT32F" },
  2218. { 0x8CAD, "GL_DEPTH32F_STENCIL8" },
  2219. { 0x8CD0, "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT" },
  2220. { 0x8CD0, "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE" },
  2221. { 0x8CD1, "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT" },
  2222. { 0x8CD1, "GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME" },
  2223. { 0x8CD2, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT" },
  2224. { 0x8CD2, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL" },
  2225. { 0x8CD3, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT" },
  2226. { 0x8CD3, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE" },
  2227. { 0x8CD4, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT" },
  2228. { 0x8CD4, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT" },
  2229. { 0x8CD4, "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER" },
  2230. { 0x8CD5, "GL_FRAMEBUFFER_COMPLETE_EXT" },
  2231. { 0x8CD5, "GL_FRAMEBUFFER_COMPLETE" },
  2232. { 0x8CD6, "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT" },
  2233. { 0x8CD6, "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT" },
  2234. { 0x8CD7, "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT" },
  2235. { 0x8CD7, "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT" },
  2236. { 0x8CD9, "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT" },
  2237. { 0x8CDA, "GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT" },
  2238. { 0x8CDB, "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT" },
  2239. { 0x8CDB, "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER" },
  2240. { 0x8CDC, "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT" },
  2241. { 0x8CDC, "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER" },
  2242. { 0x8CDD, "GL_FRAMEBUFFER_UNSUPPORTED_EXT" },
  2243. { 0x8CDD, "GL_FRAMEBUFFER_UNSUPPORTED" },
  2244. { 0x8CDF, "GL_MAX_COLOR_ATTACHMENTS_EXT" },
  2245. { 0x8CDF, "GL_MAX_COLOR_ATTACHMENTS" },
  2246. { 0x8CE0, "GL_COLOR_ATTACHMENT0_EXT" },
  2247. { 0x8CE0, "GL_COLOR_ATTACHMENT0" },
  2248. { 0x8CE1, "GL_COLOR_ATTACHMENT1_EXT" },
  2249. { 0x8CE1, "GL_COLOR_ATTACHMENT1" },
  2250. { 0x8CE2, "GL_COLOR_ATTACHMENT2_EXT" },
  2251. { 0x8CE2, "GL_COLOR_ATTACHMENT2" },
  2252. { 0x8CE3, "GL_COLOR_ATTACHMENT3_EXT" },
  2253. { 0x8CE3, "GL_COLOR_ATTACHMENT3" },
  2254. { 0x8CE4, "GL_COLOR_ATTACHMENT4_EXT" },
  2255. { 0x8CE4, "GL_COLOR_ATTACHMENT4" },
  2256. { 0x8CE5, "GL_COLOR_ATTACHMENT5_EXT" },
  2257. { 0x8CE5, "GL_COLOR_ATTACHMENT5" },
  2258. { 0x8CE6, "GL_COLOR_ATTACHMENT6_EXT" },
  2259. { 0x8CE6, "GL_COLOR_ATTACHMENT6" },
  2260. { 0x8CE7, "GL_COLOR_ATTACHMENT7_EXT" },
  2261. { 0x8CE7, "GL_COLOR_ATTACHMENT7" },
  2262. { 0x8CE8, "GL_COLOR_ATTACHMENT8_EXT" },
  2263. { 0x8CE8, "GL_COLOR_ATTACHMENT8" },
  2264. { 0x8CE9, "GL_COLOR_ATTACHMENT9_EXT" },
  2265. { 0x8CE9, "GL_COLOR_ATTACHMENT9" },
  2266. { 0x8CEA, "GL_COLOR_ATTACHMENT10_EXT" },
  2267. { 0x8CEA, "GL_COLOR_ATTACHMENT10" },
  2268. { 0x8CEB, "GL_COLOR_ATTACHMENT11_EXT" },
  2269. { 0x8CEB, "GL_COLOR_ATTACHMENT11" },
  2270. { 0x8CEC, "GL_COLOR_ATTACHMENT12_EXT" },
  2271. { 0x8CEC, "GL_COLOR_ATTACHMENT12" },
  2272. { 0x8CED, "GL_COLOR_ATTACHMENT13_EXT" },
  2273. { 0x8CED, "GL_COLOR_ATTACHMENT13" },
  2274. { 0x8CEE, "GL_COLOR_ATTACHMENT14_EXT" },
  2275. { 0x8CEE, "GL_COLOR_ATTACHMENT14" },
  2276. { 0x8CEF, "GL_COLOR_ATTACHMENT15_EXT" },
  2277. { 0x8CEF, "GL_COLOR_ATTACHMENT15" },
  2278. { 0x8D00, "GL_DEPTH_ATTACHMENT_EXT" },
  2279. { 0x8D00, "GL_DEPTH_ATTACHMENT" },
  2280. { 0x8D20, "GL_STENCIL_ATTACHMENT_EXT" },
  2281. { 0x8D20, "GL_STENCIL_ATTACHMENT" },
  2282. { 0x8D40, "GL_FRAMEBUFFER_EXT" },
  2283. { 0x8D40, "GL_FRAMEBUFFER" },
  2284. { 0x8D41, "GL_RENDERBUFFER_EXT" },
  2285. { 0x8D41, "GL_RENDERBUFFER" },
  2286. { 0x8D42, "GL_RENDERBUFFER_WIDTH_EXT" },
  2287. { 0x8D42, "GL_RENDERBUFFER_WIDTH" },
  2288. { 0x8D43, "GL_RENDERBUFFER_HEIGHT_EXT" },
  2289. { 0x8D43, "GL_RENDERBUFFER_HEIGHT" },
  2290. { 0x8D44, "GL_RENDERBUFFER_INTERNAL_FORMAT_EXT" },
  2291. { 0x8D44, "GL_RENDERBUFFER_INTERNAL_FORMAT" },
  2292. { 0x8D46, "GL_STENCIL_INDEX1_EXT" },
  2293. { 0x8D46, "GL_STENCIL_INDEX1" },
  2294. { 0x8D47, "GL_STENCIL_INDEX4_EXT" },
  2295. { 0x8D47, "GL_STENCIL_INDEX4" },
  2296. { 0x8D48, "GL_STENCIL_INDEX8_EXT" },
  2297. { 0x8D48, "GL_STENCIL_INDEX8" },
  2298. { 0x8D49, "GL_STENCIL_INDEX16_EXT" },
  2299. { 0x8D49, "GL_STENCIL_INDEX16" },
  2300. { 0x8D50, "GL_RENDERBUFFER_RED_SIZE_EXT" },
  2301. { 0x8D50, "GL_RENDERBUFFER_RED_SIZE" },
  2302. { 0x8D51, "GL_RENDERBUFFER_GREEN_SIZE_EXT" },
  2303. { 0x8D51, "GL_RENDERBUFFER_GREEN_SIZE" },
  2304. { 0x8D52, "GL_RENDERBUFFER_BLUE_SIZE_EXT" },
  2305. { 0x8D52, "GL_RENDERBUFFER_BLUE_SIZE" },
  2306. { 0x8D53, "GL_RENDERBUFFER_ALPHA_SIZE_EXT" },
  2307. { 0x8D53, "GL_RENDERBUFFER_ALPHA_SIZE" },
  2308. { 0x8D54, "GL_RENDERBUFFER_DEPTH_SIZE_EXT" },
  2309. { 0x8D54, "GL_RENDERBUFFER_DEPTH_SIZE" },
  2310. { 0x8D55, "GL_RENDERBUFFER_STENCIL_SIZE_EXT" },
  2311. { 0x8D55, "GL_RENDERBUFFER_STENCIL_SIZE" },
  2312. { 0x8D56, "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT" },
  2313. { 0x8D56, "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE" },
  2314. { 0x8D57, "GL_MAX_SAMPLES_EXT" },
  2315. { 0x8D57, "GL_MAX_SAMPLES" },
  2316. { 0x8D70, "GL_RGBA32UI_EXT" },
  2317. { 0x8D71, "GL_RGB32UI_EXT" },
  2318. { 0x8D72, "GL_ALPHA32UI_EXT" },
  2319. { 0x8D73, "GL_INTENSITY32UI_EXT" },
  2320. { 0x8D74, "GL_LUMINANCE32UI_EXT" },
  2321. { 0x8D75, "GL_LUMINANCE_ALPHA32UI_EXT" },
  2322. { 0x8D76, "GL_RGBA16UI_EXT" },
  2323. { 0x8D77, "GL_RGB16UI_EXT" },
  2324. { 0x8D78, "GL_ALPHA16UI_EXT" },
  2325. { 0x8D79, "GL_INTENSITY16UI_EXT" },
  2326. { 0x8D7A, "GL_LUMINANCE16UI_EXT" },
  2327. { 0x8D7B, "GL_LUMINANCE_ALPHA16UI_EXT" },
  2328. { 0x8D7C, "GL_RGBA8UI_EXT" },
  2329. { 0x8D7D, "GL_RGB8UI_EXT" },
  2330. { 0x8D7E, "GL_ALPHA8UI_EXT" },
  2331. { 0x8D7F, "GL_INTENSITY8UI_EXT" },
  2332. { 0x8D80, "GL_LUMINANCE8UI_EXT" },
  2333. { 0x8D81, "GL_LUMINANCE_ALPHA8UI_EXT" },
  2334. { 0x8D82, "GL_RGBA32I_EXT" },
  2335. { 0x8D83, "GL_RGB32I_EXT" },
  2336. { 0x8D84, "GL_ALPHA32I_EXT" },
  2337. { 0x8D85, "GL_INTENSITY32I_EXT" },
  2338. { 0x8D86, "GL_LUMINANCE32I_EXT" },
  2339. { 0x8D87, "GL_LUMINANCE_ALPHA32I_EXT" },
  2340. { 0x8D88, "GL_RGBA16I_EXT" },
  2341. { 0x8D89, "GL_RGB16I_EXT" },
  2342. { 0x8D8A, "GL_ALPHA16I_EXT" },
  2343. { 0x8D8B, "GL_INTENSITY16I_EXT" },
  2344. { 0x8D8C, "GL_LUMINANCE16I_EXT" },
  2345. { 0x8D8D, "GL_LUMINANCE_ALPHA16I_EXT" },
  2346. { 0x8D8E, "GL_RGBA8I_EXT" },
  2347. { 0x8D8F, "GL_RGB8I_EXT" },
  2348. { 0x8D90, "GL_ALPHA8I_EXT" },
  2349. { 0x8D91, "GL_INTENSITY8I_EXT" },
  2350. { 0x8D92, "GL_LUMINANCE8I_EXT" },
  2351. { 0x8D93, "GL_LUMINANCE_ALPHA8I_EXT" },
  2352. { 0x8D94, "GL_RED_INTEGER_EXT" },
  2353. { 0x8D95, "GL_GREEN_INTEGER_EXT" },
  2354. { 0x8D96, "GL_BLUE_INTEGER_EXT" },
  2355. { 0x8D97, "GL_ALPHA_INTEGER_EXT" },
  2356. { 0x8D98, "GL_RGB_INTEGER_EXT" },
  2357. { 0x8D99, "GL_RGBA_INTEGER_EXT" },
  2358. { 0x8D9A, "GL_BGR_INTEGER_EXT" },
  2359. { 0x8D9B, "GL_BGRA_INTEGER_EXT" },
  2360. { 0x8D9C, "GL_LUMINANCE_INTEGER_EXT" },
  2361. { 0x8D9D, "GL_LUMINANCE_ALPHA_INTEGER_EXT" },
  2362. { 0x8D9E, "GL_RGBA_INTEGER_MODE_EXT" },
  2363. { 0x8DA7, "GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT" },
  2364. { 0x8DA8, "GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT" },
  2365. { 0x8DA9, "GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT" },
  2366. { 0x8DAD, "GL_FLOAT_32_UNSIGNED_INT_24_8_REV" },
  2367. { 0x8DB9, "GL_FRAMEBUFFER_SRGB_EXT" },
  2368. { 0x8DBA, "GL_FRAMEBUFFER_SRGB_CAPABLE_EXT" },
  2369. { 0x8DBB, "GL_COMPRESSED_RED_RGTC1" },
  2370. { 0x8DBC, "GL_COMPRESSED_SIGNED_RED_RGTC1" },
  2371. { 0x8DBD, "GL_COMPRESSED_RG_RGTC2" },
  2372. { 0x8DBE, "GL_COMPRESSED_SIGNED_RG_RGTC2" },
  2373. { 0x8DC0, "GL_SAMPLER_1D_ARRAY_EXT" },
  2374. { 0x8DC1, "GL_SAMPLER_2D_ARRAY_EXT" },
  2375. { 0x8DC2, "GL_SAMPLER_BUFFER_EXT" },
  2376. { 0x8DC3, "GL_SAMPLER_1D_ARRAY_SHADOW_EXT" },
  2377. { 0x8DC4, "GL_SAMPLER_2D_ARRAY_SHADOW_EXT" },
  2378. { 0x8DC5, "GL_SAMPLER_CUBE_SHADOW_EXT" },
  2379. { 0x8DC6, "GL_UNSIGNED_INT_VEC2_EXT" },
  2380. { 0x8DC7, "GL_UNSIGNED_INT_VEC3_EXT" },
  2381. { 0x8DC8, "GL_UNSIGNED_INT_VEC4_EXT" },
  2382. { 0x8DC9, "GL_INT_SAMPLER_1D_EXT" },
  2383. { 0x8DCA, "GL_INT_SAMPLER_2D_EXT" },
  2384. { 0x8DCB, "GL_INT_SAMPLER_3D_EXT" },
  2385. { 0x8DCC, "GL_INT_SAMPLER_CUBE_EXT" },
  2386. { 0x8DCD, "GL_INT_SAMPLER_2D_RECT_EXT" },
  2387. { 0x8DCE, "GL_INT_SAMPLER_1D_ARRAY_EXT" },
  2388. { 0x8DCF, "GL_INT_SAMPLER_2D_ARRAY_EXT" },
  2389. { 0x8DD0, "GL_INT_SAMPLER_BUFFER_EXT" },
  2390. { 0x8DD1, "GL_UNSIGNED_INT_SAMPLER_1D_EXT" },
  2391. { 0x8DD2, "GL_UNSIGNED_INT_SAMPLER_2D_EXT" },
  2392. { 0x8DD3, "GL_UNSIGNED_INT_SAMPLER_3D_EXT" },
  2393. { 0x8DD4, "GL_UNSIGNED_INT_SAMPLER_CUBE_EXT" },
  2394. { 0x8DD5, "GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT" },
  2395. { 0x8DD6, "GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT" },
  2396. { 0x8DD7, "GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT" },
  2397. { 0x8DD8, "GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT" },
  2398. { 0x8DD9, "GL_GEOMETRY_SHADER_EXT" },
  2399. { 0x8DDA, "GL_GEOMETRY_VERTICES_OUT_EXT" },
  2400. { 0x8DDB, "GL_GEOMETRY_INPUT_TYPE_EXT" },
  2401. { 0x8DDC, "GL_GEOMETRY_OUTPUT_TYPE_EXT" },
  2402. { 0x8DDD, "GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT" },
  2403. { 0x8DDE, "GL_MAX_VERTEX_VARYING_COMPONENTS_EXT" },
  2404. { 0x8DDF, "GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT" },
  2405. { 0x8DE0, "GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT" },
  2406. { 0x8DE1, "GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT" },
  2407. { 0x8DE2, "GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT" },
  2408. { 0x8DE3, "GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT" },
  2409. { 0x8DE4, "GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT" },
  2410. { 0x8DED, "GL_MAX_BINDABLE_UNIFORM_SIZE_EXT" },
  2411. { 0x8DEE, "GL_UNIFORM_BUFFER_EXT" },
  2412. { 0x8DEF, "GL_UNIFORM_BUFFER_BINDING_EXT" },
  2413. { 0x8E4C, "GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT" },
  2414. { 0x8E4D, "GL_FIRST_VERTEX_CONVENTION_EXT" },
  2415. { 0x8E4E, "GL_LAST_VERTEX_CONVENTION_EXT" },
  2416. { 0x8E4F, "GL_PROVOKING_VERTEX_EXT" },
  2417. VE( TERMVALUE )
  2418. };
  2419. const GLMValueEntry_t g_gl_renderers[] =
  2420. {
  2421. { 0x00020200, "Generic" },
  2422. { 0x00020400, "GenericFloat" },
  2423. { 0x00020600, "AppleSW" },
  2424. { 0x00021000, "ATIRage128" },
  2425. { 0x00021200, "ATIRadeon" },
  2426. { 0x00021400, "ATIRagePro" },
  2427. { 0x00021600, "ATIRadeon8500" },
  2428. { 0x00021800, "ATIRadeon9700" },
  2429. { 0x00021900, "ATIRadeonX1000" },
  2430. { 0x00021A00, "ATIRadeonX2000" },
  2431. { 0x00022000, "NVGeForce2MX" },
  2432. { 0x00022200, "NVGeForce3" },
  2433. { 0x00022400, "NVGeForceFX" },
  2434. { 0x00022600, "NVGeForce8xxx" },
  2435. { 0x00023000, "VTBladeXP2" },
  2436. { 0x00024000, "Intel900" },
  2437. { 0x00024200, "IntelX3100" },
  2438. { 0x00040000, "Mesa3DFX" },
  2439. VE( TERMVALUE )
  2440. };
  2441. //===============================================================================
  2442. // decode helper funcs
  2443. char s_glmStrScratch[65536];
  2444. int s_glmStrCursor = 0;
  2445. const char * GLMDecode( GLMThing_t thingtype, unsigned long value )
  2446. {
  2447. const GLMValueEntry_t *table = NULL;
  2448. //char isflags = 0;
  2449. switch( thingtype )
  2450. {
  2451. case eD3D_DEVTYPE: table = g_d3d_devtypes;
  2452. break;
  2453. case eD3D_FORMAT: table = g_d3d_formats;
  2454. break;
  2455. case eD3D_RTYPE: table = g_d3d_rtypes;
  2456. break;
  2457. case eD3D_USAGE: table = g_d3d_usages;
  2458. break;
  2459. case eD3D_RSTATE: table = g_d3d_rstates;
  2460. break;
  2461. case eD3D_SIO: table = g_d3d_opcodes;
  2462. break;
  2463. case eD3D_VTXDECLUSAGE: table = g_d3d_vtxdeclusages;
  2464. break;
  2465. case eCGL_RENDID: table = g_cgl_rendids;
  2466. break;
  2467. case eGL_ERROR: table = g_gl_errors;
  2468. break;
  2469. case eGL_ENUM: table = g_gl_enums;
  2470. break;
  2471. case eGL_RENDERER: table = g_gl_renderers;
  2472. break;
  2473. default:
  2474. GLMStop();
  2475. return "UNKNOWNTYPE";
  2476. break;
  2477. }
  2478. if (table)
  2479. {
  2480. while( table->value != TERMVALUE )
  2481. {
  2482. if (table->value == value)
  2483. {
  2484. return table->name;
  2485. }
  2486. table++;
  2487. }
  2488. }
  2489. return "UNKNOWN";
  2490. }
  2491. const char *GLMDecodeMask( GLMThing_t kind, unsigned long value )
  2492. {
  2493. // if cursor to scratch buffer is within 1K of EOB, rewind
  2494. // nobody is going to decode 63K of flag string values in a single call..
  2495. // this means that strings returned by this function have a short lifetime.. print them and do not save the pointer..
  2496. if ( (sizeof(s_glmStrScratch) - s_glmStrCursor) < 1000 )
  2497. {
  2498. s_glmStrCursor = 0;
  2499. }
  2500. char *start = &s_glmStrScratch[ s_glmStrCursor ];
  2501. char *dest = start;
  2502. char first = 1;
  2503. DWORD mask = static_cast<DWORD>(1L<<31);
  2504. while(mask)
  2505. {
  2506. if (mask & value)
  2507. {
  2508. sprintf(dest,"%s%s", (first) ? "" : "|", GLMDecode( kind, value&mask ) );
  2509. first = 0;
  2510. dest += strlen(dest); // leaves dest pointing at the end null
  2511. }
  2512. mask >>= 1;
  2513. }
  2514. s_glmStrCursor = (dest - s_glmStrScratch) + 1; // +1 so the next decoded flag set doesn't land on the ending null
  2515. return start;
  2516. }
  2517. #undef VE
  2518. #undef TERMVALUE
  2519. //===============================================================================
  2520. bool GLMDetectOGLP( void )
  2521. {
  2522. return false;
  2523. }
  2524. // from http://blog.timac.org/?p=190
  2525. #ifndef _WIN32
  2526. #include <stdbool.h>
  2527. #endif
  2528. #include <sys/types.h>
  2529. #ifndef _WIN32
  2530. #include <unistd.h>
  2531. #include <sys/sysctl.h>
  2532. #endif
  2533. // From Technical Q&A QA1361
  2534. // Returns true if the current process
  2535. // is being debugged (either running
  2536. // under the debugger or has a debugger
  2537. // attached post facto).
  2538. bool GLMDetectGDB( void ) // aka AmIBeingDebugged()
  2539. {
  2540. #ifdef OSX
  2541. bool result;
  2542. int junk;
  2543. int mib[4];
  2544. struct kinfo_proc info;
  2545. size_t size;
  2546. // Initialize the flags so that,
  2547. // if sysctl fails for some bizarre
  2548. // reason, we get a predictable result.
  2549. info.kp_proc.p_flag = 0;
  2550. // Initialize mib, which tells sysctl the info
  2551. // we want, in this case we're looking for
  2552. // information about a specific process ID.
  2553. mib[0] = CTL_KERN;
  2554. mib[1] = KERN_PROC;
  2555. mib[2] = KERN_PROC_PID;
  2556. mib[3] = getpid();
  2557. // Call sysctl.
  2558. size = sizeof(info);
  2559. junk = sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, NULL, 0);
  2560. assert(junk == 0);
  2561. // We're being debugged if the P_TRACED
  2562. // flag is set.
  2563. result = ( (info.kp_proc.p_flag & P_TRACED) != 0 );
  2564. return result;
  2565. #else
  2566. return Sys_IsDebuggerPresent();
  2567. #endif
  2568. }
  2569. static uint g_glmDebugChannelMask = 0; // which output channels are available (can be more than one)
  2570. static uint g_glmDebugFlavorMask = 0; // which message flavors are enabled for output (can be more than one)
  2571. uint GLMDetectAvailableChannels( void )
  2572. {
  2573. uint result = 0;
  2574. // printf is always available (except maybe in release... ?)
  2575. result |= (1 << ePrintf);
  2576. // gdb
  2577. if (GLMDetectGDB())
  2578. {
  2579. result |= (1 << eDebugger);
  2580. printf("\n############# GDB Detected");
  2581. }
  2582. // oglp
  2583. if (GLMDetectOGLP())
  2584. {
  2585. result |= (1 << eGLProfiler);
  2586. printf("\n############# OGLP Detected");
  2587. }
  2588. return result;
  2589. }
  2590. static bool g_debugInitDone = false;
  2591. #if GLMDEBUG
  2592. // following funcs vanish if GLMDEBUG not set
  2593. void GLMDebugInitialize( bool forceReinit )
  2594. {
  2595. if ( !g_debugInitDone || forceReinit )
  2596. {
  2597. // detect channels
  2598. uint channelMask = GLMDetectAvailableChannels();
  2599. // see if there are any prohibitions on the commandline
  2600. // (also add any other desired reasons, release build say)..
  2601. if ( CommandLine()->FindParm("-noprintconsole") )
  2602. {
  2603. channelMask &= ~(1<<ePrintf);
  2604. }
  2605. if ( CommandLine()->FindParm("-noprintdebugger") )
  2606. {
  2607. channelMask &= ~(1<<eDebugger);
  2608. }
  2609. if ( CommandLine()->FindParm("-noprintoglp") )
  2610. {
  2611. channelMask &= ~(1<<eGLProfiler);
  2612. }
  2613. // finally, disable all of them if commandline did not say "enable spew"
  2614. if (!CommandLine()->FindParm("-glmspew"))
  2615. {
  2616. channelMask = 0;
  2617. }
  2618. // set the output channel mask
  2619. GLMDebugChannelMask( &channelMask );
  2620. // if any channels are enabled, enable some output
  2621. if ( channelMask )
  2622. {
  2623. // start mostly quiet unless the -glmbootspew option is there
  2624. if ( CommandLine()->FindParm( "-glmbootspew" ) )
  2625. {
  2626. g_glmDebugFlavorMask = 0xFFFFFFFF;
  2627. }
  2628. else
  2629. {
  2630. g_glmDebugFlavorMask =
  2631. (1<<eAllFlavors)
  2632. | (1<<eDebugDump) // -D- stuff
  2633. // | (1<<eFrameBufData) // -F-
  2634. // | (1<<eDXStuff) // -X-
  2635. // | (1<<eTenure) // > <
  2636. // | (1<<eAllocations) // -A-
  2637. | (1<<eSlowness) // -Z-
  2638. | (1<<eDefaultFlavor); // adjust to suit
  2639. }
  2640. }
  2641. else
  2642. {
  2643. g_glmDebugFlavorMask = 0;
  2644. }
  2645. }
  2646. }
  2647. uint GLMDebugChannelMask( uint *newValue )
  2648. {
  2649. if (newValue)
  2650. {
  2651. g_glmDebugChannelMask = *newValue;
  2652. }
  2653. uint result = g_glmDebugChannelMask;
  2654. // leave space for any override / mute mechanism we might want to inject here
  2655. return result;
  2656. }
  2657. uint GLMDebugFlavorMask( uint *newValue )
  2658. {
  2659. if (newValue)
  2660. {
  2661. g_glmDebugFlavorMask = *newValue;
  2662. }
  2663. uint result = g_glmDebugFlavorMask;
  2664. // leave space for any override / mute mechanism we might want to inject here
  2665. return result;
  2666. }
  2667. #endif
  2668. //===============================================================================
  2669. void GLMEnableTrace( bool on )
  2670. {
  2671. }
  2672. //===============================================================================
  2673. #if GLMDEBUG
  2674. // following funcs vanish if GLMDEBUG not set
  2675. void GLMStringOut( char *string )
  2676. {
  2677. if ( GLMDebugChannelMask() & ( (1<<ePrintf) | (1<<eDebugger) ) )
  2678. {
  2679. #ifdef WIN32
  2680. OutputDebugStringA( string );
  2681. OutputDebugStringA( "\n");
  2682. #else
  2683. puts( string );
  2684. #endif
  2685. }
  2686. if ( GLMDebugChannelMask() & (1<<eGLProfiler) )
  2687. {
  2688. if (gGL->m_bHave_GL_GREMEDY_string_marker)
  2689. {
  2690. gGL->glStringMarkerGREMEDY(0, string);
  2691. }
  2692. }
  2693. }
  2694. int g_glm_indent = 0;
  2695. int g_glm_indent_max = 40; // 40 tabs max
  2696. #ifndef OSX
  2697. const char *strnstr( const char *haystack, const char *needle, int len )
  2698. {
  2699. return strstr( haystack, needle );
  2700. }
  2701. #endif
  2702. EGLMDebugFlavor GLMAssessFlavor( char *str )
  2703. {
  2704. EGLMDebugFlavor flavor = eDefaultFlavor;
  2705. if (strnstr(str, "-D-", 4))
  2706. {
  2707. // debug dump
  2708. flavor = eDebugDump;
  2709. }
  2710. else if (strnstr(str, "-M-", 4))
  2711. {
  2712. // matrix data
  2713. flavor = eMatrixData;
  2714. }
  2715. else if (strnstr(str, "-S-", 4))
  2716. {
  2717. // shader data
  2718. flavor = eShaderData;
  2719. }
  2720. else if (strnstr(str, "-F-", 4))
  2721. {
  2722. // framebuf data
  2723. flavor = eFrameBufData;
  2724. }
  2725. else if (strnstr(str, "-X-", 4))
  2726. {
  2727. // DirectX data
  2728. flavor = eDXStuff;
  2729. }
  2730. else if (strnstr(str, "-A-", 4))
  2731. {
  2732. // allocation data
  2733. flavor = eAllocations;
  2734. }
  2735. else if (strnstr(str, "-Z-", 4))
  2736. {
  2737. // allocation data
  2738. flavor = eSlowness;
  2739. }
  2740. else if (str[0] == '<' || str[0] == '>')
  2741. {
  2742. // entry/exit (aka tenure)
  2743. flavor = eTenure;
  2744. }
  2745. else if (strnstr(str, "---", 4)) // note we check four chars worth so you can do >-M- and it will indent and be filterable
  2746. {
  2747. // comment
  2748. flavor = eComment;
  2749. }
  2750. return flavor;
  2751. }
  2752. void GLMPrintfVA( const char *fmt, va_list vargs )
  2753. {
  2754. // if no channels open, return
  2755. uint channelMask = GLMDebugChannelMask();
  2756. if (!channelMask)
  2757. return;
  2758. // if "all flavors" is off, return
  2759. uint flavorMask = GLMDebugFlavorMask();
  2760. if (! ( flavorMask & (1<<eAllFlavors) ) )
  2761. return;
  2762. // characterize the flavor of the string
  2763. // if flavor hits against the flavor mask, print it
  2764. EGLMDebugFlavor flavor = GLMAssessFlavor( (char *)fmt );
  2765. if ( !(flavorMask & (1<<flavor)) )
  2766. return;
  2767. // print the formatted string, with indenting
  2768. // if first char is a '>' - raise indent level after print.
  2769. // if first char is a '<' - lower indent level before print.
  2770. char buf[100000];
  2771. if (fmt[0] == '<')
  2772. {
  2773. GLMIncIndent( -1 );
  2774. }
  2775. memset( buf, '\t', g_glm_indent );
  2776. vsprintf( buf+g_glm_indent, fmt, vargs );
  2777. GLMStringOut( buf );
  2778. if (fmt[0] == '>')
  2779. {
  2780. GLMIncIndent( 1 );
  2781. }
  2782. }
  2783. void GLMPrintf( const char *fmt, ... )
  2784. {
  2785. // if no channels open, return
  2786. uint channelMask = GLMDebugChannelMask();
  2787. if (!channelMask)
  2788. return;
  2789. // if "all flavors" is off, return
  2790. uint flavorMask = GLMDebugFlavorMask();
  2791. if (! ( flavorMask & (1<<eAllFlavors) ) )
  2792. return;
  2793. va_list vargs;
  2794. va_start(vargs, fmt);
  2795. GLMPrintfVA( fmt, vargs );
  2796. va_end( vargs );
  2797. }
  2798. void GLMPrintStr( const char *str, EGLMDebugFlavor flavor ) // will indent
  2799. {
  2800. // if no channels open, return
  2801. uint channelMask = GLMDebugChannelMask();
  2802. if (!channelMask)
  2803. return;
  2804. // if "all flavors" is off, return
  2805. uint flavorMask = GLMDebugFlavorMask();
  2806. if (! ( flavorMask & (1<<eAllFlavors) ) )
  2807. return;
  2808. // if flavor argument hits against the flavor mask, print it
  2809. if ( !(flavorMask & (1<<flavor)) )
  2810. return;
  2811. // just print the plain string, with indenting
  2812. // if first char is a '>' - raise indent level after print.
  2813. // if first char is a '<' - lower indent level before print.
  2814. char buf[64000];
  2815. if (str[0] == '<')
  2816. {
  2817. GLMIncIndent( -1 );
  2818. }
  2819. memset( buf, '\t', g_glm_indent );
  2820. if (strlen(str) < sizeof(buf)-g_glm_indent-1)
  2821. {
  2822. strcpy( buf + g_glm_indent, str );
  2823. }
  2824. else
  2825. {
  2826. DXABSTRACT_BREAK_ON_ERROR();
  2827. }
  2828. GLMStringOut( buf ); // single string out with indenting
  2829. if (str[0] == '>')
  2830. {
  2831. GLMIncIndent( 1 );
  2832. }
  2833. }
  2834. void GLMPrintText( const char *str, EGLMDebugFlavor flavor, uint options )
  2835. {
  2836. // if no channels open, return
  2837. uint channelMask = GLMDebugChannelMask();
  2838. if (!channelMask)
  2839. return;
  2840. // if "all flavors" is off, return
  2841. uint flavorMask = GLMDebugFlavorMask();
  2842. if (! ( flavorMask & (1<<eAllFlavors) ) )
  2843. return;
  2844. // if flavor argument hits against the flavor mask, print it
  2845. if ( !(flavorMask & (1<<flavor)) )
  2846. return;
  2847. char buf[64000];
  2848. char lineout[64000];
  2849. int linenum = 1;
  2850. V_strncpy( buf, str, sizeof(buf) );
  2851. // walk the text and treat each newline as an indentation opportunity..
  2852. const char *mark = buf;
  2853. const char *end = mark + strlen(buf);
  2854. //const char *next = NULL;
  2855. while(mark < end)
  2856. {
  2857. // starting at mark, see if there is a newline between there and end
  2858. char *next = (char*)strchr( mark, '\n' );
  2859. const char *printfrom = mark;
  2860. if (next)
  2861. {
  2862. // print text from mark up through next. move next to char after newline.
  2863. *next = 0;
  2864. mark = next+1;
  2865. }
  2866. else
  2867. {
  2868. // print all text after mark and stop
  2869. mark = end;
  2870. }
  2871. if (options & GLMPRINTTEXT_NUMBEREDLINES)
  2872. {
  2873. sprintf( lineout, "%-5d| %s", linenum, printfrom );
  2874. GLMPrintStr( lineout, flavor );
  2875. linenum++;
  2876. }
  2877. else
  2878. {
  2879. GLMPrintStr( printfrom, flavor );
  2880. }
  2881. }
  2882. }
  2883. int GLMIncIndent( int indentDelta )
  2884. {
  2885. g_glm_indent += indentDelta;
  2886. if (indentDelta>0)
  2887. {
  2888. if (g_glm_indent > g_glm_indent_max)
  2889. {
  2890. g_glm_indent = g_glm_indent_max;
  2891. }
  2892. }
  2893. else
  2894. {
  2895. if (g_glm_indent < 0)
  2896. {
  2897. g_glm_indent = 0;
  2898. }
  2899. }
  2900. return g_glm_indent;
  2901. }
  2902. int GLMGetIndent( void )
  2903. {
  2904. return g_glm_indent;
  2905. }
  2906. void GLMSetIndent( int indent )
  2907. {
  2908. g_glm_indent = indent;
  2909. }
  2910. #endif
  2911. #if 0 // defined in platform.h
  2912. inline uint64 Plat_Rdtsc()
  2913. {
  2914. #if defined( _X360 )
  2915. return ( uint64 )__mftb32();
  2916. #elif defined( _WIN64 )
  2917. return ( uint64 )__rdtsc();
  2918. #elif defined( _WIN32 )
  2919. #if defined( _MSC_VER ) && ( _MSC_VER >= 1400 )
  2920. return ( uint64 )__rdtsc();
  2921. #else
  2922. __asm rdtsc;
  2923. __asm ret;
  2924. #endif
  2925. #elif defined( __i386__ )
  2926. uint64 val;
  2927. __asm__ __volatile__ ( "rdtsc" : "=A" (val) );
  2928. return val;
  2929. #elif defined( __x86_64__ )
  2930. uint32 lo, hi;
  2931. __asm__ __volatile__ ( "rdtsc" : "=a" (lo), "=d" (hi));
  2932. return ( ( ( uint64 )hi ) << 32 ) | lo;
  2933. #else
  2934. #error
  2935. #endif
  2936. }
  2937. #endif
  2938. // PIX tracking - you can call these outside of GLMDEBUG=true
  2939. char sg_pPIXName[128];
  2940. #ifndef OSX
  2941. ConVar gl_telemetry_gpu_pipeline_flushing( "gl_telemetry_gpu_pipeline_flushing", "0" );
  2942. class CGPUTimestampManager
  2943. {
  2944. CGPUTimestampManager( const CGPUTimestampManager & );
  2945. CGPUTimestampManager& operator= ( CGPUTimestampManager & );
  2946. public:
  2947. CGPUTimestampManager() :
  2948. m_bInitialized( false ),
  2949. m_nCurFrame( 0 ),
  2950. m_flGPUToCPUOffsetInS( 0 ),
  2951. m_flGPUToS( 0 ),
  2952. m_flRdtscToS( 0 ),
  2953. m_flSToRdtsc( 0 ),
  2954. m_nFreeQueryPoolSize( 0 ),
  2955. m_nOutstandingQueriesHead( 0 ),
  2956. m_nOutstandingQueriesTail( 0 ),
  2957. m_nNumOutstandingQueryZones( 0 ),
  2958. m_nQueryZoneStackSize( 0 ),
  2959. m_nNumFinishedZones( 0 ),
  2960. m_nTotalSpanWorkCount( 0 )
  2961. {
  2962. memset( m_FreeQueryPool, 0, sizeof( m_FreeQueryPool ) ) ;
  2963. memset( m_QueryZoneStack, 0, sizeof( m_QueryZoneStack ) );
  2964. memset( m_OutstandingQueryZones, 0, sizeof( m_OutstandingQueryZones ) );
  2965. memset( m_FinishedZones, 0, sizeof( m_FinishedZones ) );
  2966. }
  2967. ~CGPUTimestampManager()
  2968. {
  2969. Deinit();
  2970. }
  2971. inline bool IsInitialized() const { return m_bInitialized; }
  2972. inline uint GetCurFrame() const { return m_nCurFrame; }
  2973. void Init()
  2974. {
  2975. Deinit();
  2976. memset( m_FreeQueryPool, 0, sizeof( m_FreeQueryPool ) ) ;
  2977. memset( m_QueryZoneStack, 0, sizeof( m_QueryZoneStack ) );
  2978. memset( m_OutstandingQueryZones, 0, sizeof( m_OutstandingQueryZones ) );
  2979. memset( m_FinishedZones, 0, sizeof( m_FinishedZones ) );
  2980. InitRdtsc();
  2981. m_nCurFrame = 0;
  2982. gGL->glGenQueries( cFreeQueryPoolSize, m_FreeQueryPool );
  2983. m_nFreeQueryPoolSize = cFreeQueryPoolSize;
  2984. m_nOutstandingQueriesHead = 0;
  2985. m_nOutstandingQueriesTail = 0;
  2986. m_nNumOutstandingQueryZones = 0;
  2987. m_nQueryZoneStackSize = 0;
  2988. m_nNumFinishedZones = 0;
  2989. m_bInitialized = true;
  2990. m_nTotalSpanWorkCount = 0;
  2991. Calibrate();
  2992. }
  2993. void Calibrate()
  2994. {
  2995. if ( !m_bInitialized )
  2996. return;
  2997. PipelineFlush();
  2998. m_flGPUToS = 1.0 / 1000000000.0;
  2999. //0.99997541250006794;
  3000. //0.99997530000006662;
  3001. // Correction factor to prevent excessive drift, only calibrated on my system, we need a better way of computing/recording this.
  3002. double flGPURatio = 0.99997425000007034000;
  3003. const uint NT = 1;
  3004. for ( uint nTrial = 0; nTrial < NT; nTrial++ )
  3005. {
  3006. const uint R = 16;
  3007. double flClockOffsetsInS[R];
  3008. for ( uint q = 0; q < R; q++)
  3009. {
  3010. uint64 nBestTotalCPUTimestamp = (uint64)-1;
  3011. uint64 nBestCPUTimestamp = 0;
  3012. GLuint64 nBestGPUTimestamp = 0;
  3013. for ( uint i = 0; i < 10; i++)
  3014. {
  3015. const uint64 nStartCPUTimestamp = Plat_Rdtsc();
  3016. gGL->glQueryCounter( m_FreeQueryPool[0], GL_TIMESTAMP);
  3017. PipelineFlush();
  3018. const uint64 nEndCPUTimestamp = Plat_Rdtsc();
  3019. GLint nAvailable;
  3020. do
  3021. {
  3022. gGL->glGetQueryObjectiv( m_FreeQueryPool[0], GL_QUERY_RESULT_AVAILABLE, &nAvailable );
  3023. } while ( !nAvailable );
  3024. GLuint64 nGPUTimestamp;
  3025. gGL->glGetQueryObjectui64v( m_FreeQueryPool[0], GL_QUERY_RESULT, &nGPUTimestamp );
  3026. const uint64 nTotalCPUTimestamp = nEndCPUTimestamp - nStartCPUTimestamp;
  3027. if ( nTotalCPUTimestamp < nBestTotalCPUTimestamp )
  3028. {
  3029. nBestTotalCPUTimestamp = nTotalCPUTimestamp;
  3030. nBestCPUTimestamp = nStartCPUTimestamp;
  3031. nBestGPUTimestamp = nGPUTimestamp;
  3032. }
  3033. }
  3034. double flCPUTimestampTimeInSeconds = nBestCPUTimestamp * m_flRdtscToS;
  3035. double flGPUTimestampTimeInSeconds = nBestGPUTimestamp * m_flGPUToS * flGPURatio;
  3036. flClockOffsetsInS[q] = flCPUTimestampTimeInSeconds - flGPUTimestampTimeInSeconds;
  3037. ThreadSleep(100);
  3038. DbgPrintf("%f %f %1.20f\n", flCPUTimestampTimeInSeconds, flGPUTimestampTimeInSeconds, flClockOffsetsInS[q] );
  3039. }
  3040. m_flGPUToCPUOffsetInS = 0.0f;
  3041. for ( uint i = 0; i < R; i++ )
  3042. m_flGPUToCPUOffsetInS += flClockOffsetsInS[i];
  3043. m_flGPUToCPUOffsetInS /= R;
  3044. if ( NT > 1 )
  3045. {
  3046. DbgPrintf("------- Ratio: %2.20f\n", flGPURatio );
  3047. double flDelta = flClockOffsetsInS[0] - flClockOffsetsInS[R - 1];
  3048. DbgPrintf("------- %1.20f\n", flDelta );
  3049. #if 1
  3050. if ( flDelta < 0.0000005f )
  3051. {
  3052. flGPURatio += .000000125f;
  3053. }
  3054. else if ( flDelta > 0.0000005f )
  3055. {
  3056. flGPURatio -= .000000125f;
  3057. }
  3058. #else
  3059. if ( flDelta < 0.0000005f )
  3060. {
  3061. flGPURatio += .0000000125f;
  3062. }
  3063. else if ( flDelta > 0.0000005f )
  3064. {
  3065. flGPURatio -= .0000000125f;
  3066. }
  3067. #endif
  3068. }
  3069. }
  3070. m_flGPUToS *= flGPURatio;
  3071. #if 0
  3072. // dump drift over time to debugger output
  3073. double flLatency = 0;
  3074. for ( ; ; )
  3075. {
  3076. // test
  3077. const uint64 nStartCPUTime = Plat_Rdtsc();
  3078. gGL->glQueryCounter( m_FreeQueryPool[0], GL_TIMESTAMP);
  3079. PipelineFlush();
  3080. GLint nAvailable;
  3081. do
  3082. {
  3083. gGL->glGetQueryObjectiv( m_FreeQueryPool[0], GL_QUERY_RESULT_AVAILABLE, &nAvailable );
  3084. } while ( !nAvailable );
  3085. GLuint64 nGPUTime;
  3086. gGL->glGetQueryObjectui64v( m_FreeQueryPool[0], GL_QUERY_RESULT, &nGPUTime );
  3087. double flStartGPUTime = ( ( nGPUTime * m_flGPUToS ) + m_flGPUToCPUOffsetInS );
  3088. flLatency = flStartGPUTime - nStartCPUTime * m_flRdtscToS;
  3089. DbgPrintf("%f\n", flLatency );
  3090. }
  3091. #endif
  3092. }
  3093. void Deinit()
  3094. {
  3095. if ( !m_bInitialized )
  3096. return;
  3097. if ( m_nFreeQueryPoolSize )
  3098. {
  3099. gGL->glDeleteQueries( m_nFreeQueryPoolSize, m_FreeQueryPool );
  3100. }
  3101. m_nFreeQueryPoolSize = 0;
  3102. for ( uint i = 0; i < m_nNumOutstandingQueryZones; i++ )
  3103. {
  3104. QueryZone_t &query = m_OutstandingQueryZones[ ( m_nOutstandingQueriesHead + i ) % cMaxQueryZones ];
  3105. if ( query.m_nBeginQuery )
  3106. {
  3107. gGL->glDeleteQueries( 1, &query.m_nBeginQuery );
  3108. }
  3109. if ( query.m_nEndQuery )
  3110. {
  3111. gGL->glDeleteQueries( 1, &query.m_nEndQuery );
  3112. }
  3113. }
  3114. m_nOutstandingQueriesHead = 0;
  3115. m_nOutstandingQueriesTail = 0;
  3116. m_nNumOutstandingQueryZones = 0;
  3117. for ( uint i = 0; i < m_nQueryZoneStackSize; i++ )
  3118. {
  3119. QueryZone_t &query = m_QueryZoneStack[i];
  3120. if ( query.m_nBeginQuery )
  3121. {
  3122. gGL->glDeleteQueries( 1, &query.m_nBeginQuery );
  3123. }
  3124. if ( query.m_nEndQuery )
  3125. {
  3126. gGL->glDeleteQueries( 1, &query.m_nEndQuery );
  3127. }
  3128. }
  3129. m_nQueryZoneStackSize = 0;
  3130. m_flGPUToCPUOffsetInS = 0;
  3131. m_flGPUToS = 0;
  3132. m_flRdtscToS = 0;
  3133. m_flSToRdtsc = 0;
  3134. m_bInitialized = false;
  3135. }
  3136. // pName is assumed to be a telemetry dynamic string!
  3137. void BeginZone( const char *pName )
  3138. {
  3139. if ( !m_bInitialized )
  3140. return;
  3141. if ( m_nQueryZoneStackSize >= cMaxQueryZoneStackSize )
  3142. {
  3143. Panic( "Increase cMaxQueryZoneStackSize!" );
  3144. }
  3145. QueryZone_t &zone = m_QueryZoneStack[m_nQueryZoneStackSize];
  3146. zone.m_pName = pName;
  3147. zone.m_nBeginQuery = AllocQueryHandle();
  3148. zone.m_nEndQuery = 0;
  3149. zone.m_nStackLevel = m_nQueryZoneStackSize;
  3150. zone.m_nTotalGPUWorkCount = g_nTotalDrawsOrClears;
  3151. #if GL_TELEMETRY_GPU_ZONES
  3152. zone.m_nTotalGPUWorkCount += g_TelemetryGPUStats.GetTotal();
  3153. #endif
  3154. gGL->glQueryCounter( m_QueryZoneStack[m_nQueryZoneStackSize].m_nBeginQuery, GL_TIMESTAMP );
  3155. m_nQueryZoneStackSize++;
  3156. }
  3157. void EndZone()
  3158. {
  3159. if ( !m_bInitialized )
  3160. return;
  3161. if ( ( !m_nQueryZoneStackSize ) || ( m_nNumOutstandingQueryZones == cMaxQueryZones ) )
  3162. {
  3163. Panic( "Query zone error!" );
  3164. }
  3165. m_nQueryZoneStackSize--;
  3166. uint nCurGPUWorkCount = g_nTotalDrawsOrClears;
  3167. #if GL_TELEMETRY_GPU_ZONES
  3168. nCurGPUWorkCount += g_TelemetryGPUStats.GetTotal();
  3169. #endif
  3170. uint nTotalDraws = nCurGPUWorkCount - m_QueryZoneStack[m_nQueryZoneStackSize].m_nTotalGPUWorkCount;
  3171. m_QueryZoneStack[m_nQueryZoneStackSize].m_nEndQuery = AllocQueryHandle();
  3172. gGL->glQueryCounter( m_QueryZoneStack[m_nQueryZoneStackSize].m_nEndQuery, GL_TIMESTAMP );
  3173. m_QueryZoneStack[m_nQueryZoneStackSize].m_nTotalGPUWorkCount = nTotalDraws;
  3174. m_OutstandingQueryZones[m_nOutstandingQueriesHead] = m_QueryZoneStack[m_nQueryZoneStackSize];
  3175. m_nOutstandingQueriesHead = ( m_nOutstandingQueriesHead + 1 ) % cMaxQueryZones;
  3176. m_nNumOutstandingQueryZones++;
  3177. COMPILE_TIME_ASSERT( ( int )cMaxQueryZones > ( int )cMaxQueryZoneStackSize );
  3178. if ( m_nNumOutstandingQueryZones >= ( cMaxQueryZones - cMaxQueryZoneStackSize ) )
  3179. {
  3180. TM_MESSAGE( TELEMETRY_LEVEL2, TMMF_ICON_NOTE | TMMF_SEVERITY_WARNING, "CGPUTimestampManager::EndZone: Too many outstanding query zones - forcing a pipeline flush! This is probably expensive." );
  3181. FlushOutstandingQueries( true );
  3182. }
  3183. if ( gl_telemetry_gpu_pipeline_flushing.GetBool() )
  3184. {
  3185. PipelineFlush();
  3186. }
  3187. }
  3188. void Tick()
  3189. {
  3190. m_nCurFrame++;
  3191. if ( !m_bInitialized )
  3192. return;
  3193. if ( m_nQueryZoneStackSize > 0 )
  3194. {
  3195. Panic( "Zone stack is not empty!" );
  3196. }
  3197. FlushOutstandingQueries( false );
  3198. TM_MESSAGE( TELEMETRY_LEVEL2, 0, "Total PIX timespan GPU work count: %u", m_nTotalSpanWorkCount );
  3199. m_nTotalSpanWorkCount = 0;
  3200. }
  3201. void FlushOutstandingQueries( bool bForce )
  3202. {
  3203. TM_ZONE( TELEMETRY_LEVEL2, 0, "FlushOutstandingQueries: %u", m_nNumOutstandingQueryZones );
  3204. if ( bForce )
  3205. {
  3206. PipelineFlush();
  3207. }
  3208. while ( m_nNumOutstandingQueryZones )
  3209. {
  3210. QueryZone_t &zone = m_OutstandingQueryZones[m_nOutstandingQueriesTail];
  3211. GLint nEndAvailable = 0;
  3212. do
  3213. {
  3214. gGL->glGetQueryObjectiv( zone.m_nEndQuery, GL_QUERY_RESULT_AVAILABLE, &nEndAvailable );
  3215. } while ( ( bForce ) && ( nEndAvailable == 0 ) );
  3216. if ( !nEndAvailable )
  3217. {
  3218. if ( bForce )
  3219. {
  3220. Panic( "Query results not available after a full pipeline flush!" );
  3221. }
  3222. break;
  3223. }
  3224. GLuint64 nBeginGPUTime, nEndGPUTime;
  3225. gGL->glGetQueryObjectui64v( zone.m_nBeginQuery, GL_QUERY_RESULT, &nBeginGPUTime );
  3226. gGL->glGetQueryObjectui64v( zone.m_nEndQuery, GL_QUERY_RESULT, &nEndGPUTime );
  3227. ReleaseQueryHandle( zone.m_nBeginQuery );
  3228. zone.m_nBeginQuery = 0;
  3229. ReleaseQueryHandle( zone.m_nEndQuery );
  3230. zone.m_nEndQuery = 0;
  3231. if ( m_nNumFinishedZones >= cMaxQueryZones )
  3232. {
  3233. Panic( "Too many finished zones!" );
  3234. }
  3235. FinishedQueryZone_t &finishedZone = m_FinishedZones[m_nNumFinishedZones];
  3236. finishedZone.m_pName = zone.m_pName;
  3237. finishedZone.m_nBeginGPUTime = nBeginGPUTime;
  3238. finishedZone.m_nEndGPUTime = nEndGPUTime;
  3239. finishedZone.m_nStackLevel = zone.m_nStackLevel;
  3240. finishedZone.m_nTotalGPUWorkCount = zone.m_nTotalGPUWorkCount;
  3241. m_nNumFinishedZones++;
  3242. if ( !zone.m_nStackLevel )
  3243. {
  3244. std::sort( m_FinishedZones, m_FinishedZones + m_nNumFinishedZones );
  3245. FlushFinishedZones();
  3246. m_nNumFinishedZones = 0;
  3247. }
  3248. m_nOutstandingQueriesTail = ( m_nOutstandingQueriesTail + 1 ) % cMaxQueryZones;
  3249. m_nNumOutstandingQueryZones--;
  3250. }
  3251. }
  3252. private:
  3253. bool m_bInitialized;
  3254. uint m_nCurFrame;
  3255. double m_flGPUToCPUOffsetInS;
  3256. double m_flGPUToS;
  3257. double m_flRdtscToS;
  3258. double m_flSToRdtsc;
  3259. enum { cMaxQueryZones = 4096, cFreeQueryPoolSize = cMaxQueryZones * 2 };
  3260. GLuint m_FreeQueryPool[cFreeQueryPoolSize ];
  3261. uint m_nFreeQueryPoolSize;
  3262. GLuint AllocQueryHandle()
  3263. {
  3264. if ( !m_nFreeQueryPoolSize )
  3265. {
  3266. Panic( "Out of query handles!");
  3267. }
  3268. return m_FreeQueryPool[--m_nFreeQueryPoolSize];
  3269. }
  3270. void ReleaseQueryHandle( GLuint nHandle )
  3271. {
  3272. if ( m_nFreeQueryPoolSize >= cFreeQueryPoolSize )
  3273. {
  3274. Panic( "Query handle error!" );
  3275. }
  3276. m_FreeQueryPool[m_nFreeQueryPoolSize++] = nHandle;
  3277. }
  3278. struct QueryZone_t
  3279. {
  3280. const char *m_pName;
  3281. GLuint m_nBeginQuery;
  3282. GLuint m_nEndQuery;
  3283. uint m_nStackLevel;
  3284. uint m_nTotalGPUWorkCount;
  3285. };
  3286. QueryZone_t m_OutstandingQueryZones[cMaxQueryZones];
  3287. uint m_nOutstandingQueriesHead; // index of first outstanding query (oldest)
  3288. uint m_nOutstandingQueriesTail; // index where next query goes (newest)
  3289. uint m_nNumOutstandingQueryZones;
  3290. enum { cMaxQueryZoneStackSize = 256 };
  3291. QueryZone_t m_QueryZoneStack[cMaxQueryZoneStackSize];
  3292. uint m_nQueryZoneStackSize;
  3293. struct FinishedQueryZone_t
  3294. {
  3295. const char *m_pName;
  3296. GLuint64 m_nBeginGPUTime;
  3297. GLuint64 m_nEndGPUTime;
  3298. uint m_nStackLevel;
  3299. uint m_nTotalGPUWorkCount;
  3300. inline bool operator< ( const FinishedQueryZone_t &rhs ) const
  3301. {
  3302. if ( m_nBeginGPUTime == rhs.m_nBeginGPUTime)
  3303. return m_nStackLevel < rhs.m_nStackLevel;
  3304. return m_nBeginGPUTime < rhs.m_nBeginGPUTime;
  3305. }
  3306. };
  3307. FinishedQueryZone_t m_FinishedZones[cMaxQueryZones];
  3308. uint m_nNumFinishedZones;
  3309. uint m_nTotalSpanWorkCount;
  3310. void InitRdtsc()
  3311. {
  3312. m_flRdtscToS = 0.0f;
  3313. m_flSToRdtsc = 0.0f;
  3314. for ( uint i = 0; i < 10; i++ )
  3315. {
  3316. TmU64 t0 = Plat_Rdtsc();
  3317. double d0 = Plat_FloatTime();
  3318. ThreadSleep( 250 );
  3319. TmU64 t1 = Plat_Rdtsc();
  3320. double d1 = Plat_FloatTime();
  3321. double flRdtscToS = ( d1 - d0 ) / ( t1 - t0 );
  3322. double flSToRdtsc = ( t1 - t0 ) / ( d1 - d0 );
  3323. if ( flSToRdtsc > m_flSToRdtsc )
  3324. {
  3325. m_flRdtscToS = flRdtscToS;
  3326. m_flSToRdtsc = flSToRdtsc;
  3327. }
  3328. }
  3329. }
  3330. void PipelineFlush()
  3331. {
  3332. #ifdef HAVE_GL_ARB_SYNC
  3333. GLsync nSyncObj = gGL->glFenceSync( GL_SYNC_GPU_COMMANDS_COMPLETE, 0 );
  3334. if ( nSyncObj )
  3335. {
  3336. gGL->glClientWaitSync( nSyncObj, GL_SYNC_FLUSH_COMMANDS_BIT, 300000000000ULL );
  3337. gGL->glDeleteSync( nSyncObj );
  3338. }
  3339. #endif
  3340. }
  3341. inline void NewTimeSpan( uint64 nStartGPUTime, uint64 nEndGPUTime, const char *pName, uint nTotalDraws )
  3342. {
  3343. // LINUXTODO- telemetry define off, so need this ifdef here to build
  3344. #if defined( RAD_TELEMETRY_ENABLED )
  3345. // apparently we must use level0 for timespans?
  3346. tmBeginTimeSpanAt( TELEMETRY_LEVEL0, 1, 0, nStartGPUTime, "%s [C:%u]", pName ? pName : "", nTotalDraws );
  3347. tmEndTimeSpanAt( TELEMETRY_LEVEL0, 1, 0, nEndGPUTime, "%s [C:%u]", pName ? pName : "", nTotalDraws );
  3348. #endif
  3349. }
  3350. void FlushFinishedZones()
  3351. {
  3352. for ( uint i = 0; i < m_nNumFinishedZones; i++ )
  3353. {
  3354. FinishedQueryZone_t &zone = m_FinishedZones[i];
  3355. if ( !zone.m_nTotalGPUWorkCount )
  3356. continue;
  3357. bool bEmit = false;
  3358. if ( i == ( m_nNumFinishedZones - 1 ) )
  3359. bEmit = true;
  3360. else
  3361. {
  3362. FinishedQueryZone_t &nextZone = m_FinishedZones[i + 1];
  3363. bEmit = zone.m_nEndGPUTime <= nextZone.m_nBeginGPUTime;
  3364. }
  3365. if ( bEmit )
  3366. {
  3367. uint64 nStartGPUTime = ( ( zone.m_nBeginGPUTime * m_flGPUToS ) + m_flGPUToCPUOffsetInS ) * m_flSToRdtsc;
  3368. uint64 nEndGPUTime = ( ( zone.m_nEndGPUTime * m_flGPUToS ) + m_flGPUToCPUOffsetInS ) * m_flSToRdtsc;
  3369. NewTimeSpan( nStartGPUTime, nEndGPUTime, zone.m_pName, zone.m_nTotalGPUWorkCount );
  3370. m_nTotalSpanWorkCount += zone.m_nTotalGPUWorkCount;
  3371. }
  3372. }
  3373. }
  3374. void Panic( const char *pMsg )
  3375. {
  3376. DXABSTRACT_BREAK_ON_ERROR();
  3377. Error( "%s", pMsg );
  3378. }
  3379. static void DbgPrintf( const char *pFmt, ... )
  3380. {
  3381. va_list vargs;
  3382. va_start( vargs, pFmt );
  3383. char buf[1024];
  3384. V_vsnprintf( buf, sizeof( buf ), pFmt, vargs );
  3385. #ifdef WIN32
  3386. OutputDebugStringA( buf );
  3387. #else
  3388. printf( "%s", buf );
  3389. #endif
  3390. va_end( vargs );
  3391. }
  3392. };
  3393. static CGPUTimestampManager g_GPUTimestampManager;
  3394. void GLMGPUTimestampManagerInit()
  3395. {
  3396. g_GPUTimestampManager.Init();
  3397. }
  3398. void GLMGPUTimestampManagerDeinit()
  3399. {
  3400. g_GPUTimestampManager.Deinit();
  3401. }
  3402. ConVar gl_telemetry_gpu( "gl_telemetry_gpu", "0" );
  3403. static bool g_bPrevTelemetryGPU;
  3404. void GLMGPUTimestampManagerTick()
  3405. {
  3406. if ( g_bPrevTelemetryGPU != gl_telemetry_gpu.GetBool() )
  3407. {
  3408. if ( !gl_telemetry_gpu.GetBool() )
  3409. g_GPUTimestampManager.Deinit();
  3410. else
  3411. {
  3412. #if !PIX_ENABLE || !GL_TELEMETRY_GPU_ZONES
  3413. ConMsg( "Must define PIX_ENABLE and GL_TELEMETRY_GPU_ZONES to use this feature" );
  3414. #else
  3415. g_GPUTimestampManager.Init();
  3416. #endif
  3417. }
  3418. g_bPrevTelemetryGPU = gl_telemetry_gpu.GetBool();
  3419. }
  3420. g_GPUTimestampManager.Tick();
  3421. }
  3422. #endif // OSX
  3423. static uint g_nPIXEventIndex;
  3424. void GLMBeginPIXEvent( const char *str )
  3425. {
  3426. #ifndef OSX
  3427. char szName[1024];
  3428. V_snprintf( szName, sizeof( szName ), "[ID:%u FR:%u] %s", g_nPIXEventIndex, g_GPUTimestampManager.GetCurFrame(), str );
  3429. const char *p = tmDynamicString( TELEMETRY_LEVEL2, szName ); //p can be null if tm is getting shut down
  3430. TM_ENTER( TELEMETRY_LEVEL2, TMZF_NONE, "PIX %s", p ? p : "" );
  3431. g_nPIXEventIndex++;
  3432. g_GPUTimestampManager.BeginZone( p );
  3433. #endif
  3434. V_strncpy( sg_pPIXName, str, 128 );
  3435. if ( gGL->m_bHave_GL_GREMEDY_string_marker )
  3436. {
  3437. gGL->glStringMarkerGREMEDY( 0, sg_pPIXName );
  3438. }
  3439. }
  3440. void GLMEndPIXEvent( void )
  3441. {
  3442. #ifndef OSX
  3443. g_GPUTimestampManager.EndZone();
  3444. if ( gGL->m_bHave_GL_GREMEDY_string_marker )
  3445. {
  3446. gGL->glStringMarkerGREMEDY( 0, sg_pPIXName );
  3447. }
  3448. sg_pPIXName[0] = '\0';
  3449. TM_LEAVE( TELEMETRY_LEVEL2 );
  3450. #endif
  3451. }
  3452. //===============================================================================
  3453. // Knob - hash table mapping string names to float values
  3454. struct GLMKnobKey
  3455. {
  3456. char *m_knobName;
  3457. };
  3458. struct GLMKnobValue
  3459. {
  3460. float m_value;
  3461. };
  3462. bool LessFunc_GLMKnobKey( const GLMKnobKey &a, const GLMKnobKey &b )
  3463. {
  3464. // Umm, what should this really be?
  3465. //return strcmp( a.m_knobName, b.m_knobName );
  3466. return strcmp( a.m_knobName, b.m_knobName ) < 0;
  3467. }
  3468. CUtlMap< GLMKnobKey, GLMKnobValue* > *g_knobMap = NULL;
  3469. // add some special knob-names that just read mod keys
  3470. extern "C" uint GetCurrentKeyModifiers( void );
  3471. enum ECarbonModKeyIndex
  3472. {
  3473. EcmdKeyBit = 8, /* command key down?*/
  3474. EshiftKeyBit = 9, /* shift key down?*/
  3475. EalphaLockBit = 10, /* alpha lock down?*/
  3476. EoptionKeyBit = 11, /* option key down?*/
  3477. EcontrolKeyBit = 12 /* control key down?*/
  3478. };
  3479. enum ECarbonModKeyMask
  3480. {
  3481. EcmdKey = 1 << EcmdKeyBit,
  3482. EshiftKey = 1 << EshiftKeyBit,
  3483. EalphaLock = 1 << EalphaLockBit,
  3484. EoptionKey = 1 << EoptionKeyBit,
  3485. EcontrolKey = 1 << EcontrolKeyBit
  3486. };
  3487. float GLMKnob( char *knobname, float *setvalue )
  3488. {
  3489. #if GLMDEBUG
  3490. float result = 0.0f;
  3491. if (!g_knobMap)
  3492. {
  3493. g_knobMap = new CUtlMap< GLMKnobKey, GLMKnobValue* >;
  3494. g_knobMap->SetLessFunc( LessFunc_GLMKnobKey );
  3495. }
  3496. #ifdef OSX
  3497. uint mods = GetCurrentKeyModifiers();
  3498. #else
  3499. uint mods = 0;
  3500. #endif
  3501. // is it a special key name ?
  3502. if (!strcmp(knobname,"caps-key"))
  3503. {
  3504. return (mods & (EalphaLock)) ? 1.0 : 0.0;
  3505. }
  3506. else if (!strcmp(knobname,"control-key"))
  3507. {
  3508. return (mods & (EcontrolKey)) ? 1.0 : 0.0;
  3509. }
  3510. else if (!strcmp(knobname,"shift-key"))
  3511. {
  3512. return (mods & (EshiftKey)) ? 1.0 : 0.0;
  3513. }
  3514. else if (!strcmp(knobname,"option-key"))
  3515. {
  3516. return (mods & (EoptionKey)) ? 1.0 : 0.0;
  3517. }
  3518. else
  3519. {
  3520. // does the key exist in the map ?
  3521. GLMKnobKey key;
  3522. key.m_knobName = knobname;
  3523. GLMKnobValue *knob = NULL;
  3524. unsigned short index = g_knobMap->Find( key );
  3525. if (index != g_knobMap->InvalidIndex())
  3526. {
  3527. // found it
  3528. knob = (*g_knobMap)[ index ];
  3529. if (setvalue)
  3530. {
  3531. knob->m_value = *setvalue;
  3532. }
  3533. result = knob->m_value;
  3534. }
  3535. else
  3536. {
  3537. // need to make a new one
  3538. knob = new GLMKnobValue;
  3539. knob->m_value = (setvalue) ? *setvalue : 0.0f;
  3540. g_knobMap->Insert( key, knob );
  3541. }
  3542. return knob->m_value;
  3543. }
  3544. #else
  3545. // GLM knobs just return 0.0 all the time when no GLMDEBUG
  3546. return 0.0f;
  3547. #endif
  3548. }
  3549. // for boolean knobs..
  3550. float GLMKnobToggle( char *knobname )
  3551. {
  3552. // if not 0.0, make it 0.0
  3553. // if 0.0, make it 1.0
  3554. float newValue = 0.0; // assume falling edge
  3555. float curValue = GLMKnob( knobname, NULL );
  3556. if (curValue == 0.0)
  3557. {
  3558. newValue = 1.0;
  3559. }
  3560. return GLMKnob( knobname, &newValue );
  3561. }
  3562. //===============================================================================
  3563. // helpers for CGLSetOption - no op if no profiler
  3564. void GLMProfilerClearTrace( void )
  3565. {
  3566. }
  3567. void GLMProfilerEnableTrace( bool enable )
  3568. {
  3569. }
  3570. // helpers for CGLSetParameter - no op if no profiler
  3571. void GLMProfilerDumpState( void )
  3572. {
  3573. }
  3574. //===============================================================================
  3575. CGLMFileMirror::CGLMFileMirror( char *fullpath )
  3576. {
  3577. m_path = strdup( fullpath );
  3578. m_data = (char *)malloc(1);
  3579. m_size = 0;
  3580. UpdateStatInfo();
  3581. if (m_exists)
  3582. {
  3583. ReadFile();
  3584. }
  3585. }
  3586. CGLMFileMirror::~CGLMFileMirror( )
  3587. {
  3588. if (m_path)
  3589. {
  3590. free (m_path);
  3591. m_path = NULL;
  3592. }
  3593. if (m_data)
  3594. {
  3595. free (m_data);
  3596. m_data = NULL;
  3597. }
  3598. }
  3599. bool CGLMFileMirror::HasData( void )
  3600. {
  3601. return (m_size != 0);
  3602. }
  3603. // return direct pointer to buffer. Will be invalidated if file is re-loaded or if data is written to
  3604. void CGLMFileMirror::GetData( char **dataPtr, uint *dataSizePtr )
  3605. {
  3606. *dataPtr = m_data;
  3607. *dataSizePtr = m_size;
  3608. }
  3609. void CGLMFileMirror::SetData( char *data, uint dataSize )
  3610. {
  3611. if (m_data)
  3612. {
  3613. free( m_data );
  3614. m_data = NULL;
  3615. }
  3616. m_size = dataSize;
  3617. m_data = (char *)malloc( m_size +1 );
  3618. m_data[ m_size ] = 0; // extra NULL terminator, no charge
  3619. memcpy( m_data, data, m_size ); // copy data in
  3620. WriteFile(); // keep disk copy sync'd
  3621. }
  3622. static bool stat_diff( struct stat *a, struct stat *b )
  3623. {
  3624. if (a->st_size != b->st_size)
  3625. {
  3626. return true;
  3627. }
  3628. #ifdef OSX
  3629. if (memcmp( &a->st_mtimespec, &b->st_mtimespec, sizeof( struct timespec ) ) )
  3630. #else
  3631. if (memcmp( &a->st_mtime, &b->st_mtime, sizeof( time_t ) ) )
  3632. #endif
  3633. {
  3634. return true;
  3635. }
  3636. return false;
  3637. }
  3638. bool CGLMFileMirror::PollForChanges( void )
  3639. {
  3640. // snapshot old stat
  3641. //bool old_exists = m_exists;
  3642. struct stat old_stat = m_stat;
  3643. UpdateStatInfo();
  3644. if (m_exists)
  3645. {
  3646. if ( stat_diff( &old_stat, &m_stat ) )
  3647. {
  3648. // initial difference detected. continue to poll at 0.1s intervals until it stops changing, then read it.
  3649. int stablecount = 0;
  3650. do
  3651. {
  3652. ThreadSleep(100000);
  3653. struct stat last_stat = m_stat;
  3654. UpdateStatInfo();
  3655. if (stat_diff( &last_stat, &m_stat ))
  3656. {
  3657. stablecount = 0;
  3658. }
  3659. else
  3660. {
  3661. stablecount++;
  3662. }
  3663. } while(stablecount<3);
  3664. // changes have settled down, now re-read it
  3665. ReadFile();
  3666. return true;
  3667. }
  3668. else
  3669. {
  3670. return false; // no change
  3671. }
  3672. }
  3673. else
  3674. {
  3675. // file does not exist. remake it. not considered to be a change.
  3676. WriteFile();
  3677. return false;
  3678. }
  3679. }
  3680. void CGLMFileMirror::UpdateStatInfo( void )
  3681. {
  3682. // stat the path
  3683. struct stat newstat;
  3684. memset (&newstat, 0, sizeof(newstat) );
  3685. int result = stat( m_path, &newstat );
  3686. if (!result)
  3687. {
  3688. m_exists = true;
  3689. m_stat = newstat;
  3690. }
  3691. else
  3692. {
  3693. m_exists = false;
  3694. memset( &m_stat, 0, sizeof( m_stat ) );
  3695. }
  3696. }
  3697. void CGLMFileMirror::ReadFile( void )
  3698. {
  3699. // unconditional - we discard any old buffer, make a new one,
  3700. UpdateStatInfo();
  3701. if (m_data)
  3702. {
  3703. free( m_data );
  3704. m_data = NULL;
  3705. }
  3706. if (m_exists)
  3707. {
  3708. FILE *infile = fopen( m_path, "rb" );
  3709. if (infile)
  3710. {
  3711. // get size from stat
  3712. m_size = m_stat.st_size;
  3713. m_data = (char *)malloc( m_size +1 );
  3714. m_data[ m_size ] = 0; // extra NULL terminator, no charge
  3715. fread( m_data, 1, m_size, infile );
  3716. fclose( infile );
  3717. }
  3718. else
  3719. {
  3720. GLMDebugger(); // ouch
  3721. }
  3722. }
  3723. else
  3724. {
  3725. // hmmmmmm
  3726. m_data = (char *)malloc(1);
  3727. m_data[0] = 0;
  3728. m_size = 0;
  3729. }
  3730. }
  3731. void CGLMFileMirror::WriteFile( void )
  3732. {
  3733. FILE *outfile = fopen( m_path, "wb" );
  3734. if (outfile)
  3735. {
  3736. fwrite( m_data, 1, m_size, outfile );
  3737. fclose( outfile );
  3738. UpdateStatInfo(); // sets m_stat and m_exists
  3739. }
  3740. else
  3741. {
  3742. GLMDebugger(); // ouch
  3743. }
  3744. }
  3745. void CGLMFileMirror::OpenInEditor( bool foreground )
  3746. {
  3747. char temp[64000];
  3748. // pass -b if no desire to bring editor to foreground
  3749. sprintf(temp,"/usr/bin/bbedit %s %s", foreground ? "" : "-b", m_path );
  3750. system( temp );
  3751. }
  3752. CGLMEditableTextItem::CGLMEditableTextItem( char *text, uint size, bool forceOverwrite, char *prefix, char *suffix )
  3753. {
  3754. // clone input text (exact size copy)
  3755. m_origSize = size;
  3756. m_origText = (char *)malloc( m_origSize );
  3757. memcpy( m_origText, text, m_origSize );
  3758. // null out munged form til we generate it
  3759. m_mungedSize = 0;
  3760. m_mungedText = NULL;
  3761. // null out mirror until we create it
  3762. m_mirrorBaseName = NULL;
  3763. m_mirrorFullPath = NULL;
  3764. m_mirror = NULL;
  3765. GenHashOfOrigText(); // will fill out m_origDigest
  3766. GenMungedText( false );
  3767. GenBaseNameAndFullPath( prefix, suffix ); // figure out where the mirror will go
  3768. if (!strcmp(m_mirrorBaseName, "96c7e9d2faf76b1148f7274afd684d4b.fsh"))
  3769. {
  3770. printf("\nhello there\n");
  3771. }
  3772. // make the mirror from the filename.
  3773. // see if there was any content on disk
  3774. // if so, honor that content *unless* the force-option is set.
  3775. m_mirror = new CGLMFileMirror( m_mirrorFullPath );
  3776. // the logic is simple.
  3777. // the only time we will choose the copy on disk, is if
  3778. // a - forceOverwrite is false
  3779. // AND b - the copy on disk is bigger than 10 bytes.
  3780. bool replaceDiskCopy = true;
  3781. char *mirrorData = NULL;
  3782. uint mirrorSize = 0;
  3783. if (!forceOverwrite)
  3784. {
  3785. if (m_mirror->HasData())
  3786. {
  3787. // peek at it, and use it if it is more than some minimum number of bytes.
  3788. m_mirror->GetData( &mirrorData, &mirrorSize );
  3789. if (mirrorSize > 10)
  3790. {
  3791. replaceDiskCopy = false;
  3792. }
  3793. }
  3794. }
  3795. if (replaceDiskCopy)
  3796. {
  3797. // push our generated data to the mirror - disk copy is overwritten
  3798. m_mirror->SetData( m_mungedText, m_mungedSize );
  3799. }
  3800. else
  3801. {
  3802. GenMungedText( true );
  3803. }
  3804. }
  3805. CGLMEditableTextItem::~CGLMEditableTextItem( )
  3806. {
  3807. if (m_origText)
  3808. {
  3809. free (m_origText);
  3810. }
  3811. if (m_mungedText)
  3812. {
  3813. free (m_mungedText);
  3814. }
  3815. if (m_mirrorBaseName)
  3816. {
  3817. free (m_mirrorBaseName);
  3818. }
  3819. if (m_mirrorFullPath)
  3820. {
  3821. free (m_mirrorFullPath);
  3822. }
  3823. if (m_mirror)
  3824. {
  3825. free( m_mirror );
  3826. }
  3827. }
  3828. bool CGLMEditableTextItem::HasData( void )
  3829. {
  3830. return m_mirror->HasData();
  3831. }
  3832. bool CGLMEditableTextItem::PollForChanges( void )
  3833. {
  3834. bool changed = m_mirror->PollForChanges();
  3835. if (changed)
  3836. {
  3837. // re-gen munged text from mirror (means "copy")
  3838. GenMungedText( true );
  3839. }
  3840. return changed;
  3841. }
  3842. void CGLMEditableTextItem::GetCurrentText( char **textOut, uint *sizeOut )
  3843. {
  3844. if (!m_mungedText) GLMDebugger();
  3845. *textOut = m_mungedText;
  3846. *sizeOut = m_mungedSize;
  3847. }
  3848. void CGLMEditableTextItem::OpenInEditor( bool foreground )
  3849. {
  3850. m_mirror->OpenInEditor( foreground );
  3851. }
  3852. void CGLMEditableTextItem::GenHashOfOrigText( void )
  3853. {
  3854. MD5Context_t md5ctx;
  3855. MD5Init( &md5ctx );
  3856. MD5Update( &md5ctx, (unsigned char*)m_origText, m_origSize );
  3857. MD5Final( m_origDigest, &md5ctx );
  3858. }
  3859. void CGLMEditableTextItem::GenBaseNameAndFullPath( char *prefix, char *suffix )
  3860. {
  3861. // base name is hash digest in hex, plus the suffix.
  3862. char temp[5000];
  3863. Q_binarytohex( m_origDigest, sizeof(m_origDigest), temp, sizeof( temp ) );
  3864. if (suffix)
  3865. {
  3866. strcat( temp, suffix );
  3867. }
  3868. if (m_mirrorBaseName) free(m_mirrorBaseName);
  3869. m_mirrorBaseName = strdup( temp );
  3870. sprintf( temp, "%s%s", prefix, m_mirrorBaseName );
  3871. if (m_mirrorFullPath) free(m_mirrorFullPath);
  3872. m_mirrorFullPath = strdup( temp );
  3873. }
  3874. void CGLMEditableTextItem::GenMungedText( bool fromMirror )
  3875. {
  3876. if (fromMirror)
  3877. {
  3878. // just import the text as is from the mirror file.
  3879. char *mirrorData = NULL;
  3880. uint mirrorSize = 0;
  3881. if (m_mirror->HasData())
  3882. {
  3883. // peek at it, and use it if it is more than some minimum number of bytes.
  3884. m_mirror->GetData( &mirrorData, &mirrorSize );
  3885. if (m_mungedText)
  3886. {
  3887. free( m_mungedText );
  3888. m_mungedText = NULL;
  3889. }
  3890. m_mungedText = (char *)malloc( mirrorSize+1 );
  3891. m_mungedText[ mirrorSize ] = 0;
  3892. memcpy( m_mungedText, mirrorData, mirrorSize );
  3893. m_mungedSize = mirrorSize;
  3894. }
  3895. else
  3896. {
  3897. GLMDebugger();
  3898. }
  3899. }
  3900. else
  3901. {
  3902. #if 1
  3903. // we don't actually clone/munge any more.
  3904. if (m_mungedText)
  3905. {
  3906. free( m_mungedText );
  3907. m_mungedText = NULL;
  3908. }
  3909. m_mungedText = (char *)malloc( m_origSize+1 );
  3910. m_mungedText[ m_origSize ] = 0;
  3911. memcpy( m_mungedText, m_origText, m_origSize );
  3912. m_mungedSize = m_origSize;
  3913. #else
  3914. // take pure 'orig' text that came in from the engine, and clone it
  3915. // do not clone the first line
  3916. char temp[100000];
  3917. char *dst = temp;
  3918. char *lim = &temp[ sizeof(temp) ];
  3919. // zero temp
  3920. memset( temp, 0, sizeof(temp) );
  3921. // write orig text to temp
  3922. if (m_origSize >= (sizeof(temp)/2) )
  3923. {
  3924. GLMDebugger();
  3925. }
  3926. memcpy( dst, m_origText, m_origSize );
  3927. dst += m_origSize;
  3928. // add a newline if the last character wasn't
  3929. if ( (*(dst-1)) != '\n' )
  3930. {
  3931. *dst++ = '\n';
  3932. }
  3933. // walk orig text again and copy it over, with these caveats
  3934. // don't copy the first line
  3935. // insert a # before all the other lines.
  3936. char *src = temp;
  3937. // walk to end of first line
  3938. char *firstNewline = strchr( src, '\n' );
  3939. if (!firstNewline)
  3940. {
  3941. GLMDebugger();
  3942. }
  3943. else
  3944. {
  3945. // advance 'src' to that newline- we're not copying the !! line
  3946. src = firstNewline;
  3947. }
  3948. // now walk the rest - insert a # after each newline
  3949. while( (dst < lim) && ((src-temp) < m_origSize) )
  3950. {
  3951. switch( *src )
  3952. {
  3953. case '\n':
  3954. *dst++ = *src++;
  3955. *dst++ = '#';
  3956. break;
  3957. default:
  3958. *dst++ = *src++;
  3959. }
  3960. }
  3961. if (dst >= lim)
  3962. {
  3963. GLMDebugger();
  3964. }
  3965. // final newline
  3966. *dst++ = '\n';
  3967. // copyout
  3968. if (m_mungedText)
  3969. {
  3970. free( m_mungedText );
  3971. m_mungedText = NULL;
  3972. }
  3973. m_mungedSize = dst - temp;
  3974. m_mungedText = (char *)malloc( m_mungedSize );
  3975. memcpy( m_mungedText, temp, m_mungedSize );
  3976. #endif
  3977. }
  3978. }
  3979. //===============================================================================
  3980. // class for cracking multi-part text blobs
  3981. // sections are demarcated by beginning-of-line markers submitted in a table by the caller
  3982. // typically
  3983. // asm flavors have first-line rules so we use those tags as is
  3984. // !!ARBvp (etc)
  3985. // !!ARBfp (etc)
  3986. // //!!GLSLF // slashes required
  3987. // //!GLSLV
  3988. // maybe also introduce "present but disabled" markers like these
  3989. // -!!ARBvp (etc)
  3990. // -!!ARBfp (etc)
  3991. // -//!!GLSLF
  3992. // -//!GLSLV
  3993. // resolved. there is no default section for text that doesn't have a marker in front of it. mark it or miss it.
  3994. CGLMTextSectioner::CGLMTextSectioner( char *text, int textLength, const char **markers )
  3995. {
  3996. // find lines
  3997. // for each line, see if it starts with a marker
  3998. // if so, open a new section based at that line
  3999. GLMTextSection *curSection = NULL; // no current section until we see a marker
  4000. char *cursor = text;
  4001. char *textLimit = text+textLength;
  4002. int foundMarker;
  4003. const char **markerCursor;
  4004. while( cursor < textLimit )
  4005. {
  4006. // top of loop. cursor points to start of a line.
  4007. // find the end of the line and keep that handy.
  4008. char *eol = strchr( cursor, '\n' );
  4009. int charsInLine = (eol) ? (eol-cursor)+1 : strlen(cursor);
  4010. //see if any of the marker strings is located here.
  4011. foundMarker = -1;
  4012. markerCursor = markers;
  4013. while( (foundMarker<0) && (*markerCursor!=NULL) )
  4014. {
  4015. // see if the n'th marker is a hit
  4016. int markerLen = strlen(*markerCursor);
  4017. if (!strncmp( cursor, *markerCursor, markerLen ) )
  4018. {
  4019. // hit
  4020. foundMarker = markerCursor - markers;
  4021. }
  4022. markerCursor++;
  4023. }
  4024. // outcome is either "marker spotted" or "no".
  4025. // if marker seen, open new section using that marker.
  4026. // else, grow active section if underway.
  4027. // then, move cursor to next line.
  4028. if (foundMarker >= 0)
  4029. {
  4030. // found marker. start new section.
  4031. // no need to do anything special with prior section - it was up to date before seeing this marker.
  4032. int index = m_sectionTable.AddToTail();
  4033. curSection = &m_sectionTable[ index ];
  4034. curSection->m_markerIndex = foundMarker;
  4035. curSection->m_textOffset = cursor - text; // text includes the marker
  4036. curSection->m_textLength = charsInLine; // this line goes in the tally, later lines add to it
  4037. }
  4038. else
  4039. {
  4040. // add this line to current section if live
  4041. if (curSection)
  4042. {
  4043. curSection->m_textLength += charsInLine;
  4044. }
  4045. }
  4046. cursor += charsInLine;
  4047. }
  4048. }
  4049. CGLMTextSectioner::~CGLMTextSectioner( )
  4050. {
  4051. // not much to do.
  4052. }
  4053. int CGLMTextSectioner::Count( void )
  4054. {
  4055. return m_sectionTable.Count();
  4056. }
  4057. void CGLMTextSectioner::GetSection( int index, uint *offsetOut, uint *lengthOut, int *markerIndexOut )
  4058. {
  4059. Assert( index < m_sectionTable.Count() );
  4060. GLMTextSection *section = &m_sectionTable[ index ];
  4061. *offsetOut = section->m_textOffset;
  4062. *lengthOut = section->m_textLength;
  4063. *markerIndexOut = section->m_markerIndex;
  4064. }
  4065. //===============================================================================
  4066. // how to make a compiled-in font:
  4067. // a. type in a matrix of characters in your fav editor
  4068. // b. take a screen shot of the characters (128x128 pixels in this case)
  4069. // c. export as TIFF raw.
  4070. // d. hex dump it
  4071. // e. column-copy just the hex data
  4072. // f. find and replace: chop out all the spaces and line feeds, change FFFFFF and 000000 to your marker chars of choice.
  4073. // g. wrap each line with quotes and a comma.
  4074. unsigned char g_glmDebugFontMap[ 128 * 128 ] =
  4075. {
  4076. " * "
  4077. " * * * * * "
  4078. " * * * * * *** * * ** * * * * * "
  4079. " * * * ***** * * * * * * * * * * * * * * * * "
  4080. " * * * * * * * * * * * * * *** * * "
  4081. " * ***** *** * * * * * * * ***** ***** * "
  4082. " * * * * * * * * * * * * * * * "
  4083. " * * * * * * * * * * * ** ** * "
  4084. " * *** * * ** * * * ** ** * "
  4085. " * * * * * "
  4086. " * "
  4087. " "
  4088. " "
  4089. " *** * *** *** * ***** *** ***** *** *** * * *** "
  4090. "* * ** * * * * ** * * * * * * * ** ** * * * * "
  4091. "* ** * * * * * **** **** * * * * * ** ** * ***** * * "
  4092. "* * * * * ** * * * * * * *** * * * * * "
  4093. "** * * * * ***** * * * * * * **** * ***** * * "
  4094. "* * * * * * * * * * * * * * * ** ** * * "
  4095. " *** * ***** *** * *** *** * *** *** ** ** * * * "
  4096. " * "
  4097. " * "
  4098. " "
  4099. " *** "
  4100. "* * *** **** *** **** ***** ***** *** * * * * * * * * * * * *** "
  4101. "* * * * * * * * * * * * * * * * * * * * * ** ** ** * * * "
  4102. "* * * * * * * * * * * * * * * * * * * * * * * * * * * * "
  4103. "*** * ***** **** * * * **** **** * ** ***** * * ** * * * * ** * * "
  4104. "* ** * * * * * * * * * * * * * * * * * * * * * * * * * "
  4105. "* * * * * * * * * * * * * * * * * * * * * * * * * * * "
  4106. "* * * * **** *** **** ***** * *** * * * *** * * ***** * * * * *** "
  4107. " *** "
  4108. " "
  4109. " * "
  4110. " ** * ** * "
  4111. "**** *** **** *** ***** * * * * * * * * * * ***** * * * * * "
  4112. "* * * * * * * * * * * * * * * * * * * * * * * * * "
  4113. "* * * * * * * * * * * * * * * * * * * * * "
  4114. "**** * * **** *** * * * * * * * * * * * * * * "
  4115. "* * * * * * * * * * * * * * * * * * * * "
  4116. "* * * * * * * * * * * ** ** * * * * * * * "
  4117. "* *** * * *** * *** * * * * * * ***** * * * ****** "
  4118. " * ** * ** "
  4119. " "
  4120. " "
  4121. " * "
  4122. " * * * ** * * * * * "
  4123. " * * * * * * * "
  4124. " **** **** *** **** *** *** **** **** * * * * * **** * ** *** "
  4125. " * * * * * * * * * * * * * * * * * * * * * * * ** * * * "
  4126. " * * * * * * * ***** * * * * * * * *** * * * * * * * * "
  4127. " * ** * * * * * * * * * * * * * * * * * * * * * * * "
  4128. " ** * **** **** **** **** * **** * * * * * * ** * * * * * *** "
  4129. " * * "
  4130. " *** ** "
  4131. " * "
  4132. " ** * ** "
  4133. " * * * * ** * "
  4134. " * * * * * ** *** "
  4135. "**** **** * ** **** **** * * * * * * * * * * * ***** * * * ***** "
  4136. "* * * * ** * * * * * * * * * * * * * * * ** * ** ***** "
  4137. "* * * * * *** * * * * * * * * * * * * * * * ***** "
  4138. "* * * * * * * * ** * * * * * * * * * * * * * *** "
  4139. "**** **** * **** ** ** * * * * * * **** ***** * * * "
  4140. "* * * ** * ** "
  4141. "* * *** * "
  4142. " "
  4143. " "
  4144. " "
  4145. " "
  4146. " "
  4147. " "
  4148. " "
  4149. " "
  4150. " "
  4151. " "
  4152. " "
  4153. " "
  4154. " "
  4155. " "
  4156. " "
  4157. " "
  4158. " "
  4159. " "
  4160. " "
  4161. " "
  4162. " "
  4163. " "
  4164. " "
  4165. " "
  4166. " "
  4167. " "
  4168. " "
  4169. " "
  4170. " "
  4171. " "
  4172. " "
  4173. " "
  4174. " "
  4175. " "
  4176. " "
  4177. " "
  4178. " "
  4179. " "
  4180. " "
  4181. " "
  4182. " "
  4183. " "
  4184. " "
  4185. " "
  4186. " "
  4187. " "
  4188. " "
  4189. " "
  4190. " "
  4191. " "
  4192. " "
  4193. " "
  4194. " "
  4195. " "
  4196. " "
  4197. " "
  4198. " "
  4199. " "
  4200. " "
  4201. " "
  4202. " "
  4203. };