GrGLInterfaceAutogen.cpp 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  1. /*
  2. * Copyright 2011 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. *
  7. * THIS FILE IS AUTOGENERATED
  8. * Make edits to tools/gpu/gl/interface/templates.go or they will
  9. * be overwritten.
  10. */
  11. #include "include/gpu/gl/GrGLExtensions.h"
  12. #include "include/gpu/gl/GrGLInterface.h"
  13. #include "src/gpu/gl/GrGLUtil.h"
  14. #include <stdio.h>
  15. GrGLInterface::GrGLInterface() {
  16. fStandard = kNone_GrGLStandard;
  17. }
  18. #define RETURN_FALSE_INTERFACE \
  19. SkDEBUGF("%s:%d GrGLInterface::validate() failed.\n", __FILE__, __LINE__); \
  20. return false
  21. bool GrGLInterface::validate() const {
  22. if (kNone_GrGLStandard == fStandard) {
  23. RETURN_FALSE_INTERFACE;
  24. }
  25. if (!fExtensions.isInitialized()) {
  26. RETURN_FALSE_INTERFACE;
  27. }
  28. GrGLVersion glVer = GrGLGetVersion(this);
  29. if (GR_GL_INVALID_VER == glVer) {
  30. RETURN_FALSE_INTERFACE;
  31. }
  32. // Autogenerated content follows
  33. if (!fFunctions.fActiveTexture ||
  34. !fFunctions.fAttachShader ||
  35. !fFunctions.fBindAttribLocation ||
  36. !fFunctions.fBindBuffer ||
  37. !fFunctions.fBindTexture ||
  38. !fFunctions.fBlendColor ||
  39. !fFunctions.fBlendEquation ||
  40. !fFunctions.fBlendFunc ||
  41. !fFunctions.fBufferData ||
  42. !fFunctions.fBufferSubData ||
  43. !fFunctions.fClear ||
  44. !fFunctions.fClearColor ||
  45. !fFunctions.fClearStencil ||
  46. !fFunctions.fColorMask ||
  47. !fFunctions.fCompileShader ||
  48. !fFunctions.fCompressedTexImage2D ||
  49. !fFunctions.fCompressedTexSubImage2D ||
  50. !fFunctions.fCopyTexSubImage2D ||
  51. !fFunctions.fCreateProgram ||
  52. !fFunctions.fCreateShader ||
  53. !fFunctions.fCullFace ||
  54. !fFunctions.fDeleteBuffers ||
  55. !fFunctions.fDeleteProgram ||
  56. !fFunctions.fDeleteShader ||
  57. !fFunctions.fDeleteTextures ||
  58. !fFunctions.fDepthMask ||
  59. !fFunctions.fDisable ||
  60. !fFunctions.fDisableVertexAttribArray ||
  61. !fFunctions.fDrawArrays ||
  62. !fFunctions.fDrawElements ||
  63. !fFunctions.fEnable ||
  64. !fFunctions.fEnableVertexAttribArray ||
  65. !fFunctions.fFinish ||
  66. !fFunctions.fFlush ||
  67. !fFunctions.fFrontFace ||
  68. !fFunctions.fGenBuffers ||
  69. !fFunctions.fGenTextures ||
  70. !fFunctions.fGetBufferParameteriv ||
  71. !fFunctions.fGetError ||
  72. !fFunctions.fGetIntegerv ||
  73. !fFunctions.fGetProgramInfoLog ||
  74. !fFunctions.fGetProgramiv ||
  75. !fFunctions.fGetShaderInfoLog ||
  76. !fFunctions.fGetShaderiv ||
  77. !fFunctions.fGetString ||
  78. !fFunctions.fGetUniformLocation ||
  79. !fFunctions.fIsTexture ||
  80. !fFunctions.fLineWidth ||
  81. !fFunctions.fLinkProgram ||
  82. !fFunctions.fPixelStorei ||
  83. !fFunctions.fReadPixels ||
  84. !fFunctions.fScissor ||
  85. !fFunctions.fShaderSource ||
  86. !fFunctions.fStencilFunc ||
  87. !fFunctions.fStencilFuncSeparate ||
  88. !fFunctions.fStencilMask ||
  89. !fFunctions.fStencilMaskSeparate ||
  90. !fFunctions.fStencilOp ||
  91. !fFunctions.fStencilOpSeparate ||
  92. !fFunctions.fTexImage2D ||
  93. !fFunctions.fTexParameterf ||
  94. !fFunctions.fTexParameterfv ||
  95. !fFunctions.fTexParameteri ||
  96. !fFunctions.fTexParameteriv ||
  97. !fFunctions.fTexSubImage2D ||
  98. !fFunctions.fUniform1f ||
  99. !fFunctions.fUniform1fv ||
  100. !fFunctions.fUniform1i ||
  101. !fFunctions.fUniform1iv ||
  102. !fFunctions.fUniform2f ||
  103. !fFunctions.fUniform2fv ||
  104. !fFunctions.fUniform2i ||
  105. !fFunctions.fUniform2iv ||
  106. !fFunctions.fUniform3f ||
  107. !fFunctions.fUniform3fv ||
  108. !fFunctions.fUniform3i ||
  109. !fFunctions.fUniform3iv ||
  110. !fFunctions.fUniform4f ||
  111. !fFunctions.fUniform4fv ||
  112. !fFunctions.fUniform4i ||
  113. !fFunctions.fUniform4iv ||
  114. !fFunctions.fUniformMatrix2fv ||
  115. !fFunctions.fUniformMatrix3fv ||
  116. !fFunctions.fUniformMatrix4fv ||
  117. !fFunctions.fUseProgram ||
  118. !fFunctions.fVertexAttrib1f ||
  119. !fFunctions.fVertexAttrib2fv ||
  120. !fFunctions.fVertexAttrib3fv ||
  121. !fFunctions.fVertexAttrib4fv ||
  122. !fFunctions.fVertexAttribPointer ||
  123. !fFunctions.fViewport) {
  124. RETURN_FALSE_INTERFACE;
  125. }
  126. if (GR_IS_GR_GL(fStandard)) {
  127. if (!fFunctions.fDrawBuffer ||
  128. !fFunctions.fPolygonMode) {
  129. RETURN_FALSE_INTERFACE;
  130. }
  131. }
  132. if ((GR_IS_GR_GL(fStandard) && (
  133. (glVer >= GR_GL_VER(3,0)))) ||
  134. (GR_IS_GR_GL_ES(fStandard) && (
  135. (glVer >= GR_GL_VER(3,0)))) ||
  136. (GR_IS_GR_WEBGL(fStandard) && (
  137. (glVer >= GR_GL_VER(2,0))))) {
  138. if (!fFunctions.fGetStringi) {
  139. RETURN_FALSE_INTERFACE;
  140. }
  141. }
  142. if (GR_IS_GR_GL(fStandard) ||
  143. (GR_IS_GR_GL_ES(fStandard) && (
  144. (glVer >= GR_GL_VER(3,0)) ||
  145. fExtensions.has("GL_OES_vertex_array_object"))) ||
  146. (GR_IS_GR_WEBGL(fStandard) && (
  147. (glVer >= GR_GL_VER(2,0)) ||
  148. fExtensions.has("GL_OES_vertex_array_object") ||
  149. fExtensions.has("OES_vertex_array_object")))) {
  150. if (!fFunctions.fBindVertexArray ||
  151. !fFunctions.fDeleteVertexArrays ||
  152. !fFunctions.fGenVertexArrays) {
  153. RETURN_FALSE_INTERFACE;
  154. }
  155. }
  156. if ((GR_IS_GR_GL(fStandard) && (
  157. (glVer >= GR_GL_VER(3,0)))) ||
  158. (GR_IS_GR_GL_ES(fStandard) && (
  159. (glVer >= GR_GL_VER(3,0) && fExtensions.has("GL_EXT_blend_func_extended"))))) {
  160. if (!fFunctions.fBindFragDataLocation) {
  161. RETURN_FALSE_INTERFACE;
  162. }
  163. }
  164. if ((GR_IS_GR_GL(fStandard) && (
  165. (glVer >= GR_GL_VER(3,3)) ||
  166. fExtensions.has("GL_ARB_blend_func_extended"))) ||
  167. (GR_IS_GR_GL_ES(fStandard) && (
  168. (glVer >= GR_GL_VER(3,0) && fExtensions.has("GL_EXT_blend_func_extended"))))) {
  169. if (!fFunctions.fBindFragDataLocationIndexed) {
  170. RETURN_FALSE_INTERFACE;
  171. }
  172. }
  173. if ((GR_IS_GR_GL(fStandard) && (
  174. fExtensions.has("GL_KHR_blend_equation_advanced") ||
  175. fExtensions.has("GL_NV_blend_equation_advanced"))) ||
  176. (GR_IS_GR_GL_ES(fStandard) && (
  177. fExtensions.has("GL_KHR_blend_equation_advanced") ||
  178. fExtensions.has("GL_NV_blend_equation_advanced")))) {
  179. if (!fFunctions.fBlendBarrier) {
  180. RETURN_FALSE_INTERFACE;
  181. }
  182. }
  183. if ((GR_IS_GR_GL(fStandard) && (
  184. (glVer >= GR_GL_VER(4,4)) ||
  185. fExtensions.has("GL_ARB_clear_texture"))) ||
  186. (GR_IS_GR_GL_ES(fStandard) && (
  187. fExtensions.has("GL_EXT_clear_texture")))) {
  188. // all functions were marked optional or test_only
  189. }
  190. if ((GR_IS_GR_GL(fStandard) && (
  191. (glVer >= GR_GL_VER(3,1)) ||
  192. fExtensions.has("GL_ARB_draw_instanced") ||
  193. fExtensions.has("GL_EXT_draw_instanced"))) ||
  194. (GR_IS_GR_GL_ES(fStandard) && (
  195. (glVer >= GR_GL_VER(3,0)) ||
  196. fExtensions.has("GL_EXT_draw_instanced"))) ||
  197. (GR_IS_GR_WEBGL(fStandard) && (
  198. (glVer >= GR_GL_VER(2,0))))) {
  199. if (!fFunctions.fDrawArraysInstanced ||
  200. !fFunctions.fDrawElementsInstanced) {
  201. RETURN_FALSE_INTERFACE;
  202. }
  203. }
  204. if (GR_IS_GR_GL(fStandard) ||
  205. (GR_IS_GR_GL_ES(fStandard) && (
  206. (glVer >= GR_GL_VER(3,0)))) ||
  207. (GR_IS_GR_WEBGL(fStandard) && (
  208. (glVer >= GR_GL_VER(2,0))))) {
  209. if (!fFunctions.fDrawBuffers ||
  210. !fFunctions.fReadBuffer) {
  211. RETURN_FALSE_INTERFACE;
  212. }
  213. }
  214. if ((GR_IS_GR_GL(fStandard) && (
  215. (glVer >= GR_GL_VER(4,0)) ||
  216. fExtensions.has("GL_ARB_draw_indirect"))) ||
  217. (GR_IS_GR_GL_ES(fStandard) && (
  218. (glVer >= GR_GL_VER(3,1))))) {
  219. if (!fFunctions.fDrawArraysIndirect ||
  220. !fFunctions.fDrawElementsIndirect) {
  221. RETURN_FALSE_INTERFACE;
  222. }
  223. }
  224. if (GR_IS_GR_GL(fStandard) ||
  225. (GR_IS_GR_GL_ES(fStandard) && (
  226. (glVer >= GR_GL_VER(3,0)))) ||
  227. (GR_IS_GR_WEBGL(fStandard) && (
  228. (glVer >= GR_GL_VER(2,0))))) {
  229. if (!fFunctions.fDrawRangeElements) {
  230. RETURN_FALSE_INTERFACE;
  231. }
  232. }
  233. if ((GR_IS_GR_GL(fStandard) && (
  234. (glVer >= GR_GL_VER(3,2)) ||
  235. fExtensions.has("GL_ARB_texture_multisample"))) ||
  236. (GR_IS_GR_GL_ES(fStandard) && (
  237. (glVer >= GR_GL_VER(3,1))))) {
  238. if (!fFunctions.fGetMultisamplefv) {
  239. RETURN_FALSE_INTERFACE;
  240. }
  241. }
  242. if (GR_IS_GR_GL(fStandard) ||
  243. (GR_IS_GR_GL_ES(fStandard) && (
  244. (glVer >= GR_GL_VER(3,1))))) {
  245. if (!fFunctions.fGetTexLevelParameteriv) {
  246. RETURN_FALSE_INTERFACE;
  247. }
  248. }
  249. if ((GR_IS_GR_GL(fStandard) && (
  250. (glVer >= GR_GL_VER(4,3)) ||
  251. fExtensions.has("GL_ARB_multi_draw_indirect"))) ||
  252. (GR_IS_GR_GL_ES(fStandard) && (
  253. fExtensions.has("GL_EXT_multi_draw_indirect")))) {
  254. if (!fFunctions.fMultiDrawArraysIndirect ||
  255. !fFunctions.fMultiDrawElementsIndirect) {
  256. RETURN_FALSE_INTERFACE;
  257. }
  258. }
  259. if ((GR_IS_GR_GL(fStandard) && (
  260. (glVer >= GR_GL_VER(3,1)))) ||
  261. (GR_IS_GR_GL_ES(fStandard) && (
  262. (glVer >= GR_GL_VER(3,2)) ||
  263. fExtensions.has("GL_OES_texture_buffer") ||
  264. fExtensions.has("GL_EXT_texture_buffer")))) {
  265. if (!fFunctions.fTexBuffer) {
  266. RETURN_FALSE_INTERFACE;
  267. }
  268. }
  269. if ((GR_IS_GR_GL(fStandard) && (
  270. (glVer >= GR_GL_VER(4,3)))) ||
  271. (GR_IS_GR_GL_ES(fStandard) && (
  272. (glVer >= GR_GL_VER(3,2)) ||
  273. fExtensions.has("GL_OES_texture_buffer") ||
  274. fExtensions.has("GL_EXT_texture_buffer")))) {
  275. if (!fFunctions.fTexBufferRange) {
  276. RETURN_FALSE_INTERFACE;
  277. }
  278. }
  279. if ((GR_IS_GR_GL(fStandard) && (
  280. (glVer >= GR_GL_VER(4,2)) ||
  281. fExtensions.has("GL_ARB_texture_storage") ||
  282. fExtensions.has("GL_EXT_texture_storage"))) ||
  283. (GR_IS_GR_GL_ES(fStandard) && (
  284. (glVer >= GR_GL_VER(3,0)) ||
  285. fExtensions.has("GL_EXT_texture_storage"))) ||
  286. (GR_IS_GR_WEBGL(fStandard) && (
  287. (glVer >= GR_GL_VER(2,0))))) {
  288. if (!fFunctions.fTexStorage2D) {
  289. RETURN_FALSE_INTERFACE;
  290. }
  291. }
  292. if ((GR_IS_GR_GL(fStandard) && (
  293. (glVer >= GR_GL_VER(4,5)) ||
  294. fExtensions.has("GL_ARB_texture_barrier") ||
  295. fExtensions.has("GL_NV_texture_barrier"))) ||
  296. (GR_IS_GR_GL_ES(fStandard) && (
  297. fExtensions.has("GL_NV_texture_barrier")))) {
  298. if (!fFunctions.fTextureBarrier) {
  299. RETURN_FALSE_INTERFACE;
  300. }
  301. }
  302. if ((GR_IS_GR_GL_ES(fStandard) && (
  303. fExtensions.has("GL_EXT_discard_framebuffer")))) {
  304. if (!fFunctions.fDiscardFramebuffer) {
  305. RETURN_FALSE_INTERFACE;
  306. }
  307. }
  308. if ((GR_IS_GR_GL(fStandard) && (
  309. (glVer >= GR_GL_VER(3,2)) ||
  310. fExtensions.has("GL_ARB_instanced_arrays"))) ||
  311. (GR_IS_GR_GL_ES(fStandard) && (
  312. (glVer >= GR_GL_VER(3,0)) ||
  313. fExtensions.has("GL_EXT_instanced_arrays")))) {
  314. if (!fFunctions.fVertexAttribDivisor) {
  315. RETURN_FALSE_INTERFACE;
  316. }
  317. }
  318. if ((GR_IS_GR_GL(fStandard) && (
  319. (glVer >= GR_GL_VER(3,0)))) ||
  320. (GR_IS_GR_GL_ES(fStandard) && (
  321. (glVer >= GR_GL_VER(3,0)))) ||
  322. (GR_IS_GR_WEBGL(fStandard) && (
  323. (glVer >= GR_GL_VER(2,0))))) {
  324. if (!fFunctions.fVertexAttribIPointer) {
  325. RETURN_FALSE_INTERFACE;
  326. }
  327. }
  328. if ((GR_IS_GR_GL(fStandard) && (
  329. (glVer >= GR_GL_VER(3,0)) ||
  330. fExtensions.has("GL_ARB_framebuffer_object") ||
  331. fExtensions.has("GL_EXT_framebuffer_object"))) ||
  332. GR_IS_GR_GL_ES(fStandard) ||
  333. GR_IS_GR_WEBGL(fStandard)) {
  334. if (!fFunctions.fBindFramebuffer ||
  335. !fFunctions.fBindRenderbuffer ||
  336. !fFunctions.fCheckFramebufferStatus ||
  337. !fFunctions.fDeleteFramebuffers ||
  338. !fFunctions.fDeleteRenderbuffers ||
  339. !fFunctions.fFramebufferRenderbuffer ||
  340. !fFunctions.fFramebufferTexture2D ||
  341. !fFunctions.fGenFramebuffers ||
  342. !fFunctions.fGenRenderbuffers ||
  343. !fFunctions.fGenerateMipmap ||
  344. !fFunctions.fGetFramebufferAttachmentParameteriv ||
  345. !fFunctions.fGetRenderbufferParameteriv ||
  346. !fFunctions.fRenderbufferStorage) {
  347. RETURN_FALSE_INTERFACE;
  348. }
  349. }
  350. if ((GR_IS_GR_GL(fStandard) && (
  351. (glVer >= GR_GL_VER(3,0)) ||
  352. fExtensions.has("GL_ARB_framebuffer_object") ||
  353. fExtensions.has("GL_EXT_framebuffer_blit"))) ||
  354. (GR_IS_GR_GL_ES(fStandard) && (
  355. (glVer >= GR_GL_VER(3,0)) ||
  356. fExtensions.has("GL_CHROMIUM_framebuffer_multisample") ||
  357. fExtensions.has("GL_ANGLE_framebuffer_blit")))) {
  358. if (!fFunctions.fBlitFramebuffer) {
  359. RETURN_FALSE_INTERFACE;
  360. }
  361. }
  362. if ((GR_IS_GR_GL(fStandard) && (
  363. (glVer >= GR_GL_VER(3,0)) ||
  364. fExtensions.has("GL_ARB_framebuffer_object") ||
  365. fExtensions.has("GL_EXT_framebuffer_multisample"))) ||
  366. (GR_IS_GR_GL_ES(fStandard) && (
  367. (glVer >= GR_GL_VER(3,0)) ||
  368. fExtensions.has("GL_CHROMIUM_framebuffer_multisample") ||
  369. fExtensions.has("GL_ANGLE_framebuffer_multisample"))) ||
  370. (GR_IS_GR_WEBGL(fStandard) && (
  371. (glVer >= GR_GL_VER(2,0))))) {
  372. if (!fFunctions.fRenderbufferStorageMultisample) {
  373. RETURN_FALSE_INTERFACE;
  374. }
  375. }
  376. if ((GR_IS_GR_GL_ES(fStandard) && (
  377. fExtensions.has("GL_CHROMIUM_map_sub")))) {
  378. if (!fFunctions.fMapBufferSubData ||
  379. !fFunctions.fMapTexSubImage2D ||
  380. !fFunctions.fUnmapBufferSubData ||
  381. !fFunctions.fUnmapTexSubImage2D) {
  382. RETURN_FALSE_INTERFACE;
  383. }
  384. }
  385. if ((GR_IS_GR_GL_ES(fStandard) && (
  386. fExtensions.has("GL_EXT_multisampled_render_to_texture") ||
  387. fExtensions.has("GL_IMG_multisampled_render_to_texture")))) {
  388. if (!fFunctions.fFramebufferTexture2DMultisample) {
  389. RETURN_FALSE_INTERFACE;
  390. }
  391. }
  392. if ((GR_IS_GR_GL_ES(fStandard) && (
  393. fExtensions.has("GL_EXT_multisampled_render_to_texture")))) {
  394. if (!fFunctions.fRenderbufferStorageMultisampleES2EXT) {
  395. RETURN_FALSE_INTERFACE;
  396. }
  397. }
  398. if ((GR_IS_GR_GL_ES(fStandard) && (
  399. fExtensions.has("GL_IMG_multisampled_render_to_texture")))) {
  400. if (!fFunctions.fRenderbufferStorageMultisampleES2EXT) {
  401. RETURN_FALSE_INTERFACE;
  402. }
  403. }
  404. if ((GR_IS_GR_GL_ES(fStandard) && (
  405. fExtensions.has("GL_APPLE_framebuffer_multisample")))) {
  406. if (!fFunctions.fResolveMultisampleFramebuffer ||
  407. !fFunctions.fRenderbufferStorageMultisampleES2APPLE) {
  408. RETURN_FALSE_INTERFACE;
  409. }
  410. }
  411. if (GR_IS_GR_GL(fStandard) ||
  412. (GR_IS_GR_GL_ES(fStandard) && (
  413. fExtensions.has("GL_OES_mapbuffer")))) {
  414. if (!fFunctions.fMapBuffer) {
  415. RETURN_FALSE_INTERFACE;
  416. }
  417. }
  418. if (GR_IS_GR_GL(fStandard) ||
  419. (GR_IS_GR_GL_ES(fStandard) && (
  420. (glVer >= GR_GL_VER(3,0)) ||
  421. fExtensions.has("GL_OES_mapbuffer")))) {
  422. if (!fFunctions.fUnmapBuffer) {
  423. RETURN_FALSE_INTERFACE;
  424. }
  425. }
  426. if ((GR_IS_GR_GL(fStandard) && (
  427. (glVer >= GR_GL_VER(3,0)) ||
  428. fExtensions.has("GL_ARB_map_buffer_range"))) ||
  429. (GR_IS_GR_GL_ES(fStandard) && (
  430. (glVer >= GR_GL_VER(3,0)) ||
  431. fExtensions.has("GL_EXT_map_buffer_range")))) {
  432. if (!fFunctions.fFlushMappedBufferRange ||
  433. !fFunctions.fMapBufferRange) {
  434. RETURN_FALSE_INTERFACE;
  435. }
  436. }
  437. if ((GR_IS_GR_GL(fStandard) && (
  438. fExtensions.has("GL_EXT_debug_marker"))) ||
  439. (GR_IS_GR_GL_ES(fStandard) && (
  440. fExtensions.has("GL_EXT_debug_marker")))) {
  441. if (!fFunctions.fInsertEventMarker ||
  442. !fFunctions.fPopGroupMarker ||
  443. !fFunctions.fPushGroupMarker) {
  444. RETURN_FALSE_INTERFACE;
  445. }
  446. }
  447. if ((GR_IS_GR_GL(fStandard) && (
  448. (glVer >= GR_GL_VER(4,3)) ||
  449. fExtensions.has("GL_ARB_program_interface_query"))) ||
  450. (GR_IS_GR_GL_ES(fStandard) && (
  451. (glVer >= GR_GL_VER(3,1))))) {
  452. if (!fFunctions.fGetProgramResourceLocation) {
  453. RETURN_FALSE_INTERFACE;
  454. }
  455. }
  456. if ((GR_IS_GR_GL(fStandard) && (
  457. fExtensions.has("GL_NV_path_rendering"))) ||
  458. (GR_IS_GR_GL_ES(fStandard) && (
  459. fExtensions.has("GL_CHROMIUM_path_rendering") ||
  460. fExtensions.has("GL_NV_path_rendering")))) {
  461. if (!fFunctions.fMatrixLoadIdentity ||
  462. !fFunctions.fMatrixLoadf) {
  463. RETURN_FALSE_INTERFACE;
  464. }
  465. }
  466. if ((GR_IS_GR_GL(fStandard) && (
  467. fExtensions.has("GL_NV_path_rendering"))) ||
  468. (GR_IS_GR_GL_ES(fStandard) && (
  469. fExtensions.has("GL_CHROMIUM_path_rendering") ||
  470. fExtensions.has("GL_NV_path_rendering")))) {
  471. if (!fFunctions.fCoverFillPath ||
  472. !fFunctions.fCoverFillPathInstanced ||
  473. !fFunctions.fCoverStrokePath ||
  474. !fFunctions.fCoverStrokePathInstanced ||
  475. !fFunctions.fDeletePaths ||
  476. !fFunctions.fGenPaths ||
  477. !fFunctions.fIsPath ||
  478. !fFunctions.fPathCommands ||
  479. !fFunctions.fPathParameterf ||
  480. !fFunctions.fPathParameteri ||
  481. !fFunctions.fPathStencilFunc ||
  482. !fFunctions.fStencilFillPath ||
  483. !fFunctions.fStencilFillPathInstanced ||
  484. !fFunctions.fStencilStrokePath ||
  485. !fFunctions.fStencilStrokePathInstanced) {
  486. RETURN_FALSE_INTERFACE;
  487. }
  488. }
  489. if ((GR_IS_GR_GL_ES(fStandard) && (
  490. fExtensions.has("GL_CHROMIUM_path_rendering")))) {
  491. if (!fFunctions.fBindFragmentInputLocation) {
  492. RETURN_FALSE_INTERFACE;
  493. }
  494. }
  495. if ((GR_IS_GR_GL(fStandard) && (
  496. fExtensions.has("GL_NV_framebuffer_mixed_samples"))) ||
  497. (GR_IS_GR_GL_ES(fStandard) && (
  498. fExtensions.has("GL_CHROMIUM_framebuffer_mixed_samples") ||
  499. fExtensions.has("GL_NV_framebuffer_mixed_samples")))) {
  500. if (!fFunctions.fCoverageModulation) {
  501. RETURN_FALSE_INTERFACE;
  502. }
  503. }
  504. if ((GR_IS_GR_GL(fStandard) && (
  505. (glVer >= GR_GL_VER(4,3)) ||
  506. fExtensions.has("GL_KHR_debug"))) ||
  507. (GR_IS_GR_GL_ES(fStandard) && (
  508. fExtensions.has("GL_KHR_debug")))) {
  509. if (!fFunctions.fDebugMessageCallback ||
  510. !fFunctions.fDebugMessageControl ||
  511. !fFunctions.fDebugMessageInsert ||
  512. !fFunctions.fGetDebugMessageLog ||
  513. !fFunctions.fObjectLabel ||
  514. !fFunctions.fPopDebugGroup ||
  515. !fFunctions.fPushDebugGroup) {
  516. RETURN_FALSE_INTERFACE;
  517. }
  518. }
  519. if ((GR_IS_GR_GL_ES(fStandard) && (
  520. fExtensions.has("GL_CHROMIUM_bind_uniform_location")))) {
  521. if (!fFunctions.fBindUniformLocation) {
  522. RETURN_FALSE_INTERFACE;
  523. }
  524. }
  525. if ((GR_IS_GR_GL(fStandard) && (
  526. fExtensions.has("GL_EXT_window_rectangles"))) ||
  527. (GR_IS_GR_GL_ES(fStandard) && (
  528. fExtensions.has("GL_EXT_window_rectangles")))) {
  529. if (!fFunctions.fWindowRectangles) {
  530. RETURN_FALSE_INTERFACE;
  531. }
  532. }
  533. if ((GR_IS_GR_GL(fStandard) && (
  534. (glVer >= GR_GL_VER(3,2)) ||
  535. fExtensions.has("GL_ARB_sync"))) ||
  536. (GR_IS_GR_GL_ES(fStandard) && (
  537. (glVer >= GR_GL_VER(3,0)) ||
  538. fExtensions.has("GL_APPLE_sync"))) ||
  539. (GR_IS_GR_WEBGL(fStandard) && (
  540. (glVer >= GR_GL_VER(2,0))))) {
  541. if (!fFunctions.fClientWaitSync ||
  542. !fFunctions.fDeleteSync ||
  543. !fFunctions.fFenceSync ||
  544. !fFunctions.fIsSync ||
  545. !fFunctions.fWaitSync) {
  546. RETURN_FALSE_INTERFACE;
  547. }
  548. }
  549. if ((GR_IS_GR_GL(fStandard) && (
  550. (glVer >= GR_GL_VER(4,2)) ||
  551. fExtensions.has("GL_ARB_internalformat_query"))) ||
  552. (GR_IS_GR_GL_ES(fStandard) && (
  553. (glVer >= GR_GL_VER(3,0))))) {
  554. if (!fFunctions.fGetInternalformativ) {
  555. RETURN_FALSE_INTERFACE;
  556. }
  557. }
  558. if ((GR_IS_GR_GL(fStandard) && (
  559. (glVer >= GR_GL_VER(4,1)))) ||
  560. (GR_IS_GR_GL_ES(fStandard) && (
  561. (glVer >= GR_GL_VER(3,0)) ||
  562. fExtensions.has("GL_OES_get_program_binary")))) {
  563. if (!fFunctions.fGetProgramBinary ||
  564. !fFunctions.fProgramBinary) {
  565. RETURN_FALSE_INTERFACE;
  566. }
  567. }
  568. if ((GR_IS_GR_GL(fStandard) && (
  569. (glVer >= GR_GL_VER(4,1)))) ||
  570. (GR_IS_GR_GL_ES(fStandard) && (
  571. (glVer >= GR_GL_VER(3,0))))) {
  572. if (!fFunctions.fProgramParameteri) {
  573. RETURN_FALSE_INTERFACE;
  574. }
  575. }
  576. if ((GR_IS_GR_GL(fStandard) && (
  577. (glVer >= GR_GL_VER(3,2)) ||
  578. fExtensions.has("GL_ARB_sampler_objects"))) ||
  579. (GR_IS_GR_GL_ES(fStandard) && (
  580. (glVer >= GR_GL_VER(3,0)))) ||
  581. (GR_IS_GR_WEBGL(fStandard) && (
  582. (glVer >= GR_GL_VER(2,0))))) {
  583. if (!fFunctions.fBindSampler ||
  584. !fFunctions.fDeleteSamplers ||
  585. !fFunctions.fGenSamplers ||
  586. !fFunctions.fSamplerParameteri ||
  587. !fFunctions.fSamplerParameteriv) {
  588. RETURN_FALSE_INTERFACE;
  589. }
  590. }
  591. if (GR_IS_GR_GL(fStandard)) {
  592. if (!fFunctions.fGetQueryObjectiv) {
  593. RETURN_FALSE_INTERFACE;
  594. }
  595. }
  596. if (GR_IS_GR_GL(fStandard) ||
  597. (GR_IS_GR_GL_ES(fStandard) && (
  598. (glVer >= GR_GL_VER(3,0)) ||
  599. fExtensions.has("GL_EXT_occlusion_query_boolean")))) {
  600. #if GR_TEST_UTILS
  601. if (!fFunctions.fBeginQuery ||
  602. !fFunctions.fDeleteQueries ||
  603. !fFunctions.fEndQuery ||
  604. !fFunctions.fGenQueries ||
  605. !fFunctions.fGetQueryObjectuiv ||
  606. !fFunctions.fGetQueryiv) {
  607. RETURN_FALSE_INTERFACE;
  608. }
  609. #endif
  610. // all functions were marked optional or test_only
  611. }
  612. if ((GR_IS_GR_GL(fStandard) && (
  613. (glVer >= GR_GL_VER(3,3)) ||
  614. fExtensions.has("GL_ARB_timer_query") ||
  615. fExtensions.has("GL_EXT_timer_query")))) {
  616. if (!fFunctions.fGetQueryObjecti64v ||
  617. !fFunctions.fGetQueryObjectui64v) {
  618. RETURN_FALSE_INTERFACE;
  619. }
  620. }
  621. if ((GR_IS_GR_GL(fStandard) && (
  622. (glVer >= GR_GL_VER(3,3)) ||
  623. fExtensions.has("GL_ARB_timer_query")))) {
  624. if (!fFunctions.fQueryCounter) {
  625. RETURN_FALSE_INTERFACE;
  626. }
  627. }
  628. if ((GR_IS_GR_GL(fStandard) && (
  629. (glVer >= GR_GL_VER(4,3)) ||
  630. fExtensions.has("GL_ARB_invalidate_subdata")))) {
  631. if (!fFunctions.fInvalidateBufferData ||
  632. !fFunctions.fInvalidateBufferSubData ||
  633. !fFunctions.fInvalidateTexImage ||
  634. !fFunctions.fInvalidateTexSubImage) {
  635. RETURN_FALSE_INTERFACE;
  636. }
  637. }
  638. if ((GR_IS_GR_GL(fStandard) && (
  639. (glVer >= GR_GL_VER(4,3)) ||
  640. fExtensions.has("GL_ARB_invalidate_subdata"))) ||
  641. (GR_IS_GR_GL_ES(fStandard) && (
  642. (glVer >= GR_GL_VER(3,0)))) ||
  643. (GR_IS_GR_WEBGL(fStandard) && (
  644. (glVer >= GR_GL_VER(2,0))))) {
  645. if (!fFunctions.fInvalidateFramebuffer ||
  646. !fFunctions.fInvalidateSubFramebuffer) {
  647. RETURN_FALSE_INTERFACE;
  648. }
  649. }
  650. if ((GR_IS_GR_GL(fStandard) && (
  651. (glVer >= GR_GL_VER(4,3)) ||
  652. fExtensions.has("GL_ARB_ES2_compatibility"))) ||
  653. GR_IS_GR_GL_ES(fStandard) ||
  654. GR_IS_GR_WEBGL(fStandard)) {
  655. if (!fFunctions.fGetShaderPrecisionFormat) {
  656. RETURN_FALSE_INTERFACE;
  657. }
  658. }
  659. // End autogenerated content
  660. return true;
  661. }
  662. #if GR_TEST_UTILS
  663. void GrGLInterface::abandon() const {
  664. const_cast<GrGLInterface*>(this)->fFunctions = GrGLInterface::Functions();
  665. }
  666. #endif // GR_TEST_UTILS