@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.
- package/dist/adapter/converters/device-parameters.d.ts +1 -1
- package/dist/adapter/converters/device-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/device-parameters.js +4 -1
- package/dist/adapter/converters/device-parameters.js.map +1 -1
- package/dist/adapter/converters/sampler-parameters.d.ts +1 -1
- package/dist/adapter/converters/sampler-parameters.d.ts.map +1 -1
- package/dist/adapter/converters/sampler-parameters.js +1 -1
- package/dist/adapter/converters/sampler-parameters.js.map +1 -1
- package/dist/adapter/converters/shader-formats.d.ts +1 -64
- package/dist/adapter/converters/shader-formats.d.ts.map +1 -1
- package/dist/adapter/converters/shader-formats.js +1 -64
- package/dist/adapter/converters/shader-formats.js.map +1 -1
- package/dist/adapter/converters/webgl-shadertypes.d.ts +1 -3
- package/dist/adapter/converters/webgl-shadertypes.d.ts.map +1 -1
- package/dist/adapter/converters/webgl-shadertypes.js +1 -6
- package/dist/adapter/converters/webgl-shadertypes.js.map +1 -1
- package/dist/adapter/converters/webgl-texture-table.d.ts +1 -3
- package/dist/adapter/converters/webgl-texture-table.d.ts.map +1 -1
- package/dist/adapter/converters/webgl-texture-table.js +1 -15
- package/dist/adapter/converters/webgl-texture-table.js.map +1 -1
- package/dist/adapter/converters/webgl-vertex-formats.d.ts +1 -1
- package/dist/adapter/converters/webgl-vertex-formats.d.ts.map +1 -1
- package/dist/adapter/converters/webgl-vertex-formats.js +1 -1
- package/dist/adapter/converters/webgl-vertex-formats.js.map +1 -1
- package/dist/adapter/device-helpers/webgl-device-features.d.ts +1 -1
- package/dist/adapter/device-helpers/webgl-device-features.d.ts.map +1 -1
- package/dist/adapter/device-helpers/webgl-device-info.d.ts +1 -1
- package/dist/adapter/device-helpers/webgl-device-info.d.ts.map +1 -1
- package/dist/adapter/device-helpers/webgl-device-info.js +1 -1
- package/dist/adapter/device-helpers/webgl-device-info.js.map +1 -1
- package/dist/adapter/device-helpers/webgl-device-limits.d.ts +1 -1
- package/dist/adapter/device-helpers/webgl-device-limits.d.ts.map +1 -1
- package/dist/adapter/device-helpers/webgl-device-limits.js +1 -1
- package/dist/adapter/device-helpers/webgl-device-limits.js.map +1 -1
- package/dist/adapter/helpers/format-utils.d.ts +1 -1
- package/dist/adapter/helpers/format-utils.d.ts.map +1 -1
- package/dist/adapter/helpers/format-utils.js +1 -1
- package/dist/adapter/helpers/format-utils.js.map +1 -1
- package/dist/adapter/helpers/get-shader-layout-from-glsl.js +14 -2
- package/dist/adapter/helpers/get-shader-layout-from-glsl.js.map +1 -1
- package/dist/adapter/helpers/set-uniform.d.ts +1 -1
- package/dist/adapter/helpers/set-uniform.d.ts.map +1 -1
- package/dist/adapter/helpers/set-uniform.js +1 -1
- package/dist/adapter/helpers/set-uniform.js.map +1 -1
- package/dist/adapter/helpers/webgl-texture-utils.d.ts +1 -1
- package/dist/adapter/helpers/webgl-texture-utils.d.ts.map +1 -1
- package/dist/adapter/helpers/webgl-texture-utils.js +4 -4
- package/dist/adapter/helpers/webgl-texture-utils.js.map +1 -1
- package/dist/adapter/helpers/webgl-topology-utils.d.ts +1 -1
- package/dist/adapter/helpers/webgl-topology-utils.d.ts.map +1 -1
- package/dist/adapter/helpers/webgl-topology-utils.js +1 -1
- package/dist/adapter/helpers/webgl-topology-utils.js.map +1 -1
- package/dist/adapter/resources/webgl-buffer.d.ts +1 -1
- package/dist/adapter/resources/webgl-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-buffer.js +1 -1
- package/dist/adapter/resources/webgl-buffer.js.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.d.ts +1 -1
- package/dist/adapter/resources/webgl-command-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-command-buffer.js +20 -34
- package/dist/adapter/resources/webgl-command-buffer.js.map +1 -1
- package/dist/adapter/resources/webgl-command-encoder.d.ts +1 -1
- package/dist/adapter/resources/webgl-command-encoder.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-command-encoder.js +3 -1
- package/dist/adapter/resources/webgl-command-encoder.js.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.d.ts +3 -1
- package/dist/adapter/resources/webgl-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-framebuffer.js +10 -1
- package/dist/adapter/resources/webgl-framebuffer.js.map +1 -1
- package/dist/adapter/resources/webgl-query-set.d.ts +8 -0
- package/dist/adapter/resources/webgl-query-set.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-query-set.js +59 -4
- package/dist/adapter/resources/webgl-query-set.js.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.d.ts +1 -1
- package/dist/adapter/resources/webgl-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pass.js +13 -11
- package/dist/adapter/resources/webgl-render-pass.js.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.d.ts +8 -6
- package/dist/adapter/resources/webgl-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-render-pipeline.js +39 -20
- package/dist/adapter/resources/webgl-render-pipeline.js.map +1 -1
- package/dist/adapter/resources/webgl-sampler.d.ts +1 -1
- package/dist/adapter/resources/webgl-sampler.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-sampler.js +1 -1
- package/dist/adapter/resources/webgl-sampler.js.map +1 -1
- package/dist/adapter/resources/webgl-shader.d.ts +1 -1
- package/dist/adapter/resources/webgl-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-shader.js +15 -8
- package/dist/adapter/resources/webgl-shader.js.map +1 -1
- package/dist/adapter/resources/webgl-shared-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-shared-render-pipeline.js +4 -1
- package/dist/adapter/resources/webgl-shared-render-pipeline.js.map +1 -1
- package/dist/adapter/resources/webgl-texture.d.ts +4 -2
- package/dist/adapter/resources/webgl-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-texture.js +12 -17
- package/dist/adapter/resources/webgl-texture.js.map +1 -1
- package/dist/adapter/resources/webgl-transform-feedback.js +1 -1
- package/dist/adapter/resources/webgl-transform-feedback.js.map +1 -1
- package/dist/adapter/resources/webgl-vertex-array.d.ts +2 -2
- package/dist/adapter/resources/webgl-vertex-array.d.ts.map +1 -1
- package/dist/adapter/resources/webgl-vertex-array.js +1 -1
- package/dist/adapter/resources/webgl-vertex-array.js.map +1 -1
- package/dist/adapter/webgl-device.d.ts +2 -1
- package/dist/adapter/webgl-device.d.ts.map +1 -1
- package/dist/adapter/webgl-device.js +11 -7
- package/dist/adapter/webgl-device.js.map +1 -1
- package/dist/constants/index.d.ts +3 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +5 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/webgl-constants.d.ts +822 -0
- package/dist/constants/webgl-constants.d.ts.map +1 -0
- package/dist/constants/webgl-constants.js +928 -0
- package/dist/constants/webgl-constants.js.map +1 -0
- package/dist/constants/webgl-types.d.ts +480 -0
- package/dist/constants/webgl-types.d.ts.map +1 -0
- package/dist/constants/webgl-types.js +6 -0
- package/dist/constants/webgl-types.js.map +1 -0
- package/dist/context/debug/webgl-developer-tools.js +1 -1
- package/dist/context/debug/webgl-developer-tools.js.map +1 -1
- package/dist/context/helpers/webgl-context-data.d.ts +1 -1
- package/dist/context/helpers/webgl-context-data.d.ts.map +1 -1
- package/dist/context/helpers/webgl-extensions.d.ts +1 -1
- package/dist/context/helpers/webgl-extensions.d.ts.map +1 -1
- package/dist/context/parameters/unified-parameter-api.d.ts +1 -1
- package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.d.ts +1 -1
- package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -1
- package/dist/context/parameters/webgl-parameter-tables.js +1 -1
- package/dist/context/parameters/webgl-parameter-tables.js.map +1 -1
- package/dist/context/polyfills/polyfill-webgl1-extensions.js +1 -1
- package/dist/context/polyfills/polyfill-webgl1-extensions.js.map +1 -1
- package/dist/dist.dev.js +267 -162
- package/dist/dist.min.js +2 -2
- package/dist/index.cjs +3 -5941
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/webgl-constants.d.ts +2 -0
- package/dist/webgl-constants.d.ts.map +1 -0
- package/dist/webgl-constants.js +5 -0
- package/dist/webgl-constants.js.map +1 -0
- package/dist/webgl-types.d.ts +2 -0
- package/dist/webgl-types.d.ts.map +1 -0
- package/dist/{types.js → webgl-types.js} +1 -1
- package/dist/webgl-types.js.map +1 -0
- package/package.json +18 -4
- package/src/adapter/converters/device-parameters.ts +6 -2
- package/src/adapter/converters/sampler-parameters.ts +1 -1
- package/src/adapter/converters/shader-formats.ts +1 -66
- package/src/adapter/converters/webgl-shadertypes.ts +1 -9
- package/src/adapter/converters/webgl-texture-table.ts +1 -21
- package/src/adapter/converters/webgl-vertex-formats.ts +1 -1
- package/src/adapter/device-helpers/webgl-device-features.ts +1 -1
- package/src/adapter/device-helpers/webgl-device-info.ts +1 -1
- package/src/adapter/device-helpers/webgl-device-limits.ts +1 -1
- package/src/adapter/helpers/format-utils.ts +1 -1
- package/src/adapter/helpers/get-shader-layout-from-glsl.ts +21 -2
- package/src/adapter/helpers/set-uniform.ts +1 -1
- package/src/adapter/helpers/webgl-texture-utils.ts +4 -4
- package/src/adapter/helpers/webgl-topology-utils.ts +1 -1
- package/src/adapter/resources/webgl-buffer.ts +1 -1
- package/src/adapter/resources/webgl-command-buffer.ts +25 -26
- package/src/adapter/resources/webgl-command-encoder.ts +6 -4
- package/src/adapter/resources/webgl-framebuffer.ts +12 -1
- package/src/adapter/resources/webgl-query-set.ts +71 -4
- package/src/adapter/resources/webgl-render-pass.ts +13 -13
- package/src/adapter/resources/webgl-render-pipeline.ts +65 -26
- package/src/adapter/resources/webgl-sampler.ts +1 -1
- package/src/adapter/resources/webgl-shader.ts +15 -8
- package/src/adapter/resources/webgl-shared-render-pipeline.ts +4 -1
- package/src/adapter/resources/webgl-texture.ts +15 -18
- package/src/adapter/resources/webgl-transform-feedback.ts +1 -1
- package/src/adapter/resources/webgl-vertex-array.ts +1 -1
- package/src/adapter/webgl-device.ts +16 -8
- package/src/constants/index.d.ts.map +1 -0
- package/src/constants/index.js.map +1 -0
- package/src/constants/index.ts +31 -0
- package/src/constants/webgl-constants.d.ts.map +1 -0
- package/src/constants/webgl-constants.js.map +1 -0
- package/src/constants/webgl-constants.ts +1051 -0
- package/src/constants/webgl-types.d.ts.map +1 -0
- package/src/constants/webgl-types.js.map +1 -0
- package/src/constants/webgl-types.ts +813 -0
- package/src/context/debug/webgl-developer-tools.ts +1 -1
- package/src/context/helpers/webgl-context-data.ts +1 -1
- package/src/context/helpers/webgl-extensions.ts +1 -1
- package/src/context/parameters/unified-parameter-api.ts +1 -1
- package/src/context/parameters/webgl-parameter-tables.ts +1 -1
- package/src/context/polyfills/polyfill-webgl1-extensions.ts +1 -1
- package/src/index.ts +26 -0
- package/src/webgl-constants.d.ts.map +1 -0
- package/src/webgl-constants.js.map +1 -0
- package/src/webgl-constants.ts +5 -0
- package/src/webgl-types.d.ts.map +1 -0
- package/src/webgl-types.js.map +1 -0
- package/src/webgl-types.ts +29 -0
- package/dist/types.d.ts +0 -11
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js.map +0 -1
- 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";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,YAAY,EAAC,iBAAiB,EAAC,wDAAqD;
|
|
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
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;
|
|
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 @@
|
|
|
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 @@
|
|
|
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"}
|
|
@@ -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.
|
|
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.
|
|
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": "
|
|
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,
|
|
@@ -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. */
|
|
@@ -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,
|
|
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(
|
|
123
|
-
throw new Error('
|
|
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
|
|
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 × 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 !==
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|