{ "version": 3, "sources": ["index.js", "adapter/webgl-device.js", "context/state-tracker/track-context-state.js", "context/parameters/webgl-parameter-tables.js", "context/parameters/unified-parameter-api.js", "context/state-tracker/deep-array-equal.js", "context/helpers/create-browser-context.js", "adapter/device-helpers/webgl-device-info.js", "context/helpers/webgl-extensions.js", "adapter/device-helpers/webgl-device-features.js", "adapter/converters/texture-formats.js", "adapter/converters/vertex-formats.js", "adapter/device-helpers/webgl-device-limits.js", "adapter/webgl-canvas-context.js", "adapter/resources/webgl-framebuffer.js", "adapter/resources/webgl-texture.js", "context/state-tracker/with-parameters.js", "adapter/converters/sampler-parameters.js", "adapter/converters/device-parameters.js", "adapter/resources/webgl-buffer.js", "adapter/resources/webgl-sampler.js", "adapter/resources/webgl-texture-view.js", "context/debug/spector.js", "context/debug/webgl-developer-tools.js", "adapter/resources/webgl-shader.js", "adapter/helpers/parse-shader-compiler-log.js", "adapter/resources/webgl-render-pass.js", "adapter/resources/webgl-render-pipeline.js", "adapter/helpers/get-shader-layout.js", "classic/accessor.js", "classic/typed-array-utils.js", "adapter/helpers/decode-webgl-types.js", "adapter/helpers/set-uniform.js", "adapter/helpers/webgl-topology-utils.js", "adapter/resources/webgl-command-encoder.js", "adapter/resources/webgl-command-buffer.js", "adapter/resources/webgl-vertex-array.js", "adapter/resources/webgl-transform-feedback.js", "adapter/resources/webgl-query-set.js", "classic/copy-and-blit.js", "classic/format-utils.js", "classic/clear.js", "adapter/objects/webgl-resource.js", "adapter/objects/webgl-renderbuffer.js"], "sourcesContent": ["// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// WebGL adapter classes\nexport { WebGLDevice } from \"./adapter/webgl-device.js\";\nexport { WebGLCanvasContext } from \"./adapter/webgl-canvas-context.js\";\n// WebGL Resource classes\nexport { WebGLResource, WebGLResource as WEBGLResource } from \"./adapter/objects/webgl-resource.js\";\nexport { WEBGLBuffer } from \"./adapter/resources/webgl-buffer.js\";\nexport { WEBGLTexture } from \"./adapter/resources/webgl-texture.js\";\n// export {WEBGLExternalTexture} from './adapter/resources/webgl-external-texture';\nexport { WEBGLShader } from \"./adapter/resources/webgl-shader.js\";\nexport { WEBGLSampler } from \"./adapter/resources/webgl-sampler.js\";\nexport { WEBGLFramebuffer } from \"./adapter/resources/webgl-framebuffer.js\";\nexport { WEBGLRenderPipeline } from \"./adapter/resources/webgl-render-pipeline.js\";\n// export {WEBGLComputePipeline} from './adapter/resources/webgl-compute-pipeline';\nexport { WEBGLCommandEncoder } from \"./adapter/resources/webgl-command-encoder.js\";\nexport { WEBGLRenderPass } from \"./adapter/resources/webgl-render-pass.js\";\n// export {WEBGLComputePass} from './adapter/resources/webgl-compute-pass';\nexport { WEBGLVertexArray } from \"./adapter/resources/webgl-vertex-array.js\";\n// WebGL adapter classes\nexport { WEBGLTransformFeedback } from \"./adapter/resources/webgl-transform-feedback.js\";\n// WebGL adapter classes\nexport { Accessor } from \"./classic/accessor.js\";\n// Unified parameter API\nexport { setDeviceParameters, withDeviceParameters } from \"./adapter/converters/device-parameters.js\";\n// HELPERS - EXPERIMENTAL\nexport { getShaderLayout } from \"./adapter/helpers/get-shader-layout.js\";\nexport { convertGLToTextureFormat } from \"./adapter/converters/texture-formats.js\";\nexport { WEBGLRenderbuffer as _WEBGLRenderbuffer } from \"./adapter/objects/webgl-renderbuffer.js\";\n// TEST EXPORTS\nexport { TEXTURE_FORMATS as _TEXTURE_FORMATS } from \"./adapter/converters/texture-formats.js\";\n// DEPRECATED TEST EXPORTS\n// State tracking\nexport { trackContextState, pushContextState, popContextState } from \"./context/state-tracker/track-context-state.js\";\nexport { resetGLParameters, setGLParameters, getGLParameters } from \"./context/parameters/unified-parameter-api.js\";\nexport { withGLParameters } from \"./context/state-tracker/with-parameters.js\";\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Device, CanvasContext, log, uid, assert } from '@luma.gl/core';\nimport { popContextState, pushContextState, trackContextState } from \"../context/state-tracker/track-context-state.js\";\nimport { createBrowserContext } from \"../context/helpers/create-browser-context.js\";\nimport { getDeviceInfo } from \"./device-helpers/webgl-device-info.js\";\nimport { WebGLDeviceFeatures } from \"./device-helpers/webgl-device-features.js\";\nimport { WebGLDeviceLimits } from \"./device-helpers/webgl-device-limits.js\";\nimport { WebGLCanvasContext } from \"./webgl-canvas-context.js\";\nimport { loadSpectorJS, initializeSpectorJS } from \"../context/debug/spector.js\";\nimport { loadWebGLDeveloperTools, makeDebugContext } from \"../context/debug/webgl-developer-tools.js\";\nimport { isTextureFormatSupported, isTextureFormatRenderable, isTextureFormatFilterable } from \"./converters/texture-formats.js\";\nimport { WEBGLBuffer } from \"./resources/webgl-buffer.js\";\nimport { WEBGLShader } from \"./resources/webgl-shader.js\";\nimport { WEBGLSampler } from \"./resources/webgl-sampler.js\";\nimport { WEBGLTexture } from \"./resources/webgl-texture.js\";\nimport { WEBGLFramebuffer } from \"./resources/webgl-framebuffer.js\";\nimport { WEBGLRenderPass } from \"./resources/webgl-render-pass.js\";\nimport { WEBGLRenderPipeline } from \"./resources/webgl-render-pipeline.js\";\nimport { WEBGLCommandEncoder } from \"./resources/webgl-command-encoder.js\";\nimport { WEBGLVertexArray } from \"./resources/webgl-vertex-array.js\";\nimport { WEBGLTransformFeedback } from \"./resources/webgl-transform-feedback.js\";\nimport { WEBGLQuerySet } from \"./resources/webgl-query-set.js\";\nimport { readPixelsToArray, readPixelsToBuffer } from \"../classic/copy-and-blit.js\";\nimport { setGLParameters, getGLParameters, resetGLParameters } from \"../context/parameters/unified-parameter-api.js\";\nimport { withGLParameters } from \"../context/state-tracker/with-parameters.js\";\nimport { clear } from \"../classic/clear.js\";\nimport { getWebGLExtension } from \"../context/helpers/webgl-extensions.js\";\nconst LOG_LEVEL = 1;\n/** WebGPU style Device API for a WebGL context */\nexport class WebGLDevice extends Device {\n //\n // Public `Device` API\n //\n /** type of this device */\n static type = 'webgl';\n /** type of this device */\n type = 'webgl';\n /** The underlying WebGL context */\n handle;\n features;\n limits;\n info;\n canvasContext;\n lost;\n _resolveContextLost;\n //\n // Static methods, expected to be present by `luma.createDevice()`\n //\n /** Check if WebGL 2 is available */\n static isSupported() {\n return typeof WebGL2RenderingContext !== 'undefined';\n }\n /**\n * Get a device instance from a GL context\n * Creates and instruments the device if not already created\n * @param gl\n * @returns\n */\n static attach(gl) {\n if (gl instanceof WebGLDevice) {\n return gl;\n }\n // @ts-expect-error\n if (gl?.device instanceof Device) {\n // @ts-expect-error\n return gl.device;\n }\n if (!isWebGL(gl)) {\n throw new Error('Invalid WebGL2RenderingContext');\n }\n return new WebGLDevice({ gl: gl });\n }\n static async create(props = {}) {\n log.groupCollapsed(LOG_LEVEL, 'WebGLDevice created')();\n const promises = [];\n // Load webgl and spector debug scripts from CDN if requested\n if (props.debug) {\n promises.push(loadWebGLDeveloperTools());\n }\n if (props.spector) {\n promises.push(loadSpectorJS());\n }\n // Wait for page to load: if canvas is a string we need to query the DOM for the canvas element.\n // We only wait when props.canvas is string to avoids setting the global page onload callback unless necessary.\n if (typeof props.canvas === 'string') {\n promises.push(CanvasContext.pageLoaded);\n }\n // Wait for all the loads to settle before creating the context.\n // The Device.create() functions are async, so in contrast to the constructor, we can `await` here.\n const results = await Promise.allSettled(promises);\n for (const result of results) {\n if (result.status === 'rejected') {\n log.error(`Failed to initialize debug libraries ${result.reason}`)();\n }\n }\n log.probe(LOG_LEVEL + 1, 'DOM is loaded')();\n // @ts-expect-error\n if (props.gl?.device) {\n log.warn('reattaching existing device')();\n return WebGLDevice.attach(props.gl);\n }\n const device = new WebGLDevice(props);\n // Log some debug info about the newly created context\n const message = `\\\nCreated ${device.type}${device.debug ? ' debug' : ''} context: \\\n${device.info.vendor}, ${device.info.renderer} for canvas: ${device.canvasContext.id}`;\n log.probe(LOG_LEVEL, message)();\n log.table(LOG_LEVEL, device.info)();\n log.groupEnd(LOG_LEVEL)();\n return device;\n }\n //\n // Public API\n //\n constructor(props) {\n super({ ...props, id: props.id || uid('webgl-device') });\n // If attaching to an already attached context, return the attached device\n // @ts-expect-error device is attached to context\n const device = props.gl?.device;\n if (device) {\n throw new Error(`WebGL context already attached to device ${device.id}`);\n }\n // Create and instrument context\n const canvas = props.gl?.canvas || props.canvas;\n this.canvasContext = new WebGLCanvasContext(this, { ...props, canvas });\n this.lost = new Promise(resolve => {\n this._resolveContextLost = resolve;\n });\n let gl = props.gl || null;\n gl ||= createBrowserContext(this.canvasContext.canvas, {\n ...props,\n onContextLost: (event) => this._resolveContextLost?.({\n reason: 'destroyed',\n message: 'Entered sleep mode, or too many apps or browser tabs are using the GPU.'\n })\n });\n if (!gl) {\n throw new Error('WebGL context creation failed');\n }\n this.handle = gl;\n this.gl = gl;\n this.gl.device = this; // Update GL context: Link webgl context back to device\n this.gl._version = 2; // Update GL context: Store WebGL version field on gl context (HACK to identify debug contexts)\n if (props.spector) {\n this.spectorJS = initializeSpectorJS({ ...this.props, canvas: this.handle.canvas });\n }\n // luma Device fields\n this.info = getDeviceInfo(this.gl, this._extensions);\n this.limits = new WebGLDeviceLimits(this.gl);\n this.features = new WebGLDeviceFeatures(this.gl, this._extensions, this.props.disabledFeatures);\n if (this.props.initalizeFeatures) {\n this.features.initializeFeatures();\n }\n this.canvasContext.resize();\n // Install context state tracking\n // @ts-expect-error - hidden parameters\n const { enable = true, copyState = false } = props;\n trackContextState(this.gl, {\n enable,\n copyState,\n log: (...args) => log.log(1, ...args)()\n });\n // DEBUG contexts: Add debug instrumentation to the context, force log level to at least 1\n if (props.debug) {\n this.gl = makeDebugContext(this.gl, { ...props, throwOnError: true });\n this.debug = true;\n log.level = Math.max(log.level, 1);\n log.warn('WebGL debug mode activated. Performance reduced.')();\n }\n }\n /**\n * Destroys the context\n * @note Has no effect for WebGL browser contexts, there is no browser API for destroying contexts\n */\n destroy() { }\n get isLost() {\n return this.gl.isContextLost();\n }\n getSize() {\n return [this.gl.drawingBufferWidth, this.gl.drawingBufferHeight];\n }\n isTextureFormatSupported(format) {\n return isTextureFormatSupported(this.gl, format, this._extensions);\n }\n isTextureFormatFilterable(format) {\n return isTextureFormatFilterable(this.gl, format, this._extensions);\n }\n isTextureFormatRenderable(format) {\n return isTextureFormatRenderable(this.gl, format, this._extensions);\n }\n // IMPLEMENTATION OF ABSTRACT DEVICE\n createCanvasContext(props) {\n throw new Error('WebGL only supports a single canvas');\n }\n createBuffer(props) {\n const newProps = this._getBufferProps(props);\n return new WEBGLBuffer(this, newProps);\n }\n _createTexture(props) {\n return new WEBGLTexture(this, props);\n }\n createExternalTexture(props) {\n throw new Error('createExternalTexture() not implemented'); // return new Program(props);\n }\n createSampler(props) {\n return new WEBGLSampler(this, props);\n }\n createShader(props) {\n return new WEBGLShader(this, props);\n }\n createFramebuffer(props) {\n return new WEBGLFramebuffer(this, props);\n }\n createVertexArray(props) {\n return new WEBGLVertexArray(this, props);\n }\n createTransformFeedback(props) {\n return new WEBGLTransformFeedback(this, props);\n }\n createQuerySet(props) {\n return new WEBGLQuerySet(this, props);\n }\n createRenderPipeline(props) {\n return new WEBGLRenderPipeline(this, props);\n }\n beginRenderPass(props) {\n return new WEBGLRenderPass(this, props);\n }\n createComputePipeline(props) {\n throw new Error('ComputePipeline not supported in WebGL');\n }\n beginComputePass(props) {\n throw new Error('ComputePass not supported in WebGL');\n }\n renderPass = null;\n createCommandEncoder(props) {\n return new WEBGLCommandEncoder(this, props);\n }\n /**\n * Offscreen Canvas Support: Commit the frame\n * https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/commit\n * Chrome's offscreen canvas does not require gl.commit\n */\n submit() {\n this.renderPass?.end();\n this.renderPass = null;\n // this.canvasContext.commit();\n }\n //\n // TEMPORARY HACKS - will be removed in v9.1\n //\n /** @deprecated - should use command encoder */\n readPixelsToArrayWebGL(source, options) {\n return readPixelsToArray(source, options);\n }\n /** @deprecated - should use command encoder */\n readPixelsToBufferWebGL(source, options) {\n return readPixelsToBuffer(source, options);\n }\n setParametersWebGL(parameters) {\n setGLParameters(this.gl, parameters);\n }\n getParametersWebGL(parameters) {\n return getGLParameters(this.gl, parameters);\n }\n withParametersWebGL(parameters, func) {\n return withGLParameters(this.gl, parameters, func);\n }\n clearWebGL(options) {\n clear(this, options);\n }\n resetWebGL() {\n log.warn('WebGLDevice.resetWebGL is deprecated, use only for debugging')();\n resetGLParameters(this.gl);\n }\n //\n // WebGL-only API (not part of `Device` API)\n //\n /** WebGL2 context. */\n gl;\n debug = false;\n /** State used by luma.gl classes: TODO - move to canvasContext*/\n _canvasSizeInfo = { clientWidth: 0, clientHeight: 0, devicePixelRatio: 1 };\n /** State used by luma.gl classes - TODO - not used? */\n _extensions = {};\n _polyfilled = false;\n /** Instance of Spector.js (if initialized) */\n spectorJS;\n /**\n * Triggers device (or WebGL context) loss.\n * @note primarily intended for testing how application reacts to device loss\n */\n loseDevice() {\n let deviceLossTriggered = false;\n const extensions = this.getExtension('WEBGL_lose_context');\n const ext = extensions.WEBGL_lose_context;\n if (ext) {\n deviceLossTriggered = true;\n ext.loseContext();\n // ext.loseContext should trigger context loss callback but the platform may not do this, so do it explicitly\n }\n this._resolveContextLost?.({\n reason: 'destroyed',\n message: 'Application triggered context loss'\n });\n return deviceLossTriggered;\n }\n /** Save current WebGL context state onto an internal stack */\n pushState() {\n pushContextState(this.gl);\n }\n /** Restores previously saved context state */\n popState() {\n popContextState(this.gl);\n }\n /**\n * Storing data on a special field on WebGLObjects makes that data visible in SPECTOR chrome debug extension\n * luma.gl ids and props can be inspected\n */\n setSpectorMetadata(handle, props) {\n // @ts-expect-error\n // eslint-disable-next-line camelcase\n handle.__SPECTOR_Metadata = props;\n }\n /**\n * Returns the GL. constant that corresponds to a numeric value of a GL constant\n * Be aware that there are some duplicates especially for constants that are 0,\n * so this isn't guaranteed to return the right key in all cases.\n */\n getGLKey(value, gl) {\n // @ts-ignore expect-error depends on settings\n gl = gl || this.gl2 || this.gl;\n const number = Number(value);\n for (const key in gl) {\n // @ts-ignore expect-error depends on settings\n if (gl[key] === number) {\n return `GL.${key}`;\n }\n }\n // No constant found. Stringify the value and return it.\n return String(value);\n }\n /** Store constants */\n _constants;\n /**\n * Set a constant value for a location. Disabled attributes at that location will read from this value\n * @note WebGL constants are stored globally on the WebGL context, not the VertexArray\n * so they need to be updated before every render\n * @todo - remember/cache values to avoid setting them unnecessarily?\n */\n setConstantAttributeWebGL(location, constant) {\n const maxVertexAttributes = this.limits.maxVertexAttributes;\n this._constants = this._constants || new Array(maxVertexAttributes).fill(null);\n const currentConstant = this._constants[location];\n if (currentConstant && compareConstantArrayValues(currentConstant, constant)) {\n log.info(1, `setConstantAttributeWebGL(${location}) could have been skipped, value unchanged`)();\n }\n this._constants[location] = constant;\n switch (constant.constructor) {\n case Float32Array:\n setConstantFloatArray(this, location, constant);\n break;\n case Int32Array:\n setConstantIntArray(this, location, constant);\n break;\n case Uint32Array:\n setConstantUintArray(this, location, constant);\n break;\n default:\n assert(false);\n }\n }\n /** Ensure extensions are only requested once */\n getExtension(name) {\n getWebGLExtension(this.gl, name, this._extensions);\n return this._extensions;\n }\n}\n/** Check if supplied parameter is a WebGL2RenderingContext */\nfunction isWebGL(gl) {\n if (typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext) {\n return true;\n }\n // Look for debug contexts, headless gl etc\n return Boolean(gl && Number.isFinite(gl._version));\n}\n/** Set constant float array attribute */\nfunction setConstantFloatArray(device, location, array) {\n switch (array.length) {\n case 1:\n device.gl.vertexAttrib1fv(location, array);\n break;\n case 2:\n device.gl.vertexAttrib2fv(location, array);\n break;\n case 3:\n device.gl.vertexAttrib3fv(location, array);\n break;\n case 4:\n device.gl.vertexAttrib4fv(location, array);\n break;\n default:\n assert(false);\n }\n}\n/** Set constant signed int array attribute */\nfunction setConstantIntArray(device, location, array) {\n device.gl.vertexAttribI4iv(location, array);\n // TODO - not clear if we need to use the special forms, more testing needed\n // switch (array.length) {\n // case 1:\n // gl.vertexAttribI1iv(location, array);\n // break;\n // case 2:\n // gl.vertexAttribI2iv(location, array);\n // break;\n // case 3:\n // gl.vertexAttribI3iv(location, array);\n // break;\n // case 4:\n // break;\n // default:\n // assert(false);\n // }\n}\n/** Set constant unsigned int array attribute */\nfunction setConstantUintArray(device, location, array) {\n device.gl.vertexAttribI4uiv(location, array);\n // TODO - not clear if we need to use the special forms, more testing needed\n // switch (array.length) {\n // case 1:\n // gl.vertexAttribI1uiv(location, array);\n // break;\n // case 2:\n // gl.vertexAttribI2uiv(location, array);\n // break;\n // case 3:\n // gl.vertexAttribI3uiv(location, array);\n // break;\n // case 4:\n // gl.vertexAttribI4uiv(location, array);\n // break;\n // default:\n // assert(false);\n // }\n}\n/**\n * Compares contents of two typed arrays\n * @todo max length?\n */\nfunction compareConstantArrayValues(v1, v2) {\n if (!v1 || !v2 || v1.length !== v2.length || v1.constructor !== v2.constructor) {\n return false;\n }\n for (let i = 0; i < v1.length; ++i) {\n if (v1[i] !== v2[i]) {\n return false;\n }\n }\n return true;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// Support for listening to context state changes and intercepting state queries\n// NOTE: this system does not handle buffer bindings\nimport { assert } from '@luma.gl/core';\nimport { GL_PARAMETER_DEFAULTS, GL_HOOKED_SETTERS, NON_CACHE_PARAMETERS } from \"../parameters/webgl-parameter-tables.js\";\nimport { setGLParameters, getGLParameters } from \"../parameters/unified-parameter-api.js\";\nimport { deepArrayEqual } from \"./deep-array-equal.js\";\n// HELPER CLASS - GLState\n/* eslint-disable no-shadow */\nclass GLState {\n gl;\n program = null;\n stateStack = [];\n enable = true;\n cache;\n log;\n constructor(gl, { copyState = false, // Copy cache from params (slow) or initialize from WebGL defaults (fast)\n log = () => { } // Logging function, called when gl parameter change calls are actually issued\n } = {}) {\n this.gl = gl;\n this.cache = copyState ? getGLParameters(gl) : Object.assign({}, GL_PARAMETER_DEFAULTS);\n this.log = log;\n this._updateCache = this._updateCache.bind(this);\n Object.seal(this);\n }\n push(values = {}) {\n this.stateStack.push({});\n }\n pop() {\n assert(this.stateStack.length > 0);\n // Use the saved values in the state stack to restore parameters\n const oldValues = this.stateStack[this.stateStack.length - 1];\n setGLParameters(this.gl, oldValues);\n // Don't pop until we have reset parameters (to make sure other \"stack frames\" are not affected)\n this.stateStack.pop();\n }\n /**\n // interceptor for context set functions - update our cache and our stack\n // values (Object) - the key values for this setter\n * @param values\n * @returns\n */\n _updateCache(values) {\n let valueChanged = false;\n let oldValue; // = undefined\n const oldValues = this.stateStack.length > 0 ? this.stateStack[this.stateStack.length - 1] : null;\n for (const key in values) {\n assert(key !== undefined);\n const value = values[key];\n const cached = this.cache[key];\n // Check that value hasn't already been shadowed\n if (!deepArrayEqual(value, cached)) {\n valueChanged = true;\n oldValue = cached;\n // First, save current value being shadowed\n // If a state stack frame is active, save the current parameter values for pop\n // but first check that value hasn't already been shadowed and saved\n if (oldValues && !(key in oldValues)) {\n oldValues[key] = cached;\n }\n // Save current value being shadowed\n this.cache[key] = value;\n }\n }\n return { valueChanged, oldValue };\n }\n}\nfunction getContextState(gl) {\n // @ts-expect-error\n return gl.state;\n}\n// PUBLIC API\n/**\n * Initialize WebGL state caching on a context\n * can be called multiple times to enable/disable\n *\n * @note After calling this function, context state will be cached\n * gl.state.push() and gl.state.pop() will be available for saving,\n * temporarily modifying, and then restoring state.\n */\nexport function trackContextState(gl, options) {\n const { enable = true, copyState } = options;\n assert(copyState !== undefined);\n // @ts-expect-error\n if (!gl.state) {\n // @ts-ignore\n // const {polyfillContext} = global_;\n // if (polyfillContext) {\n // polyfillContext(gl);\n // }\n // Create a state cache\n // @ts-expect-error\n gl.state = new GLState(gl, { copyState });\n installProgramSpy(gl);\n // intercept all setter functions in the table\n for (const key in GL_HOOKED_SETTERS) {\n const setter = GL_HOOKED_SETTERS[key];\n installSetterSpy(gl, key, setter);\n }\n // intercept all getter functions in the table\n installGetterOverride(gl, 'getParameter');\n installGetterOverride(gl, 'isEnabled');\n }\n const glState = getContextState(gl);\n glState.enable = enable;\n return gl;\n}\n/**\n * Saves current WebGL context state onto an internal per-context stack\n */\nexport function pushContextState(gl) {\n let glState = getContextState(gl);\n if (!glState) {\n trackContextState(gl, { copyState: false });\n glState = getContextState(gl);\n }\n glState.push();\n}\n/**\n * Restores previously saved WebGL context state\n */\nexport function popContextState(gl) {\n const glState = getContextState(gl);\n assert(glState);\n glState.pop();\n}\n// HELPER FUNCTIONS - INSTALL GET/SET INTERCEPTORS (SPYS) ON THE CONTEXT\n/**\n// Overrides a WebGL2RenderingContext state \"getter\" function\n// to return values directly from cache\n * @param gl\n * @param functionName\n */\nfunction installGetterOverride(gl, functionName) {\n // Get the original function from the WebGL2RenderingContext\n const originalGetterFunc = gl[functionName].bind(gl);\n // Wrap it with a spy so that we can update our state cache when it gets called\n gl[functionName] = function get(pname) {\n if (pname === undefined || NON_CACHE_PARAMETERS.has(pname)) {\n // Invalid or blacklisted parameter, do not cache\n return originalGetterFunc(pname);\n }\n const glState = getContextState(gl);\n if (!(pname in glState.cache)) {\n // WebGL limits are not prepopulated in the cache, call the original getter when first queried.\n glState.cache[pname] = originalGetterFunc(pname);\n }\n // Optionally call the original function to do a \"hard\" query from the WebGL2RenderingContext\n return glState.enable\n ? // Call the getter the params so that it can e.g. serve from a cache\n glState.cache[pname]\n : // Optionally call the original function to do a \"hard\" query from the WebGL2RenderingContext\n originalGetterFunc(pname);\n };\n // Set the name of this anonymous function to help in debugging and profiling\n Object.defineProperty(gl[functionName], 'name', {\n value: `${functionName}-from-cache`,\n configurable: false\n });\n}\n/**\n// Overrides a WebGL2RenderingContext state \"setter\" function\n// to call a setter spy before the actual setter. Allows us to keep a cache\n// updated with a copy of the WebGL context state.\n * @param gl\n * @param functionName\n * @param setter\n * @returns\n */\nfunction installSetterSpy(gl, functionName, setter) {\n // Get the original function from the WebGL2RenderingContext\n if (!gl[functionName]) {\n // TODO - remove?\n // This could happen if we try to intercept WebGL2 method on a WebGL1 context\n return;\n }\n const originalSetterFunc = gl[functionName].bind(gl);\n // Wrap it with a spy so that we can update our state cache when it gets called\n gl[functionName] = function set(...params) {\n // Update the value\n // Call the setter with the state cache and the params so that it can store the parameters\n const glState = getContextState(gl);\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { valueChanged, oldValue } = setter(glState._updateCache, ...params);\n // Call the original WebGL2RenderingContext func to make sure the context actually gets updated\n if (valueChanged) {\n originalSetterFunc(...params);\n }\n // Note: if the original function fails to set the value, our state cache will be bad\n // No solution for this at the moment, but assuming that this is unlikely to be a real problem\n // We could call the setter after the originalSetterFunc. Concern is that this would\n // cause different behavior in debug mode, where originalSetterFunc can throw exceptions\n return oldValue;\n };\n // Set the name of this anonymous function to help in debugging and profiling\n Object.defineProperty(gl[functionName], 'name', {\n value: `${functionName}-to-cache`,\n configurable: false\n });\n}\nfunction installProgramSpy(gl) {\n const originalUseProgram = gl.useProgram.bind(gl);\n gl.useProgram = function useProgramLuma(handle) {\n const glState = getContextState(gl);\n if (glState.program !== handle) {\n originalUseProgram(handle);\n glState.program = handle;\n }\n };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// Tables describing WebGL parameters\nimport { GL } from '@luma.gl/constants';\n// DEFAULT SETTINGS - FOR FAST CACHE INITIALIZATION AND CONTEXT RESETS\n/* eslint-disable no-shadow */\nexport const GL_PARAMETER_DEFAULTS = {\n [3042]: false,\n [32773]: new Float32Array([0, 0, 0, 0]),\n [32777]: 32774,\n [34877]: 32774,\n [32969]: 1,\n [32968]: 0,\n [32971]: 1,\n [32970]: 0,\n [3106]: new Float32Array([0, 0, 0, 0]), // TBD\n [3107]: [true, true, true, true],\n [2884]: false,\n [2885]: 1029,\n [2929]: false,\n [2931]: 1,\n [2932]: 513,\n [2928]: new Float32Array([0, 1]), // TBD\n [2930]: true,\n [3024]: true,\n [35725]: null,\n // FRAMEBUFFER_BINDING and DRAW_FRAMEBUFFER_BINDING(WebGL2) refer same state.\n [36006]: null,\n [36007]: null,\n [34229]: null,\n [34964]: null,\n [2886]: 2305,\n [33170]: 4352,\n [2849]: 1,\n [32823]: false,\n [32824]: 0,\n [10752]: 0,\n [32926]: false,\n [32928]: false,\n [32938]: 1.0,\n [32939]: false,\n [3089]: false,\n // Note: Dynamic value. If scissor test enabled we expect users to set correct scissor box\n [3088]: new Int32Array([0, 0, 1024, 1024]),\n [2960]: false,\n [2961]: 0,\n [2968]: 0xffffffff,\n [36005]: 0xffffffff,\n [2962]: 519,\n [2967]: 0,\n [2963]: 0xffffffff,\n [34816]: 519,\n [36003]: 0,\n [36004]: 0xffffffff,\n [2964]: 7680,\n [2965]: 7680,\n [2966]: 7680,\n [34817]: 7680,\n [34818]: 7680,\n [34819]: 7680,\n // Dynamic value: We use [0, 0, 1024, 1024] as default, but usually this is updated in each frame.\n [2978]: [0, 0, 1024, 1024],\n [36389]: null,\n [36662]: null,\n [36663]: null,\n [35053]: null,\n [35055]: null,\n [35723]: 4352,\n [36010]: null,\n [35977]: false,\n [3333]: 4,\n [3317]: 4,\n [37440]: false,\n [37441]: false,\n [37443]: 37444,\n [3330]: 0,\n [3332]: 0,\n [3331]: 0,\n [3314]: 0,\n [32878]: 0,\n [3316]: 0,\n [3315]: 0,\n [32877]: 0\n};\n// SETTER TABLES - ENABLES SETTING ANY PARAMETER WITH A COMMON API\nconst enable = (gl, value, key) => value ? gl.enable(key) : gl.disable(key);\nconst hint = (gl, value, key) => gl.hint(key, value);\nconst pixelStorei = (gl, value, key) => gl.pixelStorei(key, value);\nconst bindFramebuffer = (gl, value, key) => {\n const target = key === 36006 ? 36009 : 36008;\n return gl.bindFramebuffer(target, value);\n};\nconst bindBuffer = (gl, value, key) => {\n const bindingMap = {\n [34964]: 34962,\n [36662]: 36662,\n [36663]: 36663,\n [35053]: 35051,\n [35055]: 35052\n };\n const glTarget = bindingMap[key];\n gl.bindBuffer(glTarget, value);\n};\n// Utility\nfunction isArray(array) {\n return Array.isArray(array) || (ArrayBuffer.isView(array) && !(array instanceof DataView));\n}\n// Map from WebGL parameter names to corresponding WebGL setter functions\n// WegGL constants are read by parameter names, but set by function names\n// NOTE: When value type is a string, it will be handled by 'GL_COMPOSITE_PARAMETER_SETTERS'\nexport const GL_PARAMETER_SETTERS = {\n [3042]: enable,\n [32773]: (gl, value) => gl.blendColor(...value),\n [32777]: 'blendEquation',\n [34877]: 'blendEquation',\n [32969]: 'blendFunc',\n [32968]: 'blendFunc',\n [32971]: 'blendFunc',\n [32970]: 'blendFunc',\n [3106]: (gl, value) => gl.clearColor(...value),\n [3107]: (gl, value) => gl.colorMask(...value),\n [2884]: enable,\n [2885]: (gl, value) => gl.cullFace(value),\n [2929]: enable,\n [2931]: (gl, value) => gl.clearDepth(value),\n [2932]: (gl, value) => gl.depthFunc(value),\n [2928]: (gl, value) => gl.depthRange(...value),\n [2930]: (gl, value) => gl.depthMask(value),\n [3024]: enable,\n [35723]: hint,\n [35725]: (gl, value) => gl.useProgram(value),\n [36007]: (gl, value) => gl.bindRenderbuffer(36161, value),\n [36389]: (gl, value) => gl.bindTransformFeedback?.(36386, value),\n [34229]: (gl, value) => gl.bindVertexArray(value),\n // NOTE: FRAMEBUFFER_BINDING and DRAW_FRAMEBUFFER_BINDING(WebGL2) refer same state.\n [36006]: bindFramebuffer,\n [36010]: bindFramebuffer,\n // Buffers\n [34964]: bindBuffer,\n [36662]: bindBuffer,\n [36663]: bindBuffer,\n [35053]: bindBuffer,\n [35055]: bindBuffer,\n [2886]: (gl, value) => gl.frontFace(value),\n [33170]: hint,\n [2849]: (gl, value) => gl.lineWidth(value),\n [32823]: enable,\n [32824]: 'polygonOffset',\n [10752]: 'polygonOffset',\n [35977]: enable,\n [32926]: enable,\n [32928]: enable,\n [32938]: 'sampleCoverage',\n [32939]: 'sampleCoverage',\n [3089]: enable,\n [3088]: (gl, value) => gl.scissor(...value),\n [2960]: enable,\n [2961]: (gl, value) => gl.clearStencil(value),\n [2968]: (gl, value) => gl.stencilMaskSeparate(1028, value),\n [36005]: (gl, value) => gl.stencilMaskSeparate(1029, value),\n [2962]: 'stencilFuncFront',\n [2967]: 'stencilFuncFront',\n [2963]: 'stencilFuncFront',\n [34816]: 'stencilFuncBack',\n [36003]: 'stencilFuncBack',\n [36004]: 'stencilFuncBack',\n [2964]: 'stencilOpFront',\n [2965]: 'stencilOpFront',\n [2966]: 'stencilOpFront',\n [34817]: 'stencilOpBack',\n [34818]: 'stencilOpBack',\n [34819]: 'stencilOpBack',\n [2978]: (gl, value) => gl.viewport(...value),\n // WEBGL2 EXTENSIONS\n // EXT_depth_clamp https://registry.khronos.org/webgl/extensions/EXT_depth_clamp/\n [34383]: enable,\n // WEBGL_provoking_vertex https://registry.khronos.org/webgl/extensions/WEBGL_provoking_vertex/\n // [GL.PROVOKING_VERTEX_WEBL]: TODO - extension function needed\n // WEBGL_polygon_mode https://registry.khronos.org/webgl/extensions/WEBGL_polygon_mode/\n // POLYGON_MODE_WEBGL TODO - extension function needed\n [10754]: enable,\n // WEBGL_clip_cull_distance https://registry.khronos.org/webgl/extensions/WEBGL_clip_cull_distance/\n [12288]: enable,\n [12289]: enable,\n [12290]: enable,\n [12291]: enable,\n [12292]: enable,\n [12293]: enable,\n [12294]: enable,\n [12295]: enable,\n // PIXEL PACK/UNPACK MODES\n [3333]: pixelStorei,\n [3317]: pixelStorei,\n [37440]: pixelStorei,\n [37441]: pixelStorei,\n [37443]: pixelStorei,\n [3330]: pixelStorei,\n [3332]: pixelStorei,\n [3331]: pixelStorei,\n [3314]: pixelStorei,\n [32878]: pixelStorei,\n [3316]: pixelStorei,\n [3315]: pixelStorei,\n [32877]: pixelStorei,\n // Function-style setters\n framebuffer: (gl, framebuffer) => {\n // accepts 1) a WebGLFramebuffer 2) null (default framebuffer), or 3) luma.gl Framebuffer class\n // framebuffer is null when restoring to default framebuffer, otherwise use the WebGL handle.\n const handle = framebuffer && 'handle' in framebuffer ? framebuffer.handle : framebuffer;\n return gl.bindFramebuffer(36160, handle);\n },\n blend: (gl, value) => value ? gl.enable(3042) : gl.disable(3042),\n blendColor: (gl, value) => gl.blendColor(...value),\n blendEquation: (gl, args) => {\n const separateModes = typeof args === 'number' ? [args, args] : args;\n gl.blendEquationSeparate(...separateModes);\n },\n blendFunc: (gl, args) => {\n const separateFuncs = args?.length === 2 ? [...args, ...args] : args;\n gl.blendFuncSeparate(...separateFuncs);\n },\n clearColor: (gl, value) => gl.clearColor(...value),\n clearDepth: (gl, value) => gl.clearDepth(value),\n clearStencil: (gl, value) => gl.clearStencil(value),\n colorMask: (gl, value) => gl.colorMask(...value),\n cull: (gl, value) => value ? gl.enable(2884) : gl.disable(2884),\n cullFace: (gl, value) => gl.cullFace(value),\n depthTest: (gl, value) => value ? gl.enable(2929) : gl.disable(2929),\n depthFunc: (gl, value) => gl.depthFunc(value),\n depthMask: (gl, value) => gl.depthMask(value),\n depthRange: (gl, value) => gl.depthRange(...value),\n dither: (gl, value) => value ? gl.enable(3024) : gl.disable(3024),\n derivativeHint: (gl, value) => {\n // gl1: 'OES_standard_derivatives'\n gl.hint(35723, value);\n },\n frontFace: (gl, value) => gl.frontFace(value),\n mipmapHint: (gl, value) => gl.hint(33170, value),\n lineWidth: (gl, value) => gl.lineWidth(value),\n polygonOffsetFill: (gl, value) => value ? gl.enable(32823) : gl.disable(32823),\n polygonOffset: (gl, value) => gl.polygonOffset(...value),\n sampleCoverage: (gl, value) => gl.sampleCoverage(...value),\n scissorTest: (gl, value) => value ? gl.enable(3089) : gl.disable(3089),\n scissor: (gl, value) => gl.scissor(...value),\n stencilTest: (gl, value) => value ? gl.enable(2960) : gl.disable(2960),\n stencilMask: (gl, value) => {\n value = isArray(value) ? value : [value, value];\n const [mask, backMask] = value;\n gl.stencilMaskSeparate(1028, mask);\n gl.stencilMaskSeparate(1029, backMask);\n },\n stencilFunc: (gl, args) => {\n args = isArray(args) && args.length === 3 ? [...args, ...args] : args;\n const [func, ref, mask, backFunc, backRef, backMask] = args;\n gl.stencilFuncSeparate(1028, func, ref, mask);\n gl.stencilFuncSeparate(1029, backFunc, backRef, backMask);\n },\n stencilOp: (gl, args) => {\n args = isArray(args) && args.length === 3 ? [...args, ...args] : args;\n const [sfail, dpfail, dppass, backSfail, backDpfail, backDppass] = args;\n gl.stencilOpSeparate(1028, sfail, dpfail, dppass);\n gl.stencilOpSeparate(1029, backSfail, backDpfail, backDppass);\n },\n viewport: (gl, value) => gl.viewport(...value)\n};\nfunction getValue(glEnum, values, cache) {\n return values[glEnum] !== undefined ? values[glEnum] : cache[glEnum];\n}\n// COMPOSITE_WEBGL_PARAMETER_\nexport const GL_COMPOSITE_PARAMETER_SETTERS = {\n blendEquation: (gl, values, cache) => gl.blendEquationSeparate(getValue(32777, values, cache), getValue(34877, values, cache)),\n blendFunc: (gl, values, cache) => gl.blendFuncSeparate(getValue(32969, values, cache), getValue(32968, values, cache), getValue(32971, values, cache), getValue(32970, values, cache)),\n polygonOffset: (gl, values, cache) => gl.polygonOffset(getValue(32824, values, cache), getValue(10752, values, cache)),\n sampleCoverage: (gl, values, cache) => gl.sampleCoverage(getValue(32938, values, cache), getValue(32939, values, cache)),\n stencilFuncFront: (gl, values, cache) => gl.stencilFuncSeparate(1028, getValue(2962, values, cache), getValue(2967, values, cache), getValue(2963, values, cache)),\n stencilFuncBack: (gl, values, cache) => gl.stencilFuncSeparate(1029, getValue(34816, values, cache), getValue(36003, values, cache), getValue(36004, values, cache)),\n stencilOpFront: (gl, values, cache) => gl.stencilOpSeparate(1028, getValue(2964, values, cache), getValue(2965, values, cache), getValue(2966, values, cache)),\n stencilOpBack: (gl, values, cache) => gl.stencilOpSeparate(1029, getValue(34817, values, cache), getValue(34818, values, cache), getValue(34819, values, cache))\n};\n// Setter functions intercepted for cache updates\nexport const GL_HOOKED_SETTERS = {\n // GENERIC SETTERS\n enable: (update, capability) => update({\n [capability]: true\n }),\n disable: (update, capability) => update({\n [capability]: false\n }),\n pixelStorei: (update, pname, value) => update({\n [pname]: value\n }),\n hint: (update, pname, hint) => update({\n [pname]: hint\n }),\n // SPECIFIC SETTERS\n useProgram: (update, value) => update({\n [35725]: value\n }),\n bindRenderbuffer: (update, target, value) => update({\n [36007]: value\n }),\n bindTransformFeedback: (update, target, value) => update({\n [36389]: value\n }),\n bindVertexArray: (update, value) => update({\n [34229]: value\n }),\n bindFramebuffer: (update, target, framebuffer) => {\n switch (target) {\n case 36160:\n return update({\n [36006]: framebuffer,\n [36010]: framebuffer\n });\n case 36009:\n return update({ [36006]: framebuffer });\n case 36008:\n return update({ [36010]: framebuffer });\n default:\n return null;\n }\n },\n bindBuffer: (update, target, buffer) => {\n const pname = {\n [34962]: [34964],\n [36662]: [36662],\n [36663]: [36663],\n [35051]: [35053],\n [35052]: [35055]\n }[target];\n if (pname) {\n return update({ [pname]: buffer });\n }\n // targets that should not be cached\n return { valueChanged: true };\n },\n blendColor: (update, r, g, b, a) => update({\n [32773]: new Float32Array([r, g, b, a])\n }),\n blendEquation: (update, mode) => update({\n [32777]: mode,\n [34877]: mode\n }),\n blendEquationSeparate: (update, modeRGB, modeAlpha) => update({\n [32777]: modeRGB,\n [34877]: modeAlpha\n }),\n blendFunc: (update, src, dst) => update({\n [32969]: src,\n [32968]: dst,\n [32971]: src,\n [32970]: dst\n }),\n blendFuncSeparate: (update, srcRGB, dstRGB, srcAlpha, dstAlpha) => update({\n [32969]: srcRGB,\n [32968]: dstRGB,\n [32971]: srcAlpha,\n [32970]: dstAlpha\n }),\n clearColor: (update, r, g, b, a) => update({\n [3106]: new Float32Array([r, g, b, a])\n }),\n clearDepth: (update, depth) => update({\n [2931]: depth\n }),\n clearStencil: (update, s) => update({\n [2961]: s\n }),\n colorMask: (update, r, g, b, a) => update({\n [3107]: [r, g, b, a]\n }),\n cullFace: (update, mode) => update({\n [2885]: mode\n }),\n depthFunc: (update, func) => update({\n [2932]: func\n }),\n depthRange: (update, zNear, zFar) => update({\n [2928]: new Float32Array([zNear, zFar])\n }),\n depthMask: (update, mask) => update({\n [2930]: mask\n }),\n frontFace: (update, face) => update({\n [2886]: face\n }),\n lineWidth: (update, width) => update({\n [2849]: width\n }),\n polygonOffset: (update, factor, units) => update({\n [32824]: factor,\n [10752]: units\n }),\n sampleCoverage: (update, value, invert) => update({\n [32938]: value,\n [32939]: invert\n }),\n scissor: (update, x, y, width, height) => update({\n [3088]: new Int32Array([x, y, width, height])\n }),\n stencilMask: (update, mask) => update({\n [2968]: mask,\n [36005]: mask\n }),\n stencilMaskSeparate: (update, face, mask) => update({\n [face === 1028 ? 2968 : 36005]: mask\n }),\n stencilFunc: (update, func, ref, mask) => update({\n [2962]: func,\n [2967]: ref,\n [2963]: mask,\n [34816]: func,\n [36003]: ref,\n [36004]: mask\n }),\n stencilFuncSeparate: (update, face, func, ref, mask) => update({\n [face === 1028 ? 2962 : 34816]: func,\n [face === 1028 ? 2967 : 36003]: ref,\n [face === 1028 ? 2963 : 36004]: mask\n }),\n stencilOp: (update, fail, zfail, zpass) => update({\n [2964]: fail,\n [2965]: zfail,\n [2966]: zpass,\n [34817]: fail,\n [34818]: zfail,\n [34819]: zpass\n }),\n stencilOpSeparate: (update, face, fail, zfail, zpass) => update({\n [face === 1028 ? 2964 : 34817]: fail,\n [face === 1028 ? 2965 : 34818]: zfail,\n [face === 1028 ? 2966 : 34819]: zpass\n }),\n viewport: (update, x, y, width, height) => update({\n [2978]: [x, y, width, height]\n })\n};\n// GETTER TABLE - FOR READING OUT AN ENTIRE CONTEXT\nconst isEnabled = (gl, key) => gl.isEnabled(key);\n// Exceptions for any keys that cannot be queried by gl.getParameters\nexport const GL_PARAMETER_GETTERS = {\n [3042]: isEnabled,\n [2884]: isEnabled,\n [2929]: isEnabled,\n [3024]: isEnabled,\n [32823]: isEnabled,\n [32926]: isEnabled,\n [32928]: isEnabled,\n [3089]: isEnabled,\n [2960]: isEnabled,\n [35977]: isEnabled\n};\nexport const NON_CACHE_PARAMETERS = new Set([\n 34016,\n 36388,\n 36387,\n 35983,\n 35368,\n 34965,\n 35739,\n 35738,\n 3074,\n 34853,\n 34854,\n 34855,\n 34856,\n 34857,\n 34858,\n 34859,\n 34860,\n 34861,\n 34862,\n 34863,\n 34864,\n 34865,\n 34866,\n 34867,\n 34868,\n 35097,\n 32873,\n 35869,\n 32874,\n 34068\n]);\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { GL_PARAMETER_DEFAULTS, GL_PARAMETER_SETTERS, GL_COMPOSITE_PARAMETER_SETTERS, GL_PARAMETER_GETTERS } from \"./webgl-parameter-tables.js\";\n/**\n * Sets any GL parameter regardless of function (gl.blendMode, ...)\n *\n * @note requires a `cache` object to be set on the context (gl.state.cache)\n * This object is used to fill in any missing values for composite setter functions\n */\nexport function setGLParameters(gl, parameters) {\n if (isObjectEmpty(parameters)) {\n return;\n }\n const compositeSetters = {};\n // HANDLE PRIMITIVE SETTERS (and make note of any composite setters)\n for (const key in parameters) {\n const glConstant = Number(key);\n const setter = GL_PARAMETER_SETTERS[key];\n if (setter) {\n // Composite setters should only be called once, so save them\n if (typeof setter === 'string') {\n compositeSetters[setter] = true;\n }\n else {\n // if (gl[glConstant] !== undefined) {\n // TODO - added above check since this is being called on WebGL2 parameters in WebGL1...\n // TODO - deep equal on values? only call setter if value has changed?\n // NOTE - the setter will automatically update this.state\n setter(gl, parameters[key], glConstant);\n }\n }\n }\n // HANDLE COMPOSITE SETTERS\n // NOTE: any non-provided values needed by composite setters are filled in from state cache\n // The cache parameter is automatically retrieved from the context\n // This depends on `trackContextState`, which is technically a \"circular\" dependency.\n // But it is too inconvenient to always require a cache parameter here.\n // This is the ONLY external dependency in this module/\n // @ts-expect-error\n const cache = gl.state && gl.state.cache;\n if (cache) {\n for (const key in compositeSetters) {\n // TODO - avoid calling composite setters if values have not changed.\n const compositeSetter = GL_COMPOSITE_PARAMETER_SETTERS[key];\n // Note - if `trackContextState` has been called,\n // the setter will automatically update this.state.cache\n compositeSetter(gl, parameters, cache);\n }\n }\n // Add a log for the else case?\n}\n/**\n * Reads the entire WebGL state from a context\n\n // default to querying all parameters\n\n * @returns - a newly created map, with values keyed by GL parameters\n *\n * @note Copies the state from a context (gl.getParameter should not be overriden)\n * Reads the entire WebGL state from a context\n *\n * @note This can generates a huge amount of synchronous driver roundtrips and should be\n * considered a very slow operation, to be used only if/when a context already manipulated\n * by external code needs to be synchronized for the first time\n */\nexport function getGLParameters(gl, parameters = GL_PARAMETER_DEFAULTS) {\n // support both arrays of parameters and objects (keys represent parameters)\n if (typeof parameters === 'number') {\n // single GL enum\n const key = parameters;\n const getter = GL_PARAMETER_GETTERS[key];\n return getter ? getter(gl, key) : gl.getParameter(key);\n }\n const parameterKeys = Array.isArray(parameters) ? parameters : Object.keys(parameters);\n const state = {};\n for (const key of parameterKeys) {\n const getter = GL_PARAMETER_GETTERS[key];\n state[key] = getter ? getter(gl, Number(key)) : gl.getParameter(Number(key));\n }\n return state;\n}\n/**\n * Reset all parameters to a (almost) pure context state\n * @note viewport and scissor will be set to the values in GL_PARAMETER_DEFAULTS,\n * NOT the canvas size dimensions, so they will have to be properly set after\n * calling this function.\n */\nexport function resetGLParameters(gl) {\n setGLParameters(gl, GL_PARAMETER_DEFAULTS);\n}\n// Helpers\n// Returns true if given object is empty, false otherwise.\nfunction isObjectEmpty(object) {\n // @ts-ignore dummy key variable\n for (const key in object) {\n return false;\n }\n return true;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/** deeply compare two arrays */\nexport function deepArrayEqual(x, y) {\n if (x === y) {\n return true;\n }\n const isArrayX = Array.isArray(x) || ArrayBuffer.isView(x);\n const isArrayY = Array.isArray(y) || ArrayBuffer.isView(y);\n // @ts-expect-error TODO fix\n if (isArrayX && isArrayY && x.length === y.length) {\n // @ts-expect-error TODO fix\n for (let i = 0; i < x.length; ++i) {\n if (x[i] !== y[i]) {\n return false;\n }\n }\n return true;\n }\n return false;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst DEFAULT_CONTEXT_PROPS = {\n powerPreference: 'high-performance', // After all, most apps are using WebGL for performance reasons\n // eslint-disable-next-line no-console\n onContextLost: () => console.error('WebGL context lost'),\n // eslint-disable-next-line no-console\n onContextRestored: () => console.info('WebGL context restored')\n};\n/**\n * Create a WebGL context for a canvas\n * Note calling this multiple time on the same canvas does return the same context\n * @param canvas A canvas element or offscreen canvas\n */\nexport function createBrowserContext(canvas, props) {\n props = { ...DEFAULT_CONTEXT_PROPS, ...props };\n // Try to extract any extra information about why context creation failed\n let errorMessage = null;\n const onCreateError = error => (errorMessage = error.statusMessage || errorMessage);\n canvas.addEventListener('webglcontextcreationerror', onCreateError, false);\n // Create the desired context\n let gl = null;\n // props.failIfMajorPerformanceCaveat = true;\n // We require webgl2 context\n gl ||= canvas.getContext('webgl2', props);\n // Software GPU\n // props.failIfMajorPerformanceCaveat = false;\n // if (!gl && props.webgl1) {\n // gl = canvas.getContext('webgl', props);\n // }\n // TODO are we removing this listener before giving it a chance to fire?\n canvas.removeEventListener('webglcontextcreationerror', onCreateError, false);\n if (!gl) {\n throw new Error(`Failed to create WebGL context: ${errorMessage || 'Unknown error'}`);\n }\n if (props.onContextLost) {\n // Carefully extract and wrap callbacks to prevent addEventListener from rebinding them.\n const { onContextLost } = props;\n canvas.addEventListener('webglcontextlost', (event) => onContextLost(event), false);\n }\n if (props.onContextRestored) {\n // Carefully extract and wrap callbacks to prevent addEventListener from rebinding them.\n const { onContextRestored } = props;\n canvas.addEventListener('webglcontextrestored', (event) => onContextRestored(event), false);\n }\n return gl;\n}\n/* TODO - can we call this asynchronously to catch the error events?\nexport async function createBrowserContextAsync(canvas: HTMLCanvasElement | OffscreenCanvas, props: ContextProps): Promise {\n props = {...DEFAULT_CONTEXT_PROPS, ...props};\n\n // Try to extract any extra information about why context creation failed\n let errorMessage = null;\n const onCreateError = (error) => (errorMessage = error.statusMessage || errorMessage);\n canvas.addEventListener('webglcontextcreationerror', onCreateError, false);\n\n const gl = createBrowserContext(canvas, props);\n\n // Give the listener a chance to fire\n await new Promise(resolve => setTimeout(resolve, 0));\n\n canvas.removeEventListener('webglcontextcreationerror', onCreateError, false);\n\n return gl;\n}\n*/\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { GL } from '@luma.gl/constants';\nimport { getWebGLExtension } from \"../../context/helpers/webgl-extensions.js\";\n/** @returns strings identifying the GPU vendor and driver. */\nexport function getDeviceInfo(gl, extensions) {\n // \"Masked\" info is always available, but don't contain much useful information\n const vendorMasked = gl.getParameter(7936);\n const rendererMasked = gl.getParameter(7937);\n // If we are lucky, unmasked info is available\n // https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_renderer_info/\n getWebGLExtension(gl, 'WEBGL_debug_renderer_info', extensions);\n const ext = extensions.WEBGL_debug_renderer_info;\n const vendorUnmasked = gl.getParameter(ext ? ext.UNMASKED_VENDOR_WEBGL : 7936);\n const rendererUnmasked = gl.getParameter(ext ? ext.UNMASKED_RENDERER_WEBGL : 7937);\n const vendor = vendorUnmasked || vendorMasked;\n const renderer = rendererUnmasked || rendererMasked;\n // Driver version\n const version = gl.getParameter(7938);\n // \"Sniff\" the GPU type and backend from the info. This works best if unmasked info is available.\n const gpu = identifyGPUVendor(vendor, renderer);\n const gpuBackend = identifyGPUBackend(vendor, renderer);\n const gpuType = identifyGPUType(vendor, renderer);\n // Determine GLSL version\n // For now, skip parsing of the long version string, just use context type below to deduce version\n // const version = gl.getParameter(GL.SHADING_LANGUAGE_VERSION) as string;\n // const shadingLanguageVersion = parseGLSLVersion(version);\n const shadingLanguage = 'glsl';\n const shadingLanguageVersion = 300;\n return {\n type: 'webgl',\n gpu,\n gpuType,\n gpuBackend,\n vendor,\n renderer,\n version,\n shadingLanguage,\n shadingLanguageVersion\n };\n}\n/** \"Sniff\" the GPU type from the info. This works best if unmasked info is available. */\nfunction identifyGPUVendor(vendor, renderer) {\n if (/NVIDIA/i.exec(vendor) || /NVIDIA/i.exec(renderer)) {\n return 'nvidia';\n }\n if (/INTEL/i.exec(vendor) || /INTEL/i.exec(renderer)) {\n return 'intel';\n }\n if (/Apple/i.exec(vendor) || /Apple/i.exec(renderer)) {\n return 'apple';\n }\n if (/AMD/i.exec(vendor) ||\n /AMD/i.exec(renderer) ||\n /ATI/i.exec(vendor) ||\n /ATI/i.exec(renderer)) {\n return 'amd';\n }\n if (/SwiftShader/i.exec(vendor) || /SwiftShader/i.exec(renderer)) {\n return 'software';\n }\n return 'unknown';\n}\n/** \"Sniff\" the GPU backend from the info. This works best if unmasked info is available. */\nfunction identifyGPUBackend(vendor, renderer) {\n if (/Metal/i.exec(vendor) || /Metal/i.exec(renderer)) {\n return 'metal';\n }\n if (/ANGLE/i.exec(vendor) || /ANGLE/i.exec(renderer)) {\n return 'opengl';\n }\n return 'unknown';\n}\nfunction identifyGPUType(vendor, renderer) {\n if (/SwiftShader/i.exec(vendor) || /SwiftShader/i.exec(renderer)) {\n return 'cpu';\n }\n const gpuVendor = identifyGPUVendor(vendor, renderer);\n switch (gpuVendor) {\n case 'intel':\n return 'integrated';\n case 'software':\n return 'cpu';\n case 'unknown':\n return 'unknown';\n default:\n return 'discrete';\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/** Ensure extensions are only requested once */\nexport function getWebGLExtension(gl, name, extensions) {\n if (extensions[name] === undefined) {\n extensions[name] = gl.getExtension(name) || null;\n }\n return extensions[name];\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// Feature detection for WebGL\n// Provides a function that enables simple checking of which WebGL features are\nimport { DeviceFeatures } from '@luma.gl/core';\nimport { getWebGLExtension } from \"../../context/helpers/webgl-extensions.js\";\nimport { isTextureFeature, checkTextureFeature } from \"../converters/texture-formats.js\";\nimport { TEXTURE_FEATURES } from \"../converters/texture-formats.js\";\n/**\n * Defines luma.gl \"feature\" names and semantics\n * when value is 'string' it is the name of the extension that enables this feature\n */\nconst WEBGL_FEATURES = {\n // optional WebGPU features\n 'depth-clip-control': 'EXT_depth_clamp', // TODO these seem subtly different\n // 'timestamp-query' // GPUQueryType \"timestamp-query\"\n // \"indirect-first-instance\"\n // Textures are handled by getTextureFeatures()\n // 'depth24unorm-stencil8' // GPUTextureFormat 'depth24unorm-stencil8'\n // 'depth32float-stencil8' // GPUTextureFormat 'depth32float-stencil8'\n // optional WebGL features\n 'timer-query-webgl': 'EXT_disjoint_timer_query_webgl2',\n 'compilation-status-async-webgl': 'KHR_parallel_shader_compile',\n 'polygon-mode-webgl': 'WEBGL_polygon_mode',\n 'provoking-vertex-webgl': 'WEBGL_provoking_vertex',\n 'shader-clip-cull-distance-webgl': 'WEBGL_clip_cull_distance',\n 'shader-noperspective-interpolation-webgl': 'NV_shader_noperspective_interpolation',\n 'shader-conservative-depth-webgl': 'EXT_conservative_depth'\n // Textures are handled by getTextureFeatures()\n};\n/**\n * WebGL extensions exposed as luma.gl features\n * To minimize GL log noise and improve performance, this class ensures that\n * - WebGL extensions are not queried until the corresponding feature is checked.\n * - WebGL extensions are only queried once.\n */\nexport class WebGLDeviceFeatures extends DeviceFeatures {\n gl;\n extensions;\n testedFeatures = new Set();\n constructor(gl, extensions, disabledFeatures) {\n super([], disabledFeatures);\n this.gl = gl;\n this.extensions = extensions;\n // TODO - is this really needed?\n // Enable EXT_float_blend first: https://developer.mozilla.org/en-US/docs/Web/API/EXT_float_blend\n getWebGLExtension(gl, 'EXT_color_buffer_float', extensions);\n }\n *[Symbol.iterator]() {\n const features = this.getFeatures();\n for (const feature of features) {\n if (this.has(feature)) {\n yield feature;\n }\n }\n return [];\n }\n has(feature) {\n if (this.disabledFeatures[feature]) {\n return false;\n }\n // We have already tested this feature\n if (!this.testedFeatures.has(feature)) {\n this.testedFeatures.add(feature);\n // Check the feature once\n if (isTextureFeature(feature) && checkTextureFeature(this.gl, feature, this.extensions)) {\n this.features.add(feature);\n }\n if (this.getWebGLFeature(feature)) {\n this.features.add(feature);\n }\n }\n return this.features.has(feature);\n }\n // FOR DEVICE\n initializeFeatures() {\n // Initialize all features by checking them.\n // Except WEBGL_polygon_mode since Chrome logs ugly console warnings\n const features = this.getFeatures().filter(feature => feature !== 'polygon-mode-webgl');\n for (const feature of features) {\n this.has(feature);\n }\n }\n // IMPLEMENTATION\n getFeatures() {\n return [...Object.keys(WEBGL_FEATURES), ...Object.keys(TEXTURE_FEATURES)];\n }\n /** Extract all WebGL features */\n getWebGLFeature(feature) {\n const featureInfo = WEBGL_FEATURES[feature];\n // string value requires checking the corresponding WebGL extension\n const isSupported = typeof featureInfo === 'string'\n ? Boolean(getWebGLExtension(this.gl, featureInfo, this.extensions))\n : Boolean(featureInfo);\n return isSupported;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { decodeTextureFormat } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\nimport { getWebGLExtension } from \"../../context/helpers/webgl-extensions.js\";\nimport { getGLFromVertexType } from \"./vertex-formats.js\";\n/* eslint-disable camelcase */\n// TEXTURE FEATURES\n// Define local device feature strings to optimize minification\nconst texture_compression_bc = 'texture-compression-bc';\nconst texture_compression_astc = 'texture-compression-astc';\nconst texture_compression_etc2 = 'texture-compression-etc2';\nconst texture_compression_etc1_webgl = 'texture-compression-etc1-webgl';\nconst texture_compression_pvrtc_webgl = 'texture-compression-pvrtc-webgl';\nconst texture_compression_atc_webgl = 'texture-compression-atc-webgl';\nconst float32_renderable = 'float32-renderable-webgl';\nconst float16_renderable = 'float16-renderable-webgl';\nconst rgb9e5ufloat_renderable = 'rgb9e5ufloat_renderable-webgl';\nconst snorm8_renderable = 'snorm8-renderable-webgl';\nconst norm16_renderable = 'norm16-renderable-webgl';\nconst snorm16_renderable = 'snorm16-renderable-webgl';\nconst float32_filterable = 'float32-filterable';\nconst float16_filterable = 'float16-filterable-webgl';\n// Define local webgl extension strings to optimize minification\nconst X_S3TC = 'WEBGL_compressed_texture_s3tc'; // BC1, BC2, BC3\nconst X_S3TC_SRGB = 'WEBGL_compressed_texture_s3tc_srgb'; // BC1, BC2, BC3\nconst X_RGTC = 'EXT_texture_compression_rgtc'; // BC4, BC5\nconst X_BPTC = 'EXT_texture_compression_bptc'; // BC6, BC7\nconst X_ETC2 = 'WEBGL_compressed_texture_etc'; // Renamed from 'WEBGL_compressed_texture_es3'\nconst X_ASTC = 'WEBGL_compressed_texture_astc';\nconst X_ETC1 = 'WEBGL_compressed_texture_etc1';\nconst X_PVRTC = 'WEBGL_compressed_texture_pvrtc';\nconst X_ATC = 'WEBGL_compressed_texture_atc';\n// Define local webgl extension strings to optimize minification\nconst EXT_texture_norm16 = 'EXT_texture_norm16';\nconst EXT_render_snorm = 'EXT_render_snorm';\nconst EXT_color_buffer_float = 'EXT_color_buffer_float';\n// prettier-ignore\nexport const TEXTURE_FEATURES = {\n 'float32-renderable-webgl': ['EXT_color_buffer_float'],\n 'float16-renderable-webgl': ['EXT_color_buffer_half_float'],\n 'rgb9e5ufloat_renderable-webgl': ['WEBGL_render_shared_exponent'],\n 'snorm8-renderable-webgl': [EXT_render_snorm],\n 'norm16-renderable-webgl': [EXT_texture_norm16],\n 'snorm16-renderable-webgl': [EXT_texture_norm16, EXT_render_snorm],\n 'float32-filterable': ['OES_texture_float_linear'],\n 'float16-filterable-webgl': ['OES_texture_half_float_linear'],\n 'texture-filterable-anisotropic-webgl': ['EXT_texture_filter_anisotropic'],\n 'texture-blend-float-webgl': ['EXT_float_blend'],\n 'texture-compression-bc': [X_S3TC, X_S3TC_SRGB, X_RGTC, X_BPTC],\n // 'texture-compression-bc3-srgb-webgl': [X_S3TC_SRGB],\n // 'texture-compression-bc3-webgl': [X_S3TC],\n 'texture-compression-bc5-webgl': [X_RGTC],\n 'texture-compression-bc7-webgl': [X_BPTC],\n 'texture-compression-etc2': [X_ETC2],\n 'texture-compression-astc': [X_ASTC],\n 'texture-compression-etc1-webgl': [X_ETC1],\n 'texture-compression-pvrtc-webgl': [X_PVRTC],\n 'texture-compression-atc-webgl': [X_ATC]\n};\n/** Return a list of texture feature strings (for Device.features). Mainly compressed texture support */\n// export function getTextureFeatures(\n// gl: WebGL2RenderingContext,\n// extensions: GLExtensions\n// ): DeviceFeature[] {\n// const textureFeatures = Object.keys(TEXTURE_FEATURES) as DeviceFeature[];\n// return textureFeatures.filter(feature => checkTextureFeature(gl, feature, extensions));\n// }\nexport function isTextureFeature(feature) {\n return feature in TEXTURE_FEATURES;\n}\n/** Checks a texture feature (for Device.features). Mainly compressed texture support */\nexport function checkTextureFeature(gl, feature, extensions) {\n const textureExtensions = TEXTURE_FEATURES[feature] || [];\n return textureExtensions.every(extension => getWebGLExtension(gl, extension, extensions));\n}\n// TABLES\n/**\n * Texture format data -\n * Exported but can change without notice\n */\n// prettier-ignore\nexport const TEXTURE_FORMATS = {\n // Unsized formats that leave the precision up to the driver. TODO - Fix bpp constants\n 'rgb8unorm-unsized': { gl: 6407, b: 4, c: 2, bpp: 4,\n dataFormat: 6407, types: [5121, 33635] },\n 'rgba8unorm-unsized': { gl: 6408, b: 4, c: 2, bpp: 4,\n dataFormat: 6408, types: [5121, 32819, 32820] },\n // 'r8unorm-unsized': {gl: GL.LUMINANCE, b: 4, c: 2, bpp: 4},\n // 'rgb8unorm-srgb-unsized': {gl: GL.SRGB_EXT, b: 4, c: 2, bpp: 4, gl1Ext: SRGB},\n // 'rgba8unorm-srgb-unsized': {gl: GL.SRGB_ALPHA_EXT, b: 4, c: 2, bpp: 4, gl1Ext: SRGB},\n // 8-bit formats\n 'r8unorm': { gl: 33321, b: 1, c: 1, rb: true },\n 'r8snorm': { gl: 36756, b: 1, c: 1, render: snorm8_renderable },\n 'r8uint': { gl: 33330, b: 1, c: 1, rb: true },\n 'r8sint': { gl: 33329, b: 1, c: 1, rb: true },\n // 16-bit formats\n 'rg8unorm': { gl: 33323, b: 2, c: 2, rb: true },\n 'rg8snorm': { gl: 36757, b: 2, c: 2, render: snorm8_renderable },\n 'rg8uint': { gl: 33336, b: 2, c: 2, rb: true },\n 'rg8sint': { gl: 33335, b: 2, c: 2, rb: true },\n 'r16uint': { gl: 33332, b: 2, c: 1, rb: true },\n 'r16sint': { gl: 33331, b: 2, c: 1, rb: true },\n 'r16float': { gl: 33325, b: 2, c: 1, render: float16_renderable, filter: 'float16-filterable-webgl', rb: true },\n 'r16unorm-webgl': { gl: 33322, b: 2, c: 1, f: norm16_renderable, rb: true },\n 'r16snorm-webgl': { gl: 36760, b: 2, c: 1, f: snorm16_renderable },\n // Packed 16-bit formats\n 'rgba4unorm-webgl': { gl: 32854, b: 2, c: 4, wgpu: false, rb: true },\n 'rgb565unorm-webgl': { gl: 36194, b: 2, c: 4, wgpu: false, rb: true },\n 'rgb5a1unorm-webgl': { gl: 32855, b: 2, c: 4, wgpu: false, rb: true },\n // 24-bit formats\n 'rgb8unorm-webgl': { gl: 32849, b: 3, c: 3, wgpu: false },\n 'rgb8snorm-webgl': { gl: 36758, b: 3, c: 3, wgpu: false },\n // 32-bit formats \n 'rgba8unorm': { gl: 32856, b: 4, c: 2, bpp: 4 },\n 'rgba8unorm-srgb': { gl: 35907, b: 4, c: 4, bpp: 4 },\n 'rgba8snorm': { gl: 36759, b: 4, c: 4, render: snorm8_renderable },\n 'rgba8uint': { gl: 36220, b: 4, c: 4, bpp: 4 },\n 'rgba8sint': { gl: 36238, b: 4, c: 4, bpp: 4 },\n // reverse colors, webgpu only\n 'bgra8unorm': { b: 4, c: 4 },\n 'bgra8unorm-srgb': { b: 4, c: 4 },\n 'rg16uint': { gl: 33338, b: 4, c: 1, bpp: 4 },\n 'rg16sint': { gl: 33337, b: 4, c: 2, bpp: 4 },\n // When using a WebGL 2 context and the EXT_color_buffer_float WebGL2 extension\n 'rg16float': { gl: 33327, bpp: 4, b: 4, c: 2, render: float16_renderable, filter: float16_filterable, rb: true },\n 'rg16unorm-webgl': { gl: 33324, b: 2, c: 2, render: norm16_renderable },\n 'rg16snorm-webgl': { gl: 36761, b: 2, c: 2, render: snorm16_renderable },\n 'r32uint': { gl: 33334, b: 4, c: 1, bpp: 4, rb: true },\n 'r32sint': { gl: 33333, b: 4, c: 1, bpp: 4, rb: true },\n 'r32float': { gl: 33326, bpp: 4, b: 4, c: 1, render: float32_renderable, filter: float32_filterable },\n // Packed 32-bit formats\n 'rgb9e5ufloat': { gl: 35901, b: 4, c: 3, p: 1, render: rgb9e5ufloat_renderable }, // , filter: true},\n 'rg11b10ufloat': { gl: 35898, b: 4, c: 3, p: 1, render: float32_renderable, rb: true },\n 'rgb10a2unorm': { gl: 32857, b: 4, c: 4, p: 1, rb: true },\n 'rgb10a2uint-webgl': { b: 4, c: 4, gl: 36975, p: 1, wgpu: false, bpp: 4, rb: true },\n // 48-bit formats\n 'rgb16unorm-webgl': { gl: 32852, b: 2, c: 3, f: norm16_renderable }, // rgb not renderable\n 'rgb16snorm-webgl': { gl: 36762, b: 2, c: 3, f: norm16_renderable }, // rgb not renderable\n // 64-bit formats\n 'rg32uint': { gl: 33340, b: 8, c: 2, rb: true },\n 'rg32sint': { gl: 33339, b: 8, c: 2, rb: true },\n 'rg32float': { gl: 33328, b: 8, c: 2, render: float32_renderable, filter: float32_filterable, rb: true },\n 'rgba16uint': { gl: 36214, b: 8, c: 4, rb: true },\n 'rgba16sint': { gl: 36232, b: 8, c: 4, rb: true },\n 'rgba16float': { gl: 34842, b: 8, c: 4, render: float16_renderable, filter: float16_filterable },\n 'rgba16unorm-webgl': { gl: 32859, b: 2, c: 4, render: norm16_renderable, rb: true },\n 'rgba16snorm-webgl': { gl: 36763, b: 2, c: 4, render: snorm16_renderable },\n // 96-bit formats (deprecated!)\n 'rgb32float-webgl': { gl: 34837, render: float32_renderable, filter: float32_filterable,\n gl2ext: EXT_color_buffer_float, dataFormat: 6407, types: [5126] },\n // 128-bit formats\n 'rgba32uint': { gl: 36208, b: 16, c: 4, rb: true },\n 'rgba32sint': { gl: 36226, b: 16, c: 4, rb: true },\n 'rgba32float': { gl: 34836, b: 16, c: 4, render: float32_renderable, filter: float32_filterable, rb: true },\n // Depth and stencil formats\n 'stencil8': { gl: 36168, b: 1, c: 1, attachment: 36128, rb: true }, // 8 stencil bits\n 'depth16unorm': { gl: 33189, b: 2, c: 1, attachment: 36096,\n dataFormat: 6402, types: [5123], rb: true }, // 16 depth bits\n 'depth24plus': { gl: 33190, b: 3, c: 1, attachment: 36096,\n dataFormat: 6402, types: [5125] },\n 'depth32float': { gl: 36012, b: 4, c: 1, attachment: 36096,\n dataFormat: 6402, types: [5126], rb: true },\n // The depth component of the \"depth24plus\" and \"depth24plus-stencil8\" formats may be implemented as either a 24-bit depth value or a \"depth32float\" value.\n 'depth24plus-stencil8': { gl: 35056, b: 4, c: 2, p: 1, attachment: 33306, rb: true, depthTexture: true,\n dataFormat: 34041, types: [34042] },\n // \"depth24unorm-stencil8\" feature\n 'depth24unorm-stencil8': { gl: 35056, b: 4, c: 2, p: 1, attachment: 33306,\n dataFormat: 34041, types: [34042], rb: true },\n // \"depth32float-stencil8\" feature - TODO below is render buffer only?\n 'depth32float-stencil8': { gl: 36013, b: 5, c: 2, p: 1, attachment: 33306,\n dataFormat: 34041, types: [36269], rb: true },\n // BC compressed formats: check device.features.has(\"texture-compression-bc\");\n 'bc1-rgb-unorm-webgl': { gl: 33776, x: X_S3TC, f: texture_compression_bc },\n 'bc1-rgb-unorm-srgb-webgl': { gl: 35916, x: X_S3TC_SRGB, f: texture_compression_bc },\n 'bc1-rgba-unorm': { gl: 33777, x: X_S3TC, f: texture_compression_bc },\n 'bc1-rgba-unorm-srgb': { gl: 35916, x: X_S3TC_SRGB, f: texture_compression_bc },\n 'bc2-rgba-unorm': { gl: 33778, x: X_S3TC, f: texture_compression_bc },\n 'bc2-rgba-unorm-srgb': { gl: 35918, x: X_S3TC_SRGB, f: texture_compression_bc },\n 'bc3-rgba-unorm': { gl: 33779, x: X_S3TC, f: texture_compression_bc },\n 'bc3-rgba-unorm-srgb': { gl: 35919, x: X_S3TC_SRGB, f: texture_compression_bc },\n 'bc4-r-unorm': { gl: 36283, x: X_RGTC, f: texture_compression_bc },\n 'bc4-r-snorm': { gl: 36284, x: X_RGTC, f: texture_compression_bc },\n 'bc5-rg-unorm': { gl: 36285, x: X_RGTC, f: texture_compression_bc },\n 'bc5-rg-snorm': { gl: 36286, x: X_RGTC, f: texture_compression_bc },\n 'bc6h-rgb-ufloat': { gl: 36495, x: X_BPTC, f: texture_compression_bc },\n 'bc6h-rgb-float': { gl: 36494, x: X_BPTC, f: texture_compression_bc },\n 'bc7-rgba-unorm': { gl: 36492, x: X_BPTC, f: texture_compression_bc },\n 'bc7-rgba-unorm-srgb': { gl: 36493, x: X_BPTC, f: texture_compression_bc },\n // WEBGL_compressed_texture_etc: device.features.has(\"texture-compression-etc2\")\n // Note: Supposedly guaranteed availability compressed formats in WebGL2, but through CPU decompression\n 'etc2-rgb8unorm': { gl: 37492, f: texture_compression_etc2 },\n 'etc2-rgb8unorm-srgb': { gl: 37494, f: texture_compression_etc2 },\n 'etc2-rgb8a1unorm': { gl: 37496, f: texture_compression_etc2 },\n 'etc2-rgb8a1unorm-srgb': { gl: 37497, f: texture_compression_etc2 },\n 'etc2-rgba8unorm': { gl: 37493, f: texture_compression_etc2 },\n 'etc2-rgba8unorm-srgb': { gl: 37495, f: texture_compression_etc2 },\n 'eac-r11unorm': { gl: 37488, f: texture_compression_etc2 },\n 'eac-r11snorm': { gl: 37489, f: texture_compression_etc2 },\n 'eac-rg11unorm': { gl: 37490, f: texture_compression_etc2 },\n 'eac-rg11snorm': { gl: 37491, f: texture_compression_etc2 },\n // X_ASTC compressed formats: device.features.has(\"texture-compression-astc\")\n 'astc-4x4-unorm': { gl: 37808, f: texture_compression_astc },\n 'astc-4x4-unorm-srgb': { gl: 37840, f: texture_compression_astc },\n 'astc-5x4-unorm': { gl: 37809, f: texture_compression_astc },\n 'astc-5x4-unorm-srgb': { gl: 37841, f: texture_compression_astc },\n 'astc-5x5-unorm': { gl: 37810, f: texture_compression_astc },\n 'astc-5x5-unorm-srgb': { gl: 37842, f: texture_compression_astc },\n 'astc-6x5-unorm': { gl: 37811, f: texture_compression_astc },\n 'astc-6x5-unorm-srgb': { gl: 37843, f: texture_compression_astc },\n 'astc-6x6-unorm': { gl: 37812, f: texture_compression_astc },\n 'astc-6x6-unorm-srgb': { gl: 37844, f: texture_compression_astc },\n 'astc-8x5-unorm': { gl: 37813, f: texture_compression_astc },\n 'astc-8x5-unorm-srgb': { gl: 37845, f: texture_compression_astc },\n 'astc-8x6-unorm': { gl: 37814, f: texture_compression_astc },\n 'astc-8x6-unorm-srgb': { gl: 37846, f: texture_compression_astc },\n 'astc-8x8-unorm': { gl: 37815, f: texture_compression_astc },\n 'astc-8x8-unorm-srgb': { gl: 37847, f: texture_compression_astc },\n 'astc-10x5-unorm': { gl: 37819, f: texture_compression_astc },\n 'astc-10x5-unorm-srgb': { gl: 37851, f: texture_compression_astc },\n 'astc-10x6-unorm': { gl: 37817, f: texture_compression_astc },\n 'astc-10x6-unorm-srgb': { gl: 37849, f: texture_compression_astc },\n 'astc-10x8-unorm': { gl: 37818, f: texture_compression_astc },\n 'astc-10x8-unorm-srgb': { gl: 37850, f: texture_compression_astc },\n 'astc-10x10-unorm': { gl: 37819, f: texture_compression_astc },\n 'astc-10x10-unorm-srgb': { gl: 37851, f: texture_compression_astc },\n 'astc-12x10-unorm': { gl: 37820, f: texture_compression_astc },\n 'astc-12x10-unorm-srgb': { gl: 37852, f: texture_compression_astc },\n 'astc-12x12-unorm': { gl: 37821, f: texture_compression_astc },\n 'astc-12x12-unorm-srgb': { gl: 37853, f: texture_compression_astc },\n // WEBGL_compressed_texture_pvrtc\n 'pvrtc-rgb4unorm-webgl': { gl: 35840, f: texture_compression_pvrtc_webgl },\n 'pvrtc-rgba4unorm-webgl': { gl: 35842, f: texture_compression_pvrtc_webgl },\n 'pvrtc-rbg2unorm-webgl': { gl: 35841, f: texture_compression_pvrtc_webgl },\n 'pvrtc-rgba2unorm-webgl': { gl: 35843, f: texture_compression_pvrtc_webgl },\n // WEBGL_compressed_texture_etc1\n 'etc1-rbg-unorm-webgl': { gl: 36196, f: texture_compression_etc1_webgl },\n // WEBGL_compressed_texture_atc\n 'atc-rgb-unorm-webgl': { gl: 35986, f: texture_compression_atc_webgl },\n 'atc-rgba-unorm-webgl': { gl: 35986, f: texture_compression_atc_webgl },\n 'atc-rgbai-unorm-webgl': { gl: 34798, f: texture_compression_atc_webgl }\n};\n/** Legal combinations for internalFormat, format and type *\n// [GL.DEPTH_COMPONENT]: {types: [GL.UNSIGNED_SHORT, GL.UNSIGNED_INT, GL.UNSIGNED_INT_24_8]},\n// [GL.DEPTH_STENCIL]: ,\n// Sized texture format\n// R\n[GL.R8]: {dataFormat: GL.RED, types: [GL.UNSIGNED_BYTE], gl2: true},\n[GL.R16F]: {dataFormat: GL.RED, types: [GL.HALF_FLOAT, GL.FLOAT], gl2: true},\n[GL.R8UI]: {dataFormat: GL.RED_INTEGER, types: [GL.UNSIGNED_BYTE], gl2: true},\n// // RG\n[GL.RG8]: {dataFormat: GL.RG, types: [GL.UNSIGNED_BYTE], gl2: true},\n[GL.RG16F]: {dataFormat: GL.RG, types: [GL.HALF_FLOAT, GL.FLOAT], gl2: true},\n[GL.RG8UI]: {dataFormat: GL.RG_INTEGER, types: [GL.UNSIGNED_BYTE], gl2: true},\n// // RGB\n[GL.RGB8]: {dataFormat: GL.RGB, types: [GL.UNSIGNED_BYTE], gl2: true},\n[GL.SRGB8]: {dataFormat: GL.RGB, types: [GL.UNSIGNED_BYTE], gl2: true},\n[GL.RGB16F]: {dataFormat: GL.RGB, types: [GL.HALF_FLOAT, GL.FLOAT], gl2: true},\n[GL.RGB8UI]: {dataFormat: GL.RGB_INTEGER, types: [GL.UNSIGNED_BYTE], gl2: true},\n// // RGBA\n\n[GL.RGB565]: {dataFormat: GL.RGB, types: [GL.UNSIGNED_BYTE, GL.UNSIGNED_SHORT_5_6_5], gl2: true},\n[GL.R11F_G11F_B10F]: {dataFormat: GL.RGB, types: [GL.UNSIGNED_INT_10F_11F_11F_REV, GL.HALF_FLOAT, GL.FLOAT], gl2: true},\n[GL.RGB9_E5]: {dataFormat: GL.RGB, types: [GL.HALF_FLOAT, GL.FLOAT], gl2: true},\n[GL.RGBA8]: {dataFormat: GL.RGBA, types: [GL.UNSIGNED_BYTE], gl2: true},\n[GL.SRGB8_ALPHA8]: {dataFormat: GL.RGBA, types: [GL.UNSIGNED_BYTE], gl2: true, gl1ext: EXT_SRGB},\n[GL.RGB5_A1]: {dataFormat: GL.RGBA, types: [GL.UNSIGNED_BYTE, GL.UNSIGNED_SHORT_5_5_5_1], gl2: true},\n[GL.RGBA4]: {dataFormat: GL.RGBA, types: [GL.UNSIGNED_BYTE, GL.UNSIGNED_SHORT_4_4_4_4], gl2: true},\n[GL.RGBA16F]: {dataFormat: GL.RGBA, types: [GL.HALF_FLOAT, GL.FLOAT], gl2: true},\n[GL.RGBA8UI]: {dataFormat: GL.RGBA_INTEGER, types: [GL.UNSIGNED_BYTE], gl2: true}\n*/\n/* This table is now baked into the above table\ntype RenderbufferFormat = {\n bpp: number;\n gl2?: boolean;\n ext?: string;\n};\n\nexport const RENDERBUFFER_FORMATS: Record = {\n [GL.DEPTH_COMPONENT16]: {bpp: 2}, // 16 depth bits.\n // TODO - Not clear which webgpu value to map this to.\n // [GL.DEPTH_COMPONENT24]: {gl2: true, bpp: 3},\n [GL.DEPTH_COMPONENT32F]: {gl2: true, bpp: 4},\n\n [GL.STENCIL_INDEX8]: {bpp: 1}, // 8 stencil bits.\n\n [GL.DEPTH_STENCIL]: {bpp: 4},\n [GL.DEPTH24_STENCIL8]: {gl2: true, bpp: 4},\n [GL.DEPTH32F_STENCIL8]: {gl2: true, bpp: 5},\n\n // When using a WebGL 1 context, color renderbuffer formats are limited\n [GL.RGBA4]: {gl2: true, bpp: 2},\n [GL.RGB565]: {gl2: true, bpp: 2},\n [GL.RGB5_A1]: {gl2: true, bpp: 2},\n\n // When using a WebGL 2 context, the following values are available additionally:\n [GL.R8]: {gl2: true, bpp: 1},\n [GL.R8UI]: {gl2: true, bpp: 1},\n [GL.R8I]: {gl2: true, bpp: 1},\n [GL.R16UI]: {gl2: true, bpp: 2},\n [GL.R16I]: {gl2: true, bpp: 2},\n [GL.R32UI]: {gl2: true, bpp: 4},\n [GL.R32I]: {gl2: true, bpp: 4},\n [GL.RG8]: {gl2: true, bpp: 2},\n [GL.RG8UI]: {gl2: true, bpp: 2},\n [GL.RG8I]: {gl2: true, bpp: 2},\n [GL.RG16UI]: {gl2: true, bpp: 4},\n [GL.RG16I]: {gl2: true, bpp: 4},\n [GL.RG32UI]: {gl2: true, bpp: 8},\n [GL.RG32I]: {gl2: true, bpp: 8},\n [GL.RGB8]: {gl2: true, bpp: 3},\n [GL.RGBA8]: {gl2: true, bpp: 4},\n // [GL.SRGB8_ALPHA8]: {gl2: true, gl1: SRGB}, // When using the EXT_sRGB WebGL1 extension\n [GL.RGB10_A2]: {gl2: true, bpp: 4},\n [GL.RGBA8UI]: {gl2: true, bpp: 4},\n [GL.RGBA8I]: {gl2: true, bpp: 4},\n [GL.RGB10_A2UI]: {gl2: true, bpp: 4},\n [GL.RGBA16UI]: {gl2: true, bpp: 8},\n [GL.RGBA16I]: {gl2: true, bpp: 8},\n [GL.RGBA32I]: {gl2: true, bpp: 16},\n [GL.RGBA32UI]: {gl2: true, bpp: 16},\n\n // When using a WebGL 2 context and the EXT_color_buffer_float WebGL2 extension\n [GL.R16F]: {ext: EXT_FLOAT_WEBGL2, bpp: 2},\n [GL.RG16F]: {ext: EXT_FLOAT_WEBGL2, bpp: 4},\n [GL.RGBA16F]: {ext: EXT_FLOAT_WEBGL2, bpp: 8},\n [GL.R32F]: {ext: EXT_FLOAT_WEBGL2, bpp: 4},\n [GL.RG32F]: {ext: EXT_FLOAT_WEBGL2, bpp: 8},\n // TODO - can't get WEBGL_color_buffer_float to work on renderbuffers\n [GL.RGBA32F]: {ext: EXT_FLOAT_WEBGL2, bpp: 16},\n // [GL.RGBA32F]: {ext: EXT_FLOAT_WEBGL2},\n [GL.R11F_G11F_B10F]: {ext: EXT_FLOAT_WEBGL2, bpp: 4}\n};\n*/\n/** @deprecated should be removed */\nconst DATA_FORMAT_CHANNELS = {\n [6403]: 1,\n [36244]: 1,\n [33319]: 2,\n [33320]: 2,\n [6407]: 3,\n [36248]: 3,\n [6408]: 4,\n [36249]: 4,\n [6402]: 1,\n [34041]: 1,\n [6406]: 1,\n [6409]: 1,\n [6410]: 2\n};\n/** @deprecated should be removed */\nconst TYPE_SIZES = {\n [5126]: 4,\n [5125]: 4,\n [5124]: 4,\n [5123]: 2,\n [5122]: 2,\n [5131]: 2,\n [5120]: 1,\n [5121]: 1\n};\n// FUNCTIONS\n/** Checks if a texture format is supported */\nexport function isTextureFormatSupported(gl, format, extensions) {\n const info = TEXTURE_FORMATS[format];\n if (!info) {\n return false;\n }\n // Check that we have a GL constant\n if (info.gl === undefined) {\n return false;\n }\n // Check extensions\n const extension = info.x || info.gl2ext;\n if (extension) {\n return Boolean(getWebGLExtension(gl, extension, extensions));\n }\n return true;\n}\nexport function isRenderbufferFormatSupported(gl, format, extensions) {\n // Note: Order is important since the function call initializes extensions.\n return isTextureFormatSupported(gl, format, extensions) && TEXTURE_FORMATS[format]?.rb;\n}\n/**\n * Map WebGL texture formats (GL constants) to WebGPU-style TextureFormat strings\n */\nexport function convertGLToTextureFormat(format) {\n if (typeof format === 'string') {\n return format;\n }\n const entry = Object.entries(TEXTURE_FORMATS).find(([, entry]) => entry.gl === format);\n if (!entry) {\n throw new Error(`Unknown texture format ${format}`);\n }\n return entry[0];\n}\n/**\n * Map WebGPU style texture format strings to GL constants\n */\nexport function convertTextureFormatToGL(format) {\n const formatInfo = TEXTURE_FORMATS[format];\n const webglFormat = formatInfo?.gl;\n if (webglFormat === undefined) {\n throw new Error(`Unsupported texture format ${format}`);\n }\n return webglFormat;\n}\n/** Checks if a texture format is supported */\nexport function getTextureFormatSupport(gl, format, extensions) {\n const info = TEXTURE_FORMATS[format];\n if (!info) {\n return { supported: false };\n }\n // let decoded;\n // try {\n // decoded = decodeTextureFormat(format);\n // } catch {}\n // Support Check that we have a GL constant\n let supported = info.gl === undefined;\n supported = supported && checkTextureFeature(gl, info.f, extensions);\n // Filtering\n // const filterable = info.filter\n // ? checkTextureFeature(gl, infofilter])\n // : decoded && !decoded.signed;\n // const renderable = info.filter\n // ? checkTextureFeature(gl, inforender])\n // : decoded && !decoded.signed;\n return {\n supported,\n renderable: supported && checkTextureFeature(gl, info.render, extensions),\n filterable: supported && checkTextureFeature(gl, info.filter, extensions),\n blendable: false, // tod,\n storable: false\n };\n}\n/** Checks whether linear filtering (interpolated sampling) is available for floating point textures */\nexport function isTextureFormatFilterable(gl, format, extensions) {\n if (!isTextureFormatSupported(gl, format, extensions)) {\n return false;\n }\n if (format.startsWith('depth') || format.startsWith('stencil')) {\n return false;\n }\n try {\n const decoded = decodeTextureFormat(format);\n if (decoded.signed) {\n return false;\n }\n }\n catch {\n return false;\n }\n if (format.endsWith('32float')) {\n return Boolean(getWebGLExtension(gl, 'OES_texture_float_linear, extensions', extensions));\n }\n if (format.endsWith('16float')) {\n return Boolean(getWebGLExtension(gl, 'OES_texture_half_float_linear, extensions', extensions));\n }\n return true;\n}\nexport function isTextureFormatRenderable(gl, format, extensions) {\n if (!isTextureFormatSupported(gl, format, extensions)) {\n return false;\n }\n if (typeof format === 'number') {\n return false; // isTextureFormatFilterableWebGL(gl, format);\n }\n // TODO depends on device...\n return true;\n}\n/** Get parameters necessary to work with format in WebGL: internalFormat, dataFormat, type, compressed, */\nexport function getWebGLTextureParameters(format) {\n const formatData = TEXTURE_FORMATS[format];\n const webglFormat = convertTextureFormatToGL(format);\n const decoded = decodeTextureFormat(format);\n return {\n format: webglFormat,\n dataFormat: formatData?.dataFormat ||\n getWebGLPixelDataFormat(decoded.format, decoded.integer, decoded.normalized, webglFormat),\n // depth formats don't have a type\n type: decoded.dataType\n ? getGLFromVertexType(decoded.dataType)\n : formatData?.types?.[0] || 5121,\n // @ts-expect-error\n compressed: decoded.compressed\n };\n}\nexport function getDepthStencilAttachmentWebGL(format) {\n const info = TEXTURE_FORMATS[format];\n if (!info?.attachment) {\n throw new Error(`${format} is not a depth stencil format`);\n }\n return info.attachment;\n}\n/** TODO - VERY roundabout legacy way of calculating bytes per pixel */\nexport function getTextureFormatBytesPerPixel(format) {\n // TODO remove webgl1 support\n const params = getWebGLTextureParameters(format);\n // NOTE(Tarek): Default to RGBA bytes\n const channels = DATA_FORMAT_CHANNELS[params.dataFormat] || 4;\n const channelSize = TYPE_SIZES[params.type] || 1;\n return channels * channelSize;\n}\n// DATA TYPE HELPERS\nfunction getWebGLPixelDataFormat(dataFormat, integer, normalized, format) {\n // WebGL1 formats use same internalFormat\n if (format === 6408 || format === 6407) {\n return format;\n }\n // prettier-ignore\n switch (dataFormat) {\n case 'r': return integer && !normalized ? 36244 : 6403;\n case 'rg': return integer && !normalized ? 33320 : 33319;\n case 'rgb': return integer && !normalized ? 36248 : 6407;\n case 'rgba': return integer && !normalized ? 36249 : 6408;\n default: return 6408;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { GL } from '@luma.gl/constants';\n/** Get vertex format from GL constants */\nexport function getVertexFormatFromGL(type, components) {\n const base = getVertexTypeFromGL(type);\n // prettier-ignore\n switch (components) {\n // @ts-expect-error TODO deal with lack of formats\n case 1: return base;\n case 2: return `${base}x2`;\n // @ts-expect-error TODO deal with lack of formats\n case 3: return `${base}x3`;\n case 4: return `${base}x4`;\n }\n // @ts-ignore unreachable\n throw new Error(String(components));\n}\n/** Get data type from GL constants */\nexport function getVertexTypeFromGL(type, normalized = false) {\n // prettier-ignore\n switch (type) {\n // WebGPU does not support normalized 32 bit integer attributes\n case 5124: return normalized ? 'sint32' : 'sint32';\n case 5125: return normalized ? 'uint32' : 'uint32';\n case 5122: return normalized ? 'sint16' : 'unorm16';\n case 5123: return normalized ? 'uint16' : 'unorm16';\n case 5120: return normalized ? 'sint8' : 'snorm16';\n case 5121: return normalized ? 'uint8' : 'unorm8';\n case 5126: return 'float32';\n case 5131: return 'float16';\n }\n // @ts-ignore unreachable\n throw new Error(String(type));\n}\nexport function getGLFromVertexType(dataType) {\n // prettier-ignore\n switch (dataType) {\n case 'uint8': return 5121;\n case 'sint8': return 5120;\n case 'unorm8': return 5121;\n case 'snorm8': return 5120;\n case 'uint16': return 5123;\n case 'sint16': return 5122;\n case 'unorm16': return 5123;\n case 'snorm16': return 5122;\n case 'uint32': return 5125;\n case 'sint32': return 5124;\n // WebGPU does not support normalized 32 bit integer attributes\n // case 'unorm32': return GL.UNSIGNED_INT;\n // case 'snorm32': return GL.INT;\n case 'float16': return 5131;\n case 'float32': return 5126;\n }\n // @ts-ignore unreachable\n throw new Error(String(dataType));\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { DeviceLimits } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\n// prettier-ignore\nexport class WebGLDeviceLimits extends DeviceLimits {\n get maxTextureDimension1D() { return 0; } // WebGL does not support 1D textures\n get maxTextureDimension2D() { return this.getParameter(3379); }\n get maxTextureDimension3D() { return this.getParameter(32883); }\n get maxTextureArrayLayers() { return this.getParameter(35071); }\n get maxBindGroups() { return 0; }\n get maxDynamicUniformBuffersPerPipelineLayout() { return 0; } // TBD\n get maxDynamicStorageBuffersPerPipelineLayout() { return 0; } // TBD\n get maxSampledTexturesPerShaderStage() { return this.getParameter(35660); } // ) TBD\n get maxSamplersPerShaderStage() { return this.getParameter(35661); }\n get maxStorageBuffersPerShaderStage() { return 0; } // TBD\n get maxStorageTexturesPerShaderStage() { return 0; } // TBD\n get maxUniformBuffersPerShaderStage() { return this.getParameter(35375); }\n get maxUniformBufferBindingSize() { return this.getParameter(35376); }\n get maxStorageBufferBindingSize() { return 0; }\n get minUniformBufferOffsetAlignment() { return this.getParameter(35380); }\n get minStorageBufferOffsetAlignment() { return 0; }\n get maxVertexBuffers() { return 16; } // WebGL 2 supports 16 buffers, see https://github.com/gpuweb/gpuweb/issues/4284\n get maxVertexAttributes() { return this.getParameter(34921); }\n get maxVertexBufferArrayStride() { return 2048; } // TBD, this is just the default value from WebGPU\n get maxInterStageShaderComponents() { return this.getParameter(35659); }\n get maxComputeWorkgroupStorageSize() { return 0; } // WebGL does not support compute shaders\n get maxComputeInvocationsPerWorkgroup() { return 0; } // WebGL does not support compute shaders\n get maxComputeWorkgroupSizeX() { return 0; } // WebGL does not support compute shaders\n get maxComputeWorkgroupSizeY() { return 0; } // WebGL does not support compute shaders\n get maxComputeWorkgroupSizeZ() { return 0; } // WebGL does not support compute shaders\n get maxComputeWorkgroupsPerDimension() { return 0; } // WebGL does not support compute shaders\n // PRIVATE\n gl;\n limits = {};\n constructor(gl) {\n super();\n this.gl = gl;\n }\n getParameter(parameter) {\n if (this.limits[parameter] === undefined) {\n this.limits[parameter] = this.gl.getParameter(parameter);\n }\n return this.limits[parameter];\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { CanvasContext } from '@luma.gl/core';\nimport { WEBGLFramebuffer } from \"./resources/webgl-framebuffer.js\";\n/**\n * A WebGL Canvas Context which manages the canvas and handles drawing buffer resizing etc\n */\nexport class WebGLCanvasContext extends CanvasContext {\n device;\n presentationSize;\n _framebuffer = null;\n constructor(device, props) {\n // Note: Base class creates / looks up the canvas (unless under Node.js)\n super(props);\n this.device = device;\n this.presentationSize = [-1, -1];\n this._setAutoCreatedCanvasId(`${this.device.id}-canvas`);\n this.update();\n }\n getCurrentFramebuffer() {\n this.update();\n // Setting handle to null returns a reference to the default framebuffer\n this._framebuffer = this._framebuffer || new WEBGLFramebuffer(this.device, { handle: null });\n return this._framebuffer;\n }\n /** Resizes and updates render targets if necessary */\n update() {\n const size = this.getPixelSize();\n const sizeChanged = size[0] !== this.presentationSize[0] || size[1] !== this.presentationSize[1];\n if (sizeChanged) {\n this.presentationSize = size;\n this.resize();\n }\n }\n /**\n * Resize the canvas' drawing buffer.\n *\n * Can match the canvas CSS size, and optionally also consider devicePixelRatio\n * Can be called every frame\n *\n * Regardless of size, the drawing buffer will always be scaled to the viewport, but\n * for best visual results, usually set to either:\n * canvas CSS width x canvas CSS height\n * canvas CSS width * devicePixelRatio x canvas CSS height * devicePixelRatio\n * See http://webgl2fundamentals.org/webgl/lessons/webgl-resizing-the-canvas.html\n */\n resize(options) {\n if (!this.device.gl)\n return;\n // Resize browser context .\n if (this.canvas) {\n const devicePixelRatio = this.getDevicePixelRatio(options?.useDevicePixels);\n this.setDevicePixelRatio(devicePixelRatio, options);\n return;\n }\n }\n commit() {\n // gl.commit was ultimately removed from the WebGL standard??\n // if (this.offScreen && this.gl.commit) {\n // // @ts-expect-error gl.commit is not officially part of WebGL2RenderingContext\n // this.gl.commit();\n // }\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Framebuffer, assert } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\nimport { WEBGLTexture } from \"./webgl-texture.js\";\nimport { WEBGLTextureView } from \"./webgl-texture-view.js\";\nimport { getDepthStencilAttachmentWebGL } from \"../converters/texture-formats.js\";\n/** luma.gl Framebuffer, WebGL implementation */\nexport class WEBGLFramebuffer extends Framebuffer {\n device;\n gl;\n handle;\n get texture() {\n return this.colorAttachments[0];\n }\n constructor(device, props) {\n super(device, props);\n // WebGL default framebuffer handle is null\n const isDefaultFramebuffer = props.handle === null;\n this.device = device;\n this.gl = device.gl;\n this.handle =\n this.props.handle || isDefaultFramebuffer ? this.props.handle : this.gl.createFramebuffer();\n if (!isDefaultFramebuffer) {\n // default framebuffer handle is null, so we can't set spector metadata...\n device.setSpectorMetadata(this.handle, { id: this.props.id, props: this.props });\n // Auto create textures for attachments if needed\n this.autoCreateAttachmentTextures();\n /** Attach from a map of attachments */\n // @ts-expect-error native bindFramebuffer is overridden by our state tracker\n const prevHandle = this.gl.bindFramebuffer(36160, this.handle);\n // Walk the attachments\n for (let i = 0; i < this.colorAttachments.length; ++i) {\n const attachment = this.colorAttachments[i];\n const attachmentPoint = 36064 + i;\n if (attachment) {\n this._attachOne(attachmentPoint, attachment);\n }\n }\n if (this.depthStencilAttachment) {\n this._attachOne(getDepthStencilAttachmentWebGL(this.depthStencilAttachment.props.format), this.depthStencilAttachment);\n }\n /** Check the status */\n // @ts-expect-error\n if (props.check !== false) {\n const status = this.gl.checkFramebufferStatus(36160);\n if (status !== 36053) {\n throw new Error(`Framebuffer ${_getFrameBufferStatus(status)}`);\n }\n }\n this.gl.bindFramebuffer(36160, prevHandle);\n }\n }\n /** destroys any auto created resources etc. */\n destroy() {\n super.destroy(); // destroys owned resources etc.\n if (!this.destroyed && this.handle !== null) {\n this.gl.deleteFramebuffer(this.handle);\n // this.handle = null;\n }\n }\n // PRIVATE\n /** In WebGL we must use renderbuffers for depth/stencil attachments (unless we have extensions) */\n createDepthStencilTexture(format) {\n // return new WEBGLRenderbuffer(this.device, {\n return new WEBGLTexture(this.device, {\n id: `${this.id}-depth-stencil`,\n format,\n width: this.width,\n height: this.height,\n mipmaps: false\n });\n }\n /**\n * Attachment resize is expected to be a noop if size is same\n */\n resizeAttachments(width, height) {\n // for default framebuffer, just update the stored size\n if (this.handle === null) {\n // assert(width === undefined && height === undefined);\n this.width = this.gl.drawingBufferWidth;\n this.height = this.gl.drawingBufferHeight;\n return this;\n }\n if (width === undefined) {\n width = this.gl.drawingBufferWidth;\n }\n if (height === undefined) {\n height = this.gl.drawingBufferHeight;\n }\n // TODO Not clear that this is better than default destroy/create implementation\n for (const colorAttachment of this.colorAttachments) {\n colorAttachment.texture.resize({ width, height });\n }\n if (this.depthStencilAttachment) {\n this.depthStencilAttachment.texture.resize({ width, height });\n }\n return this;\n }\n /** Attach one attachment */\n _attachOne(attachmentPoint, attachment) {\n // if (attachment instanceof WEBGLRenderbuffer) {\n // this._attachWEBGLRenderbuffer(attachmentPoint, attachment);\n // return attachment;\n // }\n if (Array.isArray(attachment)) {\n const [texture, layer = 0, level = 0] = attachment;\n this._attachTexture(attachmentPoint, texture, layer, level);\n return texture;\n }\n if (attachment instanceof WEBGLTexture) {\n this._attachTexture(attachmentPoint, attachment, 0, 0);\n return attachment;\n }\n if (attachment instanceof WEBGLTextureView) {\n const textureView = attachment;\n this._attachTexture(attachmentPoint, textureView.texture, textureView.props.baseMipLevel, textureView.props.baseArrayLayer);\n return attachment.texture;\n }\n throw new Error('attach');\n }\n // TODO - we do not seem to need render buffers in WebGL 2\n // protected _attachWEBGLRenderbuffer(attachment: GL, renderbuffer: WEBGLRenderbuffer): void {\n // this.gl.framebufferRenderbuffer(\n // GL.FRAMEBUFFER,\n // attachment,\n // GL.RENDERBUFFER,\n // renderbuffer.handle\n // );\n // }\n /**\n * @param attachment\n * @param texture\n * @param layer = 0 - index into WEBGLTextureArray and Texture3D or face for `TextureCubeMap`\n * @param level = 0 - mipmapLevel\n */\n _attachTexture(attachment, texture, layer, level) {\n const { gl } = this.device;\n gl.bindTexture(texture.target, texture.handle);\n switch (texture.target) {\n case 35866:\n case 32879:\n gl.framebufferTextureLayer(36160, attachment, texture.target, level, layer);\n break;\n case 34067:\n // layer must be a cubemap face (or if index, converted to cube map face)\n const face = mapIndexToCubeMapFace(layer);\n gl.framebufferTexture2D(36160, attachment, face, texture.handle, level);\n break;\n case 3553:\n gl.framebufferTexture2D(36160, attachment, 3553, texture.handle, level);\n break;\n default:\n assert(false, 'Illegal texture type');\n }\n gl.bindTexture(texture.target, null);\n }\n}\n// Helper functions\n// Map an index to a cube map face constant\nfunction mapIndexToCubeMapFace(layer) {\n // TEXTURE_CUBE_MAP_POSITIVE_X is a big value (0x8515)\n // if smaller assume layer is index, otherwise assume it is already a cube map face constant\n return layer < 34069\n ? layer + 34069\n : layer;\n}\n// Helper METHODS\n// Get a string describing the framebuffer error if installed\nfunction _getFrameBufferStatus(status) {\n switch (status) {\n case 36053:\n return 'success';\n case 36054:\n return 'Mismatched attachments';\n case 36055:\n return 'No attachments';\n case 36057:\n return 'Height/width mismatch';\n case 36061:\n return 'Unsupported or split attachments';\n // WebGL2\n case 36182:\n return 'Samples mismatch';\n // OVR_multiview2 extension\n // case GL.FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR: return 'baseViewIndex mismatch';\n default:\n return `${status}`;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Texture, log, assert, loadImage, isObjectEmpty } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\nimport { withGLParameters } from \"../../context/state-tracker/with-parameters.js\";\nimport { convertTextureFormatToGL, getWebGLTextureParameters, getTextureFormatBytesPerPixel } from \"../converters/texture-formats.js\";\nimport { convertSamplerParametersToWebGL } from \"../converters/sampler-parameters.js\";\nimport { WEBGLBuffer } from \"./webgl-buffer.js\";\nimport { WEBGLSampler } from \"./webgl-sampler.js\";\nimport { WEBGLTextureView } from \"./webgl-texture-view.js\";\nexport const DEFAULT_WEBGL_TEXTURE_PROPS = {\n // deprecated\n parameters: {},\n pixelStore: {},\n pixels: null,\n border: 0,\n dataFormat: undefined,\n textureUnit: undefined,\n target: undefined\n};\n// Polyfill\nexport class WEBGLTexture extends Texture {\n // TODO - remove?\n static FACES = [\n 34069,\n 34070,\n 34071,\n 34072,\n 34073,\n 34074\n ];\n MAX_ATTRIBUTES;\n device;\n gl;\n handle;\n // (TODO - currently unused in WebGL, but WebGL 2 does support sampler objects) */\n sampler = undefined;\n view = undefined;\n // data;\n glFormat = undefined;\n type = undefined;\n dataFormat = undefined;\n mipmaps = undefined;\n /**\n * @note `target` cannot be modified by bind:\n * textures are special because when you first bind them to a target,\n * they get special information. When you first bind a texture as a\n * GL_TEXTURE_2D, you are saying that this texture is a 2D texture.\n * And it will always be a 2D texture; this state cannot be changed ever.\n * A texture that was first bound as a GL_TEXTURE_2D, must always be bound as a GL_TEXTURE_2D;\n * attempting to bind it as GL_TEXTURE_3D will give rise to a run-time error\n * */\n target;\n textureUnit = undefined;\n /**\n * Program.draw() checks the loaded flag of all textures to avoid\n * Textures that are still loading from promises\n * Set to true as soon as texture has been initialized with valid data\n */\n loaded = false;\n _video;\n constructor(device, props) {\n super(device, { ...DEFAULT_WEBGL_TEXTURE_PROPS, format: 'rgba8unorm', ...props });\n this.device = device;\n this.gl = this.device.gl;\n this.handle = this.props.handle || this.gl.createTexture();\n this.device.setSpectorMetadata(this.handle, { ...this.props, data: typeof this.props.data }); // {name: this.props.id};\n this.glFormat = 6408;\n this.target = getWebGLTextureTarget(this.props);\n // Program.draw() checks the loaded flag of all textures\n this.loaded = false;\n // Signature: new Texture2D(gl, {data: url})\n if (typeof this.props?.data === 'string') {\n Object.assign(this.props, { data: loadImage(this.props.data) });\n }\n this.initialize(this.props);\n Object.seal(this);\n }\n destroy() {\n if (this.handle) {\n this.gl.deleteTexture(this.handle);\n this.removeStats();\n this.trackDeallocatedMemory('Texture');\n // this.handle = null;\n this.destroyed = true;\n }\n }\n toString() {\n return `Texture(${this.id},${this.width}x${this.height})`;\n }\n createView(props) {\n return new WEBGLTextureView(this.device, { ...props, texture: this });\n }\n // eslint-disable-next-line max-statements\n initialize(props = {}) {\n // Cube textures\n if (this.props.dimension === 'cube') {\n return this.initializeCube(props);\n }\n let data = props.data;\n if (data instanceof Promise) {\n data.then(resolvedImageData => this.initialize(Object.assign({}, props, {\n pixels: resolvedImageData,\n data: resolvedImageData\n })));\n return this;\n }\n const isVideo = typeof HTMLVideoElement !== 'undefined' && data instanceof HTMLVideoElement;\n // @ts-expect-error\n if (isVideo && data.readyState < HTMLVideoElement.HAVE_METADATA) {\n this._video = null; // Declare member before the object is sealed\n // @ts-expect-error\n data.addEventListener('loadeddata', () => this.initialize(props));\n return this;\n }\n const { parameters = {} } = props;\n const { pixels = null, pixelStore = {}, textureUnit = undefined, mipmaps = true } = props;\n // pixels variable is for API compatibility purpose\n if (!data) {\n // TODO - This looks backwards? Commenting out for now until we decide\n // which prop to use\n // log.deprecated('data', 'pixels')();\n data = pixels;\n }\n let { width, height, dataFormat, type, compressed = false } = props;\n const { depth = 0 } = props;\n const glFormat = convertTextureFormatToGL(props.format);\n // Deduce width and height\n ({ width, height, compressed, dataFormat, type } = this._deduceParameters({\n format: props.format,\n type,\n dataFormat,\n compressed,\n data,\n width,\n height\n }));\n // Store opts for accessors\n this.width = width;\n this.height = height;\n // this.depth = depth;\n this.glFormat = glFormat;\n this.type = type;\n this.dataFormat = dataFormat;\n this.textureUnit = textureUnit;\n if (Number.isFinite(this.textureUnit)) {\n this.gl.activeTexture(33984 + this.textureUnit);\n this.gl.bindTexture(this.target, this.handle);\n }\n this.mipmaps = mipmaps;\n this.setImageData({\n data,\n width,\n height,\n depth,\n format: props.format,\n type,\n dataFormat,\n // @ts-expect-error\n parameters: pixelStore,\n compressed\n });\n // Set texture sampler parameters\n this.setSampler(props.sampler);\n this._setSamplerParameters(parameters);\n this.view = this.createView({ ...this.props, mipLevelCount: 1, arrayLayerCount: 1 });\n if (mipmaps && this.device.isTextureFormatFilterable(props.format)) {\n this.generateMipmap();\n }\n if (isVideo) {\n this._video = {\n video: data,\n parameters,\n // @ts-expect-error\n lastTime: data.readyState >= HTMLVideoElement.HAVE_CURRENT_DATA ? data.currentTime : -1\n };\n }\n return this;\n }\n initializeCube(props) {\n const { mipmaps = true, parameters = {} } = props;\n // Store props for accessors\n // this.props = props;\n // @ts-expect-error\n this.setCubeMapImageData(props).then(() => {\n this.loaded = true;\n // TODO - should genMipmap() be called on the cubemap or on the faces?\n // TODO - without generateMipmap() cube textures do not work at all!!! Why?\n if (mipmaps) {\n this.generateMipmap(props);\n }\n this.setSampler(props.sampler);\n this._setSamplerParameters(parameters);\n });\n return this;\n }\n setSampler(sampler = {}) {\n let samplerProps;\n if (sampler instanceof WEBGLSampler) {\n this.sampler = sampler;\n samplerProps = sampler.props;\n }\n else {\n this.sampler = new WEBGLSampler(this.device, sampler);\n samplerProps = sampler;\n }\n const parameters = convertSamplerParametersToWebGL(samplerProps);\n this._setSamplerParameters(parameters);\n return this;\n }\n /**\n * If size has changed, reinitializes with current format\n * @note note clears image and mipmaps\n */\n resize(options) {\n const { height, width, mipmaps = false } = options;\n if (width !== this.width || height !== this.height) {\n return this.initialize({\n width,\n height,\n format: this.format,\n type: this.type,\n dataFormat: this.dataFormat,\n mipmaps\n });\n }\n return this;\n }\n /** Update external texture (video frame) */\n update() {\n if (this._video) {\n const { video, parameters, lastTime } = this._video;\n // @ts-expect-error\n if (lastTime === video.currentTime || video.readyState < HTMLVideoElement.HAVE_CURRENT_DATA) {\n return;\n }\n this.setSubImageData({\n data: video,\n parameters\n });\n if (this.mipmaps) {\n this.generateMipmap();\n }\n this._video.lastTime = video.currentTime;\n }\n }\n // Call to regenerate mipmaps after modifying texture(s)\n generateMipmap(params = {}) {\n this.mipmaps = true;\n this.gl.bindTexture(this.target, this.handle);\n withGLParameters(this.gl, params, () => {\n this.gl.generateMipmap(this.target);\n });\n this.gl.bindTexture(this.target, null);\n return this;\n }\n /*\n * Allocates storage\n * @param {*} pixels -\n * null - create empty texture of specified format\n * Typed array - init from image data in typed array\n * Buffer|WebGLBuffer - (WEBGL2) init from image data in WebGLBuffer\n * HTMLImageElement|Image - Inits with content of image. Auto width/height\n * HTMLCanvasElement - Inits with contents of canvas. Auto width/height\n * HTMLVideoElement - Creates video texture. Auto width/height\n *\n * @param width -\n * @param height -\n * @param mipMapLevel -\n * @param {GLenum} format - format of image data.\n * @param {GLenum} type\n * - format of array (autodetect from type) or\n * - (WEBGL2) format of buffer\n * @param {Number} offset - (WEBGL2) offset from start of buffer\n * @parameters - temporary settings to be applied, can be used to supply pixel store settings.\n */\n // eslint-disable-next-line max-statements, complexity\n setImageData(options) {\n if (this.props.dimension === '3d' || this.props.dimension === '2d-array') {\n return this.setImageData3D(options);\n }\n this.trackDeallocatedMemory('Texture');\n const { target = this.target, pixels = null, level = 0, glFormat = this.glFormat, offset = 0, parameters = {} } = options;\n let { data = null, type = this.type, width = this.width, height = this.height, dataFormat = this.dataFormat, compressed = false } = options;\n // pixels variable is for API compatibility purpose\n if (!data) {\n data = pixels;\n }\n ({ type, dataFormat, compressed, width, height } = this._deduceParameters({\n format: this.props.format,\n type,\n dataFormat,\n compressed,\n data,\n width,\n height\n }));\n const { gl } = this;\n gl.bindTexture(this.target, this.handle);\n let dataType = null;\n ({ data, dataType } = this._getDataType({ data, compressed }));\n withGLParameters(this.gl, parameters, () => {\n switch (dataType) {\n case 'null':\n gl.texImage2D(target, level, glFormat, width, height, 0 /* border*/, dataFormat, type, data);\n break;\n case 'typed-array':\n gl.texImage2D(target, level, glFormat, width, height, 0, // border (must be 0)\n dataFormat, type, data, offset);\n break;\n case 'buffer':\n // WebGL2 enables creating textures directly from a WebGL buffer\n this.device.gl.bindBuffer(35052, data.handle || data);\n this.device.gl.texImage2D(target, level, glFormat, width, height, 0 /* border*/, dataFormat, type, offset);\n this.device.gl.bindBuffer(35052, null);\n break;\n case 'browser-object':\n gl.texImage2D(target, level, glFormat, width, height, 0 /* border*/, dataFormat, type, data);\n break;\n case 'compressed':\n for (const [levelIndex, levelData] of data.entries()) {\n gl.compressedTexImage2D(target, levelIndex, levelData.format, levelData.width, levelData.height, 0 /* border, must be 0 */, levelData.data);\n }\n break;\n default:\n assert(false, 'Unknown image data type');\n }\n });\n if (data && data.byteLength) {\n this.trackAllocatedMemory(data.byteLength, 'Texture');\n }\n else {\n const bytesPerPixel = getTextureFormatBytesPerPixel(this.props.format);\n this.trackAllocatedMemory(this.width * this.height * bytesPerPixel, 'Texture');\n }\n this.loaded = true;\n return this;\n }\n /**\n * Redefines an area of an existing texture\n * Note: does not allocate storage\n * Redefines an area of an existing texture\n */\n setSubImageData({ target = this.target, pixels = null, data = null, x = 0, y = 0, width = this.width, height = this.height, level = 0, glFormat = this.glFormat, type = this.type, dataFormat = this.dataFormat, compressed = false, offset = 0, parameters = {} }) {\n ({ type, dataFormat, compressed, width, height } = this._deduceParameters({\n format: this.props.format,\n type,\n dataFormat,\n compressed,\n data,\n width,\n height\n }));\n assert(this.depth === 1, 'texSubImage not supported for 3D textures');\n // pixels variable is for API compatibility purpose\n if (!data) {\n data = pixels;\n }\n // Support ndarrays\n if (data && data.data) {\n const ndarray = data;\n data = ndarray.data;\n width = ndarray.shape[0];\n height = ndarray.shape[1];\n }\n // Support buffers\n if (data instanceof WEBGLBuffer) {\n data = data.handle;\n }\n this.gl.bindTexture(this.target, this.handle);\n withGLParameters(this.gl, parameters, () => {\n // TODO - x,y parameters\n if (compressed) {\n this.gl.compressedTexSubImage2D(target, level, x, y, width, height, glFormat, data);\n }\n else if (data === null) {\n this.gl.texSubImage2D(target, level, x, y, width, height, dataFormat, type, null);\n }\n else if (ArrayBuffer.isView(data)) {\n this.gl.texSubImage2D(target, level, x, y, width, height, dataFormat, type, data, offset);\n }\n else if (typeof WebGLBuffer !== 'undefined' && data instanceof WebGLBuffer) {\n // WebGL2 allows us to create texture directly from a WebGL buffer\n // This texImage2D signature uses currently bound GL.PIXEL_UNPACK_BUFFER\n this.device.gl.bindBuffer(35052, data);\n this.device.gl.texSubImage2D(target, level, x, y, width, height, dataFormat, type, offset);\n this.device.gl.bindBuffer(35052, null);\n }\n else {\n // Assume data is a browser supported object (ImageData, Canvas, ...)\n this.device.gl.texSubImage2D(target, level, x, y, width, height, dataFormat, type, data);\n }\n });\n this.gl.bindTexture(this.target, null);\n }\n /**\n * Defines a two-dimensional texture image or cube-map texture image with\n * pixels from the current framebuffer (rather than from client memory).\n * (gl.copyTexImage2D wrapper)\n *\n * Note that binding a texture into a Framebuffer's color buffer and\n * rendering can be faster.\n */\n copyFramebuffer(opts = {}) {\n log.error('Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})')();\n return null;\n }\n getActiveUnit() {\n return this.gl.getParameter(34016) - 33984;\n }\n bind(textureUnit = this.textureUnit) {\n const { gl } = this;\n if (textureUnit !== undefined) {\n this.textureUnit = textureUnit;\n gl.activeTexture(33984 + textureUnit);\n }\n gl.bindTexture(this.target, this.handle);\n return textureUnit;\n }\n unbind(textureUnit = this.textureUnit) {\n const { gl } = this;\n if (textureUnit !== undefined) {\n this.textureUnit = textureUnit;\n gl.activeTexture(33984 + textureUnit);\n }\n gl.bindTexture(this.target, null);\n return textureUnit;\n }\n // PRIVATE METHODS\n _getDataType({ data, compressed = false }) {\n if (compressed) {\n return { data, dataType: 'compressed' };\n }\n if (data === null) {\n return { data, dataType: 'null' };\n }\n if (ArrayBuffer.isView(data)) {\n return { data, dataType: 'typed-array' };\n }\n if (data instanceof WEBGLBuffer) {\n return { data: data.handle, dataType: 'buffer' };\n }\n // Raw WebGL handle (not a luma wrapper)\n if (typeof WebGLBuffer !== 'undefined' && data instanceof WebGLBuffer) {\n return { data, dataType: 'buffer' };\n }\n // Assume data is a browser supported object (ImageData, Canvas, ...)\n return { data, dataType: 'browser-object' };\n }\n // HELPER METHODS\n _deduceParameters(opts) {\n const { format, data } = opts;\n let { width, height, dataFormat, type, compressed } = opts;\n // Deduce format and type from format\n const parameters = getWebGLTextureParameters(format);\n dataFormat = dataFormat || parameters.dataFormat;\n type = type || parameters.type;\n compressed = compressed || parameters.compressed;\n ({ width, height } = this._deduceImageSize(data, width, height));\n return { dataFormat, type, compressed, width, height, format, data };\n }\n // eslint-disable-next-line complexity\n _deduceImageSize(data, width, height) {\n let size;\n if (typeof ImageData !== 'undefined' && data instanceof ImageData) {\n size = { width: data.width, height: data.height };\n }\n else if (typeof HTMLImageElement !== 'undefined' && data instanceof HTMLImageElement) {\n size = { width: data.naturalWidth, height: data.naturalHeight };\n }\n else if (typeof HTMLCanvasElement !== 'undefined' && data instanceof HTMLCanvasElement) {\n size = { width: data.width, height: data.height };\n }\n else if (typeof ImageBitmap !== 'undefined' && data instanceof ImageBitmap) {\n size = { width: data.width, height: data.height };\n }\n else if (typeof HTMLVideoElement !== 'undefined' && data instanceof HTMLVideoElement) {\n size = { width: data.videoWidth, height: data.videoHeight };\n }\n else if (!data) {\n size = { width: width >= 0 ? width : 1, height: height >= 0 ? height : 1 };\n }\n else {\n size = { width, height };\n }\n assert(size, 'Could not deduced texture size');\n assert(width === undefined || size.width === width, 'Deduced texture width does not match supplied width');\n assert(height === undefined || size.height === height, 'Deduced texture height does not match supplied height');\n return size;\n }\n // CUBE MAP METHODS\n /* eslint-disable max-statements, max-len */\n async setCubeMapImageData(options) {\n const { gl } = this;\n const { width, height, pixels, data, format = 6408, type = 5121 } = options;\n const imageDataMap = pixels || data;\n // pixel data (imageDataMap) is an Object from Face to Image or Promise.\n // For example:\n // {\n // GL.TEXTURE_CUBE_MAP_POSITIVE_X : Image-or-Promise,\n // GL.TEXTURE_CUBE_MAP_NEGATIVE_X : Image-or-Promise,\n // ... }\n // To provide multiple level-of-details (LODs) this can be Face to Array\n // of Image or Promise, like this\n // {\n // GL.TEXTURE_CUBE_MAP_POSITIVE_X : [Image-or-Promise-LOD-0, Image-or-Promise-LOD-1],\n // GL.TEXTURE_CUBE_MAP_NEGATIVE_X : [Image-or-Promise-LOD-0, Image-or-Promise-LOD-1],\n // ... }\n const resolvedFaces = await Promise.all(WEBGLTexture.FACES.map(face => {\n const facePixels = imageDataMap[face];\n return Promise.all(Array.isArray(facePixels) ? facePixels : [facePixels]);\n }));\n this.bind();\n WEBGLTexture.FACES.forEach((face, index) => {\n if (resolvedFaces[index].length > 1 && this.props.mipmaps !== false) {\n // If the user provides multiple LODs, then automatic mipmap\n // generation generateMipmap() should be disabled to avoid overwritting them.\n log.warn(`${this.id} has mipmap and multiple LODs.`)();\n }\n resolvedFaces[index].forEach((image, lodLevel) => {\n // TODO: adjust width & height for LOD!\n if (width && height) {\n gl.texImage2D(face, lodLevel, format, width, height, 0 /* border*/, format, type, image);\n }\n else {\n gl.texImage2D(face, lodLevel, format, format, type, image);\n }\n });\n });\n this.unbind();\n }\n /** @todo update this method to accept LODs */\n setImageDataForFace(options) {\n const { face, width, height, pixels, data, format = 6408, type = 5121\n // generateMipmap = false // TODO\n } = options;\n const { gl } = this;\n const imageData = pixels || data;\n this.bind();\n if (imageData instanceof Promise) {\n imageData.then(resolvedImageData => this.setImageDataForFace(Object.assign({}, options, {\n face,\n data: resolvedImageData,\n pixels: resolvedImageData\n })));\n }\n else if (this.width || this.height) {\n gl.texImage2D(face, 0, format, width, height, 0 /* border*/, format, type, imageData);\n }\n else {\n gl.texImage2D(face, 0, format, format, type, imageData);\n }\n return this;\n }\n /** Image 3D copies from Typed Array or WebGLBuffer */\n setImageData3D(options) {\n const { level = 0, dataFormat, format, type, // = GL.UNSIGNED_BYTE,\n width, height, depth = 1, offset = 0, data, parameters = {} } = options;\n this.trackDeallocatedMemory('Texture');\n this.gl.bindTexture(this.target, this.handle);\n const webglTextureFormat = getWebGLTextureParameters(format);\n withGLParameters(this.gl, parameters, () => {\n if (ArrayBuffer.isView(data)) {\n this.gl.texImage3D(this.target, level, webglTextureFormat.format, width, height, depth, 0 /* border, must be 0 */, webglTextureFormat.dataFormat, webglTextureFormat.type, // dataType: getWebGL,\n data);\n }\n if (data instanceof WEBGLBuffer) {\n this.gl.bindBuffer(35052, data.handle);\n this.gl.texImage3D(this.target, level, dataFormat, width, height, depth, 0 /* border, must be 0 */, format, type, offset);\n }\n });\n if (data && data.byteLength) {\n this.trackAllocatedMemory(data.byteLength, 'Texture');\n }\n else {\n const bytesPerPixel = getTextureFormatBytesPerPixel(this.props.format);\n this.trackAllocatedMemory(this.width * this.height * this.depth * bytesPerPixel, 'Texture');\n }\n this.loaded = true;\n return this;\n }\n // RESOURCE METHODS\n /**\n * Sets sampler parameters on texture\n */\n _setSamplerParameters(parameters) {\n // NPOT parameters may populate an empty object\n if (isObjectEmpty(parameters)) {\n return;\n }\n logParameters(parameters);\n this.gl.bindTexture(this.target, this.handle);\n for (const [pname, pvalue] of Object.entries(parameters)) {\n const param = Number(pname);\n const value = pvalue;\n // Apparently there are integer/float conversion issues requires two parameter setting functions in JavaScript.\n // For now, pick the float version for parameters specified as GLfloat.\n switch (param) {\n case 33082:\n case 33083:\n this.gl.texParameterf(this.target, param, value);\n break;\n default:\n this.gl.texParameteri(this.target, param, value);\n break;\n }\n }\n this.gl.bindTexture(this.target, null);\n return;\n }\n}\n// HELPERS\nfunction getWebGLTextureTarget(props) {\n switch (props.dimension) {\n // supported in WebGL\n case '2d':\n return 3553;\n case 'cube':\n return 34067;\n // supported in WebGL2\n case '2d-array':\n return 35866;\n case '3d':\n return 32879;\n // not supported in any WebGL version\n case '1d':\n case 'cube-array':\n default:\n throw new Error(props.dimension);\n }\n}\nfunction logParameters(parameters) {\n log.log(1, 'texture sampler parameters', parameters)();\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { setGLParameters } from \"../parameters/unified-parameter-api.js\";\nimport { pushContextState, popContextState } from \"./track-context-state.js\";\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 */\nexport function withGLParameters(gl, parameters, func) {\n if (isObjectEmpty(parameters)) {\n // Avoid setting state if no parameters provided. Just call and return\n return func(gl);\n }\n const { nocatch = true } = parameters;\n pushContextState(gl);\n setGLParameters(gl, parameters);\n // Setup is done, call the function\n let value;\n if (nocatch) {\n // Avoid try catch to minimize stack size impact for safe execution paths\n value = func(gl);\n popContextState(gl);\n }\n else {\n // Wrap in a try-catch to ensure that parameters are restored on exceptions\n try {\n value = func(gl);\n }\n finally {\n popContextState(gl);\n }\n }\n return value;\n}\n// Helpers\n// Returns true if given object is empty, false otherwise.\nfunction isObjectEmpty(object) {\n // @ts-ignore - dummy key variable\n for (const key in object) {\n return false;\n }\n return true;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { GL } from '@luma.gl/constants';\nimport { convertCompareFunction } from \"./device-parameters.js\";\n/**\n * Convert WebGPU-style sampler props to WebGL\n * @param props\n * @returns\n */\nexport function convertSamplerParametersToWebGL(props) {\n const params = {};\n if (props.addressModeU) {\n params[10242] = convertAddressMode(props.addressModeU);\n }\n if (props.addressModeV) {\n params[10243] = convertAddressMode(props.addressModeV);\n }\n if (props.addressModeW) {\n params[32882] = convertAddressMode(props.addressModeW);\n }\n if (props.magFilter) {\n params[10240] = convertMaxFilterMode(props.magFilter);\n }\n if (props.minFilter || props.mipmapFilter) {\n // TODO - arbitrary choice of linear?\n params[10241] = convertMinFilterMode(props.minFilter || 'linear', props.mipmapFilter);\n }\n if (props.lodMinClamp !== undefined) {\n params[33082] = props.lodMinClamp;\n }\n if (props.lodMaxClamp !== undefined) {\n params[33083] = props.lodMaxClamp;\n }\n if (props.type === 'comparison-sampler') {\n // Setting prop.compare turns this into a comparison sampler\n params[34892] = 34894;\n }\n if (props.compare) {\n params[34893] = convertCompareFunction('compare', props.compare);\n }\n // Note depends on WebGL extension\n if (props.maxAnisotropy) {\n params[34046] = props.maxAnisotropy;\n }\n return params;\n}\n// HELPERS\n/** Convert address more */\nfunction convertAddressMode(addressMode) {\n switch (addressMode) {\n case 'clamp-to-edge':\n return 33071;\n case 'repeat':\n return 10497;\n case 'mirror-repeat':\n return 33648;\n }\n}\nfunction convertMaxFilterMode(maxFilter) {\n switch (maxFilter) {\n case 'nearest':\n return 9728;\n case 'linear':\n return 9729;\n }\n}\n/**\n * WebGPU has separate min filter and mipmap filter,\n * WebGL is combined and effectively offers 6 options\n */\nfunction convertMinFilterMode(minFilter, mipmapFilter) {\n if (!mipmapFilter) {\n return convertMaxFilterMode(minFilter);\n }\n switch (minFilter) {\n case 'nearest':\n return mipmapFilter === 'nearest' ? 9984 : 9986;\n case 'linear':\n return mipmapFilter === 'nearest' ? 9985 : 9987;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { log, isObjectEmpty } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\nimport { pushContextState, popContextState } from \"../../context/state-tracker/track-context-state.js\";\nimport { setGLParameters } from \"../../context/parameters/unified-parameter-api.js\";\n/* eslint-disable no-unused-expressions */ // For expression ? gl.enable() : gl.disable()\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 */\nexport function withDeviceAndGLParameters(device, parameters, glParameters, func) {\n if (isObjectEmpty(parameters)) {\n // Avoid setting state if no parameters provided. Just call and return\n return func(device);\n }\n // Wrap in a try-catch to ensure that parameters are restored on exceptions\n const webglDevice = device;\n pushContextState(webglDevice.gl);\n try {\n setDeviceParameters(device, parameters);\n setGLParameters(webglDevice.gl, glParameters);\n return func(device);\n }\n finally {\n popContextState(webglDevice.gl);\n }\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 * @deprecated use withDeviceParameters instead\n */\nexport function withGLParameters(device, parameters, func) {\n if (isObjectEmpty(parameters)) {\n // Avoid setting state if no parameters provided. Just call and return\n return func(device);\n }\n // Wrap in a try-catch to ensure that parameters are restored on exceptions\n const webglDevice = device;\n pushContextState(webglDevice.gl);\n try {\n setGLParameters(webglDevice.gl, parameters);\n return func(device);\n }\n finally {\n popContextState(webglDevice.gl);\n }\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 */\nexport function withDeviceParameters(device, parameters, func) {\n if (isObjectEmpty(parameters)) {\n // Avoid setting state if no parameters provided. Just call and return\n return func(device);\n }\n // Wrap in a try-catch to ensure that parameters are restored on exceptions\n // @ts-expect-error\n pushContextState(device.gl);\n try {\n setDeviceParameters(device, parameters);\n return func(device);\n }\n finally {\n // @ts-expect-error\n popContextState(device.gl);\n }\n}\n/** Set WebGPU Style Parameters */\nexport function setDeviceParameters(device, parameters) {\n const webglDevice = device;\n const { gl } = webglDevice;\n // RASTERIZATION SETTINGS\n if (parameters.cullMode) {\n switch (parameters.cullMode) {\n case 'none':\n gl.disable(2884);\n break;\n case 'front':\n gl.enable(2884);\n gl.cullFace(1028);\n break;\n case 'back':\n gl.enable(2884);\n gl.cullFace(1029);\n break;\n }\n }\n if (parameters.frontFace) {\n gl.frontFace(map('frontFace', parameters.frontFace, {\n ccw: 2305,\n cw: 2304\n }));\n }\n if (parameters.unclippedDepth) {\n if (device.features.has('depth-clip-control')) {\n // EXT_depth_clamp\n gl.enable(34383);\n }\n }\n if (parameters.depthBias !== undefined) {\n gl.enable(32823);\n gl.polygonOffset(parameters.depthBias, parameters.depthBiasSlopeScale || 0);\n }\n // depthBiasSlopeScale: {\n // // Handled by depthBias\n // },\n // WEBGL EXTENSIONS\n if (parameters.provokingVertex) {\n if (device.features.has('provoking-vertex-webgl')) {\n const extensions = webglDevice.getExtension('WEBGL_provoking_vertex');\n const ext = extensions.WEBGL_provoking_vertex;\n const vertex = map('provokingVertex', parameters.provokingVertex, {\n first: 36429,\n last: 36430\n });\n ext?.provokingVertexWEBGL(vertex);\n }\n }\n if (parameters.polygonMode || parameters.polygonOffsetLine) {\n if (device.features.has('polygon-mode-webgl')) {\n if (parameters.polygonMode) {\n const extensions = webglDevice.getExtension('WEBGL_polygon_mode');\n const ext = extensions.WEBGL_polygon_mode;\n const mode = map('polygonMode', parameters.polygonMode, {\n fill: 6914,\n line: 6913\n });\n ext?.polygonModeWEBGL(1028, mode);\n ext?.polygonModeWEBGL(1029, mode);\n }\n if (parameters.polygonOffsetLine) {\n gl.enable(10754);\n }\n }\n }\n if (device.features.has('shader-clip-cull-distance-webgl')) {\n if (parameters.clipDistance0) {\n gl.enable(12288);\n }\n if (parameters.clipDistance1) {\n gl.enable(12289);\n }\n if (parameters.clipDistance2) {\n gl.enable(12290);\n }\n if (parameters.clipDistance3) {\n gl.enable(12291);\n }\n if (parameters.clipDistance4) {\n gl.enable(12292);\n }\n if (parameters.clipDistance5) {\n gl.enable(12293);\n }\n if (parameters.clipDistance6) {\n gl.enable(12294);\n }\n if (parameters.clipDistance7) {\n gl.enable(12295);\n }\n }\n // DEPTH STENCIL\n if (parameters.depthWriteEnabled !== undefined) {\n gl.depthMask(mapBoolean('depthWriteEnabled', parameters.depthWriteEnabled));\n }\n if (parameters.depthCompare) {\n parameters.depthCompare !== 'always' ? gl.enable(2929) : gl.disable(2929);\n gl.depthFunc(convertCompareFunction('depthCompare', parameters.depthCompare));\n }\n if (parameters.stencilWriteMask) {\n const mask = parameters.stencilWriteMask;\n gl.stencilMaskSeparate(1028, mask);\n gl.stencilMaskSeparate(1029, mask);\n }\n if (parameters.stencilReadMask) {\n // stencilReadMask is handle inside stencil***Compare.\n log.warn('stencilReadMask not supported under WebGL');\n }\n if (parameters.stencilCompare) {\n const mask = parameters.stencilReadMask || 0xffffffff;\n const glValue = convertCompareFunction('depthCompare', parameters.stencilCompare);\n // TODO - ensure back doesn't overwrite\n parameters.stencilCompare !== 'always'\n ? gl.enable(2960)\n : gl.disable(2960);\n gl.stencilFuncSeparate(1028, glValue, 0, mask);\n gl.stencilFuncSeparate(1029, glValue, 0, mask);\n }\n if (parameters.stencilPassOperation &&\n parameters.stencilFailOperation &&\n parameters.stencilDepthFailOperation) {\n const dppass = convertStencilOperation('stencilPassOperation', parameters.stencilPassOperation);\n const sfail = convertStencilOperation('stencilFailOperation', parameters.stencilFailOperation);\n const dpfail = convertStencilOperation('stencilDepthFailOperation', parameters.stencilDepthFailOperation);\n gl.stencilOpSeparate(1028, sfail, dpfail, dppass);\n gl.stencilOpSeparate(1029, sfail, dpfail, dppass);\n }\n // stencilDepthFailOperation() {\n // // handled by stencilPassOperation\n // },\n // stencilFailOperation() {\n // // handled by stencilPassOperation\n // },\n // COLOR STATE\n if (parameters.blendColorOperation || parameters.blendAlphaOperation) {\n gl.enable(3042);\n const colorEquation = convertBlendOperationToEquation('blendColorOperation', parameters.blendColorOperation || 'add');\n const alphaEquation = convertBlendOperationToEquation('blendAlphaOperation', parameters.blendAlphaOperation || 'add');\n gl.blendEquationSeparate(colorEquation, alphaEquation);\n const colorSrcFactor = convertBlendFactorToFunction('blendColorSrcFactor', parameters.blendColorSrcFactor || 'one');\n const colorDstFactor = convertBlendFactorToFunction('blendColorDstFactor', parameters.blendColorDstFactor || 'zero');\n const alphaSrcFactor = convertBlendFactorToFunction('blendAlphaSrcFactor', parameters.blendAlphaSrcFactor || 'one');\n const alphaDstFactor = convertBlendFactorToFunction('blendAlphaDstFactor', parameters.blendAlphaDstFactor || 'zero');\n gl.blendFuncSeparate(colorSrcFactor, colorDstFactor, alphaSrcFactor, alphaDstFactor);\n }\n}\n/*\n rasterizationState: {\n cullMode: \"back\",\n },\n\n depthStencilState: {\n depthWriteEnabled: true,\n depthCompare: \"less\",\n format: \"depth24plus-stencil8\",\n },\n\n colorStates: [\n {\n format: \"bgra8unorm\",\n // colorBlend.srcFactor = wgpu::BlendFactor::SrcAlpha;\n // colorBlend.dstFactor = wgpu::BlendFactor::OneMinusSrcAlpha;\n // alphaBlend.srcFactor = wgpu::BlendFactor::SrcAlpha;\n // alphaBlend.dstFactor = wgpu::BlendFactor::OneMinusSrcAlpha;\n },\n ],\n });\n*/\nexport function convertCompareFunction(parameter, value) {\n return map(parameter, value, {\n never: 512,\n less: 513,\n equal: 514,\n 'less-equal': 515,\n greater: 516,\n 'not-equal': 517,\n 'greater-equal': 518,\n always: 519\n });\n}\nexport function convertToCompareFunction(parameter, value) {\n return map(parameter, value, {\n [512]: 'never',\n [513]: 'less',\n [514]: 'equal',\n [515]: 'less-equal',\n [516]: 'greater',\n [517]: 'not-equal',\n [518]: 'greater-equal',\n [519]: 'always'\n });\n}\nfunction convertStencilOperation(parameter, value) {\n return map(parameter, value, {\n keep: 7680,\n zero: 0,\n replace: 7681,\n invert: 5386,\n 'increment-clamp': 7682,\n 'decrement-clamp': 7683,\n 'increment-wrap': 34055,\n 'decrement-wrap': 34056\n });\n}\nfunction convertBlendOperationToEquation(parameter, value) {\n return map(parameter, value, {\n add: 32774,\n subtract: 32778,\n 'reverse-subtract': 32779,\n min: 32775,\n max: 32776\n });\n}\nfunction convertBlendFactorToFunction(parameter, value) {\n return map(parameter, value, {\n one: 1,\n zero: 0,\n 'src-color': 768,\n 'one-minus-src-color': 769,\n 'dst-color': 774,\n 'one-minus-dst-color': 775,\n 'src-alpha': 770,\n 'one-minus-src-alpha': 771,\n 'dst-alpha': 772,\n 'one-minus-dst-alpha': 773,\n 'src-alpha-saturated': 776,\n 'constant-color': 32769,\n 'one-minus-constant-color': 32770,\n 'constant-alpha': 32771,\n 'one-minus-constant-alpha': 32772\n });\n}\nfunction message(parameter, value) {\n return `Illegal parameter ${value} for ${parameter}`;\n}\nfunction map(parameter, value, valueMap) {\n if (!(value in valueMap)) {\n throw new Error(message(parameter, value));\n }\n return valueMap[value];\n}\nfunction mapBoolean(parameter, value) {\n return value;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Buffer, assert } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\n/** WebGL Buffer interface */\nexport class WEBGLBuffer extends Buffer {\n device;\n gl;\n handle;\n /** Target in OpenGL defines the type of buffer */\n glTarget;\n /** Usage is a hint on how frequently the buffer will be updates */\n glUsage;\n /** Index type is needed when issuing draw calls, so we pre-compute it */\n glIndexType = 5123;\n /** Number of bytes allocated on the GPU for this buffer */\n byteLength;\n /** Number of bytes used */\n bytesUsed;\n constructor(device, props = {}) {\n super(device, props);\n this.device = device;\n this.gl = this.device.gl;\n const handle = typeof props === 'object' ? props.handle : undefined;\n this.handle = handle || this.gl.createBuffer();\n device.setSpectorMetadata(this.handle, { ...this.props, data: typeof this.props.data });\n // - In WebGL1, need to make sure we use GL.ELEMENT_ARRAY_BUFFER when initializing element buffers\n // otherwise buffer type will lock to generic (non-element) buffer\n // - In WebGL2, we can use GL.COPY_READ_BUFFER which avoids locking the type here\n this.glTarget = getWebGLTarget(this.props.usage);\n this.glUsage = getWebGLUsage(this.props.usage);\n this.glIndexType = this.props.indexType === 'uint32' ? 5125 : 5123;\n // Set data: (re)initializes the buffer\n if (props.data) {\n this._initWithData(props.data, props.byteOffset, props.byteLength);\n }\n else {\n this._initWithByteLength(props.byteLength || 0);\n }\n }\n // PRIVATE METHODS\n /** Allocate a new buffer and initialize to contents of typed array */\n _initWithData(data, byteOffset = 0, byteLength = data.byteLength + byteOffset) {\n // const glTarget = this.device.isWebGL2 ? GL.COPY_WRITE_BUFFER : this.glTarget;\n const glTarget = this.glTarget;\n this.gl.bindBuffer(glTarget, this.handle);\n this.gl.bufferData(glTarget, byteLength, this.glUsage);\n this.gl.bufferSubData(glTarget, byteOffset, data);\n this.gl.bindBuffer(glTarget, null);\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n this._setDebugData(data, byteOffset, byteLength);\n this.trackAllocatedMemory(byteLength);\n }\n // Allocate a GPU buffer of specified size.\n _initWithByteLength(byteLength) {\n assert(byteLength >= 0);\n // Workaround needed for Safari (#291):\n // gl.bufferData with size equal to 0 crashes. Instead create zero sized array.\n let data = byteLength;\n if (byteLength === 0) {\n // @ts-expect-error\n data = new Float32Array(0);\n }\n // const glTarget = this.device.isWebGL2 ? GL.COPY_WRITE_BUFFER : this.glTarget;\n const glTarget = this.glTarget;\n this.gl.bindBuffer(glTarget, this.handle);\n this.gl.bufferData(glTarget, data, this.glUsage);\n this.gl.bindBuffer(glTarget, null);\n this.bytesUsed = byteLength;\n this.byteLength = byteLength;\n this._setDebugData(null, 0, byteLength);\n this.trackAllocatedMemory(byteLength);\n return this;\n }\n destroy() {\n if (!this.destroyed && this.handle) {\n this.removeStats();\n this.trackDeallocatedMemory();\n this.gl.deleteBuffer(this.handle);\n this.destroyed = true;\n // @ts-expect-error\n this.handle = null;\n }\n }\n write(data, byteOffset = 0) {\n const srcOffset = 0;\n const byteLength = undefined; // data.byteLength;\n // Create the buffer - binding it here for the first time locks the type\n // In WebGL2, use GL.COPY_WRITE_BUFFER to avoid locking the type\n const glTarget = 36663;\n this.gl.bindBuffer(glTarget, this.handle);\n // WebGL2: subData supports additional srcOffset and length parameters\n if (srcOffset !== 0 || byteLength !== undefined) {\n this.gl.bufferSubData(glTarget, byteOffset, data, srcOffset, byteLength);\n }\n else {\n this.gl.bufferSubData(glTarget, byteOffset, data);\n }\n this.gl.bindBuffer(glTarget, null);\n this._setDebugData(data, byteOffset, data.byteLength);\n }\n /** Asynchronously read data from the buffer */\n async readAsync(byteOffset = 0, byteLength) {\n return this.readSyncWebGL(byteOffset, byteLength);\n }\n /** Synchronously read data from the buffer. WebGL only. */\n readSyncWebGL(byteOffset = 0, byteLength) {\n byteLength = byteLength ?? this.byteLength - byteOffset;\n const data = new Uint8Array(byteLength);\n const dstOffset = 0;\n // Use GL.COPY_READ_BUFFER to avoid disturbing other targets and locking type\n this.gl.bindBuffer(36662, this.handle);\n this.gl.getBufferSubData(36662, byteOffset, data, dstOffset, byteLength);\n this.gl.bindBuffer(36662, null);\n // Update local `data` if offsets are 0\n this._setDebugData(data, byteOffset, byteLength);\n return data;\n }\n}\n/**\n * Returns a WebGL buffer target\n *\n * @param usage\n * static MAP_READ = 0x01;\n * static MAP_WRITE = 0x02;\n * static COPY_SRC = 0x0004;\n * static COPY_DST = 0x0008;\n * static INDEX = 0x0010;\n * static VERTEX = 0x0020;\n * static UNIFORM = 0x0040;\n * static STORAGE = 0x0080;\n * static INDIRECT = 0x0100;\n * static QUERY_RESOLVE = 0x0200;\n *\n * @returns WebGL buffer targe\n *\n * Buffer bind points in WebGL2\n * gl.COPY_READ_BUFFER: Buffer for copying from one buffer object to another.\n * gl.COPY_WRITE_BUFFER: Buffer for copying from one buffer object to another.\n * gl.TRANSFORM_FEEDBACK_BUFFER: Buffer for transform feedback operations.\n * gl.PIXEL_PACK_BUFFER: Buffer used for pixel transfer operations.\n * gl.PIXEL_UNPACK_BUFFER: Buffer used for pixel transfer operations.\n */\nfunction getWebGLTarget(usage) {\n if (usage & Buffer.INDEX) {\n return 34963;\n }\n if (usage & Buffer.VERTEX) {\n return 34962;\n }\n if (usage & Buffer.UNIFORM) {\n return 35345;\n }\n // Binding a buffer for the first time locks the type\n // In WebGL2, we can use GL.COPY_WRITE_BUFFER to avoid locking the type\n return 34962;\n}\n/** @todo usage is not passed correctly */\nfunction getWebGLUsage(usage) {\n if (usage & Buffer.INDEX) {\n return 35044;\n }\n if (usage & Buffer.VERTEX) {\n return 35044;\n }\n if (usage & Buffer.UNIFORM) {\n return 35048;\n }\n return 35044;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Sampler } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\nimport { convertSamplerParametersToWebGL } from \"../converters/sampler-parameters.js\";\n/**\n * Sampler object -\n * so that they can be set directly on the texture\n * https://github.com/WebGLSamples/WebGL2Samples/blob/master/samples/sampler_object.html\n */\nexport class WEBGLSampler extends Sampler {\n device;\n handle;\n parameters;\n constructor(device, props) {\n super(device, props);\n this.device = device;\n this.parameters = convertSamplerParametersToWebGL(props);\n this.handle = this.handle || this.device.gl.createSampler();\n this._setSamplerParameters(this.parameters);\n }\n destroy() {\n if (this.handle) {\n this.device.gl.deleteSampler(this.handle);\n // @ts-expect-error read-only/undefined\n this.handle = undefined;\n }\n }\n toString() {\n return `Sampler(${this.id},${JSON.stringify(this.props)})`;\n }\n /** Set sampler parameters on the sampler */\n _setSamplerParameters(parameters) {\n for (const [pname, value] of Object.entries(parameters)) {\n // Apparently there are integer/float conversion issues requires two parameter setting functions in JavaScript.\n // For now, pick the float version for parameters specified as GLfloat.\n const param = Number(pname);\n switch (param) {\n case 33082:\n case 33083:\n this.device.gl.samplerParameterf(this.handle, param, value);\n break;\n default:\n this.device.gl.samplerParameteri(this.handle, param, value);\n break;\n }\n }\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// import {decodeTextureFormat} from '@luma.gl/core';\nimport { TextureView, Texture } from '@luma.gl/core';\nexport class WEBGLTextureView extends TextureView {\n device;\n gl;\n handle;\n texture;\n constructor(device, props) {\n super(device, { ...Texture.defaultProps, ...props });\n this.device = device;\n this.gl = this.device.gl;\n this.handle = null;\n this.texture = props.texture;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { log, loadScript } from '@luma.gl/core';\nconst DEFAULT_SPECTOR_PROPS = {\n spector: log.get('spector') || log.get('spectorjs')\n};\n// https://github.com/BabylonJS/Spector.js#basic-usage\nconst SPECTOR_CDN_URL = 'https://cdn.jsdelivr.net/npm/spectorjs@0.9.30/dist/spector.bundle.js';\nconst LOG_LEVEL = 1;\nlet spector = null;\nlet initialized = false;\n/** Loads spector from CDN if not already installed */\nexport async function loadSpectorJS(props) {\n if (!globalThis.SPECTOR) {\n try {\n await loadScript(SPECTOR_CDN_URL);\n }\n catch (error) {\n log.warn(String(error));\n }\n }\n}\nexport function initializeSpectorJS(props) {\n props = { ...DEFAULT_SPECTOR_PROPS, ...props };\n if (!props?.spector) {\n return null;\n }\n if (!spector && globalThis.SPECTOR) {\n log.probe(LOG_LEVEL, 'SPECTOR found and initialized')();\n spector = new globalThis.SPECTOR.Spector();\n if (globalThis.luma) {\n globalThis.luma.spector = spector;\n }\n }\n if (!spector) {\n return null;\n }\n if (!initialized) {\n initialized = true;\n // enables recording some extra information merged in the capture like texture memory sizes and formats\n spector.spyCanvases();\n // A callback when results are ready\n spector?.onCaptureStarted.add((capture) => log.info('Spector capture started:', capture)());\n spector?.onCapture.add((capture) => {\n log.info('Spector capture complete:', capture)();\n // Use undocumented Spector API to open the UI with our capture\n // See https://github.com/BabylonJS/Spector.js/blob/767ad1195a25b85a85c381f400eb50a979239eca/src/spector.ts#L124\n spector?.getResultUI();\n spector?.resultView.display();\n spector?.resultView.addCapture(capture);\n });\n }\n if (props?.canvas) {\n // @ts-expect-error If spector is specified as a canvas id, only monitor that canvas\n if (typeof props.spector === 'string' && props.spector !== props.canvas.id) {\n return spector;\n }\n // capture startup\n // spector?.captureCanvas(props?.canvas);\n spector?.startCapture(props?.canvas, 500); // 500 commands\n new Promise(resolve => setTimeout(resolve, 2000)).then(_ => {\n log.info('Spector capture stopped after 2 seconds')();\n spector?.stopCapture();\n // spector?.displayUI();\n });\n }\n return spector;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { log, loadScript } from '@luma.gl/core';\n// Rename constant to prevent inlining. We need the full set of constants for generating debug strings.\nimport { GL as GLEnum } from '@luma.gl/constants';\nimport { isBrowser } from '@probe.gl/env';\nconst WEBGL_DEBUG_CDN_URL = 'https://unpkg.com/webgl-debug@2.0.1/index.js';\n// Helper to get shared context data\nfunction getWebGLContextData(gl) {\n gl.luma = gl.luma || {};\n return gl.luma;\n}\n/**\n * Loads Khronos WebGLDeveloperTools from CDN if not already installed\n * const WebGLDebugUtils = require('webgl-debug');\n * @see https://github.com/KhronosGroup/WebGLDeveloperTools\n * @see https://github.com/vorg/webgl-debug\n */\nexport async function loadWebGLDeveloperTools() {\n if (isBrowser() && !globalThis.WebGLDebugUtils) {\n globalThis.global = globalThis.global || globalThis;\n // @ts-expect-error Developer tools expects global to be set\n globalThis.global.module = {};\n await loadScript(WEBGL_DEBUG_CDN_URL);\n }\n}\n// Returns (a potentially new) context with debug instrumentation turned off or on.\n// Note that this actually returns a new context\nexport function makeDebugContext(gl, props = {}) {\n // Return null to ensure we don't try to create a context in this case (TODO what case is that?)\n if (!gl) {\n return null;\n }\n return props.debug ? getDebugContext(gl, props) : getRealContext(gl);\n}\n// Returns the real context from either of the real/debug contexts\nfunction getRealContext(gl) {\n const data = getWebGLContextData(gl);\n // If the context has a realContext member, it is a debug context so return the realContext\n return data.realContext ? data.realContext : gl;\n}\n// Returns the debug context from either of the real/debug contexts\nfunction getDebugContext(gl, props) {\n if (!globalThis.WebGLDebugUtils) {\n log.warn('webgl-debug not loaded')();\n return gl;\n }\n const data = getWebGLContextData(gl);\n // If this already has a debug context, return it.\n if (data.debugContext) {\n return data.debugContext;\n }\n // Create a new debug context\n globalThis.WebGLDebugUtils.init({ ...GLEnum, ...gl });\n const glDebug = globalThis.WebGLDebugUtils.makeDebugContext(gl, onGLError.bind(null, props), onValidateGLFunc.bind(null, props));\n // Make sure we have all WebGL2 and extension constants (todo dynamic import to circumvent minification?)\n for (const key in GLEnum) {\n if (!(key in glDebug) && typeof GLEnum[key] === 'number') {\n glDebug[key] = GLEnum[key];\n }\n }\n // Ensure we have a clean prototype on the instrumented object\n // Note: setPrototypeOf does come with perf warnings, but we already take a bigger perf reduction\n // by synchronizing the WebGL errors after each WebGL call.\n class WebGLDebugContext {\n }\n Object.setPrototypeOf(glDebug, Object.getPrototypeOf(gl));\n Object.setPrototypeOf(WebGLDebugContext, glDebug);\n const debugContext = Object.create(WebGLDebugContext);\n // Store the debug context\n data.realContext = gl;\n data.debugContext = debugContext;\n debugContext.debug = true;\n // Return it\n return debugContext;\n}\n// DEBUG TRACING\nfunction getFunctionString(functionName, functionArgs) {\n // Cover bug in webgl-debug-tools\n functionArgs = Array.from(functionArgs).map(arg => (arg === undefined ? 'undefined' : arg));\n let args = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, functionArgs);\n args = `${args.slice(0, 100)}${args.length > 100 ? '...' : ''}`;\n return `gl.${functionName}(${args})`;\n}\nfunction onGLError(props, err, functionName, args) {\n // Cover bug in webgl-debug-tools\n args = Array.from(args).map(arg => (arg === undefined ? 'undefined' : arg));\n const errorMessage = globalThis.WebGLDebugUtils.glEnumToString(err);\n const functionArgs = globalThis.WebGLDebugUtils.glFunctionArgsToString(functionName, args);\n const message = `${errorMessage} in gl.${functionName}(${functionArgs})`;\n log.error(message)();\n debugger; // eslint-disable-line\n if (props.throwOnError) {\n throw new Error(message);\n }\n}\n// Don't generate function string until it is needed\nfunction onValidateGLFunc(props, functionName, functionArgs) {\n let functionString = '';\n if (log.level >= 1) {\n functionString = getFunctionString(functionName, functionArgs);\n log.log(1, functionString)();\n }\n // If array of breakpoint strings supplied, check if any of them is contained in current GLEnum function\n if (props.break && props.break.length > 0) {\n functionString = functionString || getFunctionString(functionName, functionArgs);\n const isBreakpoint = props.break.every((breakOn) => functionString.indexOf(breakOn) !== -1);\n if (isBreakpoint) {\n debugger; // eslint-disable-line\n }\n }\n for (const arg of functionArgs) {\n if (arg === undefined) {\n functionString = functionString || getFunctionString(functionName, functionArgs);\n if (props.throwOnError) {\n throw new Error(`Undefined argument: ${functionString}`);\n }\n else {\n log.error(`Undefined argument: ${functionString}`)();\n debugger; // eslint-disable-line\n }\n }\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Shader, log } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\nimport { parseShaderCompilerLog } from \"../helpers/parse-shader-compiler-log.js\";\n/**\n * An immutable compiled shader program that execute portions of the GPU Pipeline\n */\nexport class WEBGLShader extends Shader {\n device;\n handle;\n constructor(device, props) {\n super(device, props);\n this.device = device;\n switch (this.props.stage) {\n case 'vertex':\n this.handle = this.props.handle || this.device.gl.createShader(35633);\n break;\n case 'fragment':\n this.handle = this.props.handle || this.device.gl.createShader(35632);\n break;\n default:\n throw new Error(this.props.stage);\n }\n this._compile(this.source);\n }\n destroy() {\n if (this.handle) {\n this.removeStats();\n this.device.gl.deleteShader(this.handle);\n // this.handle = null;\n this.destroyed = true;\n }\n }\n async getCompilationInfo() {\n await this._waitForCompilationComplete();\n return this.getCompilationInfoSync();\n }\n getCompilationInfoSync() {\n const log = this.device.gl.getShaderInfoLog(this.handle);\n return parseShaderCompilerLog(log);\n }\n getTranslatedSource() {\n const extensions = this.device.getExtension('WEBGL_debug_shaders');\n const ext = extensions.WEBGL_debug_shaders;\n return ext?.getTranslatedShaderSource(this.handle);\n }\n // PRIVATE METHODS\n /** Compile a shader and get compilation status */\n async _compile(source) {\n const addGLSLVersion = (source) => source.startsWith('#version ') ? source : `#version 100\\n${source}`;\n source = addGLSLVersion(source);\n const { gl } = this.device;\n gl.shaderSource(this.handle, source);\n gl.compileShader(this.handle);\n // For performance reasons, avoid checking shader compilation errors on production\n if (log.level === 0) {\n this.compilationStatus = 'pending';\n return;\n }\n // Sync case - slower, but advantage is that it throws in the constructor, making break on error more useful\n if (!this.device.features.has('compilation-status-async-webgl')) {\n this._getCompilationStatus();\n // The `Shader` base class will determine if debug window should be opened based on this.compilationStatus\n this.debugShader();\n if (this.compilationStatus === 'error') {\n throw new Error(`GLSL compilation errors in ${this.props.stage} shader ${this.props.id}`);\n }\n return;\n }\n // async case\n log.once(1, 'Shader compilation is asynchronous')();\n await this._waitForCompilationComplete();\n log.info(2, `Shader ${this.id} - async compilation complete: ${this.compilationStatus}`)();\n this._getCompilationStatus();\n // The `Shader` base class will determine if debug window should be opened based on this.compilationStatus\n this.debugShader();\n }\n /** Use KHR_parallel_shader_compile extension if available */\n async _waitForCompilationComplete() {\n const waitMs = async (ms) => await new Promise(resolve => setTimeout(resolve, ms));\n const DELAY_MS = 10; // Shader compilation is typically quite fast (with some exceptions)\n // If status polling is not available, we can't wait for completion. Just wait a little to minimize blocking\n if (!this.device.features.has('compilation-status-async-webgl')) {\n await waitMs(DELAY_MS);\n return;\n }\n const { gl } = this.device;\n for (;;) {\n const complete = gl.getShaderParameter(this.handle, 37297);\n if (complete) {\n return;\n }\n await waitMs(DELAY_MS);\n }\n }\n /**\n * Get the shader compilation status\n * TODO - Load log even when no error reported, to catch warnings?\n * https://gamedev.stackexchange.com/questions/30429/how-to-detect-glsl-warnings\n */\n _getCompilationStatus() {\n this.compilationStatus = this.device.gl.getShaderParameter(this.handle, 35713)\n ? 'success'\n : 'error';\n }\n}\n// TODO - Original code from luma.gl v8 - keep until new debug functionality has matured\n// if (!compilationSuccess) {\n// const parsedLog = shaderLog ? parseShaderCompilerLog(shaderLog) : [];\n// const messages = parsedLog.filter(message => message.type === 'error');\n// const formattedLog = formatCompilerLog(messages, source, {showSourceCode: 'all', html: true});\n// const shaderDescription = `${this.stage} shader ${shaderName}`;\n// log.error(`GLSL compilation errors in ${shaderDescription}\\n${formattedLog}`)();\n// displayShaderLog(parsedLog, source, shaderName);\n// }\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/**\n * Parse a WebGL-format GLSL compilation log into an array of WebGPU style message records.\n * This follows documented WebGL conventions for compilation logs.\n * Based on https://github.com/wwwtyro/gl-format-compiler-error (public domain)\n */\nexport function parseShaderCompilerLog(errLog) {\n // Parse the error - note: browser and driver dependent\n const lines = errLog.split(/\\r?\\n/);\n const messages = [];\n for (const line of lines) {\n if (line.length <= 1) {\n continue; // eslint-disable-line no-continue\n }\n const segments = line.split(':');\n // Check for messages with no line information `ERROR: unsupported shader version`\n if (segments.length === 2) {\n const [messageType, message] = segments;\n messages.push({\n message: message.trim(),\n type: getMessageType(messageType),\n lineNum: 0,\n linePos: 0\n });\n continue; // eslint-disable-line no-continue\n }\n const [messageType, linePosition, lineNumber, ...rest] = segments;\n let lineNum = parseInt(lineNumber, 10);\n if (isNaN(lineNum)) {\n lineNum = 0;\n }\n let linePos = parseInt(linePosition, 10);\n if (isNaN(linePos)) {\n linePos = 0;\n }\n messages.push({\n message: rest.join(':').trim(),\n type: getMessageType(messageType),\n lineNum,\n linePos // TODO\n });\n }\n return messages;\n}\n/** Ensure supported type */\nfunction getMessageType(messageType) {\n const MESSAGE_TYPES = ['warning', 'error', 'info'];\n const lowerCaseType = messageType.toLowerCase();\n return (MESSAGE_TYPES.includes(lowerCaseType) ? lowerCaseType : 'info');\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { RenderPass } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\nimport { withGLParameters } from \"../../context/state-tracker/with-parameters.js\";\nimport { setGLParameters } from \"../../context/parameters/unified-parameter-api.js\";\nimport { pushContextState, popContextState } from \"../../context/state-tracker/track-context-state.js\";\n// Should collapse during minification\nconst GL_DEPTH_BUFFER_BIT = 0x00000100;\nconst GL_STENCIL_BUFFER_BIT = 0x00000400;\nconst GL_COLOR_BUFFER_BIT = 0x00004000;\nconst GL_COLOR = 0x1800;\nconst COLOR_CHANNELS = [0x1, 0x2, 0x4, 0x8]; // GPUColorWrite RED, GREEN, BLUE, ALPHA\nexport class WEBGLRenderPass extends RenderPass {\n device;\n /** Parameters that should be applied before each draw call */\n glParameters;\n constructor(device, props) {\n super(device, props);\n this.device = device;\n // TODO - do parameters (scissorRect) affect the clear operation?\n pushContextState(this.device.gl);\n this.setParameters(this.props.parameters);\n // Hack - for now WebGL draws in \"immediate mode\" (instead of queueing the operations)...\n this.clear();\n }\n end() {\n popContextState(this.device.gl);\n // should add commands to CommandEncoder.\n }\n pushDebugGroup(groupLabel) { }\n popDebugGroup() { }\n insertDebugMarker(markerLabel) { }\n // beginOcclusionQuery(queryIndex: number): void;\n // endOcclusionQuery(): void;\n // executeBundles(bundles: Iterable): void;\n /**\n * Maps RenderPass parameters to GL parameters\n */\n setParameters(parameters = {}) {\n const glParameters = { ...this.glParameters };\n // Framebuffers are specified using parameters in WebGL\n if (this.props.framebuffer) {\n glParameters.framebuffer = this.props.framebuffer;\n }\n if (this.props.depthReadOnly) {\n glParameters.depthMask = !this.props.depthReadOnly;\n }\n glParameters.stencilMask = this.props.stencilReadOnly ? 0 : 1;\n glParameters[35977] = this.props.discard;\n // Map the four renderpass parameters to WebGL parameters\n if (parameters.viewport) {\n // WebGPU viewports are 6 coordinates (X, Y, Z)\n if (parameters.viewport.length >= 6) {\n glParameters.viewport = parameters.viewport.slice(0, 4);\n glParameters.depthRange = [parameters.viewport[4], parameters.viewport[5]];\n }\n else {\n // WebGL viewports are 4 coordinates (X, Y)\n glParameters.viewport = parameters.viewport;\n }\n }\n if (parameters.scissorRect) {\n glParameters.scissorTest = true;\n glParameters.scissor = parameters.scissorRect;\n }\n if (parameters.blendConstant) {\n glParameters.blendColor = parameters.blendConstant;\n }\n if (parameters.stencilReference) {\n // eslint-disable-next-line no-console\n console.warn('RenderPassParameters.stencilReference not yet implemented in WebGL');\n // parameters.stencilFunc = [func, ref, mask];\n // Does this work?\n parameters[2967] = parameters.stencilReference;\n }\n if (parameters.colorMask) {\n glParameters.colorMask = COLOR_CHANNELS.map(channel => Boolean(channel & parameters.colorMask));\n }\n this.glParameters = glParameters;\n setGLParameters(this.device.gl, glParameters);\n }\n beginOcclusionQuery(queryIndex) {\n const webglQuerySet = this.props.occlusionQuerySet;\n webglQuerySet?.beginOcclusionQuery();\n }\n endOcclusionQuery() {\n const webglQuerySet = this.props.occlusionQuerySet;\n webglQuerySet?.endOcclusionQuery();\n }\n // PRIVATE\n /**\n * Optionally clears depth, color and stencil buffers based on parameters\n */\n clear() {\n const glParameters = { ...this.glParameters };\n let clearMask = 0;\n if (this.props.clearColor !== false) {\n clearMask |= GL_COLOR_BUFFER_BIT;\n glParameters.clearColor = this.props.clearColor;\n }\n if (this.props.clearDepth !== false) {\n clearMask |= GL_DEPTH_BUFFER_BIT;\n glParameters.clearDepth = this.props.clearDepth;\n }\n if (this.props.clearStencil !== false) {\n clearMask |= GL_STENCIL_BUFFER_BIT;\n glParameters.clearStencil = this.props.clearStencil;\n }\n if (clearMask !== 0) {\n // Temporarily set any clear \"colors\" and call clear\n withGLParameters(this.device.gl, glParameters, () => {\n this.device.gl.clear(clearMask);\n });\n // TODO - clear multiple color attachments\n // for (attachment of this.framebuffer.colorAttachments) {\n // this.clearColorBuffer\n // }\n }\n }\n /**\n * WebGL2 - clear a specific color buffer\n */\n clearColorBuffer(drawBuffer = 0, value = [0, 0, 0, 0]) {\n withGLParameters(this.device.gl, { framebuffer: this.props.framebuffer }, () => {\n // Method selection per OpenGL ES 3 docs\n switch (value.constructor) {\n case Int32Array:\n this.device.gl.clearBufferiv(GL_COLOR, drawBuffer, value);\n break;\n case Uint32Array:\n this.device.gl.clearBufferuiv(GL_COLOR, drawBuffer, value);\n break;\n case Float32Array:\n default:\n this.device.gl.clearBufferfv(GL_COLOR, drawBuffer, value);\n break;\n }\n });\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { RenderPipeline, cast, splitUniformsAndBindings, log } from '@luma.gl/core';\nimport { mergeShaderLayout } from '@luma.gl/core';\n// import {mergeShaderLayout, getAttributeInfosFromLayouts} from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\nimport { getShaderLayout } from \"../helpers/get-shader-layout.js\";\nimport { withDeviceAndGLParameters } from \"../converters/device-parameters.js\";\nimport { setUniform } from \"../helpers/set-uniform.js\";\nimport { WEBGLBuffer } from \"./webgl-buffer.js\";\nimport { WEBGLFramebuffer } from \"./webgl-framebuffer.js\";\nimport { WEBGLTexture } from \"./webgl-texture.js\";\nimport { WEBGLTextureView } from \"./webgl-texture-view.js\";\nimport { getGLDrawMode } from \"../helpers/webgl-topology-utils.js\";\nconst LOG_PROGRAM_PERF_PRIORITY = 4;\n/** Creates a new render pipeline */\nexport class WEBGLRenderPipeline extends RenderPipeline {\n /** The WebGL device that created this render pipeline */\n device;\n /** Handle to underlying WebGL program */\n handle;\n /** vertex shader */\n vs;\n /** fragment shader */\n fs;\n /** The layout extracted from shader by WebGL introspection APIs */\n introspectedLayout;\n /** Uniforms set on this model */\n uniforms = {};\n /** Bindings set on this model */\n bindings = {};\n /** WebGL varyings */\n varyings = null;\n _uniformCount = 0;\n _uniformSetters = {}; // TODO are these used?\n constructor(device, props) {\n super(device, props);\n this.device = device;\n this.handle = this.props.handle || this.device.gl.createProgram();\n this.device.setSpectorMetadata(this.handle, { id: this.props.id });\n // Create shaders if needed\n this.vs = cast(props.vs);\n this.fs = cast(props.fs);\n // assert(this.vs.stage === 'vertex');\n // assert(this.fs.stage === 'fragment');\n // Setup varyings if supplied\n // @ts-expect-error WebGL only\n const { varyings, bufferMode = 35981 } = props;\n if (varyings && varyings.length > 0) {\n this.varyings = varyings;\n this.device.gl.transformFeedbackVaryings(this.handle, varyings, bufferMode);\n }\n this._linkShaders();\n log.time(1, `RenderPipeline ${this.id} - shaderLayout introspection`)();\n this.introspectedLayout = getShaderLayout(this.device.gl, this.handle);\n log.timeEnd(1, `RenderPipeline ${this.id} - shaderLayout introspection`)();\n // Merge provided layout with introspected layout\n this.shaderLayout = mergeShaderLayout(this.introspectedLayout, props.shaderLayout);\n // WebGPU has more restrictive topology support than WebGL\n switch (this.props.topology) {\n case 'triangle-fan-webgl':\n case 'line-loop-webgl':\n log.warn(`Primitive topology ${this.props.topology} is deprecated and will be removed in v9.1`);\n break;\n default:\n }\n }\n destroy() {\n if (this.handle) {\n this.device.gl.deleteProgram(this.handle);\n // this.handle = null;\n this.destroyed = true;\n }\n }\n /**\n * Bindings include: textures, samplers and uniform buffers\n * @todo needed for portable model\n */\n setBindings(bindings, options) {\n // if (log.priority >= 2) {\n // checkUniformValues(uniforms, this.id, this._uniformSetters);\n // }\n for (const [name, value] of Object.entries(bindings)) {\n // Accept both `xyz` and `xyzUniforms` as valid names for `xyzUniforms` uniform block\n // This convention allows shaders to name uniform blocks as `uniform appUniforms {} app;`\n // and reference them as `app` from both GLSL and JS.\n // TODO - this is rather hacky - we could also remap the name directly in the shader layout.\n const binding = this.shaderLayout.bindings.find(binding => binding.name === name) ||\n this.shaderLayout.bindings.find(binding => binding.name === `${name}Uniforms`);\n if (!binding) {\n const validBindings = this.shaderLayout.bindings\n .map(binding => `\"${binding.name}\"`)\n .join(', ');\n if (!options?.disableWarnings) {\n log.warn(`Unknown binding \"${name}\" in render pipeline \"${this.id}\", expected one of ${validBindings}`)();\n }\n continue; // eslint-disable-line no-continue\n }\n if (!value) {\n log.warn(`Unsetting binding \"${name}\" in render pipeline \"${this.id}\"`)();\n }\n switch (binding.type) {\n case 'uniform':\n // @ts-expect-error\n if (!(value instanceof WEBGLBuffer) && !(value.buffer instanceof WEBGLBuffer)) {\n throw new Error('buffer value');\n }\n break;\n case 'texture':\n if (!(value instanceof WEBGLTextureView ||\n value instanceof WEBGLTexture ||\n value instanceof WEBGLFramebuffer)) {\n throw new Error('texture value');\n }\n break;\n case 'sampler':\n log.warn(`Ignoring sampler ${name}`)();\n break;\n default:\n throw new Error(binding.type);\n }\n this.bindings[name] = value;\n }\n }\n /** @todo needed for portable model\n * @note The WebGL API is offers many ways to draw things\n * This function unifies those ways into a single call using common parameters with sane defaults\n */\n draw(options) {\n const { renderPass, parameters = this.props.parameters, topology = this.props.topology, vertexArray, vertexCount, \n // indexCount,\n instanceCount, isInstanced = false, firstVertex = 0, \n // firstIndex,\n // firstInstance,\n // baseVertex,\n transformFeedback } = options;\n const glDrawMode = getGLDrawMode(topology);\n const isIndexed = Boolean(vertexArray.indexBuffer);\n const glIndexType = vertexArray.indexBuffer?.glIndexType;\n // Note that we sometimes get called with 0 instances\n // If we are using async linking, we need to wait until linking completes\n if (this.linkStatus !== 'success') {\n log.info(2, `RenderPipeline:${this.id}.draw() aborted - waiting for shader linking`)();\n return false;\n }\n // Avoid WebGL draw call when not rendering any data or values are incomplete\n // Note: async textures set as uniforms might still be loading.\n // Now that all uniforms have been updated, check if any texture\n // in the uniforms is not yet initialized, then we don't draw\n if (!this._areTexturesRenderable() || vertexCount === 0) {\n log.info(2, `RenderPipeline:${this.id}.draw() aborted - textures not yet loaded`)();\n return false;\n }\n // (isInstanced && instanceCount === 0)\n if (vertexCount === 0) {\n log.info(2, `RenderPipeline:${this.id}.draw() aborted - no vertices to draw`)();\n return true;\n }\n this.device.gl.useProgram(this.handle);\n // Note: Rebinds constant attributes before each draw call\n vertexArray.bindBeforeRender(renderPass);\n if (transformFeedback) {\n transformFeedback.begin(this.props.topology);\n }\n // We have to apply bindings before every draw call since other draw calls will overwrite\n this._applyBindings();\n this._applyUniforms();\n const webglRenderPass = renderPass;\n withDeviceAndGLParameters(this.device, parameters, webglRenderPass.glParameters, () => {\n if (isIndexed && isInstanced) {\n this.device.gl.drawElementsInstanced(glDrawMode, vertexCount || 0, // indexCount?\n glIndexType, firstVertex, instanceCount || 0);\n // } else if (isIndexed && this.device.isWebGL2 && !isNaN(start) && !isNaN(end)) {\n // this.device.gldrawRangeElements(glDrawMode, start, end, vertexCount, glIndexType, offset);\n }\n else if (isIndexed) {\n this.device.gl.drawElements(glDrawMode, vertexCount || 0, glIndexType, firstVertex); // indexCount?\n }\n else if (isInstanced) {\n this.device.gl.drawArraysInstanced(glDrawMode, firstVertex, vertexCount || 0, instanceCount || 0);\n }\n else {\n this.device.gl.drawArrays(glDrawMode, firstVertex, vertexCount || 0);\n }\n if (transformFeedback) {\n transformFeedback.end();\n }\n });\n vertexArray.unbindAfterRender(renderPass);\n return true;\n }\n // DEPRECATED METHODS\n setUniformsWebGL(uniforms) {\n const { bindings } = splitUniformsAndBindings(uniforms);\n Object.keys(bindings).forEach(name => {\n log.warn(`Unsupported value \"${JSON.stringify(bindings[name])}\" used in setUniforms() for key ${name}. Use setBindings() instead?`)();\n });\n // TODO - check against layout\n Object.assign(this.uniforms, uniforms);\n }\n // PRIVATE METHODS\n // setAttributes(attributes: Record): void {}\n // setBindings(bindings: Record): void {}\n async _linkShaders() {\n const { gl } = this.device;\n gl.attachShader(this.handle, this.vs.handle);\n gl.attachShader(this.handle, this.fs.handle);\n log.time(LOG_PROGRAM_PERF_PRIORITY, `linkProgram for ${this.id}`)();\n gl.linkProgram(this.handle);\n log.timeEnd(LOG_PROGRAM_PERF_PRIORITY, `linkProgram for ${this.id}`)();\n // TODO Avoid checking program linking error in production\n if (log.level === 0) {\n // return;\n }\n if (!this.device.features.has('compilation-status-async-webgl')) {\n const status = this._getLinkStatus();\n this._reportLinkStatus(status);\n return;\n }\n // async case\n log.once(1, 'RenderPipeline linking is asynchronous')();\n await this._waitForLinkComplete();\n log.info(2, `RenderPipeline ${this.id} - async linking complete: ${this.linkStatus}`)();\n const status = this._getLinkStatus();\n this._reportLinkStatus(status);\n }\n /** Report link status. First, check for shader compilation failures if linking fails */\n _reportLinkStatus(status) {\n switch (status) {\n case 'success':\n return;\n default:\n // First check for shader compilation failures if linking fails\n if (this.vs.compilationStatus === 'error') {\n this.vs.debugShader();\n throw new Error(`Error during compilation of shader ${this.vs.id}`);\n }\n if (this.fs?.compilationStatus === 'error') {\n this.fs.debugShader();\n throw new Error(`Error during compilation of shader ${this.fs.id}`);\n }\n throw new Error(`Error during ${status}: ${this.device.gl.getProgramInfoLog(this.handle)}`);\n }\n }\n /**\n * Get the shader compilation status\n * TODO - Load log even when no error reported, to catch warnings?\n * https://gamedev.stackexchange.com/questions/30429/how-to-detect-glsl-warnings\n */\n _getLinkStatus() {\n const { gl } = this.device;\n const linked = gl.getProgramParameter(this.handle, 35714);\n if (!linked) {\n this.linkStatus = 'error';\n return 'linking';\n }\n gl.validateProgram(this.handle);\n const validated = gl.getProgramParameter(this.handle, 35715);\n if (!validated) {\n this.linkStatus = 'error';\n return 'validation';\n }\n this.linkStatus = 'success';\n return 'success';\n }\n /** Use KHR_parallel_shader_compile extension if available */\n async _waitForLinkComplete() {\n const waitMs = async (ms) => await new Promise(resolve => setTimeout(resolve, ms));\n const DELAY_MS = 10; // Shader compilation is typically quite fast (with some exceptions)\n // If status polling is not available, we can't wait for completion. Just wait a little to minimize blocking\n if (!this.device.features.has('compilation-status-async-webgl')) {\n await waitMs(DELAY_MS);\n return;\n }\n const { gl } = this.device;\n for (;;) {\n const complete = gl.getProgramParameter(this.handle, 37297);\n if (complete) {\n return;\n }\n await waitMs(DELAY_MS);\n }\n }\n /**\n * Checks if all texture-values uniforms are renderable (i.e. loaded)\n * Update a texture if needed (e.g. from video)\n * Note: This is currently done before every draw call\n */\n _areTexturesRenderable() {\n let texturesRenderable = true;\n for (const [, texture] of Object.entries(this.bindings)) {\n if (texture instanceof WEBGLTexture) {\n texture.update();\n texturesRenderable = texturesRenderable && texture.loaded;\n }\n }\n return texturesRenderable;\n }\n /** Apply any bindings (before each draw call) */\n _applyBindings() {\n // If we are using async linking, we need to wait until linking completes\n if (this.linkStatus !== 'success') {\n return;\n }\n const { gl } = this.device;\n gl.useProgram(this.handle);\n let textureUnit = 0;\n let uniformBufferIndex = 0;\n for (const binding of this.shaderLayout.bindings) {\n // Accept both `xyz` and `xyzUniforms` as valid names for `xyzUniforms` uniform block\n const value = this.bindings[binding.name] || this.bindings[binding.name.replace(/Uniforms$/, '')];\n if (!value) {\n throw new Error(`No value for binding ${binding.name} in ${this.id}`);\n }\n switch (binding.type) {\n case 'uniform':\n // Set buffer\n const { name } = binding;\n const location = gl.getUniformBlockIndex(this.handle, name);\n if (location === 4294967295) {\n throw new Error(`Invalid uniform block name ${name}`);\n }\n gl.uniformBlockBinding(this.handle, uniformBufferIndex, location);\n // console.debug(binding, location);\n if (value instanceof WEBGLBuffer) {\n gl.bindBufferBase(35345, uniformBufferIndex, value.handle);\n }\n else {\n gl.bindBufferRange(35345, uniformBufferIndex, \n // @ts-expect-error\n value.buffer.handle, \n // @ts-expect-error\n value.offset || 0, \n // @ts-expect-error\n value.size || value.buffer.byteLength - value.offset);\n }\n uniformBufferIndex += 1;\n break;\n case 'texture':\n if (!(value instanceof WEBGLTextureView ||\n value instanceof WEBGLTexture ||\n value instanceof WEBGLFramebuffer)) {\n throw new Error('texture');\n }\n let texture;\n if (value instanceof WEBGLTextureView) {\n texture = value.texture;\n }\n else if (value instanceof WEBGLTexture) {\n texture = value;\n }\n else if (value instanceof WEBGLFramebuffer &&\n value.colorAttachments[0] instanceof WEBGLTextureView) {\n log.warn('Passing framebuffer in texture binding may be deprecated. Use fbo.colorAttachments[0] instead')();\n texture = value.colorAttachments[0].texture;\n }\n else {\n throw new Error('No texture');\n }\n gl.activeTexture(33984 + textureUnit);\n gl.bindTexture(texture.target, texture.handle);\n // gl.bindSampler(textureUnit, sampler.handle);\n textureUnit += 1;\n break;\n case 'sampler':\n // ignore\n break;\n case 'storage':\n case 'read-only-storage':\n throw new Error(`binding type '${binding.type}' not supported in WebGL`);\n }\n }\n }\n /**\n * Due to program sharing, uniforms need to be reset before every draw call\n * (though caching will avoid redundant WebGL calls)\n */\n _applyUniforms() {\n for (const uniformLayout of this.shaderLayout.uniforms || []) {\n const { name, location, type, textureUnit } = uniformLayout;\n const value = this.uniforms[name] ?? textureUnit;\n if (value !== undefined) {\n setUniform(this.device.gl, location, type, value);\n }\n }\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { GL } from '@luma.gl/constants';\nimport { Accessor } from \"../../classic/accessor.js\"; // TODO - should NOT depend on classic API\nimport { decodeGLUniformType, decodeGLAttributeType, isSamplerUniform } from \"./decode-webgl-types.js\";\n/**\n * Extract metadata describing binding information for a program's shaders\n * Note: `linkProgram()` needs to have been called\n * (although linking does not need to have been successful).\n */\nexport function getShaderLayout(gl, program) {\n const shaderLayout = {\n attributes: [],\n bindings: []\n };\n shaderLayout.attributes = readAttributeDeclarations(gl, program);\n // Uniform blocks\n const uniformBlocks = readUniformBlocks(gl, program);\n for (const uniformBlock of uniformBlocks) {\n const uniforms = uniformBlock.uniforms.map(uniform => ({\n name: uniform.name,\n format: uniform.format,\n byteOffset: uniform.byteOffset,\n byteStride: uniform.byteStride,\n arrayLength: uniform.arrayLength\n }));\n shaderLayout.bindings.push({\n type: 'uniform',\n name: uniformBlock.name,\n location: uniformBlock.location,\n visibility: (uniformBlock.vertex ? 0x1 : 0) & (uniformBlock.fragment ? 0x2 : 0),\n minBindingSize: uniformBlock.byteLength,\n uniforms\n });\n }\n const uniforms = readUniformBindings(gl, program);\n let textureUnit = 0;\n for (const uniform of uniforms) {\n if (isSamplerUniform(uniform.type)) {\n const { viewDimension, sampleType } = getSamplerInfo(uniform.type);\n shaderLayout.bindings.push({\n type: 'texture',\n name: uniform.name,\n location: textureUnit,\n viewDimension,\n sampleType\n });\n // @ts-expect-error\n uniform.textureUnit = textureUnit;\n textureUnit += 1;\n }\n }\n if (uniforms.length) {\n shaderLayout.uniforms = uniforms;\n }\n // Varyings\n const varyings = readVaryings(gl, program);\n // Note - samplers are always in unform bindings, even if uniform blocks are used\n if (varyings?.length) {\n shaderLayout.varyings = varyings;\n }\n return shaderLayout;\n}\n// HELPERS\n/**\n * Extract info about all transform feedback varyings\n *\n * linkProgram needs to have been called, although linking does not need to have been successful\n */\nfunction readAttributeDeclarations(gl, program) {\n const attributes = [];\n const count = gl.getProgramParameter(program, 35721);\n for (let index = 0; index < count; index++) {\n const activeInfo = gl.getActiveAttrib(program, index);\n if (!activeInfo) {\n throw new Error('activeInfo');\n }\n const { name, type: compositeType /* , size*/ } = activeInfo;\n const location = gl.getAttribLocation(program, name);\n // Add only user provided attributes, for built-in attributes like `gl_InstanceID` location will be < 0\n if (location >= 0) {\n const { attributeType } = decodeGLAttributeType(compositeType);\n // Whether an attribute is instanced is essentially fixed by the structure of the shader code,\n // so it is arguably a static property of the shader.\n // There is no hint in the shader declarations\n // Heuristic: Any attribute name containing the word \"instance\" will be assumed to be instanced\n const stepMode = /instance/i.test(name) ? 'instance' : 'vertex';\n attributes.push({\n name,\n location,\n stepMode,\n type: attributeType\n // size - for arrays, size is the number of elements in the array\n });\n }\n }\n // Sort by declaration order\n attributes.sort((a, b) => a.location - b.location);\n return attributes;\n}\n/**\n * Extract info about all transform feedback varyings\n *\n * linkProgram needs to have been called, although linking does not need to have been successful\n */\nfunction readVaryings(gl, program) {\n const varyings = [];\n const count = gl.getProgramParameter(program, 35971);\n for (let location = 0; location < count; location++) {\n const activeInfo = gl.getTransformFeedbackVarying(program, location);\n if (!activeInfo) {\n throw new Error('activeInfo');\n }\n const { name, type: compositeType, size } = activeInfo;\n const { glType, components } = decodeGLUniformType(compositeType);\n const accessor = new Accessor({ type: glType, size: size * components });\n const varying = { location, name, accessor }; // Base values\n varyings.push(varying);\n }\n varyings.sort((a, b) => a.location - b.location);\n return varyings;\n}\n/**\n * Extract info about all uniforms\n *\n * Query uniform locations and build name to setter map.\n */\nfunction readUniformBindings(gl, program) {\n const uniforms = [];\n const uniformCount = gl.getProgramParameter(program, 35718);\n for (let i = 0; i < uniformCount; i++) {\n const activeInfo = gl.getActiveUniform(program, i);\n if (!activeInfo) {\n throw new Error('activeInfo');\n }\n const { name: rawName, size, type } = activeInfo;\n const { name, isArray } = parseUniformName(rawName);\n let webglLocation = gl.getUniformLocation(program, name);\n const uniformInfo = {\n // WebGL locations are uniquely typed but just numbers\n location: webglLocation,\n name,\n size,\n type,\n isArray\n };\n uniforms.push(uniformInfo);\n // Array (e.g. matrix) uniforms can occupy several 4x4 byte banks\n if (uniformInfo.size > 1) {\n for (let j = 0; j < uniformInfo.size; j++) {\n const elementName = `${name}[${j}]`;\n webglLocation = gl.getUniformLocation(program, elementName);\n const arrayElementUniformInfo = {\n ...uniformInfo,\n name: elementName,\n location: webglLocation\n };\n uniforms.push(arrayElementUniformInfo);\n }\n }\n }\n return uniforms;\n}\n/**\n * Extract info about all \"active\" uniform blocks\n * @note In WebGL, \"active\" just means that unused (inactive) blocks may have been optimized away during linking)\n */\nfunction readUniformBlocks(gl, program) {\n const getBlockParameter = (blockIndex, pname) => gl.getActiveUniformBlockParameter(program, blockIndex, pname);\n const uniformBlocks = [];\n const blockCount = gl.getProgramParameter(program, 35382);\n for (let blockIndex = 0; blockIndex < blockCount; blockIndex++) {\n const blockInfo = {\n name: gl.getActiveUniformBlockName(program, blockIndex) || '',\n location: getBlockParameter(blockIndex, 35391),\n byteLength: getBlockParameter(blockIndex, 35392),\n vertex: getBlockParameter(blockIndex, 35396),\n fragment: getBlockParameter(blockIndex, 35398),\n uniformCount: getBlockParameter(blockIndex, 35394),\n uniforms: []\n };\n const uniformIndices = getBlockParameter(blockIndex, 35395) || [];\n const uniformType = gl.getActiveUniforms(program, uniformIndices, 35383); // Array of GLenum indicating the types of the uniforms.\n const uniformArrayLength = gl.getActiveUniforms(program, uniformIndices, 35384); // Array of GLuint indicating the sizes of the uniforms.\n // const uniformBlockIndex = gl.getActiveUniforms(\n // program,\n // uniformIndices,\n // GL.UNIFORM_BLOCK_INDEX\n // ); // Array of GLint indicating the block indices of the uniforms.\n const uniformOffset = gl.getActiveUniforms(program, uniformIndices, 35387); // Array of GLint indicating the uniform buffer offsets.\n const uniformStride = gl.getActiveUniforms(program, uniformIndices, 35388); // Array of GLint indicating the strides between the elements.\n // const uniformMatrixStride = gl.getActiveUniforms(\n // program,\n // uniformIndices,\n // GL.UNIFORM_MATRIX_STRIDE\n // ); // Array of GLint indicating the strides between columns of a column-major matrix or a row-major matrix.\n // const uniformRowMajor = gl.getActiveUniforms(program, uniformIndices, GL.UNIFORM_IS_ROW_MAJOR);\n for (let i = 0; i < blockInfo.uniformCount; ++i) {\n const activeInfo = gl.getActiveUniform(program, uniformIndices[i]);\n if (!activeInfo) {\n throw new Error('activeInfo');\n }\n blockInfo.uniforms.push({\n name: activeInfo.name,\n format: decodeGLUniformType(uniformType[i]).format,\n type: uniformType[i],\n arrayLength: uniformArrayLength[i],\n byteOffset: uniformOffset[i],\n byteStride: uniformStride[i]\n // matrixStride: uniformStride[i],\n // rowMajor: uniformRowMajor[i]\n });\n }\n uniformBlocks.push(blockInfo);\n }\n uniformBlocks.sort((a, b) => a.location - b.location);\n return uniformBlocks;\n}\n/**\n * TOOD - compare with a above, confirm copy, then delete\n const bindings: Binding[] = [];\n const count = gl.getProgramParameter(program, gl.ACTIVE_UNIFORM_BLOCKS);\n for (let blockIndex = 0; blockIndex < count; blockIndex++) {\n const vertex = gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER),\n const fragment = gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER),\n const visibility = (vertex) + (fragment);\n const binding: BufferBinding = {\n location: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_BINDING),\n // name: gl.getActiveUniformBlockName(program, blockIndex),\n type: 'uniform',\n visibility,\n minBindingSize: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_DATA_SIZE),\n // uniformCount: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_ACTIVE_UNIFORMS),\n // uniformIndices: gl.getActiveUniformBlockParameter(program, blockIndex, gl.UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES),\n }\n bindings.push(binding);\n }\n*/\nconst SAMPLER_UNIFORMS_GL_TO_GPU = {\n [35678]: ['2d', 'float'],\n [35680]: ['cube', 'float'],\n [35679]: ['3d', 'float'],\n [35682]: ['3d', 'depth'],\n [36289]: ['2d-array', 'float'],\n [36292]: ['2d-array', 'depth'],\n [36293]: ['cube', 'float'],\n [36298]: ['2d', 'sint'],\n [36299]: ['3d', 'sint'],\n [36300]: ['cube', 'sint'],\n [36303]: ['2d-array', 'uint'],\n [36306]: ['2d', 'uint'],\n [36307]: ['3d', 'uint'],\n [36308]: ['cube', 'uint'],\n [36311]: ['2d-array', 'uint']\n};\nfunction getSamplerInfo(type) {\n const sampler = SAMPLER_UNIFORMS_GL_TO_GPU[type];\n if (!sampler) {\n throw new Error('sampler');\n }\n const [viewDimension, sampleType] = sampler;\n return { viewDimension, sampleType };\n}\n// HELPERS\nfunction parseUniformName(name) {\n // Shortcut to avoid redundant or bad matches\n if (name[name.length - 1] !== ']') {\n return {\n name,\n length: 1,\n isArray: false\n };\n }\n // if array name then clean the array brackets\n const UNIFORM_NAME_REGEXP = /([^[]*)(\\[[0-9]+\\])?/;\n const matches = UNIFORM_NAME_REGEXP.exec(name);\n if (!matches || matches.length < 2) {\n throw new Error(`Failed to parse GLSL uniform name ${name}`);\n }\n return {\n name: matches[1],\n length: matches[2] ? 1 : 0,\n isArray: Boolean(matches[2])\n };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { assert, checkProps } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\nimport { getTypedArrayFromGLType } from \"./typed-array-utils.js\";\nconst DEFAULT_ACCESSOR_VALUES = {\n offset: 0,\n stride: 0,\n type: 5126,\n size: 1,\n divisor: 0,\n normalized: false,\n integer: false\n};\nconst PROP_CHECKS = {\n deprecatedProps: {\n instanced: 'divisor',\n isInstanced: 'divisor'\n }\n};\nexport class Accessor {\n offset;\n stride;\n type;\n size;\n divisor;\n normalized;\n integer;\n buffer;\n index;\n static getBytesPerElement(accessor) {\n // TODO: using `FLOAT` when type is not specified,\n // ensure this assumption is valid or force API to specify type.\n const ArrayType = getTypedArrayFromGLType(accessor.type || 5126);\n return ArrayType.BYTES_PER_ELEMENT;\n }\n static getBytesPerVertex(accessor) {\n assert(accessor.size);\n // TODO: using `FLOAT` when type is not specified,\n // ensure this assumption is valid or force API to specify type.\n const ArrayType = getTypedArrayFromGLType(accessor.type || 5126);\n return ArrayType.BYTES_PER_ELEMENT * accessor.size;\n }\n // Combines (merges) a list of accessors. On top of default values\n // Usually [programAccessor, bufferAccessor, appAccessor]\n // All props will be set in the returned object.\n // TODO check for conflicts between values in the supplied accessors\n static resolve(...accessors) {\n return new Accessor(...[DEFAULT_ACCESSOR_VALUES, ...accessors]); // Default values\n }\n constructor(...accessors) {\n accessors.forEach(accessor => this._assign(accessor)); // Merge in sequence\n Object.freeze(this);\n }\n toString() {\n return JSON.stringify(this);\n }\n // ACCESSORS\n // TODO - remove>\n get BYTES_PER_ELEMENT() {\n return Accessor.getBytesPerElement(this);\n }\n get BYTES_PER_VERTEX() {\n return Accessor.getBytesPerVertex(this);\n }\n // PRIVATE\n // eslint-disable-next-line complexity, max-statements\n _assign(props = {}) {\n props = checkProps('Accessor', props, PROP_CHECKS);\n if (props.type !== undefined) {\n this.type = props.type;\n // Auto-deduce integer type?\n if (props.type === 5124 || props.type === 5125) {\n this.integer = true;\n }\n }\n if (props.size !== undefined) {\n this.size = props.size;\n }\n if (props.offset !== undefined) {\n this.offset = props.offset;\n }\n if (props.stride !== undefined) {\n this.stride = props.stride;\n }\n // @ts-expect-error\n if (props.normalize !== undefined) {\n // @ts-expect-error\n this.normalized = props.normalize;\n }\n if (props.normalized !== undefined) {\n this.normalized = props.normalized;\n }\n if (props.integer !== undefined) {\n this.integer = props.integer;\n }\n // INSTANCE DIVISOR\n if (props.divisor !== undefined) {\n this.divisor = props.divisor;\n }\n // Buffer is optional\n if (props.buffer !== undefined) {\n this.buffer = props.buffer;\n }\n // The binding index (for binding e.g. Transform feedbacks and Uniform buffers)\n // TODO - should this be part of accessor?\n if (props.index !== undefined) {\n if (typeof props.index === 'boolean') {\n this.index = props.index ? 1 : 0;\n }\n else {\n this.index = props.index;\n }\n }\n // DEPRECATED\n // @ts-expect-error\n if (props.instanced !== undefined) {\n // @ts-expect-error\n this.divisor = props.instanced ? 1 : 0;\n }\n // @ts-expect-error\n if (props.isInstanced !== undefined) {\n // @ts-expect-error\n this.divisor = props.isInstanced ? 1 : 0;\n }\n if (this.offset === undefined)\n delete this.offset;\n if (this.stride === undefined)\n delete this.stride;\n if (this.type === undefined)\n delete this.type;\n if (this.size === undefined)\n delete this.size;\n if (this.divisor === undefined)\n delete this.divisor;\n if (this.normalized === undefined)\n delete this.normalized;\n if (this.integer === undefined)\n delete this.integer;\n if (this.buffer === undefined)\n delete this.buffer;\n if (this.index === undefined)\n delete this.index;\n return this;\n }\n}\n// TEST EXPORTS\nexport { DEFAULT_ACCESSOR_VALUES };\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { GL } from '@luma.gl/constants';\nconst ERR_TYPE_DEDUCTION = 'Failed to deduce GL constant from typed array';\n/**\n * Converts TYPED ARRAYS to corresponding GL constant\n * Used to auto deduce gl parameter types\n * @deprecated Use getDataTypeFromTypedArray\n * @param arrayOrType\n * @returns\n */\nexport function getGLTypeFromTypedArray(arrayOrType) {\n // If typed array, look up constructor\n const type = ArrayBuffer.isView(arrayOrType) ? arrayOrType.constructor : arrayOrType;\n switch (type) {\n case Float32Array:\n return 5126;\n case Uint16Array:\n return 5123;\n case Uint32Array:\n return 5125;\n case Uint8Array:\n return 5121;\n case Uint8ClampedArray:\n return 5121;\n case Int8Array:\n return 5120;\n case Int16Array:\n return 5122;\n case Int32Array:\n return 5124;\n default:\n throw new Error(ERR_TYPE_DEDUCTION);\n }\n}\n/**\n * Converts GL constant to corresponding TYPED ARRAY\n * Used to auto deduce gl parameter types\n * @deprecated Use getTypedArrayFromDataType\n * @param glType\n * @param param1\n * @returns\n */\n// eslint-disable-next-line complexity\nexport function getTypedArrayFromGLType(glType, options) {\n const { clamped = true } = options || {};\n // Sorted in some order of likelihood to reduce amount of comparisons\n switch (glType) {\n case 5126:\n return Float32Array;\n case 5123:\n case 33635:\n case 32819:\n case 32820:\n return Uint16Array;\n case 5125:\n return Uint32Array;\n case 5121:\n return clamped ? Uint8ClampedArray : Uint8Array;\n case 5120:\n return Int8Array;\n case 5122:\n return Int16Array;\n case 5124:\n return Int32Array;\n default:\n throw new Error('Failed to deduce typed array type from GL constant');\n }\n}\n/**\n * Flip rows (can be used on arrays returned from `Framebuffer.readPixels`)\n * https: *stackoverflow.com/questions/41969562/\n * how-can-i-flip-the-result-of-webglrenderingcontext-readpixels\n * @param param0\n */\nexport function flipRows(options) {\n const { data, width, height, bytesPerPixel = 4, temp } = options;\n const bytesPerRow = width * bytesPerPixel;\n // make a temp buffer to hold one row\n const tempBuffer = temp || new Uint8Array(bytesPerRow);\n for (let y = 0; y < height / 2; ++y) {\n const topOffset = y * bytesPerRow;\n const bottomOffset = (height - y - 1) * bytesPerRow;\n // make copy of a row on the top half\n tempBuffer.set(data.subarray(topOffset, topOffset + bytesPerRow));\n // copy a row from the bottom half to the top\n data.copyWithin(topOffset, bottomOffset, bottomOffset + bytesPerRow);\n // copy the copy of the top half row to the bottom half\n data.set(tempBuffer, bottomOffset);\n }\n}\nexport function scalePixels(options) {\n const { data, width, height } = options;\n const newWidth = Math.round(width / 2);\n const newHeight = Math.round(height / 2);\n const newData = new Uint8Array(newWidth * newHeight * 4);\n for (let y = 0; y < newHeight; y++) {\n for (let x = 0; x < newWidth; x++) {\n for (let c = 0; c < 4; c++) {\n newData[(y * newWidth + x) * 4 + c] = data[(y * 2 * width + x * 2) * 4 + c];\n }\n }\n }\n return { data: newData, width: newWidth, height: newHeight };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { GL } from '@luma.gl/constants';\n/** Check is uniform is of sampler type */\nexport function isSamplerUniform(type) {\n return SAMPLER_TYPES.includes(type);\n}\nconst SAMPLER_TYPES = [\n 35678,\n 35680,\n 35679,\n 35682,\n 36289,\n 36292,\n 36293,\n 36298,\n 36299,\n 36300,\n 36303,\n 36306,\n 36307,\n 36308,\n 36311\n];\n// Composite types table\nconst COMPOSITE_GL_TYPES = {\n [5126]: [5126, 1, 'float', 'f32', 'float32'],\n [35664]: [5126, 2, 'vec2', 'vec2', 'float32x2'],\n [35665]: [5126, 3, 'vec3', 'vec3', 'float32x3'],\n [35666]: [5126, 4, 'vec4', 'vec4', 'float32x4'],\n [5124]: [5124, 1, 'int', 'i32', 'sint32'],\n [35667]: [5124, 2, 'ivec2', 'vec2', 'sint32x2'],\n [35668]: [5124, 3, 'ivec3', 'vec3', 'sint32x3'],\n [35669]: [5124, 4, 'ivec4', 'vec4', 'sint32x4'],\n [5125]: [5125, 1, 'uint', 'u32', 'uint32'],\n [36294]: [5125, 2, 'uvec2', 'vec2', 'uint32x2'],\n [36295]: [5125, 3, 'uvec3', 'vec3', 'uint32x3'],\n [36296]: [5125, 4, 'uvec4', 'vec4', 'uint32x4'],\n [35670]: [5126, 1, 'bool', 'f32', 'float32'],\n [35671]: [5126, 2, 'bvec2', 'vec2', 'float32x2'],\n [35672]: [5126, 3, 'bvec3', 'vec3', 'float32x3'],\n [35673]: [5126, 4, 'bvec4', 'vec4', 'float32x4'],\n // TODO - are sizes/components below correct?\n [35674]: [5126, 8, 'mat2', 'mat2x2'], // 4\n [35685]: [5126, 8, 'mat2x3', 'mat2x3'], // 6\n [35686]: [5126, 8, 'mat2x4', 'mat2x4'], // 8\n [35687]: [5126, 12, 'mat3x2', 'mat3x2'], // 6\n [35675]: [5126, 12, 'mat3', 'mat3x3'], // 9\n [35688]: [5126, 12, 'mat3x4', 'mat3x4'], // 12\n [35689]: [5126, 16, 'mat4x2', 'mat4x2'], // 8\n [35690]: [5126, 16, 'mat4x3', 'mat4x3'], // 12\n [35676]: [5126, 16, 'mat4', 'mat4x4'] // 16\n};\n/** Decomposes a composite type (GL.VEC3) into a basic type (GL.FLOAT) and components (3) */\nexport function decodeGLUniformType(glUniformType) {\n const typeAndSize = COMPOSITE_GL_TYPES[glUniformType];\n if (!typeAndSize) {\n throw new Error('uniform');\n }\n const [glType, components, , format] = typeAndSize;\n return { format, components, glType };\n}\n/** Decomposes a composite type (GL.VEC3) into a basic type (GL.FLOAT) and components (3) */\nexport function decodeGLAttributeType(glAttributeType) {\n const typeAndSize = COMPOSITE_GL_TYPES[glAttributeType];\n if (!typeAndSize) {\n throw new Error('attribute');\n }\n const [, components, , shaderType, vertexFormat] = typeAndSize;\n // TODO sanity - if (shaderType.startsWith('mat' ...))\n const attributeType = shaderType;\n return { attributeType, vertexFormat, components }; // , glType};\n}\n/** Decomposes a composite type GL.VEC3 into a basic type (GL.FLOAT) and components (3) */\nexport function decomposeCompositeGLDataType(compositeGLDataType) {\n const typeAndSize = COMPOSITE_GL_TYPES[compositeGLDataType];\n if (!typeAndSize) {\n return null;\n }\n const [type, components] = typeAndSize;\n return { type, components };\n}\nexport function getCompositeGLDataType(type, components) {\n switch (type) {\n case 5120:\n case 5121:\n case 5122:\n case 5123:\n type = 5126;\n break;\n default:\n }\n for (const glType in COMPOSITE_GL_TYPES) {\n const [compType, compComponents, name] = COMPOSITE_GL_TYPES[glType];\n if (compType === type && compComponents === components) {\n return { glType: Number(glType), name };\n }\n }\n return null;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { GL } from '@luma.gl/constants';\n/** Set a raw uniform (without type conversion and caching) */\n/* eslint-disable max-len */\nexport function setUniform(gl, location, type, value) {\n const gl2 = gl;\n // Prepare the value for WebGL setters\n let uniformValue = value;\n if (uniformValue === true) {\n uniformValue = 1;\n }\n if (uniformValue === false) {\n uniformValue = 0;\n }\n const arrayValue = typeof uniformValue === 'number' ? [uniformValue] : uniformValue;\n // prettier-ignore\n switch (type) {\n case 35678:\n case 35680:\n case 35679:\n case 35682:\n case 36289:\n case 36292:\n case 36293:\n case 36298:\n case 36299:\n case 36300:\n case 36303:\n case 36306:\n case 36307:\n case 36308:\n case 36311:\n if (typeof value !== 'number') {\n throw new Error('samplers must be set to integers');\n }\n return gl.uniform1i(location, value);\n case 5126: return gl.uniform1fv(location, arrayValue);\n case 35664: return gl.uniform2fv(location, arrayValue);\n case 35665: return gl.uniform3fv(location, arrayValue);\n case 35666: return gl.uniform4fv(location, arrayValue);\n case 5124: return gl.uniform1iv(location, arrayValue);\n case 35667: return gl.uniform2iv(location, arrayValue);\n case 35668: return gl.uniform3iv(location, arrayValue);\n case 35669: return gl.uniform4iv(location, arrayValue);\n case 35670: return gl.uniform1iv(location, arrayValue);\n case 35671: return gl.uniform2iv(location, arrayValue);\n case 35672: return gl.uniform3iv(location, arrayValue);\n case 35673: return gl.uniform4iv(location, arrayValue);\n // WEBGL2 - unsigned integers\n case 5125: return gl2.uniform1uiv(location, arrayValue, 1);\n case 36294: return gl2.uniform2uiv(location, arrayValue, 2);\n case 36295: return gl2.uniform3uiv(location, arrayValue, 3);\n case 36296: return gl2.uniform4uiv(location, arrayValue, 4);\n // WebGL2 - quadratic matrices\n // false: don't transpose the matrix\n case 35674: return gl.uniformMatrix2fv(location, false, arrayValue);\n case 35675: return gl.uniformMatrix3fv(location, false, arrayValue);\n case 35676: return gl.uniformMatrix4fv(location, false, arrayValue);\n // WebGL2 - rectangular matrices\n case 35685: return gl2.uniformMatrix2x3fv(location, false, arrayValue);\n case 35686: return gl2.uniformMatrix2x4fv(location, false, arrayValue);\n case 35687: return gl2.uniformMatrix3x2fv(location, false, arrayValue);\n case 35688: return gl2.uniformMatrix3x4fv(location, false, arrayValue);\n case 35689: return gl2.uniformMatrix4x2fv(location, false, arrayValue);\n case 35690: return gl2.uniformMatrix4x3fv(location, false, arrayValue);\n }\n throw new Error('Illegal uniform');\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { GL } from '@luma.gl/constants';\n// Counts the number of complete primitives given a number of vertices and a drawMode\nexport function getPrimitiveDrawMode(drawMode) {\n switch (drawMode) {\n case 0:\n return 0;\n case 1:\n return 1;\n case 3:\n return 1;\n case 2:\n return 1;\n case 4:\n return 4;\n case 5:\n return 4;\n case 6:\n return 4;\n default:\n throw new Error('drawMode');\n }\n}\n// Counts the number of complete \"primitives\" given a number of vertices and a drawMode\nexport function getPrimitiveCount(options) {\n const { drawMode, vertexCount } = options;\n switch (drawMode) {\n case 0:\n case 2:\n return vertexCount;\n case 1:\n return vertexCount / 2;\n case 3:\n return vertexCount - 1;\n case 4:\n return vertexCount / 3;\n case 5:\n case 6:\n return vertexCount - 2;\n default:\n throw new Error('drawMode');\n }\n}\n// Counts the number of vertices after splitting the vertex stream into separate \"primitives\"\nexport function getVertexCount(options) {\n const { drawMode, vertexCount } = options;\n const primitiveCount = getPrimitiveCount({ drawMode, vertexCount });\n switch (getPrimitiveDrawMode(drawMode)) {\n case 0:\n return primitiveCount;\n case 1:\n return primitiveCount * 2;\n case 4:\n return primitiveCount * 3;\n default:\n throw new Error('drawMode');\n }\n}\n/** Get the primitive type for draw */\nexport function getGLDrawMode(topology) {\n // prettier-ignore\n switch (topology) {\n case 'point-list': return 0;\n case 'line-list': return 1;\n case 'line-strip': return 3;\n case 'line-loop-webgl': return 2;\n case 'triangle-list': return 4;\n case 'triangle-strip': return 5;\n case 'triangle-fan-webgl': return 6;\n default: throw new Error(topology);\n }\n}\n/** Get the primitive type for transform feedback */\nexport function getGLPrimitive(topology) {\n // prettier-ignore\n switch (topology) {\n case 'point-list': return 0;\n case 'line-list': return 1;\n case 'line-strip': return 1;\n case 'line-loop-webgl': return 1;\n case 'triangle-list': return 4;\n case 'triangle-strip': return 4;\n case 'triangle-fan-webgl': return 4;\n default: throw new Error(topology);\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { CommandEncoder } from '@luma.gl/core';\nimport { WEBGLCommandBuffer } from \"./webgl-command-buffer.js\";\nexport class WEBGLCommandEncoder extends CommandEncoder {\n device;\n commandBuffer;\n constructor(device, props) {\n super(device, props);\n this.device = device;\n this.commandBuffer = new WEBGLCommandBuffer(device);\n }\n destroy() { }\n finish() {\n this.commandBuffer.submitCommands();\n }\n // beginRenderPass(GPURenderPassDescriptor descriptor): GPURenderPassEncoder;\n // beginComputePass(optional GPUComputePassDescriptor descriptor = {}): GPUComputePassEncoder;\n // finish(options?: {id?: string}): GPUCommandBuffer;\n copyBufferToBuffer(options) {\n this.commandBuffer.commands.push({ name: 'copy-buffer-to-buffer', options });\n }\n copyBufferToTexture(options) {\n this.commandBuffer.commands.push({ name: 'copy-buffer-to-texture', options });\n }\n copyTextureToBuffer(options) {\n this.commandBuffer.commands.push({ name: 'copy-texture-to-buffer', options });\n }\n copyTextureToTexture(options) {\n this.commandBuffer.commands.push({ name: 'copy-texture-to-texture', options });\n }\n pushDebugGroup(groupLabel) { }\n popDebugGroup() { }\n insertDebugMarker(markerLabel) { }\n resolveQuerySet(querySet, destination, options) { }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { CommandBuffer, Texture } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\nimport { WEBGLTexture } from \"./webgl-texture.js\";\nimport { getWebGLTextureParameters } from \"../converters/texture-formats.js\";\nfunction cast(value) {\n return value;\n}\nexport class WEBGLCommandBuffer extends CommandBuffer {\n device;\n commands = [];\n constructor(device) {\n super(device, {});\n this.device = device;\n }\n submitCommands(commands = this.commands) {\n for (const command of commands) {\n switch (command.name) {\n case 'copy-buffer-to-buffer':\n _copyBufferToBuffer(this.device, command.options);\n break;\n case 'copy-buffer-to-texture':\n _copyBufferToTexture(this.device, command.options);\n break;\n case 'copy-texture-to-buffer':\n _copyTextureToBuffer(this.device, command.options);\n break;\n case 'copy-texture-to-texture':\n _copyTextureToTexture(this.device, command.options);\n break;\n }\n }\n }\n}\nfunction _copyBufferToBuffer(device, options) {\n const source = cast(options.source);\n const destination = cast(options.destination);\n // {In WebGL2 we can p}erform the copy on the GPU\n // Use GL.COPY_READ_BUFFER+GL.COPY_WRITE_BUFFER avoid disturbing other targets and locking type\n device.gl.bindBuffer(36662, source.handle);\n device.gl.bindBuffer(36663, destination.handle);\n device.gl.copyBufferSubData(36662, 36663, options.sourceOffset ?? 0, options.destinationOffset ?? 0, options.size);\n device.gl.bindBuffer(36662, null);\n device.gl.bindBuffer(36663, null);\n}\n/**\n * Copies data from a Buffer object into a Texture object\n * NOTE: doesn't wait for copy to be complete\n */\nfunction _copyBufferToTexture(device, options) {\n throw new Error('Not implemented');\n}\n/**\n * Copies data from a Texture object into a Buffer object.\n * NOTE: doesn't wait for copy to be complete\n */\nfunction _copyTextureToBuffer(device, options) {\n const { \n /** Texture to copy to/from. */\n source, \n /** Mip-map level of the texture to copy to/from. (Default 0) */\n mipLevel = 0, \n /** Defines which aspects of the texture to copy to/from. */\n aspect = 'all', \n /** Width to copy */\n width = options.source.width, \n /** Height to copy */\n height = options.source.height, depthOrArrayLayers = 0, \n /** Defines the origin of the copy - the minimum corner of the texture sub-region to copy to/from. */\n origin = [0, 0], \n /** Destination buffer */\n destination, \n /** Offset, in bytes, from the beginning of the buffer to the start of the image data (default 0) */\n byteOffset = 0, \n /**\n * The stride, in bytes, between the beginning of each block row and the subsequent block row.\n * Required if there are multiple block rows (i.e. the copy height or depth is more than one block).\n */\n bytesPerRow, \n /**\n * Number of block rows per single image of the texture.\n * rowsPerImage × bytesPerRow is the stride, in bytes, between the beginning of each image of data and the subsequent image.\n * Required if there are multiple images (i.e. the copy depth is more than one).\n */\n rowsPerImage } = options;\n // TODO - Not possible to read just stencil or depth part in WebGL?\n if (aspect !== 'all') {\n throw new Error('not supported');\n }\n // TODO - mipLevels are set when attaching texture to framebuffer\n if (mipLevel !== 0 || depthOrArrayLayers !== 0 || bytesPerRow || rowsPerImage) {\n throw new Error('not implemented');\n }\n // Asynchronous read (PIXEL_PACK_BUFFER) is WebGL2 only feature\n const { framebuffer, destroyFramebuffer } = getFramebuffer(source);\n let prevHandle;\n try {\n const webglBuffer = destination;\n const sourceWidth = width || framebuffer.width;\n const sourceHeight = height || framebuffer.height;\n const sourceParams = getWebGLTextureParameters(framebuffer.texture.props.format);\n const sourceFormat = sourceParams.dataFormat;\n const sourceType = sourceParams.type;\n // if (!target) {\n // // Create new buffer with enough size\n // const components = glFormatToComponents(sourceFormat);\n // const byteCount = glTypeToBytes(sourceType);\n // const byteLength = byteOffset + sourceWidth * sourceHeight * components * byteCount;\n // target = device.createBuffer({byteLength});\n // }\n device.gl.bindBuffer(35051, webglBuffer.handle);\n // @ts-expect-error native bindFramebuffer is overridden by our state tracker\n prevHandle = device.gl.bindFramebuffer(36160, framebuffer.handle);\n device.gl.readPixels(origin[0], origin[1], sourceWidth, sourceHeight, sourceFormat, sourceType, byteOffset);\n }\n finally {\n device.gl.bindBuffer(35051, null);\n // prevHandle may be unassigned if the try block failed before binding\n if (prevHandle !== undefined) {\n device.gl.bindFramebuffer(36160, prevHandle);\n }\n if (destroyFramebuffer) {\n framebuffer.destroy();\n }\n }\n}\n/**\n * Copies data from a Framebuffer or a Texture object into a Buffer object.\n * NOTE: doesn't wait for copy to be complete, it programs GPU to perform a DMA transfer.\nexport function readPixelsToBuffer(\n source: Framebuffer | Texture,\n options?: {\n sourceX?: number;\n sourceY?: number;\n sourceFormat?: number;\n target?: Buffer; // A new Buffer object is created when not provided.\n targetByteOffset?: number; // byte offset in buffer object\n // following parameters are auto deduced if not provided\n sourceWidth?: number;\n sourceHeight?: number;\n sourceType?: number;\n }\n): Buffer\n */\n/**\n * Copy a rectangle from a Framebuffer or Texture object into a texture (at an offset)\n */\n// eslint-disable-next-line complexity, max-statements\nfunction _copyTextureToTexture(device, options) {\n const { \n /** Texture to copy to/from. */\n source, \n /** Mip-map level of the texture to copy to (Default 0) */\n destinationMipLevel = 0, \n /** Defines which aspects of the texture to copy to/from. */\n // aspect = 'all',\n /** Defines the origin of the copy - the minimum corner of the texture sub-region to copy from. */\n origin = [0, 0], \n /** Defines the origin of the copy - the minimum corner of the texture sub-region to copy to. */\n destinationOrigin = [0, 0], \n /** Texture to copy to/from. */\n destination\n /** Mip-map level of the texture to copy to/from. (Default 0) */\n // destinationMipLevel = options.mipLevel,\n /** Defines the origin of the copy - the minimum corner of the texture sub-region to copy to/from. */\n // destinationOrigin = [0, 0],\n /** Defines which aspects of the texture to copy to/from. */\n // destinationAspect = options.aspect,\n } = options;\n let { width = options.destination.width, height = options.destination.height\n // depthOrArrayLayers = 0\n } = options;\n const { framebuffer, destroyFramebuffer } = getFramebuffer(source);\n const [sourceX, sourceY] = origin;\n const [destinationX, destinationY, destinationZ] = destinationOrigin;\n // @ts-expect-error native bindFramebuffer is overridden by our state tracker\n const prevHandle = device.gl.bindFramebuffer(36160, framebuffer.handle);\n // TODO - support gl.readBuffer (WebGL2 only)\n // const prevBuffer = gl.readBuffer(attachment);\n let texture = null;\n let textureTarget;\n if (destination instanceof WEBGLTexture) {\n texture = destination;\n width = Number.isFinite(width) ? width : texture.width;\n height = Number.isFinite(height) ? height : texture.height;\n texture.bind(0);\n textureTarget = texture.target;\n }\n else {\n throw new Error('invalid destination');\n }\n switch (textureTarget) {\n case 3553:\n case 34067:\n device.gl.copyTexSubImage2D(textureTarget, destinationMipLevel, destinationX, destinationY, sourceX, sourceY, width, height);\n break;\n case 35866:\n case 32879:\n device.gl.copyTexSubImage3D(textureTarget, destinationMipLevel, destinationX, destinationY, destinationZ, sourceX, sourceY, width, height);\n break;\n default:\n }\n if (texture) {\n texture.unbind();\n }\n device.gl.bindFramebuffer(36160, prevHandle);\n if (destroyFramebuffer) {\n framebuffer.destroy();\n }\n}\n// Returns number of components in a specific readPixels WebGL format\nexport function glFormatToComponents(format) {\n switch (format) {\n case 6406:\n case 33326:\n case 6403:\n return 1;\n case 33328:\n case 33319:\n return 2;\n case 6407:\n case 34837:\n return 3;\n case 6408:\n case 34836:\n return 4;\n // TODO: Add support for additional WebGL2 formats\n default:\n throw new Error('GLFormat');\n }\n}\n// Return byte count for given readPixels WebGL type\nexport function glTypeToBytes(type) {\n switch (type) {\n case 5121:\n return 1;\n case 33635:\n case 32819:\n case 32820:\n return 2;\n case 5126:\n return 4;\n // TODO: Add support for additional WebGL2 types\n default:\n throw new Error('GLType');\n }\n}\n// Helper methods\nfunction getFramebuffer(source) {\n if (source instanceof Texture) {\n const { width, height, id } = source;\n const framebuffer = source.device.createFramebuffer({\n id: `framebuffer-for-${id}`,\n width,\n height,\n colorAttachments: [source]\n });\n return { framebuffer, destroyFramebuffer: true };\n }\n return { framebuffer: source, destroyFramebuffer: false };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { VertexArray, getScratchArray, fillArray } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\nimport { getBrowser } from '@probe.gl/env';\nimport { getGLFromVertexType } from \"../converters/vertex-formats.js\";\n// import {getGLFromVertexType} from '../converters/vertex-formats';\n/** VertexArrayObject wrapper */\nexport class WEBGLVertexArray extends VertexArray {\n get [Symbol.toStringTag]() {\n return 'VertexArray';\n }\n device;\n handle;\n /** Attribute 0 buffer constant */\n buffer = null;\n bufferValue = null;\n /** * Attribute 0 can not be disable on most desktop OpenGL based browsers */\n static isConstantAttributeZeroSupported(device) {\n return getBrowser() === 'Chrome';\n }\n // Create a VertexArray\n constructor(device, props) {\n super(device, props);\n this.device = device;\n this.handle = this.device.gl.createVertexArray();\n }\n destroy() {\n super.destroy();\n if (this.buffer) {\n this.buffer?.destroy();\n }\n if (this.handle) {\n this.device.gl.deleteVertexArray(this.handle);\n // @ts-expect-error read-only/undefined\n this.handle = undefined;\n }\n // Auto-delete elements?\n // return [this.elements];\n }\n /**\n // Set (bind/unbind) an elements buffer, for indexed rendering.\n // Must be a Buffer bound to GL.ELEMENT_ARRAY_BUFFER or null. Constants not supported\n *\n * @param elementBuffer\n */\n setIndexBuffer(indexBuffer) {\n const buffer = indexBuffer;\n // Explicitly allow `null` to support clearing the index buffer\n if (buffer && buffer.glTarget !== 34963) {\n throw new Error('Use .setBuffer()');\n }\n // In WebGL The GL.ELEMENT_ARRAY_BUFFER_BINDING is stored on the VertexArrayObject\n this.device.gl.bindVertexArray(this.handle);\n this.device.gl.bindBuffer(34963, buffer ? buffer.handle : null);\n this.indexBuffer = buffer;\n // Unbind to prevent unintended changes to the VAO.\n this.device.gl.bindVertexArray(null);\n }\n /** Set a location in vertex attributes array to a buffer, enables the location, sets divisor */\n setBuffer(location, attributeBuffer) {\n const buffer = attributeBuffer;\n // Sanity check target\n if (buffer.glTarget === 34963) {\n throw new Error('Use .setIndexBuffer()');\n }\n const { size, type, stride, offset, normalized, integer, divisor } = this._getAccessor(location);\n this.device.gl.bindVertexArray(this.handle);\n // A non-zero buffer object must be bound to the GL_ARRAY_BUFFER target\n this.device.gl.bindBuffer(34962, buffer.handle);\n // WebGL2 supports *integer* data formats, i.e. GPU will see integer values\n if (integer) {\n this.device.gl.vertexAttribIPointer(location, size, type, stride, offset);\n }\n else {\n // Attaches ARRAY_BUFFER with specified buffer format to location\n this.device.gl.vertexAttribPointer(location, size, type, normalized, stride, offset);\n }\n // Clear binding - keeping it may cause [.WebGL-0x12804417100]\n // GL_INVALID_OPERATION: A transform feedback buffer that would be written to is also bound to a non-transform-feedback target\n this.device.gl.bindBuffer(34962, null);\n // Mark as non-constant\n this.device.gl.enableVertexAttribArray(location);\n // Set the step mode 0=vertex, 1=instance\n this.device.gl.vertexAttribDivisor(location, divisor || 0);\n this.attributes[location] = buffer;\n // Unbind to prevent unintended changes to the VAO.\n this.device.gl.bindVertexArray(null);\n }\n /** Set a location in vertex attributes array to a constant value, disables the location */\n setConstantWebGL(location, value) {\n this._enable(location, false);\n this.attributes[location] = value;\n }\n bindBeforeRender() {\n this.device.gl.bindVertexArray(this.handle);\n this._applyConstantAttributes();\n }\n unbindAfterRender() {\n // Unbind to prevent unintended changes to the VAO.\n this.device.gl.bindVertexArray(null);\n }\n // Internal methods\n /**\n * Constant attributes need to be reset before every draw call\n * Any attribute that is disabled in the current vertex array object\n * is read from the context's global constant value for that attribute location.\n * @note Constant attributes are only supported in WebGL, not in WebGPU\n */\n _applyConstantAttributes() {\n for (let location = 0; location < this.maxVertexAttributes; ++location) {\n const constant = this.attributes[location];\n // A typed array means this is a constant\n if (ArrayBuffer.isView(constant)) {\n this.device.setConstantAttributeWebGL(location, constant);\n }\n }\n }\n /**\n * Set a location in vertex attributes array to a buffer, enables the location, sets divisor\n * @note requires vertex array to be bound\n */\n // protected _setAttributeLayout(location: number): void {\n // const {size, type, stride, offset, normalized, integer, divisor} = this._getAccessor(location);\n // // WebGL2 supports *integer* data formats, i.e. GPU will see integer values\n // if (integer) {\n // this.device.gl.vertexAttribIPointer(location, size, type, stride, offset);\n // } else {\n // // Attaches ARRAY_BUFFER with specified buffer format to location\n // this.device.gl.vertexAttribPointer(location, size, type, normalized, stride, offset);\n // }\n // this.device.gl.vertexAttribDivisor(location, divisor || 0);\n // }\n /** Get an accessor from the */\n _getAccessor(location) {\n const attributeInfo = this.attributeInfos[location];\n if (!attributeInfo) {\n throw new Error(`Unknown attribute location ${location}`);\n }\n const glType = getGLFromVertexType(attributeInfo.bufferDataType);\n return {\n size: attributeInfo.bufferComponents,\n type: glType,\n stride: attributeInfo.byteStride,\n offset: attributeInfo.byteOffset,\n normalized: attributeInfo.normalized,\n // it is the shader attribute declaration, not the vertex memory format,\n // that determines if the data in the buffer will be treated as integers.\n //\n // Also note that WebGL supports assigning non-normalized integer data to floating point attributes,\n // but as far as we can tell, WebGPU does not.\n integer: attributeInfo.integer,\n divisor: attributeInfo.stepMode === 'instance' ? 1 : 0\n };\n }\n /**\n * Enabling an attribute location makes it reference the currently bound buffer\n * Disabling an attribute location makes it reference the global constant value\n * TODO - handle single values for size 1 attributes?\n * TODO - convert classic arrays based on known type?\n */\n _enable(location, enable = true) {\n // Attribute 0 cannot be disabled in most desktop OpenGL based browsers...\n const canDisableAttributeZero = WEBGLVertexArray.isConstantAttributeZeroSupported(this.device);\n const canDisableAttribute = canDisableAttributeZero || location !== 0;\n if (enable || canDisableAttribute) {\n location = Number(location);\n this.device.gl.bindVertexArray(this.handle);\n if (enable) {\n this.device.gl.enableVertexAttribArray(location);\n }\n else {\n this.device.gl.disableVertexAttribArray(location);\n }\n this.device.gl.bindVertexArray(null);\n }\n }\n /**\n * Provide a means to create a buffer that is equivalent to a constant.\n * NOTE: Desktop OpenGL cannot disable attribute 0.\n * https://stackoverflow.com/questions/20305231/webgl-warning-attribute-0-is-disabled-\n * this-has-significant-performance-penalty\n */\n getConstantBuffer(elementCount, value) {\n // Create buffer only when needed, and reuse it (avoids inflating buffer creation statistics)\n const constantValue = normalizeConstantArrayValue(value);\n const byteLength = constantValue.byteLength * elementCount;\n const length = constantValue.length * elementCount;\n if (this.buffer && byteLength !== this.buffer.byteLength) {\n throw new Error(`Buffer size is immutable, byte length ${byteLength} !== ${this.buffer.byteLength}.`);\n }\n let updateNeeded = !this.buffer;\n this.buffer = this.buffer || this.device.createBuffer({ byteLength });\n // Reallocate and update contents if needed\n updateNeeded = updateNeeded || !compareConstantArrayValues(constantValue, this.bufferValue);\n if (updateNeeded) {\n // Create a typed array that is big enough, and fill it with the required data\n const typedArray = getScratchArray(value.constructor, length);\n fillArray({ target: typedArray, source: constantValue, start: 0, count: length });\n this.buffer.write(typedArray);\n this.bufferValue = value;\n }\n return this.buffer;\n }\n}\n// HELPER FUNCTIONS\n/**\n * TODO - convert Arrays based on known type? (read type from accessor, don't assume Float32Array)\n * TODO - handle single values for size 1 attributes?\n */\nfunction normalizeConstantArrayValue(arrayValue) {\n if (Array.isArray(arrayValue)) {\n return new Float32Array(arrayValue);\n }\n return arrayValue;\n}\n/**\n *\n */\nfunction compareConstantArrayValues(v1, v2) {\n if (!v1 || !v2 || v1.length !== v2.length || v1.constructor !== v2.constructor) {\n return false;\n }\n for (let i = 0; i < v1.length; ++i) {\n if (v1[i] !== v2[i]) {\n return false;\n }\n }\n return true;\n}\n", "import { log, TransformFeedback } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\nimport { WEBGLBuffer } from \"../../index.js\";\nimport { getGLPrimitive } from \"../helpers/webgl-topology-utils.js\";\nexport class WEBGLTransformFeedback extends TransformFeedback {\n device;\n gl;\n handle;\n /**\n * NOTE: The Model already has this information while drawing, but\n * TransformFeedback currently needs it internally, to look up\n * varying information outside of a draw() call.\n */\n layout;\n buffers = {};\n unusedBuffers = {};\n /**\n * Allows us to avoid a Chrome bug where a buffer that is already bound to a\n * different target cannot be bound to 'TRANSFORM_FEEDBACK_BUFFER' target.\n * This a major workaround, see: https://github.com/KhronosGroup/WebGL/issues/2346\n */\n bindOnUse = true;\n _bound = false;\n constructor(device, props) {\n super(device, props);\n this.device = device;\n this.gl = device.gl;\n this.handle = this.props.handle || this.gl.createTransformFeedback();\n this.layout = this.props.layout;\n if (props.buffers) {\n this.setBuffers(props.buffers);\n }\n Object.seal(this);\n }\n destroy() {\n this.gl.deleteTransformFeedback(this.handle);\n super.destroy();\n }\n begin(topology = 'point-list') {\n this.gl.bindTransformFeedback(36386, this.handle);\n if (this.bindOnUse) {\n this._bindBuffers();\n }\n this.gl.beginTransformFeedback(getGLPrimitive(topology));\n }\n end() {\n this.gl.endTransformFeedback();\n if (this.bindOnUse) {\n this._unbindBuffers();\n }\n this.gl.bindTransformFeedback(36386, null);\n }\n // SUBCLASS\n setBuffers(buffers) {\n this.buffers = {};\n this.unusedBuffers = {};\n this.bind(() => {\n for (const bufferName in buffers) {\n this.setBuffer(bufferName, buffers[bufferName]);\n }\n });\n }\n setBuffer(locationOrName, bufferOrRange) {\n const location = this._getVaryingIndex(locationOrName);\n const { buffer, byteLength, byteOffset } = this._getBufferRange(bufferOrRange);\n if (location < 0) {\n this.unusedBuffers[locationOrName] = buffer;\n log.warn(`${this.id} unusedBuffers varying buffer ${locationOrName}`)();\n return;\n }\n this.buffers[location] = { buffer, byteLength, byteOffset };\n // Need to avoid chrome bug where buffer that is already bound to a different target\n // cannot be bound to 'TRANSFORM_FEEDBACK_BUFFER' target.\n if (!this.bindOnUse) {\n this._bindBuffer(location, buffer, byteOffset, byteLength);\n }\n }\n getBuffer(locationOrName) {\n if (isIndex(locationOrName)) {\n return this.buffers[locationOrName] || null;\n }\n const location = this._getVaryingIndex(locationOrName);\n return location >= 0 ? this.buffers[location] : null;\n }\n bind(funcOrHandle = this.handle) {\n if (typeof funcOrHandle !== 'function') {\n this.gl.bindTransformFeedback(36386, funcOrHandle);\n return this;\n }\n let value;\n if (!this._bound) {\n this.gl.bindTransformFeedback(36386, this.handle);\n this._bound = true;\n value = funcOrHandle();\n this._bound = false;\n this.gl.bindTransformFeedback(36386, null);\n }\n else {\n value = funcOrHandle();\n }\n return value;\n }\n unbind() {\n this.bind(null);\n }\n // PRIVATE METHODS\n /** Extract offsets for bindBufferRange */\n _getBufferRange(bufferOrRange) {\n if (bufferOrRange instanceof WEBGLBuffer) {\n return { buffer: bufferOrRange, byteOffset: 0, byteLength: bufferOrRange.byteLength };\n }\n // To use bindBufferRange either offset or size must be specified.\n // @ts-expect-error Must be a BufferRange.\n const { buffer, byteOffset = 0, byteLength = bufferOrRange.buffer.byteLength } = bufferOrRange;\n return { buffer, byteOffset, byteLength };\n }\n _getVaryingIndex(locationOrName) {\n if (isIndex(locationOrName)) {\n return Number(locationOrName);\n }\n for (const varying of this.layout.varyings) {\n if (locationOrName === varying.name) {\n return varying.location;\n }\n }\n return -1;\n }\n /**\n * Need to avoid chrome bug where buffer that is already bound to a different target\n * cannot be bound to 'TRANSFORM_FEEDBACK_BUFFER' target.\n */\n _bindBuffers() {\n for (const bufferIndex in this.buffers) {\n const { buffer, byteLength, byteOffset } = this._getBufferRange(this.buffers[bufferIndex]);\n this._bindBuffer(Number(bufferIndex), buffer, byteOffset, byteLength);\n }\n }\n _unbindBuffers() {\n for (const bufferIndex in this.buffers) {\n this.gl.bindBufferBase(35982, Number(bufferIndex), null);\n }\n }\n _bindBuffer(index, buffer, byteOffset = 0, byteLength) {\n const handle = buffer && buffer.handle;\n if (!handle || byteLength === undefined) {\n this.gl.bindBufferBase(35982, index, handle);\n }\n else {\n this.gl.bindBufferRange(35982, index, handle, byteOffset, byteLength);\n }\n }\n}\n/**\n * Returns true if the given value is an integer, or a string that\n * trivially converts to an integer (only numeric characters).\n */\nfunction isIndex(value) {\n if (typeof value === 'number') {\n return Number.isInteger(value);\n }\n return /^\\d+$/.test(value);\n}\n", "// WebGL2 Query (also handles disjoint timer extensions)\nimport { QuerySet } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\n/**\n * Asynchronous queries for different kinds of information\n */\nexport class WEBGLQuerySet extends QuerySet {\n device;\n handle;\n target = null;\n _queryPending = false;\n _pollingPromise = null;\n get [Symbol.toStringTag]() {\n return 'Query';\n }\n // Create a query class\n constructor(device, props) {\n super(device, props);\n this.device = device;\n if (props.count > 1) {\n throw new Error('WebGL QuerySet can only have one value');\n }\n this.handle = this.device.gl.createQuery();\n Object.seal(this);\n }\n destroy() {\n this.device.gl.deleteQuery(this.handle);\n }\n // FOR RENDER PASS AND COMMAND ENCODER\n /**\n * Shortcut for timer query (dependent on extension in both WebGL1 and 2)\n * Measures GPU time delta between this call and a matching `end` call in the\n * GPU instruction stream.\n */\n beginTimestampQuery() {\n return this._begin(35007);\n }\n endTimestampQuery() {\n this._end();\n }\n // Shortcut for occlusion queries\n beginOcclusionQuery(options) {\n return this._begin(options?.conservative ? 36202 : 35887);\n }\n endOcclusionQuery() {\n this._end();\n }\n // Shortcut for transformFeedbackQuery\n beginTransformFeedbackQuery() {\n return this._begin(35976);\n }\n endTransformFeedbackQuery() {\n this._end();\n }\n async resolveQuery() {\n const value = await this.pollQuery();\n return [value];\n }\n // PRIVATE METHODS\n /**\n * Due to OpenGL API limitations, after calling `begin()` on one Query\n * instance, `end()` must be called on that same instance before\n * calling `begin()` on another query. While there can be multiple\n * outstanding queries representing disjoint `begin()`/`end()` intervals.\n * It is not possible to interleave or overlap `begin` and `end` calls.\n */\n _begin(target) {\n // Don't start a new query if one is already active.\n if (this._queryPending) {\n return;\n }\n this.target = target;\n this.device.gl.beginQuery(this.target, this.handle);\n return;\n }\n // ends the current query\n _end() {\n // Can't end a new query if the last one hasn't been resolved.\n if (this._queryPending) {\n return;\n }\n if (this.target) {\n this.device.gl.endQuery(this.target);\n this.target = null;\n this._queryPending = true;\n }\n return;\n }\n // Returns true if the query result is available\n isResultAvailable() {\n if (!this._queryPending) {\n return false;\n }\n const resultAvailable = this.device.gl.getQueryParameter(this.handle, 34919);\n if (resultAvailable) {\n this._queryPending = false;\n }\n return resultAvailable;\n }\n // Timing query is disjoint, i.e. results are invalid\n isTimerDisjoint() {\n return this.device.gl.getParameter(36795);\n }\n // Returns query result.\n getResult() {\n return this.device.gl.getQueryParameter(this.handle, 34918);\n }\n // Returns the query result, converted to milliseconds to match JavaScript conventions.\n getTimerMilliseconds() {\n return this.getResult() / 1e6;\n }\n // Polls the query\n pollQuery(limit = Number.POSITIVE_INFINITY) {\n if (this._pollingPromise) {\n return this._pollingPromise;\n }\n let counter = 0;\n this._pollingPromise = new Promise((resolve, reject) => {\n const poll = () => {\n if (this.isResultAvailable()) {\n resolve(this.getResult());\n this._pollingPromise = null;\n }\n else if (counter++ > limit) {\n reject('Timed out');\n this._pollingPromise = null;\n }\n else {\n requestAnimationFrame(poll);\n }\n };\n requestAnimationFrame(poll);\n });\n return this._pollingPromise;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { assert, Texture, Framebuffer } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\nimport { getGLTypeFromTypedArray, getTypedArrayFromGLType } from \"./typed-array-utils.js\";\nimport { glFormatToComponents, glTypeToBytes } from \"./format-utils.js\";\n/**\n * Copies data from a type or a Texture object into ArrayBuffer object.\n * App can provide targetPixelArray or have it auto allocated by this method\n * newly allocated by this method unless provided by app.\n * @deprecated Use CommandEncoder.copyTextureToBuffer and Buffer.read\n * @note Slow requires roundtrip to GPU\n *\n * @param source\n * @param options\n * @returns pixel array,\n */\nexport function readPixelsToArray(source, options) {\n const { sourceX = 0, sourceY = 0, sourceFormat = 6408, sourceAttachment = 36064 // TODO - support gl.readBuffer\n } = options || {};\n let { target = null, \n // following parameters are auto deduced if not provided\n sourceWidth, sourceHeight, sourceType } = options || {};\n const { framebuffer, deleteFramebuffer } = getFramebuffer(source);\n assert(framebuffer);\n const { gl, handle } = framebuffer;\n sourceWidth = sourceWidth || framebuffer.width;\n sourceHeight = sourceHeight || framebuffer.height;\n // TODO - Set and unset gl.readBuffer\n // if (sourceAttachment === GL.COLOR_ATTACHMENT0 && handle === null) {\n // sourceAttachment = GL.FRONT;\n // }\n const attachment = sourceAttachment - 36064;\n // assert(attachments[sourceAttachment]);\n // Deduce the type from color attachment if not provided.\n sourceType =\n sourceType ||\n framebuffer.colorAttachments[attachment]?.texture?.type || 5121;\n // Deduce type and allocated pixelArray if needed\n target = getPixelArray(target, sourceType, sourceFormat, sourceWidth, sourceHeight);\n // Pixel array available, if necessary, deduce type from it.\n sourceType = sourceType || getGLTypeFromTypedArray(target);\n const prevHandle = gl.bindFramebuffer(36160, handle);\n gl.readPixels(sourceX, sourceY, sourceWidth, sourceHeight, sourceFormat, sourceType, target);\n // @ts-expect-error\n gl.bindFramebuffer(36160, prevHandle || null);\n if (deleteFramebuffer) {\n framebuffer.destroy();\n }\n return target;\n}\n/**\n * Copies data from a Framebuffer or a Texture object into a Buffer object.\n * NOTE: doesn't wait for copy to be complete, it programs GPU to perform a DMA transffer.\n * @deprecated Use CommandEncoder\n * @param source\n * @param options\n */\nexport function readPixelsToBuffer(source, options) {\n const { target, sourceX = 0, sourceY = 0, sourceFormat = 6408, targetByteOffset = 0 } = options || {};\n // following parameters are auto deduced if not provided\n let { sourceWidth, sourceHeight, sourceType } = options || {};\n const { framebuffer, deleteFramebuffer } = getFramebuffer(source);\n assert(framebuffer);\n sourceWidth = sourceWidth || framebuffer.width;\n sourceHeight = sourceHeight || framebuffer.height;\n // Asynchronous read (PIXEL_PACK_BUFFER) is WebGL2 only feature\n const webglFramebuffer = framebuffer;\n // deduce type if not available.\n sourceType = sourceType || 5121;\n let webglBufferTarget = target;\n if (!webglBufferTarget) {\n // Create new buffer with enough size\n const components = glFormatToComponents(sourceFormat);\n const byteCount = glTypeToBytes(sourceType);\n const byteLength = targetByteOffset + sourceWidth * sourceHeight * components * byteCount;\n webglBufferTarget = webglFramebuffer.device.createBuffer({ byteLength });\n }\n // TODO(donmccurdy): Do we have tests to confirm this is working?\n const commandEncoder = source.device.createCommandEncoder();\n commandEncoder.copyTextureToBuffer({\n source: source,\n width: sourceWidth,\n height: sourceHeight,\n origin: [sourceX, sourceY],\n destination: webglBufferTarget,\n byteOffset: targetByteOffset\n });\n commandEncoder.destroy();\n if (deleteFramebuffer) {\n framebuffer.destroy();\n }\n return webglBufferTarget;\n}\n/**\n * Copy a rectangle from a Framebuffer or Texture object into a texture (at an offset)\n * @deprecated Use CommandEncoder\n */\n// eslint-disable-next-line complexity, max-statements\nexport function copyToTexture(source, target, options) {\n const { sourceX = 0, sourceY = 0, \n // attachment = GL.COLOR_ATTACHMENT0, // TODO - support gl.readBuffer\n targetMipmaplevel = 0, targetInternalFormat = 6408 } = options || {};\n let { targetX, targetY, targetZ, width, // defaults to target width\n height // defaults to target height\n } = options || {};\n const { framebuffer, deleteFramebuffer } = getFramebuffer(source);\n assert(framebuffer);\n const webglFramebuffer = framebuffer;\n const { device, handle } = webglFramebuffer;\n const isSubCopy = typeof targetX !== 'undefined' ||\n typeof targetY !== 'undefined' ||\n typeof targetZ !== 'undefined';\n targetX = targetX || 0;\n targetY = targetY || 0;\n targetZ = targetZ || 0;\n const prevHandle = device.gl.bindFramebuffer(36160, handle);\n // TODO - support gl.readBuffer (WebGL2 only)\n // const prevBuffer = gl.readBuffer(attachment);\n assert(target);\n let texture = null;\n let textureTarget;\n if (target instanceof Texture) {\n texture = target;\n width = Number.isFinite(width) ? width : texture.width;\n height = Number.isFinite(height) ? height : texture.height;\n texture.bind(0);\n textureTarget = texture.target;\n }\n else {\n textureTarget = target;\n }\n if (!isSubCopy) {\n device.gl.copyTexImage2D(textureTarget, targetMipmaplevel, targetInternalFormat, sourceX, sourceY, width, height, 0 /* border must be 0 */);\n }\n else {\n switch (textureTarget) {\n case 3553:\n case 34067:\n device.gl.copyTexSubImage2D(textureTarget, targetMipmaplevel, targetX, targetY, sourceX, sourceY, width, height);\n break;\n case 35866:\n case 32879:\n device.gl.copyTexSubImage3D(textureTarget, targetMipmaplevel, targetX, targetY, targetZ, sourceX, sourceY, width, height);\n break;\n default:\n }\n }\n if (texture) {\n texture.unbind();\n }\n // @ts-expect-error\n device.gl.bindFramebuffer(36160, prevHandle || null);\n if (deleteFramebuffer) {\n framebuffer.destroy();\n }\n return texture;\n}\nfunction getFramebuffer(source) {\n if (!(source instanceof Framebuffer)) {\n return { framebuffer: toFramebuffer(source), deleteFramebuffer: true };\n }\n return { framebuffer: source, deleteFramebuffer: false };\n}\n/**\n * Wraps a given texture into a framebuffer object, that can be further used\n * to read data from the texture object.\n */\nexport function toFramebuffer(texture, props) {\n const { device, width, height, id } = texture;\n const framebuffer = device.createFramebuffer({\n ...props,\n id: `framebuffer-for-${id}`,\n width,\n height,\n colorAttachments: [texture]\n });\n return framebuffer;\n}\nfunction getPixelArray(pixelArray, type, format, width, height) {\n if (pixelArray) {\n return pixelArray;\n }\n // Allocate pixel array if not already available, using supplied type\n type = type || 5121;\n const ArrayType = getTypedArrayFromGLType(type, { clamped: false });\n const components = glFormatToComponents(format);\n // TODO - check for composite type (components = 1).\n return new ArrayType(width * height * components);\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { assert } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\n// Returns number of components in a specific readPixels WebGL format\nexport function glFormatToComponents(format) {\n switch (format) {\n case 6406:\n case 33326:\n case 6403:\n return 1;\n case 33328:\n case 33319:\n return 2;\n case 6407:\n case 34837:\n return 3;\n case 6408:\n case 34836:\n return 4;\n // TODO: Add support for additional WebGL2 formats\n default:\n assert(false);\n return 0;\n }\n}\n// Return byte count for given readPixels WebGL type\nexport function glTypeToBytes(type) {\n switch (type) {\n case 5121:\n return 1;\n case 33635:\n case 32819:\n case 32820:\n return 2;\n case 5126:\n return 4;\n // TODO: Add support for additional WebGL2 types\n default:\n assert(false);\n return 0;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { assert } from '@luma.gl/core';\nimport { withGLParameters } from \"../context/state-tracker/with-parameters.js\";\n// Should collapse during minification\nconst GL_DEPTH_BUFFER_BIT = 0x00000100;\nconst GL_STENCIL_BUFFER_BIT = 0x00000400;\nconst GL_COLOR_BUFFER_BIT = 0x00004000;\nconst GL_COLOR = 0x1800;\nconst GL_DEPTH = 0x1801;\nconst GL_STENCIL = 0x1802;\nconst GL_DEPTH_STENCIL = 0x84f9;\n// Should disappear if asserts are removed\nconst ERR_ARGUMENTS = 'clear: bad arguments';\n/**\n * Optionally clears depth, color and stencil buffers\n * @deprecated Set clear color when creating a RenderPass.\n */\nexport function clear(device, options) {\n const { framebuffer = null, color = null, depth = null, stencil = null } = options || {};\n const parameters = {};\n if (framebuffer) {\n parameters.framebuffer = framebuffer;\n }\n let clearFlags = 0;\n if (color) {\n clearFlags |= GL_COLOR_BUFFER_BIT;\n if (color !== true) {\n parameters.clearColor = color;\n }\n }\n if (depth) {\n clearFlags |= GL_DEPTH_BUFFER_BIT;\n if (depth !== true) {\n parameters.clearDepth = depth;\n }\n }\n if (stencil) {\n clearFlags |= GL_STENCIL_BUFFER_BIT;\n if (depth !== true) {\n parameters.clearStencil = depth;\n }\n }\n assert(clearFlags !== 0, ERR_ARGUMENTS);\n // Temporarily set any clear \"colors\" and call clear\n const gl = device.gl;\n withGLParameters(gl, parameters, () => {\n gl.clear(clearFlags);\n });\n}\n/**\n * WebGL2 - clear a specific drawing buffer\n * @deprecated Set clear color when creating a RenderPass\n */\nexport function clearBuffer(device, options) {\n const { framebuffer = null, buffer = GL_COLOR, drawBuffer = 0, value = [0, 0, 0, 0] } = options || {};\n const gl = device.gl;\n withGLParameters(gl, { framebuffer }, () => {\n // Method selection per OpenGL ES 3 docs\n switch (buffer) {\n case GL_COLOR:\n switch (value.constructor) {\n case Int32Array:\n gl.clearBufferiv(buffer, drawBuffer, value);\n break;\n case Uint32Array:\n gl.clearBufferuiv(buffer, drawBuffer, value);\n break;\n case Float32Array:\n default:\n gl.clearBufferfv(buffer, drawBuffer, value);\n }\n break;\n case GL_DEPTH:\n gl.clearBufferfv(GL_DEPTH, 0, [value]);\n break;\n case GL_STENCIL:\n gl.clearBufferiv(GL_STENCIL, 0, [value]);\n break;\n case GL_DEPTH_STENCIL:\n const [depth, stencil] = value;\n gl.clearBufferfi(GL_DEPTH_STENCIL, 0, depth, stencil);\n break;\n default:\n assert(false, ERR_ARGUMENTS);\n }\n });\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { Resource, uid, stubRemovedMethods } from '@luma.gl/core';\nconst ERR_RESOURCE_METHOD_UNDEFINED = 'Resource subclass must define virtual methods';\n/**\n * Base class for WebGL object wrappers\n */\nexport class WebGLResource extends Resource {\n device;\n gl;\n gl2;\n _handle;\n _bound = false;\n // Only meaningful for resources that allocate GPU memory\n byteLength = 0;\n constructor(device, props, defaultProps) {\n super(device, props, defaultProps);\n this.device = device;\n const gl = this.device.gl;\n // extends\n const { id } = props || {};\n this.gl = gl;\n this.gl2 = gl;\n this.id = id || uid(this.constructor.name);\n // Set the handle\n // If handle was provided, use it, otherwise create a new handle\n // TODO - Stores the handle with context loss information\n // this.glCount = glGetContextLossCount(this.gl);\n // Default VertexArray needs to be created with null handle, so compare against undefined\n this._handle = props?.handle;\n if (this._handle === undefined) {\n this._handle = this._createHandle();\n }\n this.byteLength = 0;\n }\n toString() {\n return `${this.constructor.name}(${this.id})`;\n }\n get handle() {\n // TODO - Add context loss handling\n // Will regenerate and reinitialize the handle if necessary\n // const glCount = glGetContextLossCount(this.gl);\n // if (this.glCount !== glCount) {\n // this._handle = this._createHandle(this.props);\n // this._glCount = glCount;\n // // Reinitialize object\n // this.initialize(this.props);\n // }\n return this._handle;\n }\n delete({ deleteChildren = false } = {}) {\n // Delete this object, and get refs to any children\n // @ts-expect-error\n const children = this._handle && this._deleteHandle(this._handle);\n if (this._handle) {\n this.removeStats();\n }\n this._handle = null;\n // Optionally, recursively delete the children\n // @ts-expect-error\n if (children && deleteChildren) {\n // @ts-expect-error\n children.filter(Boolean).forEach(child => child.destroy());\n }\n return this;\n }\n bind(funcOrHandle = this.handle) {\n if (typeof funcOrHandle !== 'function') {\n this._bindHandle(funcOrHandle);\n return this;\n }\n let value;\n if (!this._bound) {\n this._bindHandle(this.handle);\n this._bound = true;\n value = funcOrHandle();\n this._bound = false;\n this._bindHandle(null);\n }\n else {\n value = funcOrHandle();\n }\n return value;\n }\n unbind() {\n this.bind(null);\n }\n // Install stubs for removed methods\n stubRemovedMethods(className, version, methodNames) {\n return stubRemovedMethods(this, className, version, methodNames);\n }\n // PUBLIC VIRTUAL METHODS\n initialize(props) { }\n // PROTECTED METHODS - These must be overridden by subclass\n _createHandle() {\n throw new Error(ERR_RESOURCE_METHOD_UNDEFINED);\n }\n _deleteHandle() {\n throw new Error(ERR_RESOURCE_METHOD_UNDEFINED);\n }\n _bindHandle(handle) {\n throw new Error(ERR_RESOURCE_METHOD_UNDEFINED);\n }\n _getOptsFromHandle() {\n throw new Error(ERR_RESOURCE_METHOD_UNDEFINED);\n }\n _getParameter(pname, props) {\n throw new Error(ERR_RESOURCE_METHOD_UNDEFINED);\n }\n _setParameter(pname, value) {\n throw new Error(ERR_RESOURCE_METHOD_UNDEFINED);\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { assert } from '@luma.gl/core';\nimport { GL } from '@luma.gl/constants';\nimport { WebGLResource } from \"./webgl-resource.js\";\nimport { isRenderbufferFormatSupported } from \"../converters/texture-formats.js\";\nimport { convertTextureFormatToGL, getTextureFormatBytesPerPixel } from \"../converters/texture-formats.js\";\n/**\n * Renderbuffers are GPU objects that contain images.\n * In contrast to Textures they are optimized for use as render targets, with Framebuffers.\n * while Textures may not be, and are the logical choice when\n * you do not need to sample (i.e. in a post-pass shader)\n * from the produced image. If you need to resample\n * (such as when reading depth back in a second shader pass),\n * use Textures instead.\n * Renderbuffer objects also natively accommodate Multisampling (MSAA).\n */\nexport class WEBGLRenderbuffer extends WebGLResource {\n static defaultProps = {\n id: undefined,\n handle: undefined,\n userData: undefined,\n format: undefined, // 'depth16unorm'\n width: 1,\n height: 1,\n samples: 0\n };\n get [Symbol.toStringTag]() {\n return 'Renderbuffer';\n }\n get width() {\n return this.props.width;\n }\n get height() {\n return this.props.height;\n }\n get format() {\n return this.props.format;\n }\n get samples() {\n return this.props.samples;\n }\n get attachment() {\n return;\n }\n /** WebGL format constant */\n glFormat;\n static isTextureFormatSupported(device, format) {\n return isRenderbufferFormatSupported(device.gl, format, device._extensions);\n }\n constructor(device, props) {\n // TODO - remove temporary sanity check\n if (typeof props.format === 'number') {\n throw new Error('Renderbuffer');\n }\n super(device, props, WEBGLRenderbuffer.defaultProps);\n this.glFormat = convertTextureFormatToGL(this.props.format);\n this._initialize(this.props);\n }\n resize(size) {\n // Don't resize if width/height haven't changed\n if (size.width !== this.width || size.height !== this.height) {\n Object.assign(this.props, { ...size, format: this.format, samples: this.samples });\n this._initialize(this.props);\n }\n }\n // PRIVATE METHODS\n /** Creates and initializes a renderbuffer object's data store */\n _initialize(props) {\n const { format, width, height, samples } = props;\n assert(format, 'Needs format');\n this.trackDeallocatedMemory();\n this.gl.bindRenderbuffer(36161, this.handle);\n if (samples !== 0) {\n this.gl.renderbufferStorageMultisample(36161, samples, this.glFormat, width, height);\n }\n else {\n this.gl.renderbufferStorage(36161, this.glFormat, width, height);\n }\n this.gl.bindRenderbuffer(36161, null);\n this.trackAllocatedMemory(width * height * (samples || 1) * getTextureFormatBytesPerPixel(this.format));\n }\n // RESOURCE IMPLEMENTATION\n _createHandle() {\n return this.gl.createRenderbuffer();\n }\n _deleteHandle() {\n this.gl.deleteRenderbuffer(this.handle);\n this.trackDeallocatedMemory();\n }\n _bindHandle(handle) {\n this.gl.bindRenderbuffer(36161, handle);\n }\n}\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGA,IAAAA,gBAAwD;;;ACExD,kBAAuB;;;ACDvB,uBAAmB;AAGZ,IAAM,wBAAwB;AAAA,EACjC,CAAC,IAAI,GAAG;AAAA,EACR,CAAC,KAAK,GAAG,IAAI,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;AAAA,EACtC,CAAC,KAAK,GAAG;AAAA,EACT,CAAC,KAAK,GAAG;AAAA,EACT,CAAC,KAAK,GAAG;AAAA,EACT,CAAC,KAAK,GAAG;AAAA,EACT,CAAC,KAAK,GAAG;AAAA,EACT,CAAC,KAAK,GAAG;AAAA,EACT,CAAC,IAAI,GAAG,IAAI,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC;AAAA;AAAA,EACrC,CAAC,IAAI,GAAG,CAAC,MAAM,MAAM,MAAM,IAAI;AAAA,EAC/B,CAAC,IAAI,GAAG;AAAA,EACR,CAAC,IAAI,GAAG;AAAA,EACR,CAAC,IAAI,GAAG;AAAA,EACR,CAAC,IAAI,GAAG;AAAA,EACR,CAAC,IAAI,GAAG;AAAA,EACR,CAAC,IAAI,GAAG,IAAI,aAAa,C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EAGA,YAAY,OAAO;AACf,UAAM,EAAE,QAAQ,OAAO,QAAQ,QAAQ,IAAI;AAC3C,8BAAO,QAAQ,cAAc;AAC7B,SAAK,uBAAuB;AAC5B,SAAK,GAAG,iBAAiB,OAAO,KAAK,MAAM;AAC3C,QAAI,YAAY,GAAG;AACf,WAAK,GAAG,+BAA+B,OAAO,SAAS,KAAK,UAAU,OAAO,MAAM;AAAA,IACvF,OACK;AACD,WAAK,GAAG,oBAAoB,OAAO,KAAK,UAAU,OAAO,MAAM;AAAA,IACnE;AACA,SAAK,GAAG,iBAAiB,OAAO,IAAI;AACpC,SAAK,qBAAqB,QAAQ,UAAU,WAAW,KAAK,8BAA8B,KAAK,MAAM,CAAC;AAAA,EAC1G;AAAA;AAAA,EAEA,gBAAgB;AACZ,WAAO,KAAK,GAAG,mBAAmB;AAAA,EACtC;AAAA,EACA,gBAAgB;AACZ,SAAK,GAAG,mBAAmB,KAAK,MAAM;AACtC,SAAK,uBAAuB;AAAA,EAChC;AAAA,EACA,YAAY,QAAQ;AAChB,SAAK,GAAG,iBAAiB,OAAO,MAAM;AAAA,EAC1C;AACJ;AA5EO,IAAM,oBAAN;AACH,cADS,mBACF,gBAAe;AAAA,EAClB,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,QAAQ;AAAA;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AACb;", "names": ["import_core", "hint", "log", "enable", "import_constants", "import_core", "import_core", "import_constants", "import_constants", "entry", "import_core", "import_constants", "import_core", "import_core", "import_constants", "import_core", "import_constants", "isObjectEmpty", "import_constants", "import_core", "import_constants", "import_core", "import_constants", "import_core", "import_constants", "import_core", "import_core", "import_core", "import_constants", "GLEnum", "message", "import_core", "import_constants", "messageType", "message", "log", "source", "import_core", "import_constants", "import_core", "import_constants", "import_constants", "import_core", "import_constants", "import_constants", "import_constants", "uniforms", "isArray", "import_constants", "import_constants", "binding", "status", "import_core", "import_core", "import_constants", "cast", "import_core", "import_constants", "import_env", "enable", "import_core", "import_constants", "import_core", "import_constants", "import_core", "import_constants", "import_core", "import_constants", "getFramebuffer", "getFramebuffer", "import_core", "GL_DEPTH_BUFFER_BIT", "GL_STENCIL_BUFFER_BIT", "GL_COLOR_BUFFER_BIT", "GL_COLOR_BUFFER_BIT", "GL_DEPTH_BUFFER_BIT", "GL_STENCIL_BUFFER_BIT", "LOG_LEVEL", "message", "_a", "enable", "compareConstantArrayValues", "import_core", "import_core", "import_constants"] }