@luma.gl/webgl 9.3.0-alpha.6 → 9.3.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/dist/adapter/converters/device-parameters.d.ts +1 -1
  2. package/dist/adapter/converters/device-parameters.d.ts.map +1 -1
  3. package/dist/adapter/converters/device-parameters.js +4 -1
  4. package/dist/adapter/converters/device-parameters.js.map +1 -1
  5. package/dist/adapter/converters/sampler-parameters.d.ts +1 -1
  6. package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -1
  7. package/dist/adapter/converters/sampler-parameters.js +1 -1
  8. package/dist/adapter/converters/sampler-parameters.js.map +1 -1
  9. package/dist/adapter/converters/shader-formats.d.ts +1 -64
  10. package/dist/adapter/converters/shader-formats.d.ts.map +1 -1
  11. package/dist/adapter/converters/shader-formats.js +1 -64
  12. package/dist/adapter/converters/shader-formats.js.map +1 -1
  13. package/dist/adapter/converters/webgl-shadertypes.d.ts +1 -3
  14. package/dist/adapter/converters/webgl-shadertypes.d.ts.map +1 -1
  15. package/dist/adapter/converters/webgl-shadertypes.js +1 -6
  16. package/dist/adapter/converters/webgl-shadertypes.js.map +1 -1
  17. package/dist/adapter/converters/webgl-texture-table.d.ts +1 -3
  18. package/dist/adapter/converters/webgl-texture-table.d.ts.map +1 -1
  19. package/dist/adapter/converters/webgl-texture-table.js +1 -15
  20. package/dist/adapter/converters/webgl-texture-table.js.map +1 -1
  21. package/dist/adapter/converters/webgl-vertex-formats.d.ts +1 -1
  22. package/dist/adapter/converters/webgl-vertex-formats.d.ts.map +1 -1
  23. package/dist/adapter/converters/webgl-vertex-formats.js +1 -1
  24. package/dist/adapter/converters/webgl-vertex-formats.js.map +1 -1
  25. package/dist/adapter/device-helpers/webgl-device-features.d.ts +1 -1
  26. package/dist/adapter/device-helpers/webgl-device-features.d.ts.map +1 -1
  27. package/dist/adapter/device-helpers/webgl-device-info.d.ts +1 -1
  28. package/dist/adapter/device-helpers/webgl-device-info.d.ts.map +1 -1
  29. package/dist/adapter/device-helpers/webgl-device-info.js +1 -1
  30. package/dist/adapter/device-helpers/webgl-device-info.js.map +1 -1
  31. package/dist/adapter/device-helpers/webgl-device-limits.d.ts +1 -1
  32. package/dist/adapter/device-helpers/webgl-device-limits.d.ts.map +1 -1
  33. package/dist/adapter/device-helpers/webgl-device-limits.js +1 -1
  34. package/dist/adapter/device-helpers/webgl-device-limits.js.map +1 -1
  35. package/dist/adapter/helpers/format-utils.d.ts +1 -1
  36. package/dist/adapter/helpers/format-utils.d.ts.map +1 -1
  37. package/dist/adapter/helpers/format-utils.js +1 -1
  38. package/dist/adapter/helpers/format-utils.js.map +1 -1
  39. package/dist/adapter/helpers/get-shader-layout-from-glsl.js +14 -2
  40. package/dist/adapter/helpers/get-shader-layout-from-glsl.js.map +1 -1
  41. package/dist/adapter/helpers/set-uniform.d.ts +1 -1
  42. package/dist/adapter/helpers/set-uniform.d.ts.map +1 -1
  43. package/dist/adapter/helpers/set-uniform.js +1 -1
  44. package/dist/adapter/helpers/set-uniform.js.map +1 -1
  45. package/dist/adapter/helpers/webgl-texture-utils.d.ts +1 -1
  46. package/dist/adapter/helpers/webgl-texture-utils.d.ts.map +1 -1
  47. package/dist/adapter/helpers/webgl-texture-utils.js +4 -4
  48. package/dist/adapter/helpers/webgl-texture-utils.js.map +1 -1
  49. package/dist/adapter/helpers/webgl-topology-utils.d.ts +1 -1
  50. package/dist/adapter/helpers/webgl-topology-utils.d.ts.map +1 -1
  51. package/dist/adapter/helpers/webgl-topology-utils.js +1 -1
  52. package/dist/adapter/helpers/webgl-topology-utils.js.map +1 -1
  53. package/dist/adapter/resources/webgl-buffer.d.ts +1 -1
  54. package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
  55. package/dist/adapter/resources/webgl-buffer.js +1 -1
  56. package/dist/adapter/resources/webgl-buffer.js.map +1 -1
  57. package/dist/adapter/resources/webgl-command-buffer.d.ts +1 -1
  58. package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
  59. package/dist/adapter/resources/webgl-command-buffer.js +20 -34
  60. package/dist/adapter/resources/webgl-command-buffer.js.map +1 -1
  61. package/dist/adapter/resources/webgl-command-encoder.d.ts +1 -1
  62. package/dist/adapter/resources/webgl-command-encoder.d.ts.map +1 -1
  63. package/dist/adapter/resources/webgl-command-encoder.js +3 -1
  64. package/dist/adapter/resources/webgl-command-encoder.js.map +1 -1
  65. package/dist/adapter/resources/webgl-framebuffer.d.ts +3 -1
  66. package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
  67. package/dist/adapter/resources/webgl-framebuffer.js +10 -1
  68. package/dist/adapter/resources/webgl-framebuffer.js.map +1 -1
  69. package/dist/adapter/resources/webgl-query-set.d.ts +8 -0
  70. package/dist/adapter/resources/webgl-query-set.d.ts.map +1 -1
  71. package/dist/adapter/resources/webgl-query-set.js +59 -4
  72. package/dist/adapter/resources/webgl-query-set.js.map +1 -1
  73. package/dist/adapter/resources/webgl-render-pass.d.ts +1 -1
  74. package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -1
  75. package/dist/adapter/resources/webgl-render-pass.js +13 -11
  76. package/dist/adapter/resources/webgl-render-pass.js.map +1 -1
  77. package/dist/adapter/resources/webgl-render-pipeline.d.ts +8 -6
  78. package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
  79. package/dist/adapter/resources/webgl-render-pipeline.js +39 -20
  80. package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
  81. package/dist/adapter/resources/webgl-sampler.d.ts +1 -1
  82. package/dist/adapter/resources/webgl-sampler.d.ts.map +1 -1
  83. package/dist/adapter/resources/webgl-sampler.js +1 -1
  84. package/dist/adapter/resources/webgl-sampler.js.map +1 -1
  85. package/dist/adapter/resources/webgl-shader.d.ts +1 -1
  86. package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
  87. package/dist/adapter/resources/webgl-shader.js +15 -8
  88. package/dist/adapter/resources/webgl-shader.js.map +1 -1
  89. package/dist/adapter/resources/webgl-shared-render-pipeline.d.ts.map +1 -1
  90. package/dist/adapter/resources/webgl-shared-render-pipeline.js +4 -1
  91. package/dist/adapter/resources/webgl-shared-render-pipeline.js.map +1 -1
  92. package/dist/adapter/resources/webgl-texture.d.ts +4 -2
  93. package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
  94. package/dist/adapter/resources/webgl-texture.js +12 -17
  95. package/dist/adapter/resources/webgl-texture.js.map +1 -1
  96. package/dist/adapter/resources/webgl-transform-feedback.js +1 -1
  97. package/dist/adapter/resources/webgl-transform-feedback.js.map +1 -1
  98. package/dist/adapter/resources/webgl-vertex-array.d.ts +2 -2
  99. package/dist/adapter/resources/webgl-vertex-array.d.ts.map +1 -1
  100. package/dist/adapter/resources/webgl-vertex-array.js +1 -1
  101. package/dist/adapter/resources/webgl-vertex-array.js.map +1 -1
  102. package/dist/adapter/webgl-device.d.ts +2 -1
  103. package/dist/adapter/webgl-device.d.ts.map +1 -1
  104. package/dist/adapter/webgl-device.js +11 -7
  105. package/dist/adapter/webgl-device.js.map +1 -1
  106. package/dist/constants/index.d.ts +3 -0
  107. package/dist/constants/index.d.ts.map +1 -0
  108. package/dist/constants/index.js +5 -0
  109. package/dist/constants/index.js.map +1 -0
  110. package/dist/constants/webgl-constants.d.ts +822 -0
  111. package/dist/constants/webgl-constants.d.ts.map +1 -0
  112. package/dist/constants/webgl-constants.js +928 -0
  113. package/dist/constants/webgl-constants.js.map +1 -0
  114. package/dist/constants/webgl-types.d.ts +480 -0
  115. package/dist/constants/webgl-types.d.ts.map +1 -0
  116. package/dist/constants/webgl-types.js +6 -0
  117. package/dist/constants/webgl-types.js.map +1 -0
  118. package/dist/context/debug/webgl-developer-tools.js +1 -1
  119. package/dist/context/debug/webgl-developer-tools.js.map +1 -1
  120. package/dist/context/helpers/webgl-context-data.d.ts +1 -1
  121. package/dist/context/helpers/webgl-context-data.d.ts.map +1 -1
  122. package/dist/context/helpers/webgl-extensions.d.ts +1 -1
  123. package/dist/context/helpers/webgl-extensions.d.ts.map +1 -1
  124. package/dist/context/parameters/unified-parameter-api.d.ts +1 -1
  125. package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -1
  126. package/dist/context/parameters/webgl-parameter-tables.d.ts +1 -1
  127. package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
  128. package/dist/context/parameters/webgl-parameter-tables.js +1 -1
  129. package/dist/context/parameters/webgl-parameter-tables.js.map +1 -1
  130. package/dist/context/polyfills/polyfill-webgl1-extensions.js +1 -1
  131. package/dist/context/polyfills/polyfill-webgl1-extensions.js.map +1 -1
  132. package/dist/dist.dev.js +267 -162
  133. package/dist/dist.min.js +2 -2
  134. package/dist/index.cjs +3 -5941
  135. package/dist/index.cjs.map +4 -4
  136. package/dist/index.d.ts +2 -0
  137. package/dist/index.d.ts.map +1 -1
  138. package/dist/index.js +1 -0
  139. package/dist/index.js.map +1 -1
  140. package/dist/webgl-constants.d.ts +2 -0
  141. package/dist/webgl-constants.d.ts.map +1 -0
  142. package/dist/webgl-constants.js +5 -0
  143. package/dist/webgl-constants.js.map +1 -0
  144. package/dist/webgl-types.d.ts +2 -0
  145. package/dist/webgl-types.d.ts.map +1 -0
  146. package/dist/{types.js → webgl-types.js} +1 -1
  147. package/dist/webgl-types.js.map +1 -0
  148. package/package.json +18 -4
  149. package/src/adapter/converters/device-parameters.ts +6 -2
  150. package/src/adapter/converters/sampler-parameters.ts +1 -1
  151. package/src/adapter/converters/shader-formats.ts +1 -66
  152. package/src/adapter/converters/webgl-shadertypes.ts +1 -9
  153. package/src/adapter/converters/webgl-texture-table.ts +1 -21
  154. package/src/adapter/converters/webgl-vertex-formats.ts +1 -1
  155. package/src/adapter/device-helpers/webgl-device-features.ts +1 -1
  156. package/src/adapter/device-helpers/webgl-device-info.ts +1 -1
  157. package/src/adapter/device-helpers/webgl-device-limits.ts +1 -1
  158. package/src/adapter/helpers/format-utils.ts +1 -1
  159. package/src/adapter/helpers/get-shader-layout-from-glsl.ts +21 -2
  160. package/src/adapter/helpers/set-uniform.ts +1 -1
  161. package/src/adapter/helpers/webgl-texture-utils.ts +4 -4
  162. package/src/adapter/helpers/webgl-topology-utils.ts +1 -1
  163. package/src/adapter/resources/webgl-buffer.ts +1 -1
  164. package/src/adapter/resources/webgl-command-buffer.ts +25 -26
  165. package/src/adapter/resources/webgl-command-encoder.ts +6 -4
  166. package/src/adapter/resources/webgl-framebuffer.ts +12 -1
  167. package/src/adapter/resources/webgl-query-set.ts +71 -4
  168. package/src/adapter/resources/webgl-render-pass.ts +13 -13
  169. package/src/adapter/resources/webgl-render-pipeline.ts +65 -26
  170. package/src/adapter/resources/webgl-sampler.ts +1 -1
  171. package/src/adapter/resources/webgl-shader.ts +15 -8
  172. package/src/adapter/resources/webgl-shared-render-pipeline.ts +4 -1
  173. package/src/adapter/resources/webgl-texture.ts +15 -18
  174. package/src/adapter/resources/webgl-transform-feedback.ts +1 -1
  175. package/src/adapter/resources/webgl-vertex-array.ts +1 -1
  176. package/src/adapter/webgl-device.ts +16 -8
  177. package/src/constants/index.d.ts.map +1 -0
  178. package/src/constants/index.js.map +1 -0
  179. package/src/constants/index.ts +31 -0
  180. package/src/constants/webgl-constants.d.ts.map +1 -0
  181. package/src/constants/webgl-constants.js.map +1 -0
  182. package/src/constants/webgl-constants.ts +1051 -0
  183. package/src/constants/webgl-types.d.ts.map +1 -0
  184. package/src/constants/webgl-types.js.map +1 -0
  185. package/src/constants/webgl-types.ts +813 -0
  186. package/src/context/debug/webgl-developer-tools.ts +1 -1
  187. package/src/context/helpers/webgl-context-data.ts +1 -1
  188. package/src/context/helpers/webgl-extensions.ts +1 -1
  189. package/src/context/parameters/unified-parameter-api.ts +1 -1
  190. package/src/context/parameters/webgl-parameter-tables.ts +1 -1
  191. package/src/context/polyfills/polyfill-webgl1-extensions.ts +1 -1
  192. package/src/index.ts +26 -0
  193. package/src/webgl-constants.d.ts.map +1 -0
  194. package/src/webgl-constants.js.map +1 -0
  195. package/src/webgl-constants.ts +5 -0
  196. package/src/webgl-types.d.ts.map +1 -0
  197. package/src/webgl-types.js.map +1 -0
  198. package/src/webgl-types.ts +29 -0
  199. package/dist/types.d.ts +0 -11
  200. package/dist/types.d.ts.map +0 -1
  201. package/dist/types.js.map +0 -1
  202. package/src/types.ts +0 -14
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export type { WebGLDeviceLimits } from "./adapter/device-helpers/webgl-device-limits.js";
2
+ export { GL } from "./constants/webgl-constants.js";
3
+ export type { GLTextureTarget, GLTextureCubeMapTarget, GLTexelDataFormat, GLPrimitiveTopology, GLPrimitive, GLDataType, GLPixelType, GLUniformType, GLSamplerType, GLFunction, GLBlendEquation, GLBlendFunction, GLStencilOp, GLSamplerParameters, GLValueParameters, GLPackParameters, GLUnpackParameters, GLFunctionParameters, GLParameters, GLLimits, GLExtensions, GLPolygonMode, GLProvokingVertex } from "./constants/webgl-types.js";
2
4
  export { webgl2Adapter } from "./adapter/webgl-adapter.js";
3
5
  export type { WebGLAdapter } from "./adapter/webgl-adapter.js";
4
6
  export { WebGLDevice } from "./adapter/webgl-device.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,YAAY,EAAC,iBAAiB,EAAC,wDAAqD;AAGpF,OAAO,EAAC,aAAa,EAAC,mCAAgC;AACtD,YAAY,EAAC,YAAY,EAAC,mCAAgC;AAG1D,OAAO,EAAC,WAAW,EAAC,kCAA+B;AACnD,OAAO,EAAC,kBAAkB,EAAC,0CAAuC;AAGlE,OAAO,EAAC,WAAW,EAAC,4CAAyC;AAC7D,OAAO,EAAC,YAAY,EAAC,6CAA0C;AAE/D,OAAO,EAAC,WAAW,EAAC,4CAAyC;AAC7D,OAAO,EAAC,YAAY,EAAC,6CAA0C;AAC/D,OAAO,EAAC,gBAAgB,EAAC,iDAA8C;AACvE,OAAO,EAAC,UAAU,EAAC,2CAAwC;AAE3D,OAAO,EAAC,mBAAmB,EAAC,qDAAkD;AAE9E,OAAO,EAAC,mBAAmB,EAAC,qDAAkD;AAC9E,OAAO,EAAC,eAAe,EAAC,iDAA8C;AAEtE,OAAO,EAAC,gBAAgB,EAAC,kDAA+C;AAGxE,OAAO,EAAC,sBAAsB,EAAC,wDAAqD;AAIpF,OAAO,EAAC,mBAAmB,EAAE,oBAAoB,EAAC,kDAA+C;AAGjG,OAAO,EAAC,uBAAuB,EAAC,yDAAsD;AACtF,OAAO,EAAC,iBAAiB,EAAC,uDAAoD;AAG9E,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,eAAe,EAChB,sDAAmD;AAEpD,OAAO,EAAC,gBAAgB,EAAC,mDAAgD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,YAAY,EAAC,iBAAiB,EAAC,wDAAqD;AACpF,OAAO,EAAC,EAAE,EAAC,uCAAoC;AAC/C,YAAY,EACV,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACb,UAAU,EACV,eAAe,EACf,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,iBAAiB,EAClB,mCAAgC;AAGjC,OAAO,EAAC,aAAa,EAAC,mCAAgC;AACtD,YAAY,EAAC,YAAY,EAAC,mCAAgC;AAG1D,OAAO,EAAC,WAAW,EAAC,kCAA+B;AACnD,OAAO,EAAC,kBAAkB,EAAC,0CAAuC;AAGlE,OAAO,EAAC,WAAW,EAAC,4CAAyC;AAC7D,OAAO,EAAC,YAAY,EAAC,6CAA0C;AAE/D,OAAO,EAAC,WAAW,EAAC,4CAAyC;AAC7D,OAAO,EAAC,YAAY,EAAC,6CAA0C;AAC/D,OAAO,EAAC,gBAAgB,EAAC,iDAA8C;AACvE,OAAO,EAAC,UAAU,EAAC,2CAAwC;AAE3D,OAAO,EAAC,mBAAmB,EAAC,qDAAkD;AAE9E,OAAO,EAAC,mBAAmB,EAAC,qDAAkD;AAC9E,OAAO,EAAC,eAAe,EAAC,iDAA8C;AAEtE,OAAO,EAAC,gBAAgB,EAAC,kDAA+C;AAGxE,OAAO,EAAC,sBAAsB,EAAC,wDAAqD;AAIpF,OAAO,EAAC,mBAAmB,EAAE,oBAAoB,EAAC,kDAA+C;AAGjG,OAAO,EAAC,uBAAuB,EAAC,yDAAsD;AACtF,OAAO,EAAC,iBAAiB,EAAC,uDAAoD;AAG9E,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,eAAe,EAChB,sDAAmD;AAEpD,OAAO,EAAC,gBAAgB,EAAC,mDAAgD"}
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // luma.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
+ export { GL } from "./constants/webgl-constants.js";
4
5
  // WebGL adapter classes
5
6
  export { webgl2Adapter } from "./adapter/webgl-adapter.js";
6
7
  // WebGL Device classes
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAWpC,wBAAwB;AACxB,OAAO,EAAC,aAAa,EAAC,mCAAgC;AAGtD,uBAAuB;AACvB,OAAO,EAAC,WAAW,EAAC,kCAA+B;AACnD,OAAO,EAAC,kBAAkB,EAAC,0CAAuC;AAElE,yBAAyB;AACzB,OAAO,EAAC,WAAW,EAAC,4CAAyC;AAC7D,OAAO,EAAC,YAAY,EAAC,6CAA0C;AAC/D,mFAAmF;AACnF,OAAO,EAAC,WAAW,EAAC,4CAAyC;AAC7D,OAAO,EAAC,YAAY,EAAC,6CAA0C;AAC/D,OAAO,EAAC,gBAAgB,EAAC,iDAA8C;AACvE,OAAO,EAAC,UAAU,EAAC,2CAAwC;AAE3D,OAAO,EAAC,mBAAmB,EAAC,qDAAkD;AAC9E,mFAAmF;AACnF,OAAO,EAAC,mBAAmB,EAAC,qDAAkD;AAC9E,OAAO,EAAC,eAAe,EAAC,iDAA8C;AACtE,2EAA2E;AAC3E,OAAO,EAAC,gBAAgB,EAAC,kDAA+C;AAExE,wBAAwB;AACxB,OAAO,EAAC,sBAAsB,EAAC,wDAAqD;AAEpF,wBAAwB;AAExB,OAAO,EAAC,mBAAmB,EAAE,oBAAoB,EAAC,kDAA+C;AAEjG,yBAAyB;AACzB,OAAO,EAAC,uBAAuB,EAAC,yDAAsD;AACtF,OAAO,EAAC,iBAAiB,EAAC,uDAAoD;AAE9E,0BAA0B;AAC1B,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,eAAe,EAChB,sDAAmD;AAEpD,OAAO,EAAC,gBAAgB,EAAC,mDAAgD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAUpC,OAAO,EAAC,EAAE,EAAC,uCAAoC;AA2B/C,wBAAwB;AACxB,OAAO,EAAC,aAAa,EAAC,mCAAgC;AAGtD,uBAAuB;AACvB,OAAO,EAAC,WAAW,EAAC,kCAA+B;AACnD,OAAO,EAAC,kBAAkB,EAAC,0CAAuC;AAElE,yBAAyB;AACzB,OAAO,EAAC,WAAW,EAAC,4CAAyC;AAC7D,OAAO,EAAC,YAAY,EAAC,6CAA0C;AAC/D,mFAAmF;AACnF,OAAO,EAAC,WAAW,EAAC,4CAAyC;AAC7D,OAAO,EAAC,YAAY,EAAC,6CAA0C;AAC/D,OAAO,EAAC,gBAAgB,EAAC,iDAA8C;AACvE,OAAO,EAAC,UAAU,EAAC,2CAAwC;AAE3D,OAAO,EAAC,mBAAmB,EAAC,qDAAkD;AAC9E,mFAAmF;AACnF,OAAO,EAAC,mBAAmB,EAAC,qDAAkD;AAC9E,OAAO,EAAC,eAAe,EAAC,iDAA8C;AACtE,2EAA2E;AAC3E,OAAO,EAAC,gBAAgB,EAAC,kDAA+C;AAExE,wBAAwB;AACxB,OAAO,EAAC,sBAAsB,EAAC,wDAAqD;AAEpF,wBAAwB;AAExB,OAAO,EAAC,mBAAmB,EAAE,oBAAoB,EAAC,kDAA+C;AAEjG,yBAAyB;AACzB,OAAO,EAAC,uBAAuB,EAAC,yDAAsD;AACtF,OAAO,EAAC,iBAAiB,EAAC,uDAAoD;AAE9E,0BAA0B;AAC1B,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,eAAe,EAChB,sDAAmD;AAEpD,OAAO,EAAC,gBAAgB,EAAC,mDAAgD"}
@@ -0,0 +1,2 @@
1
+ export { GL } from "./constants/webgl-constants.js";
2
+ //# sourceMappingURL=webgl-constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgl-constants.d.ts","sourceRoot":"","sources":["../src/webgl-constants.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,EAAE,EAAC,uCAAoC"}
@@ -0,0 +1,5 @@
1
+ // luma.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // Copyright (c) vis.gl contributors
4
+ export { GL } from "./constants/webgl-constants.js";
5
+ //# sourceMappingURL=webgl-constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgl-constants.js","sourceRoot":"","sources":["../src/webgl-constants.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,EAAE,EAAC,uCAAoC"}
@@ -0,0 +1,2 @@
1
+ export type { GLTextureTarget, GLTextureCubeMapTarget, GLTexelDataFormat, GLPrimitiveTopology, GLPrimitive, GLDataType, GLPixelType, GLUniformType, GLSamplerType, GLFunction, GLBlendEquation, GLBlendFunction, GLStencilOp, GLSamplerParameters, GLValueParameters, GLPackParameters, GLUnpackParameters, GLFunctionParameters, GLParameters, GLLimits, GLExtensions, GLPolygonMode, GLProvokingVertex } from "./constants/webgl-types.js";
2
+ //# sourceMappingURL=webgl-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgl-types.d.ts","sourceRoot":"","sources":["../src/webgl-types.ts"],"names":[],"mappings":"AAIA,YAAY,EACV,eAAe,EACf,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,UAAU,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACb,UAAU,EACV,eAAe,EACf,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,iBAAiB,EAClB,mCAAgC"}
@@ -2,4 +2,4 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
  export {};
5
- //# sourceMappingURL=types.js.map
5
+ //# sourceMappingURL=webgl-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webgl-types.js","sourceRoot":"","sources":["../src/webgl-types.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luma.gl/webgl",
3
- "version": "9.3.0-alpha.6",
3
+ "version": "9.3.0-alpha.9",
4
4
  "description": "WebGL2 adapter for the luma.gl core API",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -25,6 +25,21 @@
25
25
  "types": "./dist/index.d.ts",
26
26
  "import": "./dist/index.js",
27
27
  "require": "./dist/index.cjs"
28
+ },
29
+ "./constants": {
30
+ "types": "./dist/constants/index.d.ts",
31
+ "import": "./dist/constants/index.js",
32
+ "require": "./dist/index.cjs"
33
+ },
34
+ "./webgl-constants": {
35
+ "types": "./dist/webgl-constants.d.ts",
36
+ "import": "./dist/webgl-constants.js",
37
+ "require": "./dist/index.cjs"
38
+ },
39
+ "./webgl-types": {
40
+ "types": "./dist/webgl-types.d.ts",
41
+ "import": "./dist/webgl-types.js",
42
+ "require": "./dist/index.cjs"
28
43
  }
29
44
  },
30
45
  "files": [
@@ -40,12 +55,11 @@
40
55
  "prepublishOnly": "npm run build-minified-bundle && npm run build-dev-bundle"
41
56
  },
42
57
  "peerDependencies": {
43
- "@luma.gl/core": "9.2.0-alpha.6"
58
+ "@luma.gl/core": "9.3.0-alpha.6"
44
59
  },
45
60
  "dependencies": {
46
- "@luma.gl/constants": "9.3.0-alpha.6",
47
61
  "@math.gl/types": "^4.1.0",
48
62
  "@probe.gl/env": "^4.1.1"
49
63
  },
50
- "gitHead": "59fda5480c4d0bb3d64545d4621175221f2b6c7c"
64
+ "gitHead": "737b0f752b3f8a6ae920b394d5ca028427275b37"
51
65
  }
@@ -4,7 +4,7 @@
4
4
 
5
5
  import type {CompareFunction, StencilOperation, BlendOperation, BlendFactor} from '@luma.gl/core';
6
6
  import {Device, log, Parameters, PolygonMode, ProvokingVertex} from '@luma.gl/core';
7
- import {GL} from '@luma.gl/constants';
7
+ import {GL} from '@luma.gl/webgl/constants';
8
8
  import type {
9
9
  GLBlendEquation,
10
10
  GLBlendFunction,
@@ -13,7 +13,7 @@ import type {
13
13
  GLPolygonMode,
14
14
  GLProvokingVertex,
15
15
  GLStencilOp
16
- } from '@luma.gl/constants';
16
+ } from '@luma.gl/webgl/constants';
17
17
  import {setGLParameters} from '../../context/parameters/unified-parameter-api';
18
18
  import {WebGLDevice} from '../webgl-device';
19
19
 
@@ -232,6 +232,10 @@ export function setDeviceParameters(device: Device, parameters: Parameters) {
232
232
  gl.depthFunc(convertCompareFunction('depthCompare', parameters.depthCompare));
233
233
  }
234
234
 
235
+ if (parameters.clearDepth !== undefined) {
236
+ gl.clearDepth(parameters.clearDepth);
237
+ }
238
+
235
239
  if (parameters.stencilWriteMask) {
236
240
  const mask = parameters.stencilWriteMask;
237
241
  gl.stencilMaskSeparate(GL.FRONT, mask);
@@ -4,7 +4,7 @@
4
4
 
5
5
  // SAMPLER FILTERS
6
6
  import {SamplerProps} from '@luma.gl/core';
7
- import {GL, GLSamplerParameters} from '@luma.gl/constants';
7
+ import {GL, GLSamplerParameters} from '@luma.gl/webgl/constants';
8
8
  import {convertCompareFunction} from './device-parameters';
9
9
 
10
10
  /**
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {GL, GLDataType, GLPixelType} from '@luma.gl/constants';
5
+ import {GL, GLDataType, GLPixelType} from '@luma.gl/webgl/constants';
6
6
  import {SignedDataType} from '@luma.gl/core';
7
7
 
8
8
  /** Get shadertypes data type from GL constants */
@@ -28,68 +28,3 @@ const GL_DATA_TYPE_MAP: Record<GLDataType | GLPixelType, SignedDataType> = {
28
28
  [GL.UNSIGNED_INT_24_8]: 'uint32',
29
29
  [GL.FLOAT_32_UNSIGNED_INT_24_8_REV]: 'uint32'
30
30
  };
31
-
32
- /** Get shader data type from GL constants *
33
- export function getPrimitiveTypeFromGL(type: GL): PrimitiveDataType {
34
- switch (type) {
35
- case GL.INT:
36
- return 'i32';
37
- case GL.UNSIGNED_INT:
38
- return 'u32';
39
- case GL.SHORT:
40
- return 'i32';
41
- case GL.UNSIGNED_SHORT:
42
- return 'u32';
43
- case GL.BYTE:
44
- return 'i32';
45
- case GL.UNSIGNED_BYTE:
46
- return 'u32';
47
- case GL.FLOAT:
48
- return 'f32';
49
- case GL.HALF_FLOAT:
50
- return 'f16';
51
- default:
52
- throw new Error(String(type));
53
- }
54
- }
55
-
56
- /** Get shader attribute type from GL constants *
57
- export function getShaderAttributeTypeFromGL(
58
- type: GL,
59
- components: 1 | 2 | 3 | 4
60
- ): AttributeShaderType {
61
- const dataType = getPrimitiveTypeFromGL(type);
62
- switch (components) {
63
- case 1:
64
- return dataType;
65
- case 2:
66
- return `vec2<${dataType}>`;
67
- case 3:
68
- return `vec2<${dataType}>`;
69
- case 4:
70
- return `vec2<${dataType}>`;
71
- default:
72
- throw new Error(String(components));
73
- }
74
- }
75
- */
76
-
77
- /** GetGL constant from shader data type
78
- export function getGLFromShaderDataType(
79
- type: PrimitiveDataType
80
- ): GL.INT | GL.UNSIGNED_INT | GL.FLOAT | GL.HALF_FLOAT {
81
- switch (type) {
82
- // TODO
83
- case 'i32':
84
- return GL.INT;
85
- case 'u32':
86
- return GL.UNSIGNED_INT;
87
- case 'f32':
88
- return GL.FLOAT;
89
- case 'f16':
90
- return GL.HALF_FLOAT;
91
- default:
92
- throw new Error(String(type));
93
- }
94
- }
95
- */
@@ -3,7 +3,7 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
5
  import {VariableShaderType, SignedDataType, VertexFormat, NormalizedDataType} from '@luma.gl/core';
6
- import {GL, GLUniformType, GLSamplerType, GLDataType} from '@luma.gl/constants';
6
+ import {GL, GLUniformType, GLSamplerType, GLDataType} from '@luma.gl/webgl/constants';
7
7
 
8
8
  export type TextureBindingInfo = {
9
9
  viewDimension: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';
@@ -15,14 +15,6 @@ export function convertDataTypeToGLDataType(normalizedType: NormalizedDataType):
15
15
  return NORMALIZED_SHADER_TYPE_TO_WEBGL[normalizedType];
16
16
  }
17
17
 
18
- /** Converts to a luma shadertype to a GL data type (GL.BYTE, GL.FLOAT32 etc) */
19
- export function convertShaderVariableTypeToGLDataType(
20
- normalizedType: VariableShaderType
21
- ): GLDataType {
22
- // @ts-ignore TODO
23
- return NORMALIZED_SHADER_TYPE_TO_WEBGL[normalizedType];
24
- }
25
-
26
18
  /** Convert a WebGL "compisite type (e.g. GL.VEC3) into the corresponding luma shader uniform type */
27
19
  export function convertGLUniformTypeToShaderVariableType(
28
20
  glUniformType: GLUniformType
@@ -9,7 +9,7 @@ import type {
9
9
  DeviceTextureFormatCapabilities
10
10
  } from '@luma.gl/core';
11
11
  import {textureFormatDecoder} from '@luma.gl/core';
12
- import {GL, GLPixelType, GLExtensions, GLTexelDataFormat} from '@luma.gl/constants';
12
+ import {GL, GLPixelType, GLExtensions, GLTexelDataFormat} from '@luma.gl/webgl/constants';
13
13
  import {getWebGLExtension} from '../../context/helpers/webgl-extensions';
14
14
  import {getGLFromVertexType} from './webgl-vertex-formats';
15
15
 
@@ -312,26 +312,6 @@ export const WEBGL_TEXTURE_FORMATS: Record<TextureFormat, WebGLFormatInfo> = {
312
312
 
313
313
  // FUNCTIONS
314
314
 
315
- /** Checks if a texture format is supported */
316
- export function isWebGLTextureFormatCapabilitiesed(
317
- gl: WebGL2RenderingContext,
318
- format: TextureFormat,
319
- extensions: GLExtensions
320
- ): boolean {
321
- const webglTextureInfo = WEBGL_TEXTURE_FORMATS[format];
322
- // Check that we have a GL constant
323
- if (!webglTextureInfo?.gl) {
324
- return false;
325
- }
326
-
327
- // Check extensions
328
- const extension = webglTextureInfo.x;
329
- if (extension) {
330
- return Boolean(getWebGLExtension(gl, extension, extensions));
331
- }
332
- return true;
333
- }
334
-
335
315
  /** Checks if a texture format is supported, renderable, filterable etc */
336
316
  export function getTextureFormatCapabilitiesWebGL(
337
317
  gl: WebGL2RenderingContext,
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {GL} from '@luma.gl/constants';
5
+ import {GL} from '@luma.gl/webgl/constants';
6
6
  import {VertexFormat, NormalizedDataType} from '@luma.gl/core';
7
7
 
8
8
  type GLDataType =
@@ -6,7 +6,7 @@
6
6
  // Provides a function that enables simple checking of which WebGL features are
7
7
 
8
8
  import {DeviceFeature, DeviceFeatures} from '@luma.gl/core';
9
- import {GLExtensions} from '@luma.gl/constants';
9
+ import {GLExtensions} from '@luma.gl/webgl/constants';
10
10
  import {getWebGLExtension} from '../../context/helpers/webgl-extensions';
11
11
  import {
12
12
  isTextureFeature,
@@ -3,7 +3,7 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
5
  import {DeviceInfo} from '@luma.gl/core';
6
- import {GL, GLExtensions} from '@luma.gl/constants';
6
+ import {GL, GLExtensions} from '@luma.gl/webgl/constants';
7
7
  import {getWebGLExtension} from '../../context/helpers/webgl-extensions';
8
8
 
9
9
  /** @returns strings identifying the GPU vendor and driver. */
@@ -3,7 +3,7 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
5
  import {DeviceLimits} from '@luma.gl/core';
6
- import {GL} from '@luma.gl/constants';
6
+ import {GL} from '@luma.gl/webgl/constants';
7
7
 
8
8
  // prettier-ignore
9
9
  export class WebGLDeviceLimits extends DeviceLimits {
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {GL} from '@luma.gl/constants';
5
+ import {GL} from '@luma.gl/webgl/constants';
6
6
 
7
7
  // Returns number of components in a specific readPixels WebGL format
8
8
  export function glFormatToComponents(format: GL): 0 | 1 | 2 | 3 | 4 {
@@ -10,9 +10,9 @@ import type {
10
10
  VaryingBinding,
11
11
  AttributeShaderType
12
12
  } from '@luma.gl/core';
13
- import {getVariableShaderTypeInfo, assertDefined} from '@luma.gl/core';
13
+ import {getVariableShaderTypeInfo, assertDefined, log} from '@luma.gl/core';
14
14
 
15
- import {GL, GLUniformType} from '@luma.gl/constants';
15
+ import {GL, GLUniformType} from '@luma.gl/webgl/constants';
16
16
  import {
17
17
  isGLSamplerType,
18
18
  getTextureBindingFromGLSamplerType,
@@ -274,6 +274,25 @@ function readUniformBlocks(
274
274
  }
275
275
  }
276
276
 
277
+ const uniformInstancePrefixes = new Set(
278
+ blockInfo.uniforms
279
+ .map(uniform => uniform.name.split('.')[0])
280
+ .filter((instanceName): instanceName is string => Boolean(instanceName))
281
+ );
282
+ const blockAlias = blockInfo.name.replace(/Uniforms$/, '');
283
+ if (
284
+ uniformInstancePrefixes.size === 1 &&
285
+ !uniformInstancePrefixes.has(blockInfo.name) &&
286
+ !uniformInstancePrefixes.has(blockAlias)
287
+ ) {
288
+ const [instanceName] = uniformInstancePrefixes;
289
+ log.warn(
290
+ `Uniform block "${blockInfo.name}" uses GLSL instance "${instanceName}". ` +
291
+ `luma.gl binds uniform buffers by block name ("${blockInfo.name}") and alias ("${blockAlias}"). ` +
292
+ 'Prefer matching the instance name to one of those to avoid confusing silent mismatches.'
293
+ )();
294
+ }
295
+
277
296
  uniformBlocks.push(blockInfo);
278
297
  }
279
298
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  // Uniforms
8
8
  import type {UniformValue} from '@luma.gl/core';
9
- import {GL, GLUniformType, GLSamplerType} from '@luma.gl/constants';
9
+ import {GL, GLUniformType, GLSamplerType} from '@luma.gl/webgl/constants';
10
10
 
11
11
  /** Set a raw uniform (without type conversion and caching) */
12
12
  /* eslint-disable max-len */
@@ -5,7 +5,7 @@
5
5
  // @ts-nocheck This file will be deleted in upcoming refactor
6
6
 
7
7
  import type {Buffer, Texture, FramebufferProps} from '@luma.gl/core';
8
- import {Framebuffer, getTypedArrayConstructor, getDataType} from '@luma.gl/core';
8
+ import {Framebuffer, dataTypeDecoder} from '@luma.gl/core';
9
9
  import {
10
10
  GL,
11
11
  GLTextureTarget,
@@ -13,7 +13,7 @@ import {
13
13
  GLTexelDataFormat,
14
14
  GLPixelType,
15
15
  GLDataType
16
- } from '@luma.gl/constants';
16
+ } from '@luma.gl/webgl/constants';
17
17
 
18
18
  import {convertDataTypeToGLDataType} from '../converters/webgl-shadertypes';
19
19
  import {WEBGLFramebuffer} from '../resources/webgl-framebuffer';
@@ -232,7 +232,7 @@ export function readPixelsToArray(
232
232
  target = getPixelArray(target, sourceType, sourceFormat, sourceWidth, sourceHeight, sourceDepth);
233
233
 
234
234
  // Pixel array available, if necessary, deduce type from it.
235
- const signedType = getDataType(target);
235
+ const signedType = dataTypeDecoder.getDataType(target);
236
236
  sourceType = sourceType || convertDataTypeToGLDataType(signedType);
237
237
 
238
238
  // Note: luma.gl overrides bindFramebuffer so that we can reliably restore the previous framebuffer (this is the only function for which we do that)
@@ -484,7 +484,7 @@ function getPixelArray(
484
484
  // Allocate pixel array if not already available, using supplied type
485
485
  glType ||= GL.UNSIGNED_BYTE;
486
486
  const shaderType = convertGLDataTypeToDataType(glType);
487
- const ArrayType = getTypedArrayConstructor(shaderType);
487
+ const ArrayType = dataTypeDecoder.getTypedArrayConstructor(shaderType);
488
488
  const components = glFormatToComponents(glFormat);
489
489
  // TODO - check for composite type (components = 1).
490
490
  return new ArrayType(width * height * components) as Uint8Array | Uint16Array | Float32Array;
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- import {GL, GLPrimitiveTopology, GLPrimitive} from '@luma.gl/constants';
5
+ import {GL, GLPrimitiveTopology, GLPrimitive} from '@luma.gl/webgl/constants';
6
6
  import {PrimitiveTopology} from '@luma.gl/core';
7
7
 
8
8
  // Counts the number of complete primitives given a number of vertices and a drawMode
@@ -4,7 +4,7 @@
4
4
 
5
5
  import type {BufferMapCallback, BufferProps} from '@luma.gl/core';
6
6
  import {Buffer} from '@luma.gl/core';
7
- import {GL} from '@luma.gl/constants';
7
+ import {GL} from '@luma.gl/webgl/constants';
8
8
  import {WebGLDevice} from '../webgl-device';
9
9
 
10
10
  /** WebGL Buffer interface */
@@ -8,20 +8,20 @@ import {
8
8
  type CopyBufferToTextureOptions,
9
9
  type CopyTextureToBufferOptions,
10
10
  type CopyTextureToTextureOptions,
11
+ type TextureReadOptions,
11
12
  // type ClearTextureOptions,
12
- // type TextureReadOptions
13
13
  CommandBuffer,
14
14
  Texture,
15
15
  Framebuffer,
16
16
  assertDefined
17
17
  } from '@luma.gl/core';
18
- import {GL, type GLTextureTarget, type GLTextureCubeMapTarget} from '@luma.gl/constants';
18
+ import {GL, type GLTextureTarget, type GLTextureCubeMapTarget} from '@luma.gl/webgl/constants';
19
19
 
20
+ import {getTextureFormatWebGL} from '../converters/webgl-texture-table';
20
21
  import {WebGLDevice} from '../webgl-device';
21
22
  import {WEBGLBuffer} from './webgl-buffer';
22
23
  import {WEBGLTexture} from './webgl-texture';
23
24
  import {WEBGLFramebuffer} from './webgl-framebuffer';
24
- import {getTextureFormatWebGL} from '../converters/webgl-texture-table';
25
25
 
26
26
  type CopyBufferToBufferCommand = {
27
27
  name: 'copy-buffer-to-buffer';
@@ -119,8 +119,8 @@ function _copyBufferToBuffer(device: WebGLDevice, options: CopyBufferToBufferOpt
119
119
  * Copies data from a Buffer object into a Texture object
120
120
  * NOTE: doesn't wait for copy to be complete
121
121
  */
122
- function _copyBufferToTexture(device: WebGLDevice, options: CopyBufferToTextureOptions): void {
123
- throw new Error('Not implemented');
122
+ function _copyBufferToTexture(_device: WebGLDevice, _options: CopyBufferToTextureOptions): void {
123
+ throw new Error('copyBufferToTexture is not supported in WebGL');
124
124
  }
125
125
 
126
126
  /**
@@ -129,45 +129,44 @@ function _copyBufferToTexture(device: WebGLDevice, options: CopyBufferToTextureO
129
129
  */
130
130
  function _copyTextureToBuffer(device: WebGLDevice, options: CopyTextureToBufferOptions): void {
131
131
  const {
132
- /** Texture to copy to/from. */
133
132
  sourceTexture,
134
- /** Mip-map level of the texture to copy to/from. (Default 0) */
135
133
  mipLevel = 0,
136
- /** Defines which aspects of the texture to copy to/from. */
137
134
  aspect = 'all',
138
-
139
- /** Width to copy */
140
135
  width = options.sourceTexture.width,
141
- /** Height to copy */
142
136
  height = options.sourceTexture.height,
143
- depthOrArrayLayers = 0,
144
- /** Defines the origin of the copy - the minimum corner of the texture sub-region to copy to/from. */
137
+ depthOrArrayLayers,
145
138
  origin = [0, 0, 0],
146
-
147
- /** Destination buffer */
148
139
  destinationBuffer,
149
- /** Offset, in bytes, from the beginning of the buffer to the start of the image data (default 0) */
150
140
  byteOffset = 0,
151
- /**
152
- * The stride, in bytes, between the beginning of each block row and the subsequent block row.
153
- * Required if there are multiple block rows (i.e. the copy height or depth is more than one block).
154
- */
155
141
  bytesPerRow,
156
- /**
157
- * Number of block rows per single image of the texture.
158
- * rowsPerImage &times; bytesPerRow is the stride, in bytes, between the beginning of each image of data and the subsequent image.
159
- * Required if there are multiple images (i.e. the copy depth is more than one).
160
- */
161
142
  rowsPerImage
162
143
  } = options;
163
144
 
145
+ if (sourceTexture instanceof Texture) {
146
+ sourceTexture.readBuffer(
147
+ {
148
+ x: origin[0] ?? 0,
149
+ y: origin[1] ?? 0,
150
+ z: origin[2] ?? 0,
151
+ width,
152
+ height,
153
+ depthOrArrayLayers,
154
+ mipLevel,
155
+ aspect,
156
+ byteOffset
157
+ } as TextureReadOptions & {byteOffset?: number},
158
+ destinationBuffer
159
+ );
160
+ return;
161
+ }
162
+
164
163
  // TODO - Not possible to read just stencil or depth part in WebGL?
165
164
  if (aspect !== 'all') {
166
165
  throw new Error('aspect not supported in WebGL');
167
166
  }
168
167
 
169
168
  // TODO - mipLevels are set when attaching texture to framebuffer
170
- if (mipLevel !== 0 || depthOrArrayLayers !== 0 || bytesPerRow || rowsPerImage) {
169
+ if (mipLevel !== 0 || depthOrArrayLayers !== undefined || bytesPerRow || rowsPerImage) {
171
170
  throw new Error('not implemented');
172
171
  }
173
172
 
@@ -83,14 +83,16 @@ export class WEBGLCommandEncoder extends CommandEncoder {
83
83
  override insertDebugMarker(markerLabel: string): void {}
84
84
 
85
85
  override resolveQuerySet(
86
- querySet: QuerySet,
87
- destination: Buffer,
88
- options?: {
86
+ _querySet: QuerySet,
87
+ _destination: Buffer,
88
+ _options?: {
89
89
  firstQuery?: number;
90
90
  queryCount?: number;
91
91
  destinationOffset?: number;
92
92
  }
93
- ): void {}
93
+ ): void {
94
+ throw new Error('resolveQuerySet is not supported in WebGL');
95
+ }
94
96
 
95
97
  writeTimestamp(querySet: QuerySet, queryIndex: number): void {
96
98
  const webglQuerySet = querySet as WEBGLQuerySet;
@@ -4,7 +4,7 @@
4
4
 
5
5
  import type {FramebufferProps} from '@luma.gl/core';
6
6
  import {Framebuffer} from '@luma.gl/core';
7
- import {GL} from '@luma.gl/constants';
7
+ import {GL} from '@luma.gl/webgl/constants';
8
8
  import {WebGLDevice} from '../webgl-device';
9
9
  import {WEBGLTexture} from './webgl-texture';
10
10
  import {WEBGLTextureView} from './webgl-texture-view';
@@ -137,6 +137,17 @@ export class WEBGLFramebuffer extends Framebuffer {
137
137
 
138
138
  gl.bindTexture(texture.glTarget, null);
139
139
  }
140
+
141
+ /** Default framebuffer resize is managed by canvas size and should be a no-op. */
142
+ protected override resizeAttachments(width: number, height: number): void {
143
+ if (this.handle === null) {
144
+ this.width = width;
145
+ this.height = height;
146
+ return;
147
+ }
148
+
149
+ super.resizeAttachments(width, height);
150
+ }
140
151
  }
141
152
 
142
153
  // Helper functions