智慧水务管理系统 - 精河县供水工程综合管理平台

ContextLimits.js 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. /**
  2. * These are set in the constructor for {@link Context}
  3. *
  4. * @private
  5. */
  6. const ContextLimits = {
  7. _maximumCombinedTextureImageUnits: 0,
  8. _maximumCubeMapSize: 0,
  9. _maximumFragmentUniformVectors: 0,
  10. _maximumTextureImageUnits: 0,
  11. _maximumRenderbufferSize: 0,
  12. _maximumTextureSize: 0,
  13. _maximum3DTextureSize: 0,
  14. _maximumVaryingVectors: 0,
  15. _maximumVertexAttributes: 0,
  16. _maximumVertexTextureImageUnits: 0,
  17. _maximumVertexUniformVectors: 0,
  18. _minimumAliasedLineWidth: 0,
  19. _maximumAliasedLineWidth: 0,
  20. _minimumAliasedPointSize: 0,
  21. _maximumAliasedPointSize: 0,
  22. _maximumViewportWidth: 0,
  23. _maximumViewportHeight: 0,
  24. _maximumTextureFilterAnisotropy: 0,
  25. _maximumDrawBuffers: 0,
  26. _maximumColorAttachments: 0,
  27. _maximumSamples: 0,
  28. _highpFloatSupported: false,
  29. _highpIntSupported: false,
  30. };
  31. Object.defineProperties(ContextLimits, {
  32. /**
  33. * The maximum number of texture units that can be used from the vertex and fragment
  34. * shader with this WebGL implementation.
  35. * If both shaders access the same texture unit, this counts as two texture units.
  36. * The minimum in WebGL2 contexts is 32, or 8 in WebGL1 contexts.
  37. * @memberof ContextLimits
  38. * @type {number}
  39. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_COMBINED_TEXTURE_IMAGE_UNITS</code>.
  40. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
  41. */
  42. maximumCombinedTextureImageUnits: {
  43. get: function () {
  44. return ContextLimits._maximumCombinedTextureImageUnits;
  45. },
  46. },
  47. /**
  48. * The approximate maximum cube map width and height supported by this WebGL implementation.
  49. * The minimum in WebGL2 contexts is 2048, but most desktop and laptop implementations will support much larger sizes like 8192.
  50. * The minimum in WebGL1 contexts is 16.
  51. * @memberof ContextLimits
  52. * @type {number}
  53. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_CUBE_MAP_TEXTURE_SIZE</code>.
  54. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
  55. */
  56. maximumCubeMapSize: {
  57. get: function () {
  58. return ContextLimits._maximumCubeMapSize;
  59. },
  60. },
  61. /**
  62. * The maximum number of <code>vec4</code>, <code>ivec4</code>, and <code>bvec4</code>
  63. * uniforms that can be used by a fragment shader with this WebGL implementation.
  64. * The minimum in WebGL2 contexts is 224, or 16 in WebGL1 contexts.
  65. * @memberof ContextLimits
  66. * @type {number}
  67. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_FRAGMENT_UNIFORM_VECTORS</code>.
  68. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
  69. */
  70. maximumFragmentUniformVectors: {
  71. get: function () {
  72. return ContextLimits._maximumFragmentUniformVectors;
  73. },
  74. },
  75. /**
  76. * The maximum number of texture units that can be used from the fragment shader with this WebGL implementation.
  77. * The minimum in WebGL2 contexts is 16, or 8 in WebGL1 contexts.
  78. * @memberof ContextLimits
  79. * @type {number}
  80. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_TEXTURE_IMAGE_UNITS</code>.
  81. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
  82. */
  83. maximumTextureImageUnits: {
  84. get: function () {
  85. return ContextLimits._maximumTextureImageUnits;
  86. },
  87. },
  88. /**
  89. * The maximum renderbuffer width and height supported by this WebGL implementation.
  90. * The minimum in WebGL2 contexts is 2048, but most desktop and laptop implementations will support much larger sizes like 8192.
  91. * The minimum in WebGL1 contexts is 1.
  92. * @memberof ContextLimits
  93. * @type {number}
  94. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_RENDERBUFFER_SIZE</code>.
  95. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
  96. */
  97. maximumRenderbufferSize: {
  98. get: function () {
  99. return ContextLimits._maximumRenderbufferSize;
  100. },
  101. },
  102. /**
  103. * The approximate maximum texture width and height supported by this WebGL implementation.
  104. * The minimum in WebGL2 contexts is 2048, but most desktop and laptop implementations will support much larger sizes like 8192.
  105. * The minimum in WebGL1 contexts is 64.
  106. * @memberof ContextLimits
  107. * @type {number}
  108. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_TEXTURE_SIZE</code>.
  109. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
  110. */
  111. maximumTextureSize: {
  112. get: function () {
  113. return ContextLimits._maximumTextureSize;
  114. },
  115. },
  116. /**
  117. * The approximate maximum texture width, height, and depth supported by this WebGL2 implementation.
  118. * The minimum is 256, but most desktop and laptop implementations will support much larger sizes like 2048.
  119. * 3D textures are not supported in WebGL1 contexts.
  120. * @memberof ContextLimits
  121. * @type {number}
  122. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_3D_TEXTURE_SIZE</code>.
  123. */
  124. maximum3DTextureSize: {
  125. get: function () {
  126. return ContextLimits._maximum3DTextureSize;
  127. },
  128. },
  129. /**
  130. * The maximum number of <code>vec4</code> varying variables supported by this WebGL implementation.
  131. * The minimum is 15 in WebGL2 contexts, or 8 in WebGL1 contexts. Matrices and arrays count as multiple <code>vec4</code>s.
  132. * @memberof ContextLimits
  133. * @type {number}
  134. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_VARYING_VECTORS</code>.
  135. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
  136. */
  137. maximumVaryingVectors: {
  138. get: function () {
  139. return ContextLimits._maximumVaryingVectors;
  140. },
  141. },
  142. /**
  143. * The maximum number of <code>vec4</code> vertex attributes supported by this WebGL implementation.
  144. * The minimum is 16 in WebGL2 contexts, or 8 in WebGL1 contexts.
  145. * @memberof ContextLimits
  146. * @type {number}
  147. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_VERTEX_ATTRIBS</code>.
  148. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
  149. */
  150. maximumVertexAttributes: {
  151. get: function () {
  152. return ContextLimits._maximumVertexAttributes;
  153. },
  154. },
  155. /**
  156. * The maximum number of texture units that can be used from the vertex shader with this WebGL implementation.
  157. * The minimum is 16 in WebGL2 contexts, or 0 in WebGL1 contexts.
  158. * @memberof ContextLimits
  159. * @type {number}
  160. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_VERTEX_TEXTURE_IMAGE_UNITS</code>.
  161. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
  162. */
  163. maximumVertexTextureImageUnits: {
  164. get: function () {
  165. return ContextLimits._maximumVertexTextureImageUnits;
  166. },
  167. },
  168. /**
  169. * The maximum number of <code>vec4</code>, <code>ivec4</code>, and <code>bvec4</code>
  170. * uniforms that can be used by a vertex shader with this WebGL implementation.
  171. * The minimum is 256 in WebGL2 contexts, or 128 in WebGL1 contexts.
  172. * @memberof ContextLimits
  173. * @type {number}
  174. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_VERTEX_UNIFORM_VECTORS</code>.
  175. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es2.0/xhtml/glGet.xml|glGet in OpenGL ES 2.0} for WebGL1 contexts.
  176. */
  177. maximumVertexUniformVectors: {
  178. get: function () {
  179. return ContextLimits._maximumVertexUniformVectors;
  180. },
  181. },
  182. /**
  183. * The minimum aliased line width, in pixels, supported by this WebGL implementation. It will be at most one.
  184. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>ALIASED_LINE_WIDTH_RANGE</code>.
  185. * @memberof ContextLimits
  186. * @type {number}
  187. */
  188. minimumAliasedLineWidth: {
  189. get: function () {
  190. return ContextLimits._minimumAliasedLineWidth;
  191. },
  192. },
  193. /**
  194. * The maximum aliased line width, in pixels, supported by this WebGL implementation. It will be at least one.
  195. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>ALIASED_LINE_WIDTH_RANGE</code>.
  196. * @memberof ContextLimits
  197. * @type {number}
  198. */
  199. maximumAliasedLineWidth: {
  200. get: function () {
  201. return ContextLimits._maximumAliasedLineWidth;
  202. },
  203. },
  204. /**
  205. * The minimum aliased point size, in pixels, supported by this WebGL implementation. It will be at most one.
  206. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>ALIASED_POINT_SIZE_RANGE</code>.
  207. * @memberof ContextLimits
  208. * @type {number}
  209. */
  210. minimumAliasedPointSize: {
  211. get: function () {
  212. return ContextLimits._minimumAliasedPointSize;
  213. },
  214. },
  215. /**
  216. * The maximum aliased point size, in pixels, supported by this WebGL implementation. It will be at least one.
  217. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>ALIASED_POINT_SIZE_RANGE</code>.
  218. * @memberof ContextLimits
  219. * @type {number}
  220. */
  221. maximumAliasedPointSize: {
  222. get: function () {
  223. return ContextLimits._maximumAliasedPointSize;
  224. },
  225. },
  226. /**
  227. * The maximum supported width of the viewport. It will be at least as large as the visible width of the associated canvas.
  228. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_VIEWPORT_DIMS</code>.
  229. * @memberof ContextLimits
  230. * @type {number}
  231. */
  232. maximumViewportWidth: {
  233. get: function () {
  234. return ContextLimits._maximumViewportWidth;
  235. },
  236. },
  237. /**
  238. * The maximum supported height of the viewport. It will be at least as large as the visible height of the associated canvas.
  239. * @see {@link https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGet.xhtml|glGet in OpenGL ES 3.0} with <code>MAX_VIEWPORT_DIMS</code>.
  240. * @memberof ContextLimits
  241. * @type {number}
  242. */
  243. maximumViewportHeight: {
  244. get: function () {
  245. return ContextLimits._maximumViewportHeight;
  246. },
  247. },
  248. /**
  249. * The maximum degree of anisotropy for texture filtering
  250. * @memberof ContextLimits
  251. * @type {number}
  252. */
  253. maximumTextureFilterAnisotropy: {
  254. get: function () {
  255. return ContextLimits._maximumTextureFilterAnisotropy;
  256. },
  257. },
  258. /**
  259. * The maximum number of simultaneous outputs that may be written in a fragment shader.
  260. * @memberof ContextLimits
  261. * @type {number}
  262. */
  263. maximumDrawBuffers: {
  264. get: function () {
  265. return ContextLimits._maximumDrawBuffers;
  266. },
  267. },
  268. /**
  269. * The maximum number of color attachments supported.
  270. * @memberof ContextLimits
  271. * @type {number}
  272. */
  273. maximumColorAttachments: {
  274. get: function () {
  275. return ContextLimits._maximumColorAttachments;
  276. },
  277. },
  278. /**
  279. * The maximum number of samples supported for multisampling.
  280. * @memberof ContextLimits
  281. * @type {number}
  282. */
  283. maximumSamples: {
  284. get: function () {
  285. return ContextLimits._maximumSamples;
  286. },
  287. },
  288. /**
  289. * High precision float supported (<code>highp</code>) in fragment shaders.
  290. * @memberof ContextLimits
  291. * @type {boolean}
  292. */
  293. highpFloatSupported: {
  294. get: function () {
  295. return ContextLimits._highpFloatSupported;
  296. },
  297. },
  298. /**
  299. * High precision int supported (<code>highp</code>) in fragment shaders.
  300. * @memberof ContextLimits
  301. * @type {boolean}
  302. */
  303. highpIntSupported: {
  304. get: function () {
  305. return ContextLimits._highpIntSupported;
  306. },
  307. },
  308. });
  309. export default ContextLimits;