@luma.gl/webgl 8.6.0-alpha.1 → 8.6.0-alpha.2
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/api/device2.d.ts +52 -0
- package/dist/api/device2.d.ts.map +1 -0
- package/dist/api/device2.js +23 -0
- package/dist/api/device2.js.map +1 -0
- package/dist/classes/accessor.js +2 -2
- package/dist/classes/accessor.js.map +1 -1
- package/dist/classes/accessor.ts.disabled +1 -1
- package/dist/classes/clear.d.ts +3 -2
- package/dist/classes/clear.d.ts.map +1 -1
- package/dist/classes/clear.js +7 -4
- package/dist/classes/clear.js.map +1 -1
- package/dist/classes/copy-and-blit.d.ts +18 -1
- package/dist/classes/copy-and-blit.d.ts.map +1 -1
- package/dist/classes/copy-and-blit.js +30 -25
- package/dist/classes/copy-and-blit.js.map +1 -1
- package/dist/classes/framebuffer.d.ts +10 -1
- package/dist/classes/framebuffer.d.ts.map +1 -1
- package/dist/classes/framebuffer.js +15 -15
- package/dist/classes/framebuffer.js.map +1 -1
- package/dist/classes/program-configuration.d.ts +2 -2
- package/dist/classes/program-configuration.d.ts.map +1 -1
- package/dist/classes/program-configuration.js +1 -1
- package/dist/classes/program-configuration.js.map +1 -1
- package/dist/classes/program.d.ts +6 -6
- package/dist/classes/program.d.ts.map +1 -1
- package/dist/classes/program.js +11 -9
- package/dist/classes/program.js.map +1 -1
- package/dist/classes/query.d.ts.map +1 -1
- package/dist/classes/query.js +6 -5
- package/dist/classes/query.js.map +1 -1
- package/dist/classes/renderbuffer-formats.js +1 -1
- package/dist/classes/renderbuffer-formats.js.map +1 -1
- package/dist/classes/renderbuffer.d.ts.map +1 -1
- package/dist/classes/renderbuffer.js +4 -3
- package/dist/classes/renderbuffer.js.map +1 -1
- package/dist/classes/texture-2d.d.ts +4 -3
- package/dist/classes/texture-2d.d.ts.map +1 -1
- package/dist/classes/texture-2d.js +5 -8
- package/dist/classes/texture-2d.js.map +1 -1
- package/dist/classes/texture-3d.d.ts +3 -2
- package/dist/classes/texture-3d.d.ts.map +1 -1
- package/dist/classes/texture-3d.js +15 -6
- package/dist/classes/texture-3d.js.map +1 -1
- package/dist/classes/texture-cube.d.ts +2 -1
- package/dist/classes/texture-cube.d.ts.map +1 -1
- package/dist/classes/texture-cube.js +3 -4
- package/dist/classes/texture-cube.js.map +1 -1
- package/dist/classes/texture-formats.js +1 -1
- package/dist/classes/texture-formats.js.map +1 -1
- package/dist/classes/texture.d.ts +14 -9
- package/dist/classes/texture.d.ts.map +1 -1
- package/dist/classes/texture.js +19 -18
- package/dist/classes/texture.js.map +1 -1
- package/dist/classes/transform-feedback.d.ts.map +1 -1
- package/dist/classes/transform-feedback.js +5 -4
- package/dist/classes/transform-feedback.js.map +1 -1
- package/dist/classes/uniform-buffer-layout.js +1 -1
- package/dist/classes/uniform-buffer-layout.js.map +1 -1
- package/dist/classes/uniforms.d.ts +0 -1
- package/dist/classes/uniforms.d.ts.map +1 -1
- package/dist/classes/uniforms.js +1 -2
- package/dist/classes/uniforms.js.map +1 -1
- package/dist/classes/vertex-array-object.d.ts +1 -1
- package/dist/classes/vertex-array-object.d.ts.map +1 -1
- package/dist/classes/vertex-array-object.js +8 -9
- package/dist/classes/vertex-array-object.js.map +1 -1
- package/dist/classes/vertex-array.d.ts +1 -1
- package/dist/classes/vertex-array.d.ts.map +1 -1
- package/dist/classes/vertex-array.js +1 -2
- package/dist/classes/vertex-array.js.map +1 -1
- package/dist/classes/webgl-buffer.d.ts +2 -0
- package/dist/classes/webgl-buffer.d.ts.map +1 -1
- package/dist/classes/webgl-buffer.js +8 -5
- package/dist/classes/webgl-buffer.js.map +1 -1
- package/dist/classes/webgl-resource.d.ts +6 -4
- package/dist/classes/webgl-resource.d.ts.map +1 -1
- package/dist/classes/webgl-resource.js +12 -8
- package/dist/classes/webgl-resource.js.map +1 -1
- package/dist/classes/webgl-shader.d.ts +3 -1
- package/dist/classes/webgl-shader.d.ts.map +1 -1
- package/dist/classes/webgl-shader.js +7 -4
- package/dist/classes/webgl-shader.js.map +1 -1
- package/dist/context/context/context-state.d.ts +18 -0
- package/dist/context/context/context-state.d.ts.map +1 -0
- package/dist/context/context/context-state.js +26 -0
- package/dist/context/context/context-state.js.map +1 -0
- package/dist/context/context/create-context.d.ts +40 -0
- package/dist/context/context/create-context.d.ts.map +1 -0
- package/dist/context/context/create-context.js +37 -0
- package/dist/context/context/create-context.js.map +1 -0
- package/dist/context/context/device-pixels.d.ts +25 -0
- package/dist/context/context/device-pixels.d.ts.map +1 -0
- package/dist/context/context/device-pixels.js +98 -0
- package/dist/context/context/device-pixels.js.map +1 -0
- package/dist/context/context/get-canvas.d.ts +13 -0
- package/dist/context/context/get-canvas.d.ts.map +1 -0
- package/dist/context/context/get-canvas.js +31 -0
- package/dist/context/context/get-canvas.js.map +1 -0
- package/dist/context/context/resize-context.d.ts +20 -0
- package/dist/context/context/resize-context.d.ts.map +1 -0
- package/dist/context/context/resize-context.js +15 -0
- package/dist/context/context/resize-context.js.map +1 -0
- package/dist/context/context/webgl-checks.d.ts +13 -0
- package/dist/context/context/webgl-checks.d.ts.map +1 -0
- package/dist/context/context/webgl-checks.js +34 -0
- package/dist/context/context/webgl-checks.js.map +1 -0
- package/dist/context/parameters/unified-parameter-api.d.ts +30 -0
- package/dist/context/parameters/unified-parameter-api.d.ts.map +1 -0
- package/dist/context/parameters/unified-parameter-api.js +65 -0
- package/dist/context/parameters/unified-parameter-api.js.map +1 -0
- package/dist/context/parameters/webgl-parameter-tables.d.ts +169 -0
- package/dist/context/parameters/webgl-parameter-tables.d.ts.map +1 -0
- package/dist/context/parameters/webgl-parameter-tables.js +445 -0
- package/dist/context/parameters/webgl-parameter-tables.js.map +1 -0
- package/dist/context/parameters/webgl-parameters.d.ts +144 -0
- package/dist/context/parameters/webgl-parameters.d.ts.map +1 -0
- package/dist/context/parameters/webgl-parameters.js +2 -0
- package/dist/context/parameters/webgl-parameters.js.map +1 -0
- package/dist/context/polyfill/get-parameter-polyfill.d.ts +2 -0
- package/dist/context/polyfill/get-parameter-polyfill.d.ts.map +1 -0
- package/dist/context/polyfill/get-parameter-polyfill.js +91 -0
- package/dist/context/polyfill/get-parameter-polyfill.js.map +1 -0
- package/dist/context/polyfill/polyfill-context.d.ts +5 -0
- package/dist/context/polyfill/polyfill-context.d.ts.map +1 -0
- package/dist/context/polyfill/polyfill-context.js +91 -0
- package/dist/context/polyfill/polyfill-context.js.map +1 -0
- package/dist/context/polyfill/polyfill-table.d.ts +48 -0
- package/dist/context/polyfill/polyfill-table.d.ts.map +1 -0
- package/dist/context/polyfill/polyfill-table.js +160 -0
- package/dist/context/polyfill/polyfill-table.js.map +1 -0
- package/dist/context/polyfill/polyfill-vertex-array-object.d.ts +2 -0
- package/dist/context/polyfill/polyfill-vertex-array-object.d.ts.map +1 -0
- package/dist/context/polyfill/polyfill-vertex-array-object.js +335 -0
- package/dist/context/polyfill/polyfill-vertex-array-object.js.map +1 -0
- package/dist/context/state-tracker/deep-array-equal.d.ts +3 -0
- package/dist/context/state-tracker/deep-array-equal.d.ts.map +1 -0
- package/dist/context/state-tracker/deep-array-equal.js +21 -0
- package/dist/context/state-tracker/deep-array-equal.js.map +1 -0
- package/dist/context/state-tracker/track-context-state.d.ts +22 -0
- package/dist/context/state-tracker/track-context-state.d.ts.map +1 -0
- package/dist/context/state-tracker/track-context-state.js +169 -0
- package/dist/context/state-tracker/track-context-state.js.map +1 -0
- package/dist/context/state-tracker/with-parameters.d.ts +13 -0
- package/dist/context/state-tracker/with-parameters.d.ts.map +1 -0
- package/dist/context/state-tracker/with-parameters.js +36 -0
- package/dist/context/state-tracker/with-parameters.js.map +1 -0
- package/dist/debug/debug-uniforms.js +1 -1
- package/dist/debug/debug-uniforms.js.map +1 -1
- package/dist/debug/debug-vertex-array.js +2 -2
- package/dist/debug/debug-vertex-array.js.map +1 -1
- package/dist/device/check-glsl-extension.d.ts +4 -0
- package/dist/device/check-glsl-extension.d.ts.map +1 -0
- package/dist/device/check-glsl-extension.js +22 -0
- package/dist/device/check-glsl-extension.js.map +1 -0
- package/dist/device/device-features.d.ts +12 -0
- package/dist/device/device-features.d.ts.map +1 -0
- package/dist/device/device-features.js +123 -0
- package/dist/device/device-features.js.map +1 -0
- package/dist/device/device-limits.d.ts +51 -0
- package/dist/device/device-limits.d.ts.map +1 -0
- package/dist/device/device-limits.js +90 -0
- package/dist/device/device-limits.js.map +1 -0
- package/dist/device/get-device-info.d.ts +4 -0
- package/dist/device/get-device-info.d.ts.map +1 -0
- package/dist/device/get-device-info.js +44 -0
- package/dist/device/get-device-info.js.map +1 -0
- package/dist/device/webgl-device.d.ts +111 -0
- package/dist/device/webgl-device.d.ts.map +1 -0
- package/dist/device/webgl-device.js +208 -0
- package/dist/device/webgl-device.js.map +1 -0
- package/dist/es5/api/device2.js +42 -0
- package/dist/es5/api/device2.js.map +1 -0
- package/dist/es5/bundle.js +1 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/classes/accessor.js +104 -74
- package/dist/es5/classes/accessor.js.map +1 -1
- package/dist/es5/classes/accessor.ts.disabled +1 -1
- package/dist/es5/classes/clear.js +55 -34
- package/dist/es5/classes/clear.js.map +1 -1
- package/dist/es5/classes/copy-and-blit.js +175 -156
- package/dist/es5/classes/copy-and-blit.js.map +1 -1
- package/dist/es5/classes/framebuffer.js +647 -518
- package/dist/es5/classes/framebuffer.js.map +1 -1
- package/dist/es5/classes/program-configuration.js +138 -121
- package/dist/es5/classes/program-configuration.js.map +1 -1
- package/dist/es5/classes/program.js +368 -292
- package/dist/es5/classes/program.js.map +1 -1
- package/dist/es5/classes/query.js +172 -107
- package/dist/es5/classes/query.js.map +1 -1
- package/dist/es5/classes/renderbuffer-formats.js +126 -164
- package/dist/es5/classes/renderbuffer-formats.js.map +1 -1
- package/dist/es5/classes/renderbuffer.js +151 -98
- package/dist/es5/classes/renderbuffer.js.map +1 -1
- package/dist/es5/classes/texture-2d.js +44 -17
- package/dist/es5/classes/texture-2d.js.map +1 -1
- package/dist/es5/classes/texture-3d.js +107 -48
- package/dist/es5/classes/texture-3d.js.map +1 -1
- package/dist/es5/classes/texture-cube.js +169 -110
- package/dist/es5/classes/texture-cube.js.map +1 -1
- package/dist/es5/classes/texture-formats.js +42 -71
- package/dist/es5/classes/texture-formats.js.map +1 -1
- package/dist/es5/classes/texture.js +780 -665
- package/dist/es5/classes/texture.js.map +1 -1
- package/dist/es5/classes/transform-feedback.js +206 -150
- package/dist/es5/classes/transform-feedback.js.map +1 -1
- package/dist/es5/classes/uniform-buffer-layout.js +103 -89
- package/dist/es5/classes/uniform-buffer-layout.js.map +1 -1
- package/dist/es5/classes/uniforms.js +39 -80
- package/dist/es5/classes/uniforms.js.map +1 -1
- package/dist/es5/classes/vertex-array-object.js +268 -209
- package/dist/es5/classes/vertex-array-object.js.map +1 -1
- package/dist/es5/classes/vertex-array.js +348 -303
- package/dist/es5/classes/vertex-array.js.map +1 -1
- package/dist/es5/classes/webgl-buffer.js +374 -303
- package/dist/es5/classes/webgl-buffer.js.map +1 -1
- package/dist/es5/classes/webgl-resource.js +231 -161
- package/dist/es5/classes/webgl-resource.js.map +1 -1
- package/dist/es5/classes/webgl-shader.js +230 -134
- package/dist/es5/classes/webgl-shader.js.map +1 -1
- package/dist/es5/context/context/context-state.js +31 -0
- package/dist/es5/context/context/context-state.js.map +1 -0
- package/dist/es5/context/context/create-context.js +57 -0
- package/dist/es5/context/context/create-context.js.map +1 -0
- package/dist/es5/context/context/device-pixels.js +115 -0
- package/dist/es5/context/context/device-pixels.js.map +1 -0
- package/dist/es5/context/context/get-canvas.js +40 -0
- package/dist/es5/context/context/get-canvas.js.map +1 -0
- package/dist/es5/context/context/resize-context.js +23 -0
- package/dist/es5/context/context/resize-context.js.map +1 -0
- package/dist/es5/context/context/webgl-checks.js +54 -0
- package/dist/es5/context/context/webgl-checks.js.map +1 -0
- package/dist/es5/context/parameters/unified-parameter-api.js +95 -0
- package/dist/es5/context/parameters/unified-parameter-api.js.map +1 -0
- package/dist/es5/context/parameters/webgl-parameter-tables.js +392 -0
- package/dist/es5/context/parameters/webgl-parameter-tables.js.map +1 -0
- package/dist/es5/context/parameters/webgl-parameters.js +6 -0
- package/dist/es5/context/parameters/webgl-parameters.js.map +1 -0
- package/dist/es5/context/polyfill/get-parameter-polyfill.js +81 -0
- package/dist/es5/context/polyfill/get-parameter-polyfill.js.map +1 -0
- package/dist/es5/context/polyfill/polyfill-context.js +134 -0
- package/dist/es5/context/polyfill/polyfill-context.js.map +1 -0
- package/dist/es5/context/polyfill/polyfill-table.js +166 -0
- package/dist/es5/context/polyfill/polyfill-table.js.map +1 -0
- package/dist/es5/context/polyfill/polyfill-vertex-array-object.js +341 -0
- package/dist/es5/context/polyfill/polyfill-vertex-array-object.js.map +1 -0
- package/dist/es5/context/state-tracker/deep-array-equal.js +28 -0
- package/dist/es5/context/state-tracker/deep-array-equal.js.map +1 -0
- package/dist/es5/context/state-tracker/track-context-state.js +196 -0
- package/dist/es5/context/state-tracker/track-context-state.js.map +1 -0
- package/dist/es5/context/state-tracker/with-parameters.js +44 -0
- package/dist/es5/context/state-tracker/with-parameters.js.map +1 -0
- package/dist/es5/debug/debug-program-configuration.js +48 -20
- package/dist/es5/debug/debug-program-configuration.js.map +1 -1
- package/dist/es5/debug/debug-uniforms.js +110 -70
- package/dist/es5/debug/debug-uniforms.js.map +1 -1
- package/dist/es5/debug/debug-vertex-array.js +49 -54
- package/dist/es5/debug/debug-vertex-array.js.map +1 -1
- package/dist/es5/device/check-glsl-extension.js +33 -0
- package/dist/es5/device/check-glsl-extension.js.map +1 -0
- package/dist/es5/device/device-features.js +152 -0
- package/dist/es5/device/device-features.js.map +1 -0
- package/dist/es5/device/device-limits.js +64 -0
- package/dist/es5/device/device-limits.js.map +1 -0
- package/dist/es5/device/get-device-info.js +55 -0
- package/dist/es5/device/get-device-info.js.map +1 -0
- package/dist/es5/device/webgl-device.js +279 -0
- package/dist/es5/device/webgl-device.js.map +1 -0
- package/dist/es5/index.js +179 -189
- package/dist/es5/index.js.map +1 -1
- package/dist/es5/init.js +18 -14
- package/dist/es5/init.js.map +1 -1
- package/dist/es5/webgl-utils/attribute-utils.js +74 -87
- package/dist/es5/webgl-utils/attribute-utils.js.map +1 -1
- package/dist/es5/webgl-utils/constants-to-keys.js +7 -7
- package/dist/es5/webgl-utils/constants-to-keys.js.map +1 -1
- package/dist/es5/webgl-utils/format-utils.js +4 -4
- package/dist/es5/webgl-utils/format-utils.js.map +1 -1
- package/dist/es5/webgl-utils/get-error.js +18 -18
- package/dist/es5/webgl-utils/get-error.js.map +1 -1
- package/dist/es5/webgl-utils/index.js +10 -10
- package/dist/es5/webgl-utils/is-old-ie.js +16 -0
- package/dist/es5/webgl-utils/is-old-ie.js.map +1 -0
- package/dist/es5/webgl-utils/parse-shader-compiler-log.js +53 -25
- package/dist/es5/webgl-utils/parse-shader-compiler-log.js.map +1 -1
- package/dist/es5/webgl-utils/texture-utils.js +32 -36
- package/dist/es5/webgl-utils/texture-utils.js.map +1 -1
- package/dist/es5/webgl-utils/typed-array-utils.js +33 -32
- package/dist/es5/webgl-utils/typed-array-utils.js.map +1 -1
- package/dist/es5/webgl-utils/webgl-info.ts.disabled +135 -0
- package/dist/esm/api/device2.js +23 -0
- package/dist/esm/api/device2.js.map +1 -0
- package/dist/esm/classes/accessor.js +2 -2
- package/dist/esm/classes/accessor.js.map +1 -1
- package/dist/esm/classes/accessor.ts.disabled +1 -1
- package/dist/esm/classes/clear.js +7 -4
- package/dist/esm/classes/clear.js.map +1 -1
- package/dist/esm/classes/copy-and-blit.js +30 -25
- package/dist/esm/classes/copy-and-blit.js.map +1 -1
- package/dist/esm/classes/framebuffer.js +15 -15
- package/dist/esm/classes/framebuffer.js.map +1 -1
- package/dist/esm/classes/program-configuration.js +1 -1
- package/dist/esm/classes/program-configuration.js.map +1 -1
- package/dist/esm/classes/program.js +11 -9
- package/dist/esm/classes/program.js.map +1 -1
- package/dist/esm/classes/query.js +6 -5
- package/dist/esm/classes/query.js.map +1 -1
- package/dist/esm/classes/renderbuffer-formats.js +1 -1
- package/dist/esm/classes/renderbuffer-formats.js.map +1 -1
- package/dist/esm/classes/renderbuffer.js +4 -3
- package/dist/esm/classes/renderbuffer.js.map +1 -1
- package/dist/esm/classes/texture-2d.js +5 -8
- package/dist/esm/classes/texture-2d.js.map +1 -1
- package/dist/esm/classes/texture-3d.js +15 -6
- package/dist/esm/classes/texture-3d.js.map +1 -1
- package/dist/esm/classes/texture-cube.js +3 -4
- package/dist/esm/classes/texture-cube.js.map +1 -1
- package/dist/esm/classes/texture-formats.js +1 -1
- package/dist/esm/classes/texture-formats.js.map +1 -1
- package/dist/esm/classes/texture.js +19 -18
- package/dist/esm/classes/texture.js.map +1 -1
- package/dist/esm/classes/transform-feedback.js +5 -4
- package/dist/esm/classes/transform-feedback.js.map +1 -1
- package/dist/esm/classes/uniform-buffer-layout.js +1 -1
- package/dist/esm/classes/uniform-buffer-layout.js.map +1 -1
- package/dist/esm/classes/uniforms.js +1 -2
- package/dist/esm/classes/uniforms.js.map +1 -1
- package/dist/esm/classes/vertex-array-object.js +8 -9
- package/dist/esm/classes/vertex-array-object.js.map +1 -1
- package/dist/esm/classes/vertex-array.js +1 -2
- package/dist/esm/classes/vertex-array.js.map +1 -1
- package/dist/esm/classes/webgl-buffer.js +8 -5
- package/dist/esm/classes/webgl-buffer.js.map +1 -1
- package/dist/esm/classes/webgl-resource.js +12 -8
- package/dist/esm/classes/webgl-resource.js.map +1 -1
- package/dist/esm/classes/webgl-shader.js +7 -4
- package/dist/esm/classes/webgl-shader.js.map +1 -1
- package/dist/esm/context/context/context-state.js +26 -0
- package/dist/esm/context/context/context-state.js.map +1 -0
- package/dist/esm/context/context/create-context.js +37 -0
- package/dist/esm/context/context/create-context.js.map +1 -0
- package/dist/esm/context/context/device-pixels.js +98 -0
- package/dist/esm/context/context/device-pixels.js.map +1 -0
- package/dist/esm/context/context/get-canvas.js +31 -0
- package/dist/esm/context/context/get-canvas.js.map +1 -0
- package/dist/esm/context/context/resize-context.js +15 -0
- package/dist/esm/context/context/resize-context.js.map +1 -0
- package/dist/esm/context/context/webgl-checks.js +34 -0
- package/dist/esm/context/context/webgl-checks.js.map +1 -0
- package/dist/esm/context/parameters/unified-parameter-api.js +65 -0
- package/dist/esm/context/parameters/unified-parameter-api.js.map +1 -0
- package/dist/esm/context/parameters/webgl-parameter-tables.js +445 -0
- package/dist/esm/context/parameters/webgl-parameter-tables.js.map +1 -0
- package/dist/esm/context/parameters/webgl-parameters.js +2 -0
- package/dist/esm/context/parameters/webgl-parameters.js.map +1 -0
- package/dist/esm/context/polyfill/get-parameter-polyfill.js +91 -0
- package/dist/esm/context/polyfill/get-parameter-polyfill.js.map +1 -0
- package/dist/esm/context/polyfill/polyfill-context.js +91 -0
- package/dist/esm/context/polyfill/polyfill-context.js.map +1 -0
- package/dist/esm/context/polyfill/polyfill-table.js +160 -0
- package/dist/esm/context/polyfill/polyfill-table.js.map +1 -0
- package/dist/esm/context/polyfill/polyfill-vertex-array-object.js +335 -0
- package/dist/esm/context/polyfill/polyfill-vertex-array-object.js.map +1 -0
- package/dist/esm/context/state-tracker/deep-array-equal.js +21 -0
- package/dist/esm/context/state-tracker/deep-array-equal.js.map +1 -0
- package/dist/esm/context/state-tracker/track-context-state.js +169 -0
- package/dist/esm/context/state-tracker/track-context-state.js.map +1 -0
- package/dist/esm/context/state-tracker/with-parameters.js +36 -0
- package/dist/esm/context/state-tracker/with-parameters.js.map +1 -0
- package/dist/esm/debug/debug-uniforms.js +1 -1
- package/dist/esm/debug/debug-uniforms.js.map +1 -1
- package/dist/esm/debug/debug-vertex-array.js +2 -2
- package/dist/esm/debug/debug-vertex-array.js.map +1 -1
- package/dist/esm/device/check-glsl-extension.js +22 -0
- package/dist/esm/device/check-glsl-extension.js.map +1 -0
- package/dist/esm/device/device-features.js +123 -0
- package/dist/esm/device/device-features.js.map +1 -0
- package/dist/esm/device/device-limits.js +90 -0
- package/dist/esm/device/device-limits.js.map +1 -0
- package/dist/esm/device/get-device-info.js +44 -0
- package/dist/esm/device/get-device-info.js.map +1 -0
- package/dist/esm/device/webgl-device.js +208 -0
- package/dist/esm/device/webgl-device.js.map +1 -0
- package/dist/esm/index.js +22 -20
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/init.js +11 -8
- package/dist/esm/init.js.map +1 -1
- package/dist/esm/webgl-utils/attribute-utils.js +1 -1
- package/dist/esm/webgl-utils/attribute-utils.js.map +1 -1
- package/dist/esm/webgl-utils/constants-to-keys.js +1 -1
- package/dist/esm/webgl-utils/constants-to-keys.js.map +1 -1
- package/dist/esm/webgl-utils/format-utils.js +1 -1
- package/dist/esm/webgl-utils/format-utils.js.map +1 -1
- package/dist/esm/{features/check-old-ie.js → webgl-utils/is-old-ie.js} +3 -3
- package/dist/esm/webgl-utils/is-old-ie.js.map +1 -0
- package/dist/esm/webgl-utils/texture-utils.js +2 -2
- package/dist/esm/webgl-utils/texture-utils.js.map +1 -1
- package/dist/esm/webgl-utils/typed-array-utils.js +22 -18
- package/dist/esm/webgl-utils/typed-array-utils.js.map +1 -1
- package/dist/esm/webgl-utils/webgl-info.ts.disabled +135 -0
- package/dist/index.d.ts +36 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -20
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +11 -8
- package/dist/init.js.map +1 -1
- package/dist/webgl-utils/attribute-utils.d.ts +1 -1
- package/dist/webgl-utils/attribute-utils.js +1 -1
- package/dist/webgl-utils/attribute-utils.js.map +1 -1
- package/dist/webgl-utils/constants-to-keys.js +1 -1
- package/dist/webgl-utils/constants-to-keys.js.map +1 -1
- package/dist/webgl-utils/format-utils.d.ts +2 -2
- package/dist/webgl-utils/format-utils.js +1 -1
- package/dist/webgl-utils/format-utils.js.map +1 -1
- package/dist/webgl-utils/is-old-ie.d.ts +2 -0
- package/dist/webgl-utils/is-old-ie.d.ts.map +1 -0
- package/dist/{features/check-old-ie.js → webgl-utils/is-old-ie.js} +3 -3
- package/dist/webgl-utils/is-old-ie.js.map +1 -0
- package/dist/webgl-utils/texture-utils.d.ts +12 -8
- package/dist/webgl-utils/texture-utils.d.ts.map +1 -1
- package/dist/webgl-utils/texture-utils.js +2 -2
- package/dist/webgl-utils/texture-utils.js.map +1 -1
- package/dist/webgl-utils/typed-array-utils.d.ts +39 -32
- package/dist/webgl-utils/typed-array-utils.d.ts.map +1 -1
- package/dist/webgl-utils/typed-array-utils.js +22 -18
- package/dist/webgl-utils/typed-array-utils.js.map +1 -1
- package/dist/webgl-utils/webgl-info.ts.disabled +135 -0
- package/package.json +5 -6
- package/src/.DS_Store +0 -0
- package/src/api/device2.ts +71 -0
- package/src/classes/accessor.js +2 -2
- package/src/classes/accessor.ts.disabled +1 -1
- package/src/classes/clear.ts +9 -4
- package/src/classes/copy-and-blit.ts +49 -52
- package/src/classes/framebuffer.ts +38 -35
- package/src/classes/program-configuration.ts +6 -6
- package/src/classes/program.ts +21 -15
- package/src/classes/query.ts +6 -6
- package/src/classes/renderbuffer-formats.ts +1 -1
- package/src/classes/renderbuffer.ts +5 -4
- package/src/classes/texture-2d.ts +6 -11
- package/src/classes/texture-3d.ts +16 -11
- package/src/classes/texture-cube.ts +7 -7
- package/src/classes/texture-formats.ts +1 -1
- package/src/classes/texture.ts +39 -40
- package/src/classes/transform-feedback.ts +14 -13
- package/src/classes/uniform-buffer-layout.ts +1 -1
- package/src/classes/uniforms.ts +4 -10
- package/src/classes/vertex-array-object.ts +10 -14
- package/src/classes/vertex-array.ts +2 -3
- package/src/classes/webgl-buffer.ts +7 -5
- package/src/classes/webgl-resource.ts +20 -18
- package/src/classes/webgl-shader.ts +6 -4
- package/src/context/context/context-state.ts +39 -0
- package/src/context/context/create-context.ts +83 -0
- package/src/context/context/device-pixels.ts +147 -0
- package/src/context/context/get-canvas.ts +37 -0
- package/src/context/context/resize-context.ts +37 -0
- package/src/context/context/webgl-checks.ts +49 -0
- package/src/context/parameters/unified-parameter-api.ts +127 -0
- package/src/context/parameters/webgl-parameter-tables.ts +625 -0
- package/src/context/parameters/webgl-parameters.ts +197 -0
- package/src/context/polyfill/get-parameter-polyfill.ts +118 -0
- package/src/context/polyfill/polyfill-context.ts +98 -0
- package/src/context/polyfill/polyfill-table.ts +162 -0
- package/src/context/polyfill/polyfill-vertex-array-object.ts +360 -0
- package/src/context/state-tracker/deep-array-equal.ts +20 -0
- package/src/context/state-tracker/track-context-state.ts +250 -0
- package/src/context/state-tracker/with-parameters.ts +50 -0
- package/src/debug/debug-uniforms.ts +1 -1
- package/src/debug/debug-vertex-array.ts +2 -4
- package/src/device/check-glsl-extension.ts +44 -0
- package/src/device/device-features.ts +227 -0
- package/src/device/device-limits.ts +150 -0
- package/src/device/get-device-info.ts +49 -0
- package/src/device/webgl-device.ts +406 -0
- package/src/index.ts +76 -22
- package/src/init.ts +12 -9
- package/src/types.ts +1 -1
- package/src/webgl-utils/attribute-utils.ts +1 -1
- package/src/webgl-utils/constants-to-keys.ts +1 -1
- package/src/webgl-utils/format-utils.ts +1 -1
- package/src/{features/check-old-ie.ts → webgl-utils/is-old-ie.ts} +3 -3
- package/src/webgl-utils/{texture-utils.js → texture-utils.ts} +13 -10
- package/src/webgl-utils/{typed-array-utils.js → typed-array-utils.ts} +59 -16
- package/src/webgl-utils/webgl-info.ts.disabled +135 -0
- package/dist/context/gl-context.d.ts +0 -15
- package/dist/context/gl-context.d.ts.map +0 -1
- package/dist/context/gl-context.js +0 -32
- package/dist/context/gl-context.js.map +0 -1
- package/dist/context/luma-context-data.d.ts +0 -31
- package/dist/context/luma-context-data.d.ts.map +0 -1
- package/dist/context/luma-context-data.js +0 -5
- package/dist/context/luma-context-data.js.map +0 -1
- package/dist/es5/context/gl-context.js +0 -46
- package/dist/es5/context/gl-context.js.map +0 -1
- package/dist/es5/context/luma-context-data.js +0 -12
- package/dist/es5/context/luma-context-data.js.map +0 -1
- package/dist/es5/features/check-glsl-extension.js +0 -40
- package/dist/es5/features/check-glsl-extension.js.map +0 -1
- package/dist/es5/features/check-old-ie.js +0 -15
- package/dist/es5/features/check-old-ie.js.map +0 -1
- package/dist/es5/features/features.js +0 -85
- package/dist/es5/features/features.js.map +0 -1
- package/dist/es5/features/index.js +0 -64
- package/dist/es5/features/index.js.map +0 -1
- package/dist/es5/features/limits.js +0 -72
- package/dist/es5/features/limits.js.map +0 -1
- package/dist/es5/features/webgl-features-table.js +0 -84
- package/dist/es5/features/webgl-features-table.js.map +0 -1
- package/dist/es5/features/webgl-limits-table.js +0 -172
- package/dist/es5/features/webgl-limits-table.js.map +0 -1
- package/dist/es5/utils/array-utils-flat.js +0 -50
- package/dist/es5/utils/array-utils-flat.js.map +0 -1
- package/dist/es5/utils/assert.js +0 -13
- package/dist/es5/utils/assert.js.map +0 -1
- package/dist/es5/utils/check-props.js +0 -50
- package/dist/es5/utils/check-props.js.map +0 -1
- package/dist/es5/utils/format-value.js +0 -57
- package/dist/es5/utils/format-value.js.map +0 -1
- package/dist/es5/utils/index.js +0 -68
- package/dist/es5/utils/index.js.map +0 -1
- package/dist/es5/utils/is-old-ie.js +0 -13
- package/dist/es5/utils/is-old-ie.js.map +0 -1
- package/dist/es5/utils/load-file.js +0 -43
- package/dist/es5/utils/load-file.js.map +0 -1
- package/dist/es5/utils/stub-methods.js +0 -25
- package/dist/es5/utils/stub-methods.js.map +0 -1
- package/dist/es5/utils/utils.js +0 -31
- package/dist/es5/utils/utils.js.map +0 -1
- package/dist/es5/webgl-utils/texture-utils.d.ts +0 -11
- package/dist/es5/webgl-utils/typed-array-utils.d.ts +0 -36
- package/dist/esm/context/gl-context.js +0 -32
- package/dist/esm/context/gl-context.js.map +0 -1
- package/dist/esm/context/luma-context-data.js +0 -5
- package/dist/esm/context/luma-context-data.js.map +0 -1
- package/dist/esm/features/check-glsl-extension.js +0 -27
- package/dist/esm/features/check-glsl-extension.js.map +0 -1
- package/dist/esm/features/check-old-ie.js.map +0 -1
- package/dist/esm/features/features.js +0 -67
- package/dist/esm/features/features.js.map +0 -1
- package/dist/esm/features/index.js +0 -5
- package/dist/esm/features/index.js.map +0 -1
- package/dist/esm/features/limits.js +0 -55
- package/dist/esm/features/limits.js.map +0 -1
- package/dist/esm/features/webgl-features-table.js +0 -71
- package/dist/esm/features/webgl-features-table.js.map +0 -1
- package/dist/esm/features/webgl-limits-table.js +0 -161
- package/dist/esm/features/webgl-limits-table.js.map +0 -1
- package/dist/esm/utils/array-utils-flat.js +0 -39
- package/dist/esm/utils/array-utils-flat.js.map +0 -1
- package/dist/esm/utils/assert.js +0 -6
- package/dist/esm/utils/assert.js.map +0 -1
- package/dist/esm/utils/check-props.js +0 -38
- package/dist/esm/utils/check-props.js.map +0 -1
- package/dist/esm/utils/format-value.js +0 -50
- package/dist/esm/utils/format-value.js.map +0 -1
- package/dist/esm/utils/index.js +0 -7
- package/dist/esm/utils/index.js.map +0 -1
- package/dist/esm/utils/is-old-ie.js +0 -5
- package/dist/esm/utils/is-old-ie.js.map +0 -1
- package/dist/esm/utils/load-file.js +0 -30
- package/dist/esm/utils/load-file.js.map +0 -1
- package/dist/esm/utils/stub-methods.js +0 -16
- package/dist/esm/utils/stub-methods.js.map +0 -1
- package/dist/esm/utils/utils.js +0 -20
- package/dist/esm/utils/utils.js.map +0 -1
- package/dist/esm/webgl-utils/texture-utils.d.ts +0 -11
- package/dist/esm/webgl-utils/typed-array-utils.d.ts +0 -36
- package/dist/features/check-glsl-extension.d.ts +0 -2
- package/dist/features/check-glsl-extension.d.ts.map +0 -1
- package/dist/features/check-glsl-extension.js +0 -27
- package/dist/features/check-glsl-extension.js.map +0 -1
- package/dist/features/check-old-ie.d.ts +0 -2
- package/dist/features/check-old-ie.d.ts.map +0 -1
- package/dist/features/check-old-ie.js.map +0 -1
- package/dist/features/features.d.ts +0 -6
- package/dist/features/features.d.ts.map +0 -1
- package/dist/features/features.js +0 -67
- package/dist/features/features.js.map +0 -1
- package/dist/features/index.d.ts +0 -5
- package/dist/features/index.d.ts.map +0 -1
- package/dist/features/index.js +0 -5
- package/dist/features/index.js.map +0 -1
- package/dist/features/limits.d.ts +0 -28
- package/dist/features/limits.d.ts.map +0 -1
- package/dist/features/limits.js +0 -55
- package/dist/features/limits.js.map +0 -1
- package/dist/features/webgl-features-table.d.ts +0 -30
- package/dist/features/webgl-features-table.d.ts.map +0 -1
- package/dist/features/webgl-features-table.js +0 -71
- package/dist/features/webgl-features-table.js.map +0 -1
- package/dist/features/webgl-limits-table.d.ts +0 -161
- package/dist/features/webgl-limits-table.d.ts.map +0 -1
- package/dist/features/webgl-limits-table.js +0 -161
- package/dist/features/webgl-limits-table.js.map +0 -1
- package/dist/utils/array-utils-flat.d.ts +0 -9
- package/dist/utils/array-utils-flat.d.ts.map +0 -1
- package/dist/utils/array-utils-flat.js +0 -39
- package/dist/utils/array-utils-flat.js.map +0 -1
- package/dist/utils/assert.d.ts +0 -2
- package/dist/utils/assert.d.ts.map +0 -1
- package/dist/utils/assert.js +0 -6
- package/dist/utils/assert.js.map +0 -1
- package/dist/utils/check-props.d.ts +0 -2
- package/dist/utils/check-props.d.ts.map +0 -1
- package/dist/utils/check-props.js +0 -38
- package/dist/utils/check-props.js.map +0 -1
- package/dist/utils/format-value.d.ts +0 -5
- package/dist/utils/format-value.d.ts.map +0 -1
- package/dist/utils/format-value.js +0 -50
- package/dist/utils/format-value.js.map +0 -1
- package/dist/utils/index.d.ts +0 -7
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -7
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/is-old-ie.d.ts +0 -4
- package/dist/utils/is-old-ie.d.ts.map +0 -1
- package/dist/utils/is-old-ie.js +0 -5
- package/dist/utils/is-old-ie.js.map +0 -1
- package/dist/utils/load-file.d.ts +0 -4
- package/dist/utils/load-file.d.ts.map +0 -1
- package/dist/utils/load-file.js +0 -30
- package/dist/utils/load-file.js.map +0 -1
- package/dist/utils/stub-methods.d.ts +0 -2
- package/dist/utils/stub-methods.d.ts.map +0 -1
- package/dist/utils/stub-methods.js +0 -16
- package/dist/utils/stub-methods.js.map +0 -1
- package/dist/utils/utils.d.ts +0 -15
- package/dist/utils/utils.d.ts.map +0 -1
- package/dist/utils/utils.js +0 -20
- package/dist/utils/utils.js.map +0 -1
- package/src/context/gl-context.ts +0 -31
- package/src/context/luma-context-data.ts +0 -27
- package/src/features/check-glsl-extension.ts +0 -34
- package/src/features/features.ts +0 -80
- package/src/features/index.ts +0 -5
- package/src/features/limits.ts +0 -66
- package/src/features/webgl-features-table.ts +0 -104
- package/src/features/webgl-limits-table.ts +0 -51
- package/src/utils/array-utils-flat.ts +0 -56
- package/src/utils/assert.ts +0 -7
- package/src/utils/check-props.ts +0 -68
- package/src/utils/format-value.ts +0 -37
- package/src/utils/index.ts +0 -6
- package/src/utils/is-old-ie.ts +0 -6
- package/src/utils/load-file.ts +0 -40
- package/src/utils/stub-methods.ts +0 -20
- package/src/utils/utils.ts +0 -35
- package/src/webgl-utils/texture-utils.d.ts +0 -11
- package/src/webgl-utils/typed-array-utils.d.ts +0 -36
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.withParameters = withParameters;
|
|
7
|
+
|
|
8
|
+
var _unifiedParameterApi = require("../parameters/unified-parameter-api");
|
|
9
|
+
|
|
10
|
+
var _trackContextState = require("./track-context-state");
|
|
11
|
+
|
|
12
|
+
function withParameters(gl, parameters, func) {
|
|
13
|
+
if (isObjectEmpty(parameters)) {
|
|
14
|
+
return func(gl);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var _parameters$nocatch = parameters.nocatch,
|
|
18
|
+
nocatch = _parameters$nocatch === void 0 ? true : _parameters$nocatch;
|
|
19
|
+
(0, _trackContextState.pushContextState)(gl);
|
|
20
|
+
(0, _unifiedParameterApi.setParameters)(gl, parameters);
|
|
21
|
+
var value;
|
|
22
|
+
|
|
23
|
+
if (nocatch) {
|
|
24
|
+
value = func(gl);
|
|
25
|
+
(0, _trackContextState.popContextState)(gl);
|
|
26
|
+
} else {
|
|
27
|
+
try {
|
|
28
|
+
value = func(gl);
|
|
29
|
+
} finally {
|
|
30
|
+
(0, _trackContextState.popContextState)(gl);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function isObjectEmpty(object) {
|
|
38
|
+
for (var key in object) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=with-parameters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/context/state-tracker/with-parameters.ts"],"names":["withParameters","gl","parameters","func","isObjectEmpty","nocatch","value","object","key"],"mappings":";;;;;;;AAAA;;AACA;;AAUQ,SAASA,cAAT,CAAwBC,EAAxB,EAAmDC,UAAnD,EAAmGC,IAAnG,EAAmH;AACzH,MAAIC,aAAa,CAACF,UAAD,CAAjB,EAA+B;AAE7B,WAAOC,IAAI,CAACF,EAAD,CAAX;AACD;;AAED,4BAAyBC,UAAzB,CAAOG,OAAP;AAAA,MAAOA,OAAP,oCAAiB,IAAjB;AAEA,2CAAiBJ,EAAjB;AACA,0CAAcA,EAAd,EAAkBC,UAAlB;AAGA,MAAII,KAAJ;;AAEA,MAAID,OAAJ,EAAa;AAEXC,IAAAA,KAAK,GAAGH,IAAI,CAACF,EAAD,CAAZ;AACA,4CAAgBA,EAAhB;AACD,GAJD,MAIO;AAEL,QAAI;AACFK,MAAAA,KAAK,GAAGH,IAAI,CAACF,EAAD,CAAZ;AACD,KAFD,SAEU;AACR,8CAAgBA,EAAhB;AACD;AACF;;AAED,SAAOK,KAAP;AACD;;AAKD,SAASF,aAAT,CAAuBG,MAAvB,EAA+B;AAC7B,OAAK,IAAMC,GAAX,IAAkBD,MAAlB,EAA0B;AACxB,WAAO,KAAP;AACD;;AACD,SAAO,IAAP;AACD","sourcesContent":["import {GLParameters, setParameters} from '../parameters/unified-parameter-api';\nimport {pushContextState, popContextState} from './track-context-state';\n\n/**\n * Execute a function with a set of temporary WebGL parameter overrides\n * - Saves current \"global\" WebGL context settings\n * - Sets the supplies WebGL context parameters,\n * - Executes supplied function\n * - Restores parameters\n * - Returns the return value of the supplied function\n */\n export function withParameters(gl: WebGLRenderingContext, parameters: GLParameters & {nocatch?: boolean}, func: any): any {\n if (isObjectEmpty(parameters)) {\n // Avoid setting state if no parameters provided. Just call and return\n return func(gl);\n }\n\n const {nocatch = true} = parameters;\n\n pushContextState(gl);\n setParameters(gl, parameters);\n\n // Setup is done, call the function\n let value;\n\n if (nocatch) {\n // Avoid try catch to minimize stack size impact for safe execution paths\n value = func(gl);\n popContextState(gl);\n } else {\n // Wrap in a try-catch to ensure that parameters are restored on exceptions\n try {\n value = func(gl);\n } finally {\n popContextState(gl);\n }\n }\n\n return value;\n}\n\n// Helpers\n\n// Returns true if given object is empty, false otherwise.\nfunction isObjectEmpty(object) {\n for (const key in object) {\n return false;\n }\n return true;\n}\n"],"file":"with-parameters.js"}
|
|
@@ -1,43 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.getDebugTableForProgramConfiguration = getDebugTableForProgramConfiguration;
|
|
7
9
|
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
8
12
|
var _attributeUtils = require("../webgl-utils/attribute-utils");
|
|
9
13
|
|
|
14
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
15
|
+
|
|
16
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
+
|
|
18
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
19
|
+
|
|
10
20
|
function getDebugTableForProgramConfiguration(config) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
var table = {};
|
|
22
|
+
var header = "Accessors for ".concat(config.id);
|
|
23
|
+
|
|
24
|
+
var _iterator = _createForOfIteratorHelper(config.attributeInfos),
|
|
25
|
+
_step;
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
29
|
+
var attributeInfo = _step.value;
|
|
30
|
+
|
|
31
|
+
if (attributeInfo) {
|
|
32
|
+
var glslDeclaration = getGLSLDeclaration(attributeInfo);
|
|
33
|
+
table["in ".concat(glslDeclaration)] = (0, _defineProperty2.default)({}, header, JSON.stringify(attributeInfo.accessor));
|
|
34
|
+
}
|
|
20
35
|
}
|
|
36
|
+
} catch (err) {
|
|
37
|
+
_iterator.e(err);
|
|
38
|
+
} finally {
|
|
39
|
+
_iterator.f();
|
|
21
40
|
}
|
|
22
41
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
42
|
+
var _iterator2 = _createForOfIteratorHelper(config.varyingInfos),
|
|
43
|
+
_step2;
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
47
|
+
var varyingInfo = _step2.value;
|
|
48
|
+
|
|
49
|
+
if (varyingInfo) {
|
|
50
|
+
var _glslDeclaration = getGLSLDeclaration(varyingInfo);
|
|
51
|
+
|
|
52
|
+
table["out ".concat(_glslDeclaration)] = (0, _defineProperty2.default)({}, header, JSON.stringify(varyingInfo.accessor));
|
|
53
|
+
}
|
|
29
54
|
}
|
|
55
|
+
} catch (err) {
|
|
56
|
+
_iterator2.e(err);
|
|
57
|
+
} finally {
|
|
58
|
+
_iterator2.f();
|
|
30
59
|
}
|
|
31
60
|
|
|
32
61
|
return table;
|
|
33
62
|
}
|
|
34
63
|
|
|
35
64
|
function getGLSLDeclaration(attributeInfo) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const typeAndName = (0, _attributeUtils.getCompositeGLType)(type, size);
|
|
65
|
+
var _attributeInfo$access = attributeInfo.accessor,
|
|
66
|
+
type = _attributeInfo$access.type,
|
|
67
|
+
size = _attributeInfo$access.size;
|
|
68
|
+
var typeAndName = (0, _attributeUtils.getCompositeGLType)(type, size);
|
|
41
69
|
|
|
42
70
|
if (typeAndName) {
|
|
43
71
|
return "".concat(typeAndName.name, " ").concat(attributeInfo.name);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/debug/debug-program-configuration.ts"],"names":["getDebugTableForProgramConfiguration","config","table","header","id","
|
|
1
|
+
{"version":3,"sources":["../../../src/debug/debug-program-configuration.ts"],"names":["getDebugTableForProgramConfiguration","config","table","header","id","attributeInfos","attributeInfo","glslDeclaration","getGLSLDeclaration","JSON","stringify","accessor","varyingInfos","varyingInfo","type","size","typeAndName","name"],"mappings":";;;;;;;;;;;AAAA;;;;;;;;AAEO,SAASA,oCAAT,CAA8CC,MAA9C,EAAsD;AAC3D,MAAMC,KAAK,GAAG,EAAd;AAEA,MAAMC,MAAM,2BAAoBF,MAAM,CAACG,EAA3B,CAAZ;;AAH2D,6CAK/BH,MAAM,CAACI,cALwB;AAAA;;AAAA;AAK3D,wDAAmD;AAAA,UAAxCC,aAAwC;;AACjD,UAAIA,aAAJ,EAAmB;AACjB,YAAMC,eAAe,GAAGC,kBAAkB,CAACF,aAAD,CAA1C;AACAJ,QAAAA,KAAK,cAAOK,eAAP,EAAL,qCAAmCJ,MAAnC,EAA4CM,IAAI,CAACC,SAAL,CAAeJ,aAAa,CAACK,QAA7B,CAA5C;AACD;AACF;AAV0D;AAAA;AAAA;AAAA;AAAA;;AAAA,8CAYjCV,MAAM,CAACW,YAZ0B;AAAA;;AAAA;AAY3D,2DAA+C;AAAA,UAApCC,WAAoC;;AAC7C,UAAIA,WAAJ,EAAiB;AACf,YAAMN,gBAAe,GAAGC,kBAAkB,CAACK,WAAD,CAA1C;;AACAX,QAAAA,KAAK,eAAQK,gBAAR,EAAL,qCAAoCJ,MAApC,EAA6CM,IAAI,CAACC,SAAL,CAAeG,WAAW,CAACF,QAA3B,CAA7C;AACD;AACF;AAjB0D;AAAA;AAAA;AAAA;AAAA;;AAmB3D,SAAOT,KAAP;AACD;;AAED,SAASM,kBAAT,CAA4BF,aAA5B,EAA2C;AACzC,8BAAqBA,aAAa,CAACK,QAAnC;AAAA,MAAOG,IAAP,yBAAOA,IAAP;AAAA,MAAaC,IAAb,yBAAaA,IAAb;AACA,MAAMC,WAAW,GAAG,wCAAmBF,IAAnB,EAAyBC,IAAzB,CAApB;;AACA,MAAIC,WAAJ,EAAiB;AACf,qBAAUA,WAAW,CAACC,IAAtB,cAA8BX,aAAa,CAACW,IAA5C;AACD;;AACD,SAAOX,aAAa,CAACW,IAArB;AACD","sourcesContent":["import {getCompositeGLType} from '../webgl-utils/attribute-utils';\n\nexport function getDebugTableForProgramConfiguration(config) {\n const table = {};\n\n const header = `Accessors for ${config.id}`;\n\n for (const attributeInfo of config.attributeInfos) {\n if (attributeInfo) {\n const glslDeclaration = getGLSLDeclaration(attributeInfo);\n table[`in ${glslDeclaration}`] = {[header]: JSON.stringify(attributeInfo.accessor)};\n }\n }\n\n for (const varyingInfo of config.varyingInfos) {\n if (varyingInfo) {\n const glslDeclaration = getGLSLDeclaration(varyingInfo);\n table[`out ${glslDeclaration}`] = {[header]: JSON.stringify(varyingInfo.accessor)};\n }\n }\n\n return table;\n}\n\nfunction getGLSLDeclaration(attributeInfo) {\n const {type, size} = attributeInfo.accessor;\n const typeAndName = getCompositeGLType(type, size);\n if (typeAndName) {\n return `${typeAndName.name} ${attributeInfo.name}`;\n }\n return attributeInfo.name;\n}\n"],"file":"debug-program-configuration.js"}
|
|
@@ -1,109 +1,149 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.getDebugTableForUniforms = getDebugTableForUniforms;
|
|
7
9
|
|
|
8
|
-
var
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _api = require("@luma.gl/api");
|
|
13
|
+
|
|
14
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
15
|
+
|
|
16
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
+
|
|
18
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
9
19
|
|
|
10
20
|
function getDebugTableForUniforms(options) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
(0,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
var _options$header = options.header,
|
|
22
|
+
header = _options$header === void 0 ? 'Uniforms' : _options$header,
|
|
23
|
+
program = options.program,
|
|
24
|
+
uniforms = options.uniforms,
|
|
25
|
+
_options$undefinedOnl = options.undefinedOnly,
|
|
26
|
+
undefinedOnly = _options$undefinedOnl === void 0 ? false : _options$undefinedOnl;
|
|
27
|
+
(0, _api.assert)(program);
|
|
28
|
+
var SHADER_MODULE_UNIFORM_REGEXP = '.*_.*';
|
|
29
|
+
var PROJECT_MODULE_UNIFORM_REGEXP = '.*Matrix';
|
|
30
|
+
var uniformLocations = program._uniformSetters;
|
|
31
|
+
var table = {};
|
|
32
|
+
var uniformNames = Object.keys(uniformLocations).sort();
|
|
33
|
+
var count = 0;
|
|
34
|
+
|
|
35
|
+
var _iterator = _createForOfIteratorHelper(uniformNames),
|
|
36
|
+
_step;
|
|
37
|
+
|
|
38
|
+
try {
|
|
39
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
40
|
+
var _uniformName = _step.value;
|
|
41
|
+
|
|
42
|
+
if (!_uniformName.match(SHADER_MODULE_UNIFORM_REGEXP) && !_uniformName.match(PROJECT_MODULE_UNIFORM_REGEXP)) {
|
|
43
|
+
if (addUniformToTable({
|
|
44
|
+
table: table,
|
|
45
|
+
header: header,
|
|
46
|
+
uniforms: uniforms,
|
|
47
|
+
uniformName: _uniformName,
|
|
48
|
+
undefinedOnly: undefinedOnly
|
|
49
|
+
})) {
|
|
50
|
+
count++;
|
|
51
|
+
}
|
|
35
52
|
}
|
|
36
53
|
}
|
|
54
|
+
} catch (err) {
|
|
55
|
+
_iterator.e(err);
|
|
56
|
+
} finally {
|
|
57
|
+
_iterator.f();
|
|
37
58
|
}
|
|
38
59
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
60
|
+
var _iterator2 = _createForOfIteratorHelper(uniformNames),
|
|
61
|
+
_step2;
|
|
62
|
+
|
|
63
|
+
try {
|
|
64
|
+
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
65
|
+
var _uniformName2 = _step2.value;
|
|
66
|
+
|
|
67
|
+
if (_uniformName2.match(PROJECT_MODULE_UNIFORM_REGEXP)) {
|
|
68
|
+
if (addUniformToTable({
|
|
69
|
+
table: table,
|
|
70
|
+
header: header,
|
|
71
|
+
uniforms: uniforms,
|
|
72
|
+
uniformName: _uniformName2,
|
|
73
|
+
undefinedOnly: undefinedOnly
|
|
74
|
+
})) {
|
|
75
|
+
count++;
|
|
76
|
+
}
|
|
49
77
|
}
|
|
50
78
|
}
|
|
79
|
+
} catch (err) {
|
|
80
|
+
_iterator2.e(err);
|
|
81
|
+
} finally {
|
|
82
|
+
_iterator2.f();
|
|
51
83
|
}
|
|
52
84
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
85
|
+
var _iterator3 = _createForOfIteratorHelper(uniformNames),
|
|
86
|
+
_step3;
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
90
|
+
var _uniformName3 = _step3.value;
|
|
91
|
+
|
|
92
|
+
if (!table[_uniformName3]) {
|
|
93
|
+
if (addUniformToTable({
|
|
94
|
+
table: table,
|
|
95
|
+
header: header,
|
|
96
|
+
uniforms: uniforms,
|
|
97
|
+
uniformName: _uniformName3,
|
|
98
|
+
undefinedOnly: undefinedOnly
|
|
99
|
+
})) {
|
|
100
|
+
count++;
|
|
101
|
+
}
|
|
63
102
|
}
|
|
64
103
|
}
|
|
104
|
+
} catch (err) {
|
|
105
|
+
_iterator3.e(err);
|
|
106
|
+
} finally {
|
|
107
|
+
_iterator3.f();
|
|
65
108
|
}
|
|
66
109
|
|
|
67
|
-
|
|
68
|
-
|
|
110
|
+
var unusedCount = 0;
|
|
111
|
+
var unusedTable = {};
|
|
69
112
|
|
|
70
113
|
if (!undefinedOnly) {
|
|
71
|
-
for (
|
|
72
|
-
|
|
114
|
+
for (var uniformName in uniforms) {
|
|
115
|
+
var uniform = uniforms[uniformName];
|
|
73
116
|
|
|
74
117
|
if (!table[uniformName]) {
|
|
75
118
|
unusedCount++;
|
|
76
|
-
unusedTable[uniformName] = {
|
|
77
|
-
Type: "NOT USED: ".concat(uniform)
|
|
78
|
-
|
|
79
|
-
};
|
|
119
|
+
unusedTable[uniformName] = (0, _defineProperty2.default)({
|
|
120
|
+
Type: "NOT USED: ".concat(uniform)
|
|
121
|
+
}, header, (0, _api.formatValue)(uniform));
|
|
80
122
|
}
|
|
81
123
|
}
|
|
82
124
|
}
|
|
83
125
|
|
|
84
126
|
return {
|
|
85
|
-
table,
|
|
86
|
-
count,
|
|
87
|
-
unusedTable,
|
|
88
|
-
unusedCount
|
|
127
|
+
table: table,
|
|
128
|
+
count: count,
|
|
129
|
+
unusedTable: unusedTable,
|
|
130
|
+
unusedCount: unusedCount
|
|
89
131
|
};
|
|
90
132
|
}
|
|
91
133
|
|
|
92
|
-
function addUniformToTable({
|
|
93
|
-
table,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const isDefined = isUniformDefined(value);
|
|
134
|
+
function addUniformToTable(_ref) {
|
|
135
|
+
var table = _ref.table,
|
|
136
|
+
header = _ref.header,
|
|
137
|
+
uniforms = _ref.uniforms,
|
|
138
|
+
uniformName = _ref.uniformName,
|
|
139
|
+
undefinedOnly = _ref.undefinedOnly;
|
|
140
|
+
var value = uniforms[uniformName];
|
|
141
|
+
var isDefined = isUniformDefined(value);
|
|
101
142
|
|
|
102
143
|
if (!undefinedOnly || !isDefined) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
};
|
|
144
|
+
var _table$uniformName;
|
|
145
|
+
|
|
146
|
+
table[uniformName] = (_table$uniformName = {}, (0, _defineProperty2.default)(_table$uniformName, header, isDefined ? (0, _api.formatValue)(value) : 'N/A'), (0, _defineProperty2.default)(_table$uniformName, 'Uniform Type', isDefined ? value : 'NOT PROVIDED'), _table$uniformName);
|
|
107
147
|
return true;
|
|
108
148
|
}
|
|
109
149
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/debug/debug-uniforms.ts"],"names":["getDebugTableForUniforms","options","header","program","uniforms","undefinedOnly","SHADER_MODULE_UNIFORM_REGEXP","PROJECT_MODULE_UNIFORM_REGEXP","uniformLocations","_uniformSetters","table","uniformNames","Object","keys","sort","count","uniformName","match","addUniformToTable","unusedCount","unusedTable","uniform","Type","value","isDefined","isUniformDefined","undefined"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/debug/debug-uniforms.ts"],"names":["getDebugTableForUniforms","options","header","program","uniforms","undefinedOnly","SHADER_MODULE_UNIFORM_REGEXP","PROJECT_MODULE_UNIFORM_REGEXP","uniformLocations","_uniformSetters","table","uniformNames","Object","keys","sort","count","uniformName","match","addUniformToTable","unusedCount","unusedTable","uniform","Type","value","isDefined","isUniformDefined","undefined"],"mappings":";;;;;;;;;;;AAAA;;;;;;;;AAIO,SAASA,wBAAT,CAAkCC,OAAlC,EAUL;AACA,wBAKIA,OALJ,CACEC,MADF;AAAA,MACEA,MADF,gCACW,UADX;AAAA,MAEEC,OAFF,GAKIF,OALJ,CAEEE,OAFF;AAAA,MAGEC,QAHF,GAKIH,OALJ,CAGEG,QAHF;AAAA,8BAKIH,OALJ,CAIEI,aAJF;AAAA,MAIEA,aAJF,sCAIkB,KAJlB;AAMA,mBAAOF,OAAP;AAEA,MAAMG,4BAA4B,GAAG,OAArC;AACA,MAAMC,6BAA6B,GAAG,UAAtC;AAEA,MAAMC,gBAAgB,GAAGL,OAAO,CAACM,eAAjC;AACA,MAAMC,KAAK,GAAG,EAAd;AAGA,MAAMC,YAAY,GAAGC,MAAM,CAACC,IAAP,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F,EAGkBC,SAAS,GAAGD,KAAH,GAAW,cAHtC;AAKA,WAAO,IAAP;AACD;;AACD,SAAO,KAAP;AACD;;AAED,SAASE,gBAAT,CAA0BF,KAA1B,EAAiC;AAC/B,SAAOA,KAAK,KAAKG,SAAV,IAAuBH,KAAK,KAAK,IAAxC;AACD","sourcesContent":["import {assert, formatValue} from '@luma.gl/api';\n\n// Prepares a table suitable for console.table\n/* eslint-disable max-statements, complexity */\nexport function getDebugTableForUniforms(options?: {\n header?: string;\n program: any;\n uniforms: any;\n undefinedOnly?: boolean;\n}): {\n table: {};\n count: number;\n unusedTable: {};\n unusedCount: number;\n} {\n const {\n header = 'Uniforms',\n program,\n uniforms,\n undefinedOnly = false\n } = options;\n assert(program);\n\n const SHADER_MODULE_UNIFORM_REGEXP = '.*_.*';\n const PROJECT_MODULE_UNIFORM_REGEXP = '.*Matrix'; // TODO - Use explicit list\n\n const uniformLocations = program._uniformSetters;\n const table = {}; // {[header]: {}};\n\n // Add program's provided uniforms (in alphabetical order)\n const uniformNames = Object.keys(uniformLocations).sort();\n\n let count = 0;\n\n // First add non-underscored uniforms (assumed not coming from shader modules)\n for (const uniformName of uniformNames) {\n if (\n !uniformName.match(SHADER_MODULE_UNIFORM_REGEXP) &&\n !uniformName.match(PROJECT_MODULE_UNIFORM_REGEXP)\n ) {\n if (addUniformToTable({table, header, uniforms, uniformName, undefinedOnly})) {\n count++;\n }\n }\n }\n\n // add underscored uniforms (assumed from shader modules)\n for (const uniformName of uniformNames) {\n if (uniformName.match(PROJECT_MODULE_UNIFORM_REGEXP)) {\n if (addUniformToTable({table, header, uniforms, uniformName, undefinedOnly})) {\n count++;\n }\n }\n }\n\n for (const uniformName of uniformNames) {\n if (!table[uniformName]) {\n if (addUniformToTable({table, header, uniforms, uniformName, undefinedOnly})) {\n count++;\n }\n }\n }\n\n // Create a table of unused uniforms\n let unusedCount = 0;\n const unusedTable = {};\n if (!undefinedOnly) {\n for (const uniformName in uniforms) {\n const uniform = uniforms[uniformName];\n if (!table[uniformName]) {\n unusedCount++;\n unusedTable[uniformName] = {\n Type: `NOT USED: ${uniform}`,\n [header]: formatValue(uniform)\n };\n }\n }\n }\n\n return {table, count, unusedTable, unusedCount};\n}\n\n// Helper\nfunction addUniformToTable({table, header, uniforms, uniformName, undefinedOnly}) {\n const value = uniforms[uniformName];\n const isDefined = isUniformDefined(value);\n if (!undefinedOnly || !isDefined) {\n table[uniformName] = {\n // Add program's unprovided uniforms\n [header]: isDefined ? formatValue(value) : 'N/A',\n 'Uniform Type': isDefined ? value : 'NOT PROVIDED'\n };\n return true;\n }\n return false;\n}\n\nfunction isUniformDefined(value) {\n return value !== undefined && value !== null;\n}\n"],"file":"debug-uniforms.js"}
|
|
@@ -7,38 +7,39 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.getDebugTableForVertexArray = getDebugTableForVertexArray;
|
|
9
9
|
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _api = require("@luma.gl/api");
|
|
13
|
+
|
|
10
14
|
var _webglBuffer = _interopRequireDefault(require("../classes/webgl-buffer"));
|
|
11
15
|
|
|
12
|
-
var
|
|
16
|
+
var _constantsToKeys = require("../webgl-utils/constants-to-keys");
|
|
13
17
|
|
|
14
18
|
var _attributeUtils = require("../webgl-utils/attribute-utils");
|
|
15
19
|
|
|
16
|
-
var _utils = require("../utils");
|
|
17
|
-
|
|
18
20
|
function getDebugTableForVertexArray(options) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = options;
|
|
21
|
+
var vertexArray = options.vertexArray,
|
|
22
|
+
_options$header = options.header,
|
|
23
|
+
header = _options$header === void 0 ? 'Attributes' : _options$header;
|
|
23
24
|
|
|
24
25
|
if (!vertexArray.configuration) {
|
|
25
26
|
return {};
|
|
26
27
|
}
|
|
27
28
|
|
|
28
|
-
|
|
29
|
+
var table = {};
|
|
29
30
|
|
|
30
31
|
if (vertexArray.elements) {
|
|
31
32
|
table.ELEMENT_ARRAY_BUFFER = getDebugTableRow(vertexArray, vertexArray.elements, null, header);
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
|
|
35
|
+
var attributes = vertexArray.values;
|
|
35
36
|
|
|
36
|
-
for (
|
|
37
|
-
|
|
37
|
+
for (var attributeLocation in attributes) {
|
|
38
|
+
var info = vertexArray._getAttributeInfo(attributeLocation);
|
|
38
39
|
|
|
39
40
|
if (info) {
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
var rowHeader = "".concat(attributeLocation, ": ").concat(info.name);
|
|
42
|
+
var accessor = vertexArray.accessors[info.location];
|
|
42
43
|
|
|
43
44
|
if (accessor) {
|
|
44
45
|
rowHeader = "".concat(attributeLocation, ": ").concat(getGLSLDeclaration(info.name, accessor));
|
|
@@ -52,24 +53,23 @@ function getDebugTableForVertexArray(options) {
|
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
function getDebugTableRow(vertexArray, attribute, accessor, header) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
var _ref3;
|
|
57
|
+
|
|
58
|
+
var gl = vertexArray.gl;
|
|
58
59
|
|
|
59
60
|
if (!attribute) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
};
|
|
61
|
+
var _ref;
|
|
62
|
+
|
|
63
|
+
return _ref = {}, (0, _defineProperty2.default)(_ref, header, 'null'), (0, _defineProperty2.default)(_ref, 'Format ', 'N/A'), _ref;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
var type = 'NOT PROVIDED';
|
|
67
|
+
var size = 1;
|
|
68
|
+
var verts = 0;
|
|
69
|
+
var bytes = 0;
|
|
70
|
+
var isInteger;
|
|
71
|
+
var marker;
|
|
72
|
+
var value;
|
|
73
73
|
|
|
74
74
|
if (accessor) {
|
|
75
75
|
type = accessor.type;
|
|
@@ -79,53 +79,48 @@ function getDebugTableRow(vertexArray, attribute, accessor, header) {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
if (attribute instanceof _webglBuffer.default) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
var _ref2;
|
|
83
|
+
|
|
84
|
+
var buffer = attribute;
|
|
85
|
+
|
|
86
|
+
var _buffer$getDebugData = buffer.getDebugData(),
|
|
87
|
+
data = _buffer$getDebugData.data,
|
|
88
|
+
changed = _buffer$getDebugData.changed;
|
|
89
|
+
|
|
87
90
|
marker = changed ? '*' : '';
|
|
88
91
|
value = data;
|
|
89
92
|
bytes = buffer.byteLength;
|
|
90
93
|
verts = bytes / data.BYTES_PER_ELEMENT / size;
|
|
91
|
-
|
|
94
|
+
var format;
|
|
92
95
|
|
|
93
96
|
if (accessor) {
|
|
94
|
-
|
|
95
|
-
format = "".concat(instanced ? 'I ' : 'P ', " ").concat(verts, " (x").concat(size, "=").concat(bytes, " bytes ").concat((0,
|
|
97
|
+
var instanced = accessor.divisor > 0;
|
|
98
|
+
format = "".concat(instanced ? 'I ' : 'P ', " ").concat(verts, " (x").concat(size, "=").concat(bytes, " bytes ").concat((0, _constantsToKeys.getKey)(gl, type), ")");
|
|
96
99
|
} else {
|
|
97
100
|
isInteger = true;
|
|
98
101
|
format = "".concat(bytes, " bytes");
|
|
99
102
|
}
|
|
100
103
|
|
|
101
|
-
return {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
})),
|
|
106
|
-
'Format ': format
|
|
107
|
-
};
|
|
104
|
+
return _ref2 = {}, (0, _defineProperty2.default)(_ref2, header, "".concat(marker).concat((0, _api.formatValue)(value, {
|
|
105
|
+
size: size,
|
|
106
|
+
isInteger: isInteger
|
|
107
|
+
}))), (0, _defineProperty2.default)(_ref2, 'Format ', format), _ref2;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
value = attribute;
|
|
111
111
|
size = attribute.length;
|
|
112
112
|
type = String(attribute.constructor.name).replace('Array', '');
|
|
113
113
|
isInteger = type.indexOf('nt') !== -1;
|
|
114
|
-
return {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}), " (constant)"),
|
|
119
|
-
'Format ': "".concat(size, "x").concat(type, " (constant)")
|
|
120
|
-
};
|
|
114
|
+
return _ref3 = {}, (0, _defineProperty2.default)(_ref3, header, "".concat((0, _api.formatValue)(value, {
|
|
115
|
+
size: size,
|
|
116
|
+
isInteger: isInteger
|
|
117
|
+
}), " (constant)")), (0, _defineProperty2.default)(_ref3, 'Format ', "".concat(size, "x").concat(type, " (constant)")), _ref3;
|
|
121
118
|
}
|
|
122
119
|
|
|
123
120
|
function getGLSLDeclaration(name, accessor) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
} = accessor;
|
|
128
|
-
const typeAndName = (0, _attributeUtils.getCompositeGLType)(type, size);
|
|
121
|
+
var type = accessor.type,
|
|
122
|
+
size = accessor.size;
|
|
123
|
+
var typeAndName = (0, _attributeUtils.getCompositeGLType)(type, size);
|
|
129
124
|
return typeAndName ? "".concat(name, " (").concat(typeAndName.name, ")") : name;
|
|
130
125
|
}
|
|
131
126
|
//# sourceMappingURL=debug-vertex-array.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/debug/debug-vertex-array.ts"],"names":["getDebugTableForVertexArray","options","vertexArray","header","configuration","table","elements","ELEMENT_ARRAY_BUFFER","getDebugTableRow","attributes","values","attributeLocation","info","_getAttributeInfo","rowHeader","name","accessor","accessors","location","getGLSLDeclaration","attribute","gl","type","size","verts","bytes","isInteger","marker","value","String","replace","indexOf","Buffer","buffer","
|
|
1
|
+
{"version":3,"sources":["../../../src/debug/debug-vertex-array.ts"],"names":["getDebugTableForVertexArray","options","vertexArray","header","configuration","table","elements","ELEMENT_ARRAY_BUFFER","getDebugTableRow","attributes","values","attributeLocation","info","_getAttributeInfo","rowHeader","name","accessor","accessors","location","getGLSLDeclaration","attribute","gl","type","size","verts","bytes","isInteger","marker","value","String","replace","indexOf","Buffer","buffer","getDebugData","data","changed","byteLength","BYTES_PER_ELEMENT","format","instanced","divisor","length","constructor","typeAndName"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AAGO,SAASA,2BAAT,CAAqCC,OAArC,EAAwF;AAC7F,MAAOC,WAAP,GAA6CD,OAA7C,CAAOC,WAAP;AAAA,wBAA6CD,OAA7C,CAAoBE,MAApB;AAAA,MAAoBA,MAApB,gCAA6B,YAA7B;;AAEA,MAAI,CAACD,WAAW,CAACE,aAAjB,EAAgC;AAC9B,WAAO,EAAP;AACD;;AAED,MAAMC,KAAK,GAAG,EAAd;;AAGA,MAAIH,WAAW,CAACI,QAAhB,EAA0B;AAGxBD,IAAAA,KAAK,CAACE,oBAAN,GAA6BC,gBAAgB,CAACN,WAAD,EAAcA,WAAW,CAACI,QAA1B,EAAoC,IAApC,EAA0CH,MAA1C,CAA7C;AACD;;AAGD,MAAMM,UAAU,GAAGP,WAAW,CAACQ,MAA/B;;AAEA,OAAK,IAAMC,iBAAX,IAAgCF,UAAhC,EAA4C;AAC1C,QAAMG,IAAI,GAAGV,WAAW,CAACW,iBAAZ,CAA8BF,iBAA9B,CAAb;;AACA,QAAIC,IAAJ,EAAU;AACR,UAAIE,SAAS,aAAMH,iBAAN,eAA4BC,IAAI,CAACG,IAAjC,CAAb;AACA,UAAMC,QAAQ,GAAGd,WAAW,CAACe,SAAZ,CAAsBL,IAAI,CAACM,QAA3B,CAAjB;;AACA,UAAIF,QAAJ,EAAc;AACZF,QAAAA,SAAS,aAAMH,iBAAN,eAA4BQ,kBAAkB,CAACP,IAAI,CAACG,IAAN,EAAYC,QAAZ,CAA9C,CAAT;AACD;;AACDX,MAAAA,KAAK,CAACS,SAAD,CAAL,GAAmBN,gBAAgB,CACjCN,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B,CAApB;AACA,SAAOqB,WAAW,aAAM7B,IAAN,eAAe6B,WAAW,CAAC7B,IAA3B,SAAqCA,IAAvD;AACD","sourcesContent":["import {formatValue} from '@luma.gl/api';\nimport Buffer from '../classes/webgl-buffer';\nimport {getKey} from '../webgl-utils/constants-to-keys';\nimport {getCompositeGLType} from '../webgl-utils/attribute-utils';\n\n// Creates object suitable as input for console.table\nexport function getDebugTableForVertexArray(options?: {vertexArray: any; header?: string}): {} {\n const {vertexArray, header = 'Attributes'} = options;\n\n if (!vertexArray.configuration) {\n return {};\n }\n\n const table = {}; // {[header]: {}};\n\n // Add index (elements) if available\n if (vertexArray.elements) {\n // const elements = Object.assign({size: 1}, vertexArray.elements);\n // @ts-expect-error\n table.ELEMENT_ARRAY_BUFFER = getDebugTableRow(vertexArray, vertexArray.elements, null, header);\n }\n\n // Add used attributes\n const attributes = vertexArray.values;\n\n for (const attributeLocation in attributes) {\n const info = vertexArray._getAttributeInfo(attributeLocation);\n if (info) {\n let rowHeader = `${attributeLocation}: ${info.name}`;\n const accessor = vertexArray.accessors[info.location];\n if (accessor) {\n rowHeader = `${attributeLocation}: ${getGLSLDeclaration(info.name, accessor)}`;\n }\n table[rowHeader] = getDebugTableRow(\n vertexArray,\n attributes[attributeLocation],\n accessor,\n header\n );\n }\n }\n\n return table;\n}\n\n/* eslint-disable max-statements */\nfunction getDebugTableRow(vertexArray, attribute, accessor, header) {\n const {gl} = vertexArray;\n\n if (!attribute) {\n return {\n [header]: 'null',\n 'Format ': 'N/A'\n };\n }\n\n let type = 'NOT PROVIDED';\n let size = 1;\n let verts = 0;\n let bytes = 0;\n\n let isInteger;\n let marker;\n let value;\n\n if (accessor) {\n type = accessor.type;\n size = accessor.size;\n\n // Generate a type name by dropping Array from Float32Array etc.\n type = String(type).replace('Array', '');\n\n // Look for 'nt' to detect integer types, e.g. Int32Array, Uint32Array\n isInteger = type.indexOf('nt') !== -1;\n }\n\n if (attribute instanceof Buffer) {\n const buffer = attribute;\n\n const {data, changed} = buffer.getDebugData();\n marker = changed ? '*' : '';\n\n value = data;\n bytes = buffer.byteLength;\n verts = bytes / data.BYTES_PER_ELEMENT / size;\n\n let format;\n\n if (accessor) {\n const instanced = accessor.divisor > 0;\n format = `${instanced ? 'I ' : 'P '} ${verts} (x${size}=${bytes} bytes ${getKey(gl, type)})`;\n } else {\n // element buffer\n isInteger = true;\n format = `${bytes} bytes`;\n }\n\n return {\n [header]: `${marker}${formatValue(value, {size, isInteger})}`,\n 'Format ': format\n };\n }\n\n // CONSTANT VALUE\n value = attribute;\n size = attribute.length;\n // Generate a type name by dropping Array from Float32Array etc.\n type = String(attribute.constructor.name).replace('Array', '');\n // Look for 'nt' to detect integer types, e.g. Int32Array, Uint32Array\n isInteger = type.indexOf('nt') !== -1;\n\n return {\n [header]: `${formatValue(value, {size, isInteger})} (constant)`,\n 'Format ': `${size}x${type} (constant)`\n };\n}\n/* eslint-ensable max-statements */\n\nfunction getGLSLDeclaration(name, accessor) {\n const {type, size} = accessor;\n const typeAndName = getCompositeGLType(type, size);\n return typeAndName ? `${name} (${typeAndName.name})` : name;\n}\n"],"file":"debug-vertex-array.js"}
|