chunk-YFDOPEEZ.js 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. import {
  2. c,
  3. n,
  4. r as r2
  5. } from "./chunk-RWQH5X3O.js";
  6. import {
  7. r,
  8. t
  9. } from "./chunk-YXWMMD76.js";
  10. // node_modules/@arcgis/core/views/webgl/capabilities.js
  11. var n2;
  12. var a;
  13. function l(t2) {
  14. const e = n(t2);
  15. for (; e.length > 1; ) {
  16. const t3 = u(e.shift());
  17. if (t3.available)
  18. return t3;
  19. }
  20. return u(e.shift());
  21. }
  22. function u(t2) {
  23. switch (t2) {
  24. case r2.WEBGL1:
  25. return i();
  26. case r2.WEBGL2:
  27. return f();
  28. }
  29. }
  30. function i() {
  31. return n2 || (n2 = d()), n2;
  32. }
  33. function f() {
  34. return a || (a = x()), a;
  35. }
  36. var p = class {
  37. constructor() {
  38. this.available = false, this.majorPerformanceCaveat = false, this.maxTextureSize = 0, this.supportsVertexShaderSamplers = false, this.supportsHighPrecisionFragment = false, this.supportsElementIndexUint = false, this.supportsStandardDerivatives = false, this.supportsInstancedArrays = false, this.supportsTextureFloat = false, this.supportsTextureHalfFloat = false, this.supportsColorBufferFloat = false, this.supportsColorBufferFloatBlend = false, this.supportsColorBufferHalfFloat = false;
  39. }
  40. };
  41. var c2 = class extends p {
  42. constructor() {
  43. super(...arguments), this.type = r2.WEBGL1;
  44. }
  45. };
  46. var E = class extends p {
  47. constructor() {
  48. super(...arguments), this.type = r2.WEBGL2, this.supportsElementIndexUint = true, this.supportsStandardDerivatives = true, this.supportsInstancedArrays = true, this.supportsTextureFloat = true, this.supportsTextureHalfFloat = true;
  49. }
  50. };
  51. function _(r3, n3) {
  52. var _a;
  53. if (r3 === r2.WEBGL1 && "undefined" == typeof WebGLRenderingContext || r3 === r2.WEBGL2 && "undefined" == typeof WebGL2RenderingContext)
  54. return null;
  55. const a2 = document.createElement("canvas");
  56. if (!a2)
  57. return null;
  58. let l2 = c(a2, r3, { failIfMajorPerformanceCaveat: true });
  59. if (t(l2) && (l2 = c(a2, r3), r(l2) && (n3.majorPerformanceCaveat = true)), t(l2))
  60. return l2;
  61. if (r3 === r2.WEBGL1) {
  62. const t2 = (_a = l2.getParameter(l2.VERSION)) == null ? void 0 : _a.match(/^WebGL\s+([\d.]*)/);
  63. if (t2) {
  64. const e = parseFloat(t2[1]);
  65. n3.available = e >= 0.94;
  66. }
  67. } else
  68. n3.available = true;
  69. n3.maxTextureSize = l2.getParameter(l2.MAX_TEXTURE_SIZE), n3.supportsVertexShaderSamplers = l2.getParameter(l2.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  70. const u2 = l2.getShaderPrecisionFormat(l2.FRAGMENT_SHADER, l2.HIGH_FLOAT);
  71. return u2 && (n3.supportsHighPrecisionFragment = u2.precision > 0), l2;
  72. }
  73. function d() {
  74. const e = new c2(), r3 = _(r2.WEBGL1, e);
  75. return t(r3) || (e.supportsElementIndexUint = null !== r3.getExtension("OES_element_index_uint"), e.supportsStandardDerivatives = null !== r3.getExtension("OES_standard_derivatives"), e.supportsInstancedArrays = null !== r3.getExtension("ANGLE_instanced_arrays"), e.supportsTextureFloat = null !== r3.getExtension("OES_texture_float"), e.supportsTextureHalfFloat = null !== r3.getExtension("OES_texture_half_float"), e.supportsColorBufferFloat = null !== r3.getExtension("WEBGL_color_buffer_float"), e.supportsColorBufferFloatBlend = null !== r3.getExtension("EXT_float_blend"), e.supportsColorBufferHalfFloat = null !== r3.getExtension("EXT_color_buffer_half_float")), e;
  76. }
  77. function x() {
  78. const e = new E(), r3 = _(r2.WEBGL2, e);
  79. return t(r3) || (e.supportsColorBufferFloat = null !== r3.getExtension("EXT_color_buffer_float"), e.supportsColorBufferFloatBlend = null !== r3.getExtension("EXT_float_blend"), e.supportsColorBufferHalfFloat = e.supportsColorBufferFloat || null !== r3.getExtension("EXT_color_buffer_half_float")), e;
  80. }
  81. export {
  82. l
  83. };
  84. //# sourceMappingURL=chunk-YFDOPEEZ.js.map