@luma.gl/core 9.2.0-alpha.6 → 9.2.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,7 +32,7 @@ export class Luma {
32
32
  VERSION =
33
33
  // Version detection using build plugin
34
34
  // @ts-expect-error no-undef
35
- typeof "9.2.0-alpha.6" !== 'undefined' ? "9.2.0-alpha.6" : 'running from source';
35
+ typeof "9.2.0-beta.2" !== 'undefined' ? "9.2.0-beta.2" : 'running from source';
36
36
  spector;
37
37
  preregisteredAdapters = new Map();
38
38
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"luma.js","sourceRoot":"","sources":["../../src/adapter/luma.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAIpC,OAAO,EAAC,MAAM,EAAC,oBAAiB;AAEhC,OAAO,EAAe,SAAS,EAAC,kCAA+B;AAC/D,OAAO,EAAC,GAAG,EAAC,wBAAqB;AAOjC,MAAM,eAAe,GAAG,qDAAqD,CAAC;AAE9E,MAAM,aAAa,GACjB,kGAAkG,CAAC;AAqBrG;;;;GAIG;AACH,MAAM,OAAO,IAAI;IACf,MAAM,CAAC,YAAY,GAAgC;QACjD,GAAG,MAAM,CAAC,YAAY;QACtB,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,SAAU;QACpB,eAAe,EAAE,IAAI;KACtB,CAAC;IAEF,mCAAmC;IAC1B,KAAK,GAAiB,SAAS,CAAC;IAEzC;;;;;;OAMG;IACM,GAAG,GAAQ,GAAG,CAAC;IAExB,yBAAyB;IAChB,OAAO;IACd,uCAAuC;IACvC,4BAA4B;IAC5B,sBAAkB,KAAK,WAAW,CAAC,CAAC,iBAAa,CAAC,CAAC,qBAAqB,CAAC;IAE3E,OAAO,CAAU;IAEP,qBAAqB,GAAG,IAAI,GAAG,EAAmB,CAAC;IAE7D;QACE,IAAI,UAAU,CAAC,IAAI,EAAE,CAAC;YACpB,IAA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
@@ -5,7 +5,7 @@
5
5
  else if (typeof exports === 'object') exports['luma'] = factory();
6
6
  else root['luma'] = factory();})(globalThis, function () {
7
7
  "use strict";var __exports__=(()=>{var oe=Object.defineProperty;var Mt=Object.getOwnPropertyDescriptor;var Ft=Object.getOwnPropertyNames;var zt=Object.prototype.hasOwnProperty;var $t=(r,e,t)=>e in r?oe(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Ut=(r,e)=>{for(var t in e)oe(r,t,{get:e[t],enumerable:!0})},Ht=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ft(e))!zt.call(r,n)&&n!==t&&oe(r,n,{get:()=>e[n],enumerable:!(i=Mt(e,n))||i.enumerable});return r};var Nt=r=>Ht(oe({},"__esModule",{value:!0}),r);var a=(r,e,t)=>($t(r,typeof e!="symbol"?e+"":e,t),t);var Dr={};Ut(Dr,{Adapter:()=>Se,Buffer:()=>h,CanvasContext:()=>$,CommandBuffer:()=>te,CommandEncoder:()=>ee,ComputePass:()=>Z,ComputePipeline:()=>Q,Device:()=>C,DeviceFeatures:()=>xe,DeviceLimits:()=>be,ExternalTexture:()=>X,Framebuffer:()=>K,PipelineLayout:()=>se,QuerySet:()=>ne,RenderPass:()=>T,RenderPipeline:()=>J,Resource:()=>u,Sampler:()=>I,Shader:()=>q,Texture:()=>g,TextureFormatDecoder:()=>j,TextureView:()=>Y,TransformFeedback:()=>ie,UniformBlock:()=>N,UniformBufferLayout:()=>H,UniformStore:()=>_e,VertexArray:()=>re,_getTextureFormatDefinition:()=>O,_getTextureFormatTable:()=>pt,getAttributeInfosFromLayouts:()=>Xe,getAttributeShaderTypeInfo:()=>Ae,getDataType:()=>de,getDataTypeInfo:()=>F,getNormalizedDataType:()=>me,getScratchArray:()=>Ct,getTypedArrayConstructor:()=>lt,getVariableShaderTypeInfo:()=>Pe,getVertexFormatFromAttribute:()=>mt,getVertexFormatInfo:()=>E,log:()=>l,luma:()=>vt,makeVertexFormat:()=>De,readPixel:()=>Lt,textureFormatDecoder:()=>_,writePixel:()=>Dt});function k(){let r;if(typeof window<"u"&&window.performance)r=window.performance.now();else if(typeof process<"u"&&process.hrtime){let e=process.hrtime();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}var P=class{constructor(e,t){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=e,this.type=t,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=k(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(k()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}};var D=class{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(let e of Object.values(this.stats))e.reset();return this}forEach(e){for(let t of Object.values(this.stats))e(t)}getTable(){let e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){let{name:t,type:i}=e,n=this.stats[t];return n||(e instanceof P?n=e:n=new P(t,i),this.stats[t]=n),n}};var Ce=class{stats=new Map;getStats(e){return this.get(e)}get(e){return this.stats.has(e)||this.stats.set(e,new D({id:e})),this.stats.get(e)}},ae=new Ce;var ce=globalThis,kt=globalThis.document||{},ue=globalThis.process||{},Wt=globalThis.console,Or=globalThis.navigator||{};function et(r){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&Boolean(process.versions?.electron))return!0;let e=typeof navigator<"u"&&navigator.userAgent,t=r||e;return Boolean(t&&t.indexOf("Electron")>=0)}function x(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||et()}var Ie="4.1.0";function Vt(r){try{let e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}var fe=class{constructor(e,t,i="sessionStorage"){this.storage=Vt(i),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){let t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function tt(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function rt(r,e=8){let t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var le;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(le||(le={}));var Ot=10;function it(r){return typeof r!="string"?r:(r=r.toUpperCase(),le[r]||le.WHITE)}function nt(r,e,t){return!x&&typeof r=="string"&&(e&&(r=`\x1B[${it(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${it(t)+Ot}m${r}\x1B[49m`)),r}function st(r,e=["constructor"]){let t=Object.getPrototypeOf(r),i=Object.getOwnPropertyNames(t),n=r;for(let s of i){let o=n[s];typeof o=="function"&&(e.find(c=>s===c)||(n[s]=o.bind(r)))}}function W(r,e){if(!r)throw new Error(e||"Assertion failed")}function A(){let r;if(x()&&ce.performance)r=ce?.performance?.now?.();else if("hrtime"in ue){let e=ue?.hrtime?.();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}var B={debug:x()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},jt={enabled:!0,level:0};function M(){}var ot={},at={once:!0},v=class{constructor({id:e}={id:""}){this.VERSION=Ie,this._startTs=A(),this._deltaTs=A(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new fe(`__probe-${this.id}__`,jt),this.timeStamp(`${this.id} started`),st(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((A()-this._startTs).toPrecision(10))}getDelta(){return Number((A()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,B.warn,arguments,at)}error(e){return this._getLogFunction(0,e,B.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,B.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,B.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,B.debug||B.info,arguments,at)}table(e,t,i){return t?this._getLogFunction(e,t,console.table||M,i&&[i],{tag:Xt(t)}):M}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||M)}group(e,t,i={collapsed:!1}){let n=ct({logLevel:e,message:t,opts:i}),{collapsed:s}=i;return n.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t,i={}){return this.group(e,t,Object.assign({},i,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||M)}withGroup(e,t,i){this.group(e,t)();try{i()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=ut(e)}_getLogFunction(e,t,i,n,s){if(this._shouldLog(e)){s=ct({logLevel:e,message:t,args:n,opts:s}),i=i||s.method,W(i),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=A();let o=s.tag||s.message;if(s.once&&o)if(!ot[o])ot[o]=A();else return M;return t=Yt(this.id,s.message,s),i.bind(console,t,...s.args)}return M}};v.VERSION=Ie;function ut(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return W(Number.isFinite(e)&&e>=0),e}function ct(r){let{logLevel:e,message:t}=r;r.logLevel=ut(e);let i=r.args?Array.from(r.args):[];for(;i.length&&i.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&i.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break;default:}typeof r.message=="function"&&(r.message=r.message());let n=typeof r.message;return W(n==="string"||n==="object"),Object.assign(r,{args:i},r.opts)}function Yt(r,e,t){if(typeof e=="string"){let i=t.time?rt(tt(t.total)):"";e=t.time?`${r}: ${i} ${e}`:`${r}: ${e}`,e=nt(e,t.color,t.background)}return e}function Xt(r){for(let e in r)for(let t in r[e])return t||"untitled";return"empty"}globalThis.probe={};var gi=new v({id:"@probe.gl/log"});var l=new v({id:"luma.gl"});var Re={};function S(r="id"){Re[r]=Re[r]||1;let e=Re[r]++;return`${r}-${e}`}var u=class{toString(){return`${this[Symbol.toStringTag]||this.constructor.name}:"${this.id}"`}id;props;userData={};_device;destroyed=!1;allocatedBytes=0;_attachedResources=new Set;constructor(e,t,i){if(!e)throw new Error("no device");this._device=e,this.props=qt(t,i);let n=this.props.id!=="undefined"?this.props.id:S(this[Symbol.toStringTag]);this.props.id=n,this.id=n,this.userData=this.props.userData||{},this.addStats()}destroy(){this.destroyResource()}delete(){return this.destroy(),this}getProps(){return this.props}attachResource(e){this._attachedResources.add(e)}detachResource(e){this._attachedResources.delete(e)}destroyAttachedResource(e){this._attachedResources.delete(e)&&e.destroy()}destroyAttachedResources(){for(let e of Object.values(this._attachedResources))e.destroy();this._attachedResources=new Set}destroyResource(){this.destroyAttachedResources(),this.removeStats(),this.destroyed=!0}removeStats(){let e=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];e.get(`${t}s Active`).decrementCount()}trackAllocatedMemory(e,t=this[Symbol.toStringTag]){let i=this._device.statsManager.getStats("Resource Counts");i.get("GPU Memory").addCount(e),i.get(`${t} Memory`).addCount(e),this.allocatedBytes=e}trackDeallocatedMemory(e=this[Symbol.toStringTag]){let t=this._device.statsManager.getStats("Resource Counts");t.get("GPU Memory").subtractCount(this.allocatedBytes),t.get(`${e} Memory`).subtractCount(this.allocatedBytes),this.allocatedBytes=0}addStats(){let e=this._device.statsManager.getStats("Resource Counts"),t=this[Symbol.toStringTag];e.get("Resources Created").incrementCount(),e.get(`${t}s Created`).incrementCount(),e.get(`${t}s Active`).incrementCount()}};a(u,"defaultProps",{id:"undefined",handle:void 0,userData:void 0});function qt(r,e){let t={...e};for(let i in r)r[i]!==void 0&&(t[i]=r[i]);return t}var G=class extends u{get[Symbol.toStringTag](){return"Buffer"}usage;indexType;updateTimestamp;constructor(e,t){let i={...t};(t.usage||0)&G.INDEX&&!t.indexType&&(t.data instanceof Uint32Array?i.indexType="uint32":t.data instanceof Uint16Array&&(i.indexType="uint16")),delete i.data,super(e,i,G.defaultProps),this.usage=i.usage||0,this.indexType=i.indexType,this.updateTimestamp=e.incrementTimestamp()}clone(e){return this.device.createBuffer({...this.props,...e})}debugData=new ArrayBuffer(0);_setDebugData(e,t,i){let n=ArrayBuffer.isView(e)?e.buffer:e,s=Math.min(e?e.byteLength:i,G.DEBUG_DATA_MAX_LENGTH);n===null?this.debugData=new ArrayBuffer(s):t===0&&i===n.byteLength?this.debugData=n.slice(0,s):this.debugData=n.slice(t,t+s)}},h=G;a(h,"INDEX",16),a(h,"VERTEX",32),a(h,"UNIFORM",64),a(h,"STORAGE",128),a(h,"INDIRECT",256),a(h,"QUERY_RESOLVE",512),a(h,"MAP_READ",1),a(h,"MAP_WRITE",2),a(h,"COPY_SRC",4),a(h,"COPY_DST",8),a(h,"DEBUG_DATA_MAX_LENGTH",32),a(h,"defaultProps",{...u.defaultProps,usage:0,byteLength:0,byteOffset:0,data:null,indexType:"uint16",onMapped:void 0});function F(r){let[e,t,i]=Le[r],n=r.includes("norm"),s=!n&&!r.startsWith("float"),o=r.startsWith("s");return{signedType:e,primitiveType:t,byteLength:i,normalized:n,integer:s,signed:o}}function me(r){let e=r;switch(e){case"uint8":return"unorm8";case"sint8":return"snorm8";case"uint16":return"unorm16";case"sint16":return"snorm16";default:return e}}function ft(r,e){switch(e){case 1:return r;case 2:return r+r%2;default:return r+(4-r%4)%4}}function de(r){let e=ArrayBuffer.isView(r)?r.constructor:r;if(e===Uint8ClampedArray)return"uint8";let t=Object.values(Le).find(i=>e===i[4]);if(!t)throw new Error(e.name);return t[0]}function lt(r){let[,,,,e]=Le[r];return e}var Le={uint8:["uint8","u32",1,!1,Uint8Array],sint8:["sint8","i32",1,!1,Int8Array],unorm8:["uint8","f32",1,!0,Uint8Array],snorm8:["sint8","f32",1,!0,Int8Array],uint16:["uint16","u32",2,!1,Uint16Array],sint16:["sint16","i32",2,!1,Int16Array],unorm16:["uint16","u32",2,!0,Uint16Array],snorm16:["sint16","i32",2,!0,Int16Array],float16:["float16","f16",2,!1,Uint16Array],float32:["float32","f32",4,!1,Float32Array],uint32:["uint32","u32",4,!1,Uint32Array],sint32:["sint32","i32",4,!1,Int32Array]};function E(r){let e;r.endsWith("-webgl")&&(r.replace("-webgl",""),e=!0);let[t,i]=r.split("x"),n=t,s=i?parseInt(i):1,o=F(n),c={type:n,components:s,byteLength:o.byteLength*s,integer:o.integer,signed:o.signed,normalized:o.normalized};return e&&(c.webglOnly=!0),c}function De(r,e,t){let i=t?me(r):r;switch(i){case"unorm8":return e===1?"unorm8":e===3?"unorm8x3-webgl":`${i}x${e}`;case"snorm8":case"uint8":case"sint8":case"uint16":case"sint16":case"unorm16":case"snorm16":case"float16":if(e===1||e===3)throw new Error(`size: ${e}`);return`${i}x${e}`;default:return e===1?i:`${i}x${e}`}}function mt(r,e,t){if(!e||e>4)throw new Error(`size ${e}`);let i=e,n=de(r);return De(n,i,t)}function dt(r){let e;switch(r.primitiveType){case"f32":e="float32";break;case"i32":e="sint32";break;case"u32":e="uint32";break;case"f16":return r.components<=2?"float16x2":"float16x4"}return r.components===1?e:`${e}x${r.components}`}var b="texture-compression-bc",m="texture-compression-astc",y="texture-compression-etc2",Kt="texture-compression-etc1-webgl",he="texture-compression-pvrtc-webgl",Be="texture-compression-atc-webgl",pe="float32-renderable-webgl",Me="float16-renderable-webgl",Jt="rgb9e5ufloat-renderable-webgl",Fe="snorm8-renderable-webgl",V="norm16-renderable-webgl",ze="snorm16-renderable-webgl",ge="float32-filterable",ht="float16-filterable-webgl";function O(r){let e=gt[r];if(!e)throw new Error(`Unsupported texture format ${r}`);return e}function pt(){return gt}var Qt={r8unorm:{},rg8unorm:{},"rgb8unorm-webgl":{},rgba8unorm:{},"rgba8unorm-srgb":{},r8snorm:{render:Fe},rg8snorm:{render:Fe},"rgb8snorm-webgl":{},rgba8snorm:{render:Fe},r8uint:{},rg8uint:{},rgba8uint:{},r8sint:{},rg8sint:{},rgba8sint:{},bgra8unorm:{},"bgra8unorm-srgb":{},r16unorm:{f:V},rg16unorm:{render:V},"rgb16unorm-webgl":{f:V},rgba16unorm:{render:V},r16snorm:{f:ze},rg16snorm:{render:ze},"rgb16snorm-webgl":{f:V},rgba16snorm:{render:ze},r16uint:{},rg16uint:{},rgba16uint:{},r16sint:{},rg16sint:{},rgba16sint:{},r16float:{render:Me,filter:"float16-filterable-webgl"},rg16float:{render:Me,filter:ht},rgba16float:{render:Me,filter:ht},r32uint:{},rg32uint:{},rgba32uint:{},r32sint:{},rg32sint:{},rgba32sint:{},r32float:{render:pe,filter:ge},rg32float:{render:!1,filter:ge},"rgb32float-webgl":{render:pe,filter:ge},rgba32float:{render:pe,filter:ge},"rgba4unorm-webgl":{channels:"rgba",bitsPerChannel:[4,4,4,4],packed:!0},"rgb565unorm-webgl":{channels:"rgb",bitsPerChannel:[5,6,5,0],packed:!0},"rgb5a1unorm-webgl":{channels:"rgba",bitsPerChannel:[5,5,5,1],packed:!0},rgb9e5ufloat:{channels:"rgb",packed:!0,render:Jt},rg11b10ufloat:{channels:"rgb",bitsPerChannel:[11,11,10,0],packed:!0,p:1,render:pe},rgb10a2unorm:{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1},rgb10a2uint:{channels:"rgba",bitsPerChannel:[10,10,10,2],packed:!0,p:1},stencil8:{attachment:"stencil",bitsPerChannel:[8,0,0,0],dataType:"uint8"},depth16unorm:{attachment:"depth",bitsPerChannel:[16,0,0,0],dataType:"uint16"},depth24plus:{attachment:"depth",bitsPerChannel:[24,0,0,0],dataType:"uint32"},depth32float:{attachment:"depth",bitsPerChannel:[32,0,0,0],dataType:"float32"},"depth24plus-stencil8":{attachment:"depth-stencil",bitsPerChannel:[24,8,0,0],packed:!0},"depth32float-stencil8":{attachment:"depth-stencil",bitsPerChannel:[32,8,0,0],packed:!0}},Zt={"bc1-rgb-unorm-webgl":{f:b},"bc1-rgb-unorm-srgb-webgl":{f:b},"bc1-rgba-unorm":{f:b},"bc1-rgba-unorm-srgb":{f:b},"bc2-rgba-unorm":{f:b},"bc2-rgba-unorm-srgb":{f:b},"bc3-rgba-unorm":{f:b},"bc3-rgba-unorm-srgb":{f:b},"bc4-r-unorm":{f:b},"bc4-r-snorm":{f:b},"bc5-rg-unorm":{f:b},"bc5-rg-snorm":{f:b},"bc6h-rgb-ufloat":{f:b},"bc6h-rgb-float":{f:b},"bc7-rgba-unorm":{f:b},"bc7-rgba-unorm-srgb":{f:b},"etc2-rgb8unorm":{f:y},"etc2-rgb8unorm-srgb":{f:y},"etc2-rgb8a1unorm":{f:y},"etc2-rgb8a1unorm-srgb":{f:y},"etc2-rgba8unorm":{f:y},"etc2-rgba8unorm-srgb":{f:y},"eac-r11unorm":{f:y},"eac-r11snorm":{f:y},"eac-rg11unorm":{f:y},"eac-rg11snorm":{f:y},"astc-4x4-unorm":{f:m},"astc-4x4-unorm-srgb":{f:m},"astc-5x4-unorm":{f:m},"astc-5x4-unorm-srgb":{f:m},"astc-5x5-unorm":{f:m},"astc-5x5-unorm-srgb":{f:m},"astc-6x5-unorm":{f:m},"astc-6x5-unorm-srgb":{f:m},"astc-6x6-unorm":{f:m},"astc-6x6-unorm-srgb":{f:m},"astc-8x5-unorm":{f:m},"astc-8x5-unorm-srgb":{f:m},"astc-8x6-unorm":{f:m},"astc-8x6-unorm-srgb":{f:m},"astc-8x8-unorm":{f:m},"astc-8x8-unorm-srgb":{f:m},"astc-10x5-unorm":{f:m},"astc-10x5-unorm-srgb":{f:m},"astc-10x6-unorm":{f:m},"astc-10x6-unorm-srgb":{f:m},"astc-10x8-unorm":{f:m},"astc-10x8-unorm-srgb":{f:m},"astc-10x10-unorm":{f:m},"astc-10x10-unorm-srgb":{f:m},"astc-12x10-unorm":{f:m},"astc-12x10-unorm-srgb":{f:m},"astc-12x12-unorm":{f:m},"astc-12x12-unorm-srgb":{f:m},"pvrtc-rgb4unorm-webgl":{f:he},"pvrtc-rgba4unorm-webgl":{f:he},"pvrtc-rbg2unorm-webgl":{f:he},"pvrtc-rgba2unorm-webgl":{f:he},"etc1-rbg-unorm-webgl":{f:Kt},"atc-rgb-unorm-webgl":{f:Be},"atc-rgba-unorm-webgl":{f:Be},"atc-rgbai-unorm-webgl":{f:Be}},gt={...Qt,...Zt};var er=["bc1","bc2","bc3","bc4","bc5","bc6","bc7","etc1","etc2","eac","atc","astc","pvrtc"],tr=/^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/,j=class{getInfo(e){return bt(e)}isColor(e){return e.startsWith("rgba")||e.startsWith("bgra")||e.startsWith("rgb")}isDepthStencil(e){return e.startsWith("depth")||e.startsWith("stencil")}isCompressed(e){return er.some(t=>e.startsWith(t))}getCapabilities(e){let t=O(e),i={format:e,create:t.f??!0,render:t.render??!0,filter:t.filter??!0,blend:t.blend??!0,store:t.store??!0},n=bt(e),s=e.startsWith("depth")||e.startsWith("stencil"),o=n?.signed,c=n?.integer,f=n?.webgl;return i.render&&=!o,i.filter&&=!s&&!o&&!c&&!f,i}},_=new j;function bt(r){let e=rr(r);if(_.isCompressed(r)){e.channels="rgb",e.components=3,e.bytesPerPixel=1,e.srgb=!1,e.compressed=!0;let i=ir(r);i&&(e.blockWidth=i.blockWidth,e.blockHeight=i.blockHeight)}let t=tr.exec(r);if(t){let[,i,n,s,o,c]=t,f=`${s}${n}`,d=F(f),p=d.byteLength*8,L=i.length,Bt=[p,L>=2?p:0,L>=3?p:0,L>=4?p:0];e={format:r,attachment:e.attachment,dataType:d.signedType,components:L,channels:i,integer:d.integer,signed:d.signed,normalized:d.normalized,bitsPerChannel:Bt,bytesPerPixel:d.byteLength*i.length,packed:e.packed,srgb:e.srgb},c==="-webgl"&&(e.webgl=!0),o==="-srgb"&&(e.srgb=!0)}return r.endsWith("-webgl")&&(e.webgl=!0),r.endsWith("-srgb")&&(e.srgb=!0),e}function rr(r){let e=O(r),t=e.bytesPerPixel||1,i=e.bitsPerChannel||[8,8,8,8];return delete e.bitsPerChannel,delete e.bytesPerPixel,delete e.f,delete e.render,delete e.filter,delete e.blend,delete e.store,{...e,format:r,attachment:e.attachment||"color",channels:e.channels||"r",components:e.components||e.channels?.length||1,bytesPerPixel:t,bitsPerChannel:i,dataType:e.dataType||"uint8",srgb:e.srgb??!1,packed:e.packed??!1,webgl:e.webgl??!1,integer:e.integer??!1,signed:e.signed??!1,normalized:e.normalized??!1,compressed:e.compressed??!1}}function ir(r){let t=/.*-(\d+)x(\d+)-.*/.exec(r);if(t){let[,i,n]=t;return{blockWidth:Number(i),blockHeight:Number(n)}}return null}function xt(r){return typeof ImageData<"u"&&r instanceof ImageData||typeof ImageBitmap<"u"&&r instanceof ImageBitmap||typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement||typeof HTMLVideoElement<"u"&&r instanceof HTMLVideoElement||typeof VideoFrame<"u"&&r instanceof VideoFrame||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas}function yt(r){if(typeof ImageData<"u"&&r instanceof ImageData||typeof ImageBitmap<"u"&&r instanceof ImageBitmap||typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas)return{width:r.width,height:r.height};if(typeof HTMLImageElement<"u"&&r instanceof HTMLImageElement)return{width:r.naturalWidth,height:r.naturalHeight};if(typeof HTMLVideoElement<"u"&&r instanceof HTMLVideoElement)return{width:r.videoWidth,height:r.videoHeight};if(typeof VideoFrame<"u"&&r instanceof VideoFrame)return{width:r.displayWidth,height:r.displayHeight};throw new Error("Unknown image type")}var be=class{},xe=class{features;disabledFeatures;constructor(e=[],t){this.features=new Set(e),this.disabledFeatures=t||{}}*[Symbol.iterator](){yield*this.features}has(e){return!this.disabledFeatures?.[e]&&this.features.has(e)}},$e=class{get[Symbol.toStringTag](){return"Device"}toString(){return`Device(${this.id})`}id;props;userData={};statsManager=ae;timestamp=0;_reused=!1;_lumaData={};_textureCaps={};constructor(e){this.props={...$e.defaultProps,...e},this.id=this.props.id||S(this[Symbol.toStringTag].toLowerCase())}getVertexFormatInfo(e){return E(e)}isVertexFormatSupported(e){return!0}getTextureFormatInfo(e){return _.getInfo(e)}getTextureFormatCapabilities(e){let t=this._textureCaps[e];if(!t){let i=this._getDeviceTextureFormatCapabilities(e);t=this._getDeviceSpecificTextureFormatCapabilities(i),this._textureCaps[e]=t}return t}getMipLevelCount(e,t,i=1){let n=Math.max(e,t,i);return 1+Math.floor(Math.log2(n))}isExternalImage(e){return xt(e)}getExternalImageSize(e){return yt(e)}isTextureFormatSupported(e){return this.getTextureFormatCapabilities(e).create}isTextureFormatFilterable(e){return this.getTextureFormatCapabilities(e).filter}isTextureFormatRenderable(e){return this.getTextureFormatCapabilities(e).render}isTextureFormatCompressed(e){return _.isCompressed(e)}pushDebugGroup(e){this.commandEncoder.pushDebugGroup(e)}popDebugGroup(){this.commandEncoder?.popDebugGroup()}insertDebugMarker(e){this.commandEncoder?.insertDebugMarker(e)}loseDevice(){return!1}incrementTimestamp(){return this.timestamp++}reportError(e,t,...i){return this.props.onError(e,t)?()=>{}:l.error(e.message,t,...i)}debug(){if(this.props.debug)debugger;else{let e=`'Type luma.log.set({debug: true}) in console to enable debug breakpoints',
8
- or create a device with the 'debug: true' prop.`;l.once(0,e)()}}getDefaultCanvasContext(){if(!this.canvasContext)throw new Error("Device has no default CanvasContext. See props.createCanvasContext");return this.canvasContext}beginRenderPass(e){return this.commandEncoder.beginRenderPass(e)}beginComputePass(e){return this.commandEncoder.beginComputePass(e)}getCanvasContext(){return this.getDefaultCanvasContext()}readPixelsToArrayWebGL(e,t){throw new Error("not implemented")}readPixelsToBufferWebGL(e,t){throw new Error("not implemented")}setParametersWebGL(e){throw new Error("not implemented")}getParametersWebGL(e){throw new Error("not implemented")}withParametersWebGL(e,t){throw new Error("not implemented")}clearWebGL(e){throw new Error("not implemented")}resetWebGL(){throw new Error("not implemented")}static _getCanvasContextProps(e){return e.createCanvasContext===!0?{}:e.createCanvasContext}_getDeviceTextureFormatCapabilities(e){let t=_.getCapabilities(e),i=s=>(typeof s=="string"?this.features.has(s):s)??!0,n=i(t.create);return{format:e,create:n,render:n&&i(t.render),filter:n&&i(t.filter),blend:n&&i(t.blend),store:n&&i(t.store)}}_normalizeBufferProps(e){(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});let t={...e};if((e.usage||0)&h.INDEX&&(e.indexType||(e.data instanceof Uint32Array?t.indexType="uint32":e.data instanceof Uint16Array&&(t.indexType="uint16")),!t.indexType))throw new Error("indices buffer content must be of type uint16 or uint32");return t}},C=$e;a(C,"defaultProps",{id:null,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,createCanvasContext:void 0,webgl:{},onError:(e,t)=>{},onResize:(e,t)=>{let[i,n]=e.getDevicePixelSize();l.log(1,`${e} resized => ${i}x${n}px`)()},onPositionChange:(e,t)=>{let[i,n]=e.getPosition();l.log(1,`${e} repositioned => ${i},${n}`)()},onVisibilityChange:e=>l.log(1,`${e} Visibility changed ${e.isVisible}`)(),onDevicePixelRatioChange:(e,t)=>l.log(1,`${e} DPR changed ${t.oldRatio} => ${e.devicePixelRatio}`)(),debug:l.get("debug")||void 0,debugShaders:l.get("debug-shaders")||void 0,debugFramebuffers:Boolean(l.get("debug-framebuffers")),debugFactories:Boolean(l.get("debug-factories")),debugWebGL:Boolean(l.get("debug-webgl")),debugSpectorJS:void 0,debugSpectorJSUrl:void 0,_reuseDevices:!1,_requestMaxLimits:!0,_cacheShaders:!1,_cachePipelines:!1,_cacheDestroyPolicy:"unused",_initializeFeatures:!0,_disabledFeatures:{"compilation-status-async-webgl":!0},_handle:void 0});var nr="set luma.log.level=1 (or higher) to trace rendering",wt="No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.",we=class{stats=ae;log=l;VERSION="9.2.0-alpha.6";spector;preregisteredAdapters=new Map;constructor(){if(globalThis.luma){if(globalThis.luma.VERSION!==this.VERSION)throw l.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)(),l.error("'yarn why @luma.gl/core' can help identify the source of the conflict")(),new Error("luma.gl - multiple versions detected: see console log");l.error("This version of luma.gl has already been initialized")()}l.log(1,`${this.VERSION} - ${nr}`)(),globalThis.luma=this}async createDevice(e={}){let t={...we.defaultProps,...e},i=this.selectAdapter(t.type,t.adapters);if(!i)throw new Error(wt);return t.waitForPageLoad&&await i.pageLoaded,await i.create(t)}async attachDevice(e,t){let i=this._getTypeFromHandle(e,t.adapters),n=i&&this.selectAdapter(i,t.adapters);if(!n)throw new Error(wt);return await n?.attach?.(e,t)}registerAdapters(e){for(let t of e)this.preregisteredAdapters.set(t.type,t)}getSupportedAdapters(e=[]){let t=this._getAdapterMap(e);return Array.from(t).map(([,i])=>i).filter(i=>i.isSupported?.()).map(i=>i.type)}getBestAvailableAdapterType(e=[]){let t=["webgpu","webgl","null"],i=this._getAdapterMap(e);for(let n of t)if(i.get(n)?.isSupported?.())return n;return null}selectAdapter(e,t=[]){let i=e;e==="best-available"&&(i=this.getBestAvailableAdapterType(t));let n=this._getAdapterMap(t);return i&&n.get(i)||null}enforceWebGL2(e=!0,t=[]){let n=this._getAdapterMap(t).get("webgl");n||l.warn("enforceWebGL2: webgl adapter not found")(),n?.enforceWebGL2?.(e)}setDefaultDeviceProps(e){Object.assign(we.defaultProps,e)}_getAdapterMap(e=[]){let t=new Map(this.preregisteredAdapters);for(let i of e)t.set(i.type,i);return t}_getTypeFromHandle(e,t=[]){return e instanceof WebGL2RenderingContext?"webgl":typeof GPUDevice<"u"&&e instanceof GPUDevice||e?.queue?"webgpu":e===null?"null":(e instanceof WebGLRenderingContext?l.warn("WebGL1 is not supported",e)():l.warn("Unknown handle type",e)(),null)}},ye=we;a(ye,"defaultProps",{...C.defaultProps,type:"best-available",adapters:void 0,waitForPageLoad:!0});var vt=new ye;var Se=class{get pageLoaded(){return ar()}},sr=x()&&typeof document<"u",or=()=>sr&&document.readyState==="complete",ve=null;function ar(){return ve||(or()||typeof window>"u"?ve=Promise.resolve():ve=new Promise(r=>window.addEventListener("load",()=>r()))),ve}function St(){let r,e;return{promise:new Promise((i,n)=>{r=i,e=n}),resolve:r,reject:e}}var z=class{static isHTMLCanvas(e){return typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement}static isOffscreenCanvas(e){return typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas}id;props;canvas;htmlCanvas;offscreenCanvas;type;initialized;isInitialized=!1;isVisible=!0;cssWidth;cssHeight;devicePixelRatio;devicePixelWidth;devicePixelHeight;drawingBufferWidth;drawingBufferHeight;_initializedResolvers=St();_resizeObserver;_intersectionObserver;_position;destroyed=!1;toString(){return`${this[Symbol.toStringTag]}(${this.id})`}constructor(e){if(this.props={...z.defaultProps,...e},e=this.props,this.initialized=this._initializedResolvers.promise,x()?e.canvas?typeof e.canvas=="string"?this.canvas=ur(e.canvas):this.canvas=e.canvas:this.canvas=fr(e):this.canvas={width:e.width||1,height:e.height||1},z.isHTMLCanvas(this.canvas)?(this.id=e.id||this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):z.isOffscreenCanvas(this.canvas)?(this.id=e.id||"offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas):(this.id=e.id||"node-canvas-context",this.type="node"),this.cssWidth=this.htmlCanvas?.clientWidth||this.canvas.width,this.cssHeight=this.htmlCanvas?.clientHeight||this.canvas.height,this.devicePixelWidth=this.canvas.width,this.devicePixelHeight=this.canvas.height,this.drawingBufferWidth=this.canvas.width,this.drawingBufferHeight=this.canvas.height,this.devicePixelRatio=globalThis.devicePixelRatio||1,this._position=[0,0],z.isHTMLCanvas(this.canvas)){this._intersectionObserver=new IntersectionObserver(t=>this._handleIntersection(t)),this._intersectionObserver.observe(this.canvas),this._resizeObserver=new ResizeObserver(t=>this._handleResize(t));try{this._resizeObserver.observe(this.canvas,{box:"device-pixel-content-box"})}catch{this._resizeObserver.observe(this.canvas,{box:"content-box"})}setTimeout(()=>this._observeDevicePixelRatio(),0),this.props.trackPosition&&this._trackPosition()}}destroy(){this.destroyed=!0}setProps(e){return"useDevicePixels"in e&&(this.props.useDevicePixels=e.useDevicePixels||!1,this._updateDrawingBufferSize()),this}getCSSSize(){return[this.cssWidth,this.cssHeight]}getPosition(){return this._position}getDevicePixelSize(){return[this.devicePixelWidth,this.devicePixelHeight]}getDrawingBufferSize(){return[this.drawingBufferWidth,this.drawingBufferHeight]}getMaxDrawingBufferSize(){let e=this.device.limits.maxTextureDimension2D;return[e,e]}setDrawingBufferSize(e,t){this.canvas.width=e,this.canvas.height=t,this.drawingBufferWidth=e,this.drawingBufferHeight=t}getDevicePixelRatio(){return typeof window<"u"&&window.devicePixelRatio||1}cssToDevicePixels(e,t=!0){let i=this.cssToDeviceRatio(),[n,s]=this.getDrawingBufferSize();return lr(e,i,n,s,t)}getPixelSize(){return this.getDevicePixelSize()}getAspect(){let[e,t]=this.getDevicePixelSize();return e/t}cssToDeviceRatio(){try{let[e]=this.getDrawingBufferSize(),[t]=this.getCSSSize();return t?e/t:1}catch{return 1}}resize(e){this.setDrawingBufferSize(e.width,e.height)}_setAutoCreatedCanvasId(e){this.htmlCanvas?.id==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}_handleIntersection(e){let t=e.find(n=>n.target===this.canvas);if(!t)return;let i=t.isIntersecting;this.isVisible!==i&&(this.isVisible=i,this.device.props.onVisibilityChange(this))}_handleResize(e){let t=e.find(f=>f.target===this.canvas);if(!t)return;this.cssWidth=t.contentBoxSize[0].inlineSize,this.cssHeight=t.contentBoxSize[0].blockSize;let i=this.getDevicePixelSize(),n=t.devicePixelContentBoxSize?.[0].inlineSize||t.contentBoxSize[0].inlineSize*devicePixelRatio,s=t.devicePixelContentBoxSize?.[0].blockSize||t.contentBoxSize[0].blockSize*devicePixelRatio,[o,c]=this.getMaxDrawingBufferSize();this.devicePixelWidth=Math.max(1,Math.min(n,o)),this.devicePixelHeight=Math.max(1,Math.min(s,c)),this._updateDrawingBufferSize(),this.device.props.onResize(this,{oldPixelSize:i})}_updateDrawingBufferSize(){if(this.props.autoResize){if(typeof this.props.useDevicePixels=="number"){let e=this.props.useDevicePixels;this.setDrawingBufferSize(this.cssWidth*e,this.cssHeight*e)}else this.props.useDevicePixels?this.setDrawingBufferSize(this.devicePixelWidth,this.devicePixelHeight):this.setDrawingBufferSize(this.cssWidth,this.cssHeight);this._updateDevice()}this._initializedResolvers.resolve(),this.isInitialized=!0,this.updatePosition()}_observeDevicePixelRatio(){let e=this.devicePixelRatio;this.devicePixelRatio=window.devicePixelRatio,this.updatePosition(),this.device.props.onDevicePixelRatioChange(this,{oldRatio:e}),matchMedia(`(resolution: ${this.devicePixelRatio}dppx)`).addEventListener("change",()=>this._observeDevicePixelRatio(),{once:!0})}_trackPosition(e=100){let t=setInterval(()=>{this.destroyed?clearInterval(t):this.updatePosition()},e)}updatePosition(){let e=this.htmlCanvas?.getBoundingClientRect();if(e){let t=[e.left,e.top];if(this._position??=t,t[0]!==this._position[0]||t[1]!==this._position[1]){let n=this._position;this._position=t,this.device.props.onPositionChange?.(this,{oldPosition:n})}}}},$=z;a($,"defaultProps",{id:void 0,canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,alphaMode:"opaque",colorSpace:"srgb",trackPosition:!1});function cr(r){if(typeof r=="string"){let e=document.getElementById(r);if(!e)throw new Error(`${r} is not an HTML element`);return e}return r||document.body}function ur(r){let e=document.getElementById(r);if(!$.isHTMLCanvas(e))throw new Error("Object is not a canvas element");return e}function fr(r){let{width:e,height:t}=r,i=document.createElement("canvas");i.id=S("lumagl-auto-created-canvas"),i.width=e||1,i.height=t||1,i.style.width=Number.isFinite(e)?`${e}px`:"100%",i.style.height=Number.isFinite(t)?`${t}px`:"100%",r?.visible||(i.style.visibility="hidden");let n=cr(r?.container||null);return n.insertBefore(i,n.firstChild),i}function lr(r,e,t,i,n){let s=r,o=Tt(s[0],e,t),c=Pt(s[1],e,i,n),f=Tt(s[0]+1,e,t),d=f===t-1?f:f-1;f=Pt(s[1]+1,e,i,n);let p;return n?(f=f===0?f:f+1,p=c,c=f):p=f===i-1?f:f-1,{x:o,y:c,width:Math.max(d-o+1,1),height:Math.max(p-c+1,1)}}function Tt(r,e,t){return Math.min(Math.round(r*e),t-1)}function Pt(r,e,t,i){return i?Math.max(0,t-1-Math.round(r*e)):Math.min(Math.round(r*e),t-1)}var Te=class extends u{get[Symbol.toStringTag](){return"Sampler"}constructor(e,t){t=Te.normalizeProps(e,t),super(e,t,Te.defaultProps)}static normalizeProps(e,t){return t}},I=Te;a(I,"defaultProps",{...u.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"none",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});var mr={"1d":"1d","2d":"2d","2d-array":"2d",cube:"2d","cube-array":"2d","3d":"3d"},w=class extends u{dimension;baseDimension;format;width;height;depth;mipLevels;updateTimestamp;get[Symbol.toStringTag](){return"Texture"}toString(){return`Texture(${this.id},${this.format},${this.width}x${this.height})`}constructor(e,t){if(t=w.normalizeProps(e,t),super(e,t,w.defaultProps),this.dimension=this.props.dimension,this.baseDimension=mr[this.dimension],this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.mipLevels=this.props.mipLevels,this.props.width===void 0||this.props.height===void 0)if(e.isExternalImage(t.data)){let i=e.getExternalImageSize(t.data);this.width=i?.width||1,this.height=i?.height||1}else this.width=1,this.height=1,(this.props.width===void 0||this.props.height===void 0)&&l.warn(`${this} created with undefined width or height. This is deprecated. Use AsyncTexture instead.`)();this.updateTimestamp=e.incrementTimestamp()}setSampler(e){this.sampler=e instanceof I?e:this.device.createSampler(e)}clone(e){return this.device.createTexture({...this.props,...e})}static normalizeProps(e,t){let i={...t},{width:n,height:s}=i;return typeof n=="number"&&(i.width=Math.max(1,Math.ceil(n))),typeof s=="number"&&(i.height=Math.max(1,Math.ceil(s))),i}_initializeData(e){this.device.isExternalImage(e)?this.copyExternalImage({image:e,width:this.width,height:this.height,depth:this.depth,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1,flipY:!1}):e&&this.copyImageData({data:e,mipLevel:0,x:0,y:0,z:0,aspect:"all"})}_normalizeCopyImageDataOptions(e){let{width:t,height:i,depth:n}=this,s={...w.defaultCopyDataOptions,width:t,height:i,depth:n,...e},o=this.device.getTextureFormatInfo(this.format);if(!e.bytesPerRow&&!o.bytesPerPixel)throw new Error(`bytesPerRow must be provided for texture format ${this.format}`);return s.bytesPerRow=e.bytesPerRow||t*(o.bytesPerPixel||4),s.rowsPerImage=e.rowsPerImage||i,s}_normalizeCopyExternalImageOptions(e){let t=this.device.getExternalImageSize(e.image),i={...w.defaultCopyExternalImageOptions,...t,...e};return i.width=Math.min(i.width,this.width-i.x),i.height=Math.min(i.height,this.height-i.y),i}},g=w;a(g,"SAMPLE",4),a(g,"STORAGE",8),a(g,"RENDER",16),a(g,"COPY_SRC",1),a(g,"COPY_DST",2),a(g,"TEXTURE",4),a(g,"RENDER_ATTACHMENT",16),a(g,"defaultProps",{...u.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",usage:w.TEXTURE|w.RENDER_ATTACHMENT|w.COPY_DST,width:void 0,height:void 0,depth:1,mipLevels:1,samples:void 0,sampler:{},view:void 0}),a(g,"defaultCopyDataOptions",{data:void 0,byteOffset:0,bytesPerRow:void 0,rowsPerImage:void 0,mipLevel:0,x:0,y:0,z:0,aspect:"all"}),a(g,"defaultCopyExternalImageOptions",{image:void 0,sourceX:0,sourceY:0,width:void 0,height:void 0,depth:1,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1,flipY:!1});var Ue=class extends u{get[Symbol.toStringTag](){return"TextureView"}constructor(e,t){super(e,t,Ue.defaultProps)}},Y=Ue;a(Y,"defaultProps",{...u.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0});var He=class extends u{get[Symbol.toStringTag](){return"ExternalTexture"}constructor(e,t){super(e,t,He.defaultProps)}},X=He;a(X,"defaultProps",{...u.defaultProps,source:void 0,colorSpace:"srgb"});function At(r,e,t){let i="",n=e.split(/\r?\n/),s=r.slice().sort((o,c)=>o.lineNum-c.lineNum);switch(t?.showSourceCode||"no"){case"all":let o=0;for(let c=1;c<=n.length;c++)for(i+=Et(n[c-1],c,t);s.length>o&&s[o].lineNum===c;){let f=s[o++];i+=Ne(f,n,f.lineNum,{...t,inlineSource:!1})}for(;s.length>o;){let c=s[o++];i+=Ne(c,[],0,{...t,inlineSource:!1})}return i;case"issues":case"no":for(let c of r)i+=Ne(c,n,c.lineNum,{inlineSource:t?.showSourceCode!=="no"});return i}}function Ne(r,e,t,i){if(i?.inlineSource){let s=dr(e,t),o=r.linePos>0?`${" ".repeat(r.linePos+5)}^^^
8
+ or create a device with the 'debug: true' prop.`;l.once(0,e)()}}getDefaultCanvasContext(){if(!this.canvasContext)throw new Error("Device has no default CanvasContext. See props.createCanvasContext");return this.canvasContext}beginRenderPass(e){return this.commandEncoder.beginRenderPass(e)}beginComputePass(e){return this.commandEncoder.beginComputePass(e)}getCanvasContext(){return this.getDefaultCanvasContext()}readPixelsToArrayWebGL(e,t){throw new Error("not implemented")}readPixelsToBufferWebGL(e,t){throw new Error("not implemented")}setParametersWebGL(e){throw new Error("not implemented")}getParametersWebGL(e){throw new Error("not implemented")}withParametersWebGL(e,t){throw new Error("not implemented")}clearWebGL(e){throw new Error("not implemented")}resetWebGL(){throw new Error("not implemented")}static _getCanvasContextProps(e){return e.createCanvasContext===!0?{}:e.createCanvasContext}_getDeviceTextureFormatCapabilities(e){let t=_.getCapabilities(e),i=s=>(typeof s=="string"?this.features.has(s):s)??!0,n=i(t.create);return{format:e,create:n,render:n&&i(t.render),filter:n&&i(t.filter),blend:n&&i(t.blend),store:n&&i(t.store)}}_normalizeBufferProps(e){(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e={data:e});let t={...e};if((e.usage||0)&h.INDEX&&(e.indexType||(e.data instanceof Uint32Array?t.indexType="uint32":e.data instanceof Uint16Array&&(t.indexType="uint16")),!t.indexType))throw new Error("indices buffer content must be of type uint16 or uint32");return t}},C=$e;a(C,"defaultProps",{id:null,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,createCanvasContext:void 0,webgl:{},onError:(e,t)=>{},onResize:(e,t)=>{let[i,n]=e.getDevicePixelSize();l.log(1,`${e} resized => ${i}x${n}px`)()},onPositionChange:(e,t)=>{let[i,n]=e.getPosition();l.log(1,`${e} repositioned => ${i},${n}`)()},onVisibilityChange:e=>l.log(1,`${e} Visibility changed ${e.isVisible}`)(),onDevicePixelRatioChange:(e,t)=>l.log(1,`${e} DPR changed ${t.oldRatio} => ${e.devicePixelRatio}`)(),debug:l.get("debug")||void 0,debugShaders:l.get("debug-shaders")||void 0,debugFramebuffers:Boolean(l.get("debug-framebuffers")),debugFactories:Boolean(l.get("debug-factories")),debugWebGL:Boolean(l.get("debug-webgl")),debugSpectorJS:void 0,debugSpectorJSUrl:void 0,_reuseDevices:!1,_requestMaxLimits:!0,_cacheShaders:!1,_cachePipelines:!1,_cacheDestroyPolicy:"unused",_initializeFeatures:!0,_disabledFeatures:{"compilation-status-async-webgl":!0},_handle:void 0});var nr="set luma.log.level=1 (or higher) to trace rendering",wt="No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.",we=class{stats=ae;log=l;VERSION="9.2.0-beta.2";spector;preregisteredAdapters=new Map;constructor(){if(globalThis.luma){if(globalThis.luma.VERSION!==this.VERSION)throw l.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)(),l.error("'yarn why @luma.gl/core' can help identify the source of the conflict")(),new Error("luma.gl - multiple versions detected: see console log");l.error("This version of luma.gl has already been initialized")()}l.log(1,`${this.VERSION} - ${nr}`)(),globalThis.luma=this}async createDevice(e={}){let t={...we.defaultProps,...e},i=this.selectAdapter(t.type,t.adapters);if(!i)throw new Error(wt);return t.waitForPageLoad&&await i.pageLoaded,await i.create(t)}async attachDevice(e,t){let i=this._getTypeFromHandle(e,t.adapters),n=i&&this.selectAdapter(i,t.adapters);if(!n)throw new Error(wt);return await n?.attach?.(e,t)}registerAdapters(e){for(let t of e)this.preregisteredAdapters.set(t.type,t)}getSupportedAdapters(e=[]){let t=this._getAdapterMap(e);return Array.from(t).map(([,i])=>i).filter(i=>i.isSupported?.()).map(i=>i.type)}getBestAvailableAdapterType(e=[]){let t=["webgpu","webgl","null"],i=this._getAdapterMap(e);for(let n of t)if(i.get(n)?.isSupported?.())return n;return null}selectAdapter(e,t=[]){let i=e;e==="best-available"&&(i=this.getBestAvailableAdapterType(t));let n=this._getAdapterMap(t);return i&&n.get(i)||null}enforceWebGL2(e=!0,t=[]){let n=this._getAdapterMap(t).get("webgl");n||l.warn("enforceWebGL2: webgl adapter not found")(),n?.enforceWebGL2?.(e)}setDefaultDeviceProps(e){Object.assign(we.defaultProps,e)}_getAdapterMap(e=[]){let t=new Map(this.preregisteredAdapters);for(let i of e)t.set(i.type,i);return t}_getTypeFromHandle(e,t=[]){return e instanceof WebGL2RenderingContext?"webgl":typeof GPUDevice<"u"&&e instanceof GPUDevice||e?.queue?"webgpu":e===null?"null":(e instanceof WebGLRenderingContext?l.warn("WebGL1 is not supported",e)():l.warn("Unknown handle type",e)(),null)}},ye=we;a(ye,"defaultProps",{...C.defaultProps,type:"best-available",adapters:void 0,waitForPageLoad:!0});var vt=new ye;var Se=class{get pageLoaded(){return ar()}},sr=x()&&typeof document<"u",or=()=>sr&&document.readyState==="complete",ve=null;function ar(){return ve||(or()||typeof window>"u"?ve=Promise.resolve():ve=new Promise(r=>window.addEventListener("load",()=>r()))),ve}function St(){let r,e;return{promise:new Promise((i,n)=>{r=i,e=n}),resolve:r,reject:e}}var z=class{static isHTMLCanvas(e){return typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement}static isOffscreenCanvas(e){return typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas}id;props;canvas;htmlCanvas;offscreenCanvas;type;initialized;isInitialized=!1;isVisible=!0;cssWidth;cssHeight;devicePixelRatio;devicePixelWidth;devicePixelHeight;drawingBufferWidth;drawingBufferHeight;_initializedResolvers=St();_resizeObserver;_intersectionObserver;_position;destroyed=!1;toString(){return`${this[Symbol.toStringTag]}(${this.id})`}constructor(e){if(this.props={...z.defaultProps,...e},e=this.props,this.initialized=this._initializedResolvers.promise,x()?e.canvas?typeof e.canvas=="string"?this.canvas=ur(e.canvas):this.canvas=e.canvas:this.canvas=fr(e):this.canvas={width:e.width||1,height:e.height||1},z.isHTMLCanvas(this.canvas)?(this.id=e.id||this.canvas.id,this.type="html-canvas",this.htmlCanvas=this.canvas):z.isOffscreenCanvas(this.canvas)?(this.id=e.id||"offscreen-canvas",this.type="offscreen-canvas",this.offscreenCanvas=this.canvas):(this.id=e.id||"node-canvas-context",this.type="node"),this.cssWidth=this.htmlCanvas?.clientWidth||this.canvas.width,this.cssHeight=this.htmlCanvas?.clientHeight||this.canvas.height,this.devicePixelWidth=this.canvas.width,this.devicePixelHeight=this.canvas.height,this.drawingBufferWidth=this.canvas.width,this.drawingBufferHeight=this.canvas.height,this.devicePixelRatio=globalThis.devicePixelRatio||1,this._position=[0,0],z.isHTMLCanvas(this.canvas)){this._intersectionObserver=new IntersectionObserver(t=>this._handleIntersection(t)),this._intersectionObserver.observe(this.canvas),this._resizeObserver=new ResizeObserver(t=>this._handleResize(t));try{this._resizeObserver.observe(this.canvas,{box:"device-pixel-content-box"})}catch{this._resizeObserver.observe(this.canvas,{box:"content-box"})}setTimeout(()=>this._observeDevicePixelRatio(),0),this.props.trackPosition&&this._trackPosition()}}destroy(){this.destroyed=!0}setProps(e){return"useDevicePixels"in e&&(this.props.useDevicePixels=e.useDevicePixels||!1,this._updateDrawingBufferSize()),this}getCSSSize(){return[this.cssWidth,this.cssHeight]}getPosition(){return this._position}getDevicePixelSize(){return[this.devicePixelWidth,this.devicePixelHeight]}getDrawingBufferSize(){return[this.drawingBufferWidth,this.drawingBufferHeight]}getMaxDrawingBufferSize(){let e=this.device.limits.maxTextureDimension2D;return[e,e]}setDrawingBufferSize(e,t){this.canvas.width=e,this.canvas.height=t,this.drawingBufferWidth=e,this.drawingBufferHeight=t}getDevicePixelRatio(){return typeof window<"u"&&window.devicePixelRatio||1}cssToDevicePixels(e,t=!0){let i=this.cssToDeviceRatio(),[n,s]=this.getDrawingBufferSize();return lr(e,i,n,s,t)}getPixelSize(){return this.getDevicePixelSize()}getAspect(){let[e,t]=this.getDevicePixelSize();return e/t}cssToDeviceRatio(){try{let[e]=this.getDrawingBufferSize(),[t]=this.getCSSSize();return t?e/t:1}catch{return 1}}resize(e){this.setDrawingBufferSize(e.width,e.height)}_setAutoCreatedCanvasId(e){this.htmlCanvas?.id==="lumagl-auto-created-canvas"&&(this.htmlCanvas.id=e)}_handleIntersection(e){let t=e.find(n=>n.target===this.canvas);if(!t)return;let i=t.isIntersecting;this.isVisible!==i&&(this.isVisible=i,this.device.props.onVisibilityChange(this))}_handleResize(e){let t=e.find(f=>f.target===this.canvas);if(!t)return;this.cssWidth=t.contentBoxSize[0].inlineSize,this.cssHeight=t.contentBoxSize[0].blockSize;let i=this.getDevicePixelSize(),n=t.devicePixelContentBoxSize?.[0].inlineSize||t.contentBoxSize[0].inlineSize*devicePixelRatio,s=t.devicePixelContentBoxSize?.[0].blockSize||t.contentBoxSize[0].blockSize*devicePixelRatio,[o,c]=this.getMaxDrawingBufferSize();this.devicePixelWidth=Math.max(1,Math.min(n,o)),this.devicePixelHeight=Math.max(1,Math.min(s,c)),this._updateDrawingBufferSize(),this.device.props.onResize(this,{oldPixelSize:i})}_updateDrawingBufferSize(){if(this.props.autoResize){if(typeof this.props.useDevicePixels=="number"){let e=this.props.useDevicePixels;this.setDrawingBufferSize(this.cssWidth*e,this.cssHeight*e)}else this.props.useDevicePixels?this.setDrawingBufferSize(this.devicePixelWidth,this.devicePixelHeight):this.setDrawingBufferSize(this.cssWidth,this.cssHeight);this._updateDevice()}this._initializedResolvers.resolve(),this.isInitialized=!0,this.updatePosition()}_observeDevicePixelRatio(){let e=this.devicePixelRatio;this.devicePixelRatio=window.devicePixelRatio,this.updatePosition(),this.device.props.onDevicePixelRatioChange(this,{oldRatio:e}),matchMedia(`(resolution: ${this.devicePixelRatio}dppx)`).addEventListener("change",()=>this._observeDevicePixelRatio(),{once:!0})}_trackPosition(e=100){let t=setInterval(()=>{this.destroyed?clearInterval(t):this.updatePosition()},e)}updatePosition(){let e=this.htmlCanvas?.getBoundingClientRect();if(e){let t=[e.left,e.top];if(this._position??=t,t[0]!==this._position[0]||t[1]!==this._position[1]){let n=this._position;this._position=t,this.device.props.onPositionChange?.(this,{oldPosition:n})}}}},$=z;a($,"defaultProps",{id:void 0,canvas:null,width:800,height:600,useDevicePixels:!0,autoResize:!0,container:null,visible:!0,alphaMode:"opaque",colorSpace:"srgb",trackPosition:!1});function cr(r){if(typeof r=="string"){let e=document.getElementById(r);if(!e)throw new Error(`${r} is not an HTML element`);return e}return r||document.body}function ur(r){let e=document.getElementById(r);if(!$.isHTMLCanvas(e))throw new Error("Object is not a canvas element");return e}function fr(r){let{width:e,height:t}=r,i=document.createElement("canvas");i.id=S("lumagl-auto-created-canvas"),i.width=e||1,i.height=t||1,i.style.width=Number.isFinite(e)?`${e}px`:"100%",i.style.height=Number.isFinite(t)?`${t}px`:"100%",r?.visible||(i.style.visibility="hidden");let n=cr(r?.container||null);return n.insertBefore(i,n.firstChild),i}function lr(r,e,t,i,n){let s=r,o=Tt(s[0],e,t),c=Pt(s[1],e,i,n),f=Tt(s[0]+1,e,t),d=f===t-1?f:f-1;f=Pt(s[1]+1,e,i,n);let p;return n?(f=f===0?f:f+1,p=c,c=f):p=f===i-1?f:f-1,{x:o,y:c,width:Math.max(d-o+1,1),height:Math.max(p-c+1,1)}}function Tt(r,e,t){return Math.min(Math.round(r*e),t-1)}function Pt(r,e,t,i){return i?Math.max(0,t-1-Math.round(r*e)):Math.min(Math.round(r*e),t-1)}var Te=class extends u{get[Symbol.toStringTag](){return"Sampler"}constructor(e,t){t=Te.normalizeProps(e,t),super(e,t,Te.defaultProps)}static normalizeProps(e,t){return t}},I=Te;a(I,"defaultProps",{...u.defaultProps,type:"color-sampler",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",addressModeW:"clamp-to-edge",magFilter:"nearest",minFilter:"nearest",mipmapFilter:"none",lodMinClamp:0,lodMaxClamp:32,compare:"less-equal",maxAnisotropy:1});var mr={"1d":"1d","2d":"2d","2d-array":"2d",cube:"2d","cube-array":"2d","3d":"3d"},w=class extends u{dimension;baseDimension;format;width;height;depth;mipLevels;updateTimestamp;get[Symbol.toStringTag](){return"Texture"}toString(){return`Texture(${this.id},${this.format},${this.width}x${this.height})`}constructor(e,t){if(t=w.normalizeProps(e,t),super(e,t,w.defaultProps),this.dimension=this.props.dimension,this.baseDimension=mr[this.dimension],this.format=this.props.format,this.width=this.props.width,this.height=this.props.height,this.depth=this.props.depth,this.mipLevels=this.props.mipLevels,this.props.width===void 0||this.props.height===void 0)if(e.isExternalImage(t.data)){let i=e.getExternalImageSize(t.data);this.width=i?.width||1,this.height=i?.height||1}else this.width=1,this.height=1,(this.props.width===void 0||this.props.height===void 0)&&l.warn(`${this} created with undefined width or height. This is deprecated. Use AsyncTexture instead.`)();this.updateTimestamp=e.incrementTimestamp()}setSampler(e){this.sampler=e instanceof I?e:this.device.createSampler(e)}clone(e){return this.device.createTexture({...this.props,...e})}static normalizeProps(e,t){let i={...t},{width:n,height:s}=i;return typeof n=="number"&&(i.width=Math.max(1,Math.ceil(n))),typeof s=="number"&&(i.height=Math.max(1,Math.ceil(s))),i}_initializeData(e){this.device.isExternalImage(e)?this.copyExternalImage({image:e,width:this.width,height:this.height,depth:this.depth,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1,flipY:!1}):e&&this.copyImageData({data:e,mipLevel:0,x:0,y:0,z:0,aspect:"all"})}_normalizeCopyImageDataOptions(e){let{width:t,height:i,depth:n}=this,s={...w.defaultCopyDataOptions,width:t,height:i,depth:n,...e},o=this.device.getTextureFormatInfo(this.format);if(!e.bytesPerRow&&!o.bytesPerPixel)throw new Error(`bytesPerRow must be provided for texture format ${this.format}`);return s.bytesPerRow=e.bytesPerRow||t*(o.bytesPerPixel||4),s.rowsPerImage=e.rowsPerImage||i,s}_normalizeCopyExternalImageOptions(e){let t=this.device.getExternalImageSize(e.image),i={...w.defaultCopyExternalImageOptions,...t,...e};return i.width=Math.min(i.width,this.width-i.x),i.height=Math.min(i.height,this.height-i.y),i}},g=w;a(g,"SAMPLE",4),a(g,"STORAGE",8),a(g,"RENDER",16),a(g,"COPY_SRC",1),a(g,"COPY_DST",2),a(g,"TEXTURE",4),a(g,"RENDER_ATTACHMENT",16),a(g,"defaultProps",{...u.defaultProps,data:null,dimension:"2d",format:"rgba8unorm",usage:w.TEXTURE|w.RENDER_ATTACHMENT|w.COPY_DST,width:void 0,height:void 0,depth:1,mipLevels:1,samples:void 0,sampler:{},view:void 0}),a(g,"defaultCopyDataOptions",{data:void 0,byteOffset:0,bytesPerRow:void 0,rowsPerImage:void 0,mipLevel:0,x:0,y:0,z:0,aspect:"all"}),a(g,"defaultCopyExternalImageOptions",{image:void 0,sourceX:0,sourceY:0,width:void 0,height:void 0,depth:1,mipLevel:0,x:0,y:0,z:0,aspect:"all",colorSpace:"srgb",premultipliedAlpha:!1,flipY:!1});var Ue=class extends u{get[Symbol.toStringTag](){return"TextureView"}constructor(e,t){super(e,t,Ue.defaultProps)}},Y=Ue;a(Y,"defaultProps",{...u.defaultProps,format:void 0,dimension:void 0,aspect:"all",baseMipLevel:0,mipLevelCount:void 0,baseArrayLayer:0,arrayLayerCount:void 0});var He=class extends u{get[Symbol.toStringTag](){return"ExternalTexture"}constructor(e,t){super(e,t,He.defaultProps)}},X=He;a(X,"defaultProps",{...u.defaultProps,source:void 0,colorSpace:"srgb"});function At(r,e,t){let i="",n=e.split(/\r?\n/),s=r.slice().sort((o,c)=>o.lineNum-c.lineNum);switch(t?.showSourceCode||"no"){case"all":let o=0;for(let c=1;c<=n.length;c++)for(i+=Et(n[c-1],c,t);s.length>o&&s[o].lineNum===c;){let f=s[o++];i+=Ne(f,n,f.lineNum,{...t,inlineSource:!1})}for(;s.length>o;){let c=s[o++];i+=Ne(c,[],0,{...t,inlineSource:!1})}return i;case"issues":case"no":for(let c of r)i+=Ne(c,n,c.lineNum,{inlineSource:t?.showSourceCode!=="no"});return i}}function Ne(r,e,t,i){if(i?.inlineSource){let s=dr(e,t),o=r.linePos>0?`${" ".repeat(r.linePos+5)}^^^
9
9
  `:"";return`
10
10
  ${s}${o}${r.type.toUpperCase()}: ${r.message}
11
11
 
package/dist/index.cjs CHANGED
@@ -1111,7 +1111,7 @@ var _Luma = class {
1111
1111
  VERSION = (
1112
1112
  // Version detection using build plugin
1113
1113
  // @ts-expect-error no-undef
1114
- true ? "9.2.0-alpha.6" : "running from source"
1114
+ true ? "9.2.0-beta.2" : "running from source"
1115
1115
  );
1116
1116
  spector;
1117
1117
  preregisteredAdapters = /* @__PURE__ */ new Map();
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/utils/stats-manager.ts", "../src/utils/log.ts", "../src/utils/uid.ts", "../src/adapter/resources/resource.ts", "../src/adapter/resources/buffer.ts", "../src/shadertypes/data-types/decode-data-types.ts", "../src/shadertypes/vertex-arrays/decode-vertex-format.ts", "../src/shadertypes/textures/texture-format-table.ts", "../src/shadertypes/textures/texture-format-decoder.ts", "../src/image-utils/image-types.ts", "../src/adapter/device.ts", "../src/adapter/luma.ts", "../src/adapter/adapter.ts", "../src/adapter/canvas-context.ts", "../src/utils/promise-utils.ts", "../src/adapter/resources/sampler.ts", "../src/adapter/resources/texture.ts", "../src/adapter/resources/texture-view.ts", "../src/adapter/resources/external-texture.ts", "../src/adapter-utils/format-compiler-log.ts", "../src/adapter/resources/shader.ts", "../src/adapter/resources/framebuffer.ts", "../src/adapter/resources/render-pipeline.ts", "../src/adapter/resources/render-pass.ts", "../src/adapter/resources/compute-pipeline.ts", "../src/adapter/resources/compute-pass.ts", "../src/adapter/resources/command-encoder.ts", "../src/adapter/resources/command-buffer.ts", "../src/shadertypes/data-types/decode-shader-types.ts", "../src/adapter-utils/get-attribute-from-layouts.ts", "../src/adapter/resources/vertex-array.ts", "../src/adapter/resources/transform-feedback.ts", "../src/adapter/resources/query-set.ts", "../src/adapter/resources/pipeline-layout.ts", "../src/utils/array-utils-flat.ts", "../src/utils/is-array.ts", "../src/portable/uniform-buffer-layout.ts", "../src/utils/array-equal.ts", "../src/portable/uniform-block.ts", "../src/portable/uniform-store.ts", "../src/shadertypes/textures/pixel-utils.ts"],
4
4
  "sourcesContent": ["// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// MAIN API ACCESS POINT\nexport type {AttachDeviceProps, CreateDeviceProps} from './adapter/luma';\nexport {luma} from './adapter/luma';\n\n// ADAPTER (DEVICE AND GPU RESOURCE INTERFACES)\nexport {Adapter} from './adapter/adapter';\n\nexport type {\n DeviceProps,\n DeviceInfo,\n DeviceFeature,\n DeviceTextureFormatCapabilities\n} from './adapter/device';\nexport {Device, DeviceFeatures, DeviceLimits} from './adapter/device';\n\nexport type {CanvasContextProps} from './adapter/canvas-context';\nexport {CanvasContext} from './adapter/canvas-context';\n\n// GPU RESOURCES\nexport {Resource, type ResourceProps} from './adapter/resources/resource';\n\nexport {Buffer, type BufferProps, type BufferMapCallback} from './adapter/resources/buffer';\n\nexport {Texture, type TextureProps} from './adapter/resources/texture';\n\nexport {TextureView, type TextureViewProps} from './adapter/resources/texture-view';\n\nexport type {ExternalTextureProps} from './adapter/resources/external-texture';\nexport {ExternalTexture} from './adapter/resources/external-texture';\n\nexport type {ShaderProps} from './adapter/resources/shader';\nexport {Shader} from './adapter/resources/shader';\n\nexport type {SamplerProps, SamplerParameters} from './adapter/resources/sampler';\nexport {Sampler} from './adapter/resources/sampler';\n\nexport type {FramebufferProps} from './adapter/resources/framebuffer';\nexport {Framebuffer} from './adapter/resources/framebuffer';\n\nexport type {RenderPipelineProps} from './adapter/resources/render-pipeline';\nexport {RenderPipeline} from './adapter/resources/render-pipeline';\n\nexport type {RenderPassProps} from './adapter/resources/render-pass';\nexport {RenderPass} from './adapter/resources/render-pass';\n\nexport type {ComputePipelineProps} from './adapter/resources/compute-pipeline';\nexport {ComputePipeline} from './adapter/resources/compute-pipeline';\n\nexport type {ComputePassProps} from './adapter/resources/compute-pass';\nexport {ComputePass} from './adapter/resources/compute-pass';\n\nexport type {CommandEncoderProps} from './adapter/resources/command-encoder';\nexport {CommandEncoder} from './adapter/resources/command-encoder';\n\nexport type {CommandBufferProps} from './adapter/resources/command-buffer';\nexport {CommandBuffer} from './adapter/resources/command-buffer';\n\nexport type {VertexArrayProps} from './adapter/resources/vertex-array';\nexport {VertexArray} from './adapter/resources/vertex-array';\n\nexport type {TransformFeedbackProps, BufferRange} from './adapter/resources/transform-feedback';\nexport {TransformFeedback} from './adapter/resources/transform-feedback';\n\nexport type {QuerySetProps} from './adapter/resources/query-set';\nexport {QuerySet} from './adapter/resources/query-set';\n\nexport type {PipelineLayoutProps} from './adapter/resources/pipeline-layout';\nexport {PipelineLayout} from './adapter/resources/pipeline-layout';\n\n// PORTABLE API - UNIFORM BUFFERS\nexport {UniformBufferLayout} from './portable/uniform-buffer-layout';\nexport {UniformBlock} from './portable/uniform-block';\nexport {UniformStore} from './portable/uniform-store';\n// TEXTURE TYPES\n\n// API TYPES\nexport type {CompilerMessage} from './adapter/types/compiler-message';\n\nexport type {ExternalImage} from './image-utils/image-types';\n\nexport {\n type CopyExternalImageOptions,\n type CopyImageDataOptions\n} from './adapter/resources/texture';\n\nexport type {Parameters, PrimitiveTopology, IndexFormat} from './adapter/types/parameters';\n\nexport type {\n CullMode,\n FrontFace,\n RasterizationParameters,\n CompareFunction,\n StencilOperation,\n DepthStencilParameters,\n BlendFactor,\n BlendOperation,\n ColorParameters,\n MultisampleParameters,\n RenderPassParameters,\n RenderPipelineParameters,\n PolygonMode,\n ProvokingVertex\n} from './adapter/types/parameters';\n\nexport type {ColorAttachment, DepthStencilAttachment} from './adapter/types/attachments';\n\nexport type {\n ShaderLayout,\n ComputeShaderLayout,\n AttributeDeclaration,\n BindingDeclaration,\n Binding,\n UniformBufferBindingLayout,\n StorageBufferBindingLayout,\n TextureBindingLayout,\n SamplerBindingLayout,\n StorageTextureBindingLayout\n} from './adapter/types/shader-layout';\nexport type {BufferLayout, BufferAttributeLayout} from './adapter/types/buffer-layout';\nexport type {\n // Deprecated, todo\n AttributeBinding,\n UniformBinding,\n UniformBlockBinding,\n VaryingBinding\n} from './adapter/types/shader-layout';\n\nexport type {UniformValue} from './adapter/types/uniforms';\n\n// TYPED ARRAY TYPES\n\nexport type {\n NumberArray,\n TypedArray,\n TypedArrayConstructor,\n BigTypedArray,\n BigTypedArrayConstructor\n} from './types';\n\n// GPU TYPE UTILS - BASIC DATA TYPES\n\nexport {\n type PrimitiveDataType,\n type SignedDataType,\n type NormalizedDataType,\n type DataTypeInfo,\n type DataTypeArray,\n type NormalizedDataTypeArray\n} from './shadertypes/data-types/data-types';\nexport {\n type AttributeShaderType,\n type VariableShaderType\n} from './shadertypes/data-types/shader-types';\nexport {\n getDataTypeInfo,\n getDataType,\n getTypedArrayConstructor,\n getNormalizedDataType\n} from './shadertypes/data-types/decode-data-types';\nexport {\n getVariableShaderTypeInfo,\n getAttributeShaderTypeInfo\n} from './shadertypes/data-types/decode-shader-types';\n\n// GPU TYPE UTILS - VERTEX ARRAYs\n\nexport {type VertexFormat} from './shadertypes/vertex-arrays/vertex-formats';\n\nexport {\n getVertexFormatInfo,\n getVertexFormatFromAttribute,\n makeVertexFormat\n} from './shadertypes/vertex-arrays/decode-vertex-format';\n\n// GPU TYPE UTILS - Texture Formats\n\nexport {\n type TextureFormat,\n type TextureFormatColor,\n type TextureFormatDepthStencil,\n type TextureCompression,\n type TextureFormatInfo,\n type TextureFormatCapabilities\n} from './shadertypes/textures/texture-formats';\n\nexport {\n TextureFormatDecoder,\n textureFormatDecoder\n} from './shadertypes/textures/texture-format-decoder';\n\nexport {type PixelData, readPixel, writePixel} from './shadertypes/textures/pixel-utils';\n\n// GENERAL EXPORTS - FOR APPLICATIONS\n\nexport type {StatsManager} from './utils/stats-manager'; // TODO - should this be moved to probe.gl?\n\n// ADAPTER UTILS - for implementing Device adapters (@luma.gl/webgl and @luma.gl/webgpu)\n\nexport type {\n CopyBufferToBufferOptions,\n CopyBufferToTextureOptions,\n CopyTextureToBufferOptions,\n CopyTextureToTextureOptions\n} from './adapter/resources/command-encoder';\n\n// INTERNAL UTILS - for use in other luma.gl modules only\nexport {log} from './utils/log';\nexport {getScratchArray} from './utils/array-utils-flat';\nexport type {AttributeInfo} from './adapter-utils/get-attribute-from-layouts';\nexport {getAttributeInfosFromLayouts} from './adapter-utils/get-attribute-from-layouts';\n\n// TEST EXPORTS\nexport {\n getTextureFormatDefinition as _getTextureFormatDefinition,\n getTextureFormatTable as _getTextureFormatTable\n} from './shadertypes/textures/texture-format-table';\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Stats} from '@probe.gl/stats';\n\n/**\n * Helper class managing a collection of probe.gl stats objects\n */\nexport class StatsManager {\n stats = new Map();\n\n getStats(name: string): Stats {\n return this.get(name);\n }\n\n get(name: string): Stats {\n if (!this.stats.has(name)) {\n this.stats.set(name, new Stats({id: name}));\n }\n\n return this.stats.get(name);\n }\n}\n\n/** Global stats for all luma.gl devices */\nexport const lumaStats: StatsManager = new StatsManager();\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Log} from '@probe.gl/log';\n\n/** Global log instance */\nexport const log: Log = new Log({id: 'luma.gl'});\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nconst uidCounters: Record<string, number> = {};\n\n/**\n * Returns a UID.\n * @param id= - Identifier base name\n * @return uid\n **/\nexport function uid(id: string = 'id'): string {\n uidCounters[id] = uidCounters[id] || 1;\n const count = uidCounters[id]++;\n return `${id}-${count}`;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Device} from '../device';\nimport {uid} from '../../utils/uid';\n\nexport type ResourceProps = {\n /** Name of resource, mainly for debugging purposes. A unique name will be assigned if not provided */\n id?: string;\n /** Handle for the underlying resources (WebGL object or WebGPU handle) */\n handle?: any;\n /** User provided data stored on this resource */\n userData?: {[key: string]: any};\n};\n\n/**\n * Base class for GPU (WebGPU/WebGL) Resources\n */\nexport abstract class Resource<Props extends ResourceProps> {\n /** Default properties for resource */\n static defaultProps: Required<ResourceProps> = {\n id: 'undefined',\n handle: undefined,\n userData: undefined!\n };\n\n abstract get [Symbol.toStringTag](): string;\n\n toString(): string {\n return `${this[Symbol.toStringTag] || this.constructor.name}:\"${this.id}\"`;\n }\n\n /** props.id, for debugging. */\n id: string;\n readonly props: Required<Props>;\n readonly userData: Record<string, unknown> = {};\n abstract readonly device: Device;\n abstract readonly handle: unknown;\n private _device: Device;\n\n /** Whether this resource has been destroyed */\n destroyed: boolean = false;\n /** For resources that allocate GPU memory */\n private allocatedBytes: number = 0;\n /** Attached resources will be destroyed when this resource is destroyed. Tracks auto-created \"sub\" resources. */\n private _attachedResources = new Set<Resource<ResourceProps>>();\n\n /**\n * Create a new Resource. Called from Subclass\n */\n constructor(device: Device, props: Props, defaultProps: Required<Props>) {\n if (!device) {\n throw new Error('no device');\n }\n this._device = device;\n this.props = selectivelyMerge<Props>(props, defaultProps);\n\n const id =\n this.props.id !== 'undefined' ? (this.props.id as string) : uid(this[Symbol.toStringTag]);\n this.props.id = id;\n this.id = id;\n this.userData = this.props.userData || {};\n\n this.addStats();\n }\n\n /**\n * destroy can be called on any resource to release it before it is garbage collected.\n */\n destroy(): void {\n this.destroyResource();\n }\n\n /** @deprecated Use destroy() */\n delete(): this {\n this.destroy();\n return this;\n }\n\n /**\n * Combines a map of user props and default props, only including props from defaultProps\n * @returns returns a map of overridden default props\n */\n getProps(): object {\n return this.props;\n }\n\n // ATTACHED RESOURCES\n\n /**\n * Attaches a resource. Attached resources are auto destroyed when this resource is destroyed\n * Called automatically when sub resources are auto created but can be called by application\n */\n attachResource(resource: Resource<ResourceProps>): void {\n this._attachedResources.add(resource);\n }\n\n /**\n * Detach an attached resource. The resource will no longer be auto-destroyed when this resource is destroyed.\n */\n detachResource(resource: Resource<ResourceProps>): void {\n this._attachedResources.delete(resource);\n }\n\n /**\n * Destroys a resource (only if owned), and removes from the owned (auto-destroy) list for this resource.\n */\n destroyAttachedResource(resource: Resource<ResourceProps>): void {\n if (this._attachedResources.delete(resource)) {\n resource.destroy();\n }\n }\n\n /** Destroy all owned resources. Make sure the resources are no longer needed before calling. */\n destroyAttachedResources(): void {\n for (const resource of Object.values(this._attachedResources)) {\n resource.destroy();\n }\n // don't remove while we are iterating\n this._attachedResources = new Set<Resource<ResourceProps>>();\n }\n\n // PROTECTED METHODS\n\n /** Perform all destroy steps. Can be called by derived resources when overriding destroy() */\n protected destroyResource(): void {\n this.destroyAttachedResources();\n this.removeStats();\n this.destroyed = true;\n }\n\n /** Called by .destroy() to track object destruction. Subclass must call if overriding destroy() */\n protected removeStats(): void {\n const stats = this._device.statsManager.getStats('Resource Counts');\n const name = this[Symbol.toStringTag];\n stats.get(`${name}s Active`).decrementCount();\n }\n\n /** Called by subclass to track memory allocations */\n protected trackAllocatedMemory(bytes: number, name = this[Symbol.toStringTag]): void {\n const stats = this._device.statsManager.getStats('Resource Counts');\n stats.get('GPU Memory').addCount(bytes);\n stats.get(`${name} Memory`).addCount(bytes);\n this.allocatedBytes = bytes;\n }\n\n /** Called by subclass to track memory deallocations */\n protected trackDeallocatedMemory(name = this[Symbol.toStringTag]): void {\n const stats = this._device.statsManager.getStats('Resource Counts');\n stats.get('GPU Memory').subtractCount(this.allocatedBytes);\n stats.get(`${name} Memory`).subtractCount(this.allocatedBytes);\n this.allocatedBytes = 0;\n }\n\n /** Called by resource constructor to track object creation */\n private addStats(): void {\n const stats = this._device.statsManager.getStats('Resource Counts');\n const name = this[Symbol.toStringTag];\n stats.get('Resources Created').incrementCount();\n stats.get(`${name}s Created`).incrementCount();\n stats.get(`${name}s Active`).incrementCount();\n }\n}\n\n/**\n * Combines a map of user props and default props, only including props from defaultProps\n * @param props\n * @param defaultProps\n * @returns returns a map of overridden default props\n */\nfunction selectivelyMerge<Props>(props: Props, defaultProps: Required<Props>): Required<Props> {\n const mergedProps = {...defaultProps};\n for (const key in props) {\n if (props[key] !== undefined) {\n mergedProps[key] = props[key];\n }\n }\n return mergedProps;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Device} from '../device';\nimport {Resource, ResourceProps} from './resource';\n\n/** Callback for Buffer.mapAndReadAsync */\nexport type BufferMapCallback<T> = (arrayBuffer: ArrayBuffer, lifetime: 'mapped' | 'copied') => T;\n\nexport type BufferProps = ResourceProps & {\n /** Supply a handle to connect to an existing device-specific buffer */\n handle?: WebGLBuffer;\n /** Specifies how this buffer can be used */\n usage?: number;\n /** Length in bytes of memory to be allocated. If not specified, `byteLength` of `props.data` will be used. */\n byteLength?: number;\n /** Byte offset into the newly created Buffer to store data at */\n byteOffset?: number;\n /** If props.usage includes Buffer.INDEX */\n indexType?: 'uint16' | 'uint32';\n /** Data to initialize the buffer with. */\n data?: ArrayBuffer | ArrayBufferView | null;\n /** Callback to initialize data without copy */\n onMapped?: BufferMapCallback<void>;\n};\n\n/** Abstract GPU buffer */\nexport abstract class Buffer extends Resource<BufferProps> {\n /** Index buffer */\n static INDEX = 0x0010;\n /** Vertex buffer */\n static VERTEX = 0x0020;\n /** Uniform buffer */\n static UNIFORM = 0x0040;\n /** Storage buffer */\n static STORAGE = 0x0080;\n static INDIRECT = 0x0100;\n static QUERY_RESOLVE = 0x0200;\n\n // Usage Flags\n static MAP_READ = 0x01;\n static MAP_WRITE = 0x02;\n static COPY_SRC = 0x0004;\n static COPY_DST = 0x0008;\n\n override get [Symbol.toStringTag](): string {\n return 'Buffer';\n }\n\n /** The usage with which this buffer was created */\n readonly usage: number;\n /** For index buffers, whether indices are 16 or 32 bit */\n readonly indexType?: 'uint16' | 'uint32';\n /** Length of buffer in bytes */\n abstract byteLength: number;\n /** \"Time\" of last update, can be used to check if redraw is needed */\n updateTimestamp: number;\n\n constructor(device: Device, props: BufferProps) {\n const deducedProps = {...props};\n\n // Deduce indexType\n if ((props.usage || 0) & Buffer.INDEX && !props.indexType) {\n if (props.data instanceof Uint32Array) {\n deducedProps.indexType = 'uint32';\n } else if (props.data instanceof Uint16Array) {\n deducedProps.indexType = 'uint16';\n }\n }\n\n // Remove data from props before storing, we don't want to hold on to a big chunk of memory\n delete deducedProps.data;\n\n super(device, deducedProps, Buffer.defaultProps);\n\n this.usage = deducedProps.usage || 0;\n this.indexType = deducedProps.indexType;\n\n // TODO - perhaps this should be set on async write completion?\n this.updateTimestamp = device.incrementTimestamp();\n }\n\n /**\n * Create a copy of this Buffer with new byteLength, with same props but of the specified size.\n * @note Does not copy contents of the cloned Buffer.\n */\n clone(props: {byteLength: number}): Buffer {\n return this.device.createBuffer({...this.props, ...props});\n }\n\n /** Write data to buffer */\n abstract write(\n data: ArrayBufferLike | ArrayBufferView | SharedArrayBuffer,\n byteOffset?: number\n ): void;\n\n abstract mapAndWriteAsync(\n onMapped: BufferMapCallback<void | Promise<void>>,\n byteOffset?: number,\n byteLength?: number\n ): Promise<void>;\n\n /** Reads data asynchronously, returns a copy of the buffer data */\n abstract readAsync(byteOffset?: number, byteLength?: number): Promise<Uint8Array>;\n\n /** Maps buffer data to CPU memory. Mapped memory is only accessible in the callback */\n abstract mapAndReadAsync<T>(\n onMapped: BufferMapCallback<T>,\n byteOffset?: number,\n byteLength?: number\n ): Promise<T>;\n\n /** Read data synchronously. @note WebGL2 only */\n abstract readSyncWebGL(byteOffset?: number, byteLength?: number): Uint8Array;\n\n // PROTECTED METHODS (INTENDED FOR USE BY OTHER FRAMEWORK CODE ONLY)\n\n /** Max amount of debug data saved. Two vec4's */\n static DEBUG_DATA_MAX_LENGTH = 32;\n\n /** A partial CPU-side copy of the data in this buffer, for debugging purposes */\n debugData: ArrayBuffer = new ArrayBuffer(0);\n\n /** This doesn't handle partial non-zero offset updates correctly */\n protected _setDebugData(\n data: ArrayBufferView | ArrayBufferLike | null,\n byteOffset: number,\n byteLength: number\n ): void {\n const arrayBuffer: ArrayBufferLike | null = ArrayBuffer.isView(data) ? data.buffer : data;\n const debugDataLength = Math.min(\n data ? data.byteLength : byteLength,\n Buffer.DEBUG_DATA_MAX_LENGTH\n );\n if (arrayBuffer === null) {\n this.debugData = new ArrayBuffer(debugDataLength);\n } else if (byteOffset === 0 && byteLength === arrayBuffer.byteLength) {\n this.debugData = arrayBuffer.slice(0, debugDataLength);\n } else {\n this.debugData = arrayBuffer.slice(byteOffset, byteOffset + debugDataLength);\n }\n }\n\n static override defaultProps: Required<BufferProps> = {\n ...Resource.defaultProps,\n usage: 0, // Buffer.COPY_DST | Buffer.COPY_SRC\n byteLength: 0,\n byteOffset: 0,\n data: null,\n indexType: 'uint16',\n onMapped: undefined!\n };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {TypedArray, TypedArrayConstructor} from '../../types';\nimport {PrimitiveDataType, SignedDataType, NormalizedDataType, DataTypeInfo} from './data-types';\n\n/**\n * Gets info about a data type constant (signed or normalized)\n * @returns underlying primitive / signed types, byte length, normalization, integer, signed flags\n */\nexport function getDataTypeInfo(type: NormalizedDataType): DataTypeInfo {\n const [signedType, primitiveType, byteLength] = NORMALIZED_TYPE_MAP[type];\n const normalized: boolean = type.includes('norm');\n const integer: boolean = !normalized && !type.startsWith('float');\n const signed: boolean = type.startsWith('s');\n return {\n signedType,\n primitiveType,\n byteLength,\n normalized,\n integer,\n signed\n };\n}\n\n/** Build a vertex format from a signed data type and a component */\nexport function getNormalizedDataType(signedDataType: SignedDataType): NormalizedDataType {\n const dataType: NormalizedDataType = signedDataType;\n // prettier-ignore\n switch (dataType) {\n case 'uint8': return 'unorm8';\n case 'sint8': return 'snorm8';\n case 'uint16': return 'unorm16';\n case 'sint16': return 'snorm16';\n default: return dataType;\n }\n}\n\n/** Align offset to 1, 2 or 4 elements (4, 8 or 16 bytes) */\nexport function alignTo(size: number, count: number): number {\n // prettier-ignore\n switch (count) {\n case 1: return size; // Pad upwards to even multiple of 2\n case 2: return size + (size % 2); // Pad upwards to even multiple of 2\n default: return size + ((4 - (size % 4)) % 4); // Pad upwards to even multiple of 4\n }\n}\n\n/** Returns the VariableShaderType that corresponds to a typed array */\nexport function getDataType(arrayOrType: TypedArray | TypedArrayConstructor): SignedDataType {\n const Constructor = ArrayBuffer.isView(arrayOrType) ? arrayOrType.constructor : arrayOrType;\n if (Constructor === Uint8ClampedArray) {\n return 'uint8';\n }\n const info = Object.values(NORMALIZED_TYPE_MAP).find(entry => Constructor === entry[4]);\n if (!info) {\n throw new Error(Constructor.name);\n }\n return info[0];\n}\n\n/** Returns the TypedArray that corresponds to a shader data type */\nexport function getTypedArrayConstructor(type: NormalizedDataType): TypedArrayConstructor {\n const [, , , , Constructor] = NORMALIZED_TYPE_MAP[type];\n return Constructor;\n}\n\nconst NORMALIZED_TYPE_MAP: Record<\n NormalizedDataType,\n [\n SignedDataType,\n PrimitiveDataType,\n bytes: 1 | 2 | 4,\n normalized: boolean,\n arrayConstructor: TypedArrayConstructor\n ]\n> = {\n uint8: ['uint8', 'u32', 1, false, Uint8Array],\n sint8: ['sint8', 'i32', 1, false, Int8Array],\n unorm8: ['uint8', 'f32', 1, true, Uint8Array],\n snorm8: ['sint8', 'f32', 1, true, Int8Array],\n uint16: ['uint16', 'u32', 2, false, Uint16Array],\n sint16: ['sint16', 'i32', 2, false, Int16Array],\n unorm16: ['uint16', 'u32', 2, true, Uint16Array],\n snorm16: ['sint16', 'i32', 2, true, Int16Array],\n float16: ['float16', 'f16', 2, false, Uint16Array],\n float32: ['float32', 'f32', 4, false, Float32Array],\n uint32: ['uint32', 'u32', 4, false, Uint32Array],\n sint32: ['sint32', 'i32', 4, false, Int32Array]\n};\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {TypedArray} from '../../types';\nimport type {NormalizedDataType, PrimitiveDataType, SignedDataType} from '../data-types/data-types';\nimport type {VertexFormat, VertexFormatInfo} from './vertex-formats';\nimport {getDataTypeInfo, getDataType, getNormalizedDataType} from '../data-types/decode-data-types';\n\n/**\n * Decodes a vertex format, returning type, components, byte length and flags (integer, signed, normalized)\n */\nexport function getVertexFormatInfo(format: VertexFormat): VertexFormatInfo {\n // Strip the -webgl ending if present\n let webglOnly: boolean | undefined;\n if (format.endsWith('-webgl')) {\n format.replace('-webgl', '');\n webglOnly = true;\n }\n // split components from type\n const [type_, count] = format.split('x');\n const type = type_ as NormalizedDataType;\n const components = (count ? parseInt(count) : 1) as 1 | 2 | 3 | 4;\n // decode the type\n const decodedType = getDataTypeInfo(type);\n const result: VertexFormatInfo = {\n type,\n components,\n byteLength: decodedType.byteLength * components,\n integer: decodedType.integer,\n signed: decodedType.signed,\n normalized: decodedType.normalized\n };\n if (webglOnly) {\n result.webglOnly = true;\n }\n return result;\n}\n\n/** Build a vertex format from a signed data type and a component */\nexport function makeVertexFormat(\n signedDataType: SignedDataType,\n components: 1 | 2 | 3 | 4,\n normalized?: boolean\n): VertexFormat {\n const dataType: NormalizedDataType = normalized\n ? getNormalizedDataType(signedDataType)\n : signedDataType;\n\n switch (dataType) {\n // TODO - Special cases for WebGL (not supported on WebGPU), overrides the check below\n case 'unorm8':\n if (components === 1) {\n return 'unorm8';\n }\n if (components === 3) {\n return 'unorm8x3-webgl';\n }\n return `${dataType}x${components}`;\n\n case 'snorm8':\n case 'uint8':\n case 'sint8':\n // WebGPU 8 bit formats must be aligned to 16 bit boundaries');\n // fall through\n case 'uint16':\n case 'sint16':\n case 'unorm16':\n case 'snorm16':\n case 'float16':\n // WebGPU 16 bit formats must be aligned to 32 bit boundaries\n if (components === 1 || components === 3) {\n throw new Error(`size: ${components}`);\n }\n return `${dataType}x${components}`;\n\n default:\n return components === 1 ? dataType : `${dataType}x${components}`;\n }\n}\n\n/** Get the vertex format for an attribute with TypedArray and size */\nexport function getVertexFormatFromAttribute(\n typedArray: TypedArray,\n size: number,\n normalized?: boolean\n): VertexFormat {\n if (!size || size > 4) {\n throw new Error(`size ${size}`);\n }\n\n const components = size as 1 | 2 | 3 | 4;\n const signedDataType = getDataType(typedArray);\n return makeVertexFormat(signedDataType, components, normalized);\n}\n\n/** Return a \"default\" vertex format for a certain shader data type\n The simplest vertex format that matches the shader attribute's data type */\n\nexport function getCompatibleVertexFormat(opts: {\n primitiveType: PrimitiveDataType;\n components: 1 | 2 | 3 | 4;\n}): VertexFormat {\n let vertexType: NormalizedDataType;\n switch (opts.primitiveType) {\n case 'f32':\n vertexType = 'float32';\n break;\n case 'i32':\n vertexType = 'sint32';\n break;\n case 'u32':\n vertexType = 'uint32';\n break;\n case 'f16':\n return opts.components <= 2 ? 'float16x2' : 'float16x4';\n }\n\n // TODO logic does not work for float16\n if (opts.components === 1) {\n return vertexType;\n }\n return `${vertexType}x${opts.components}`;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {\n TextureFormat,\n TextureFormatColorUncompressed,\n TextureFormatDepthStencil,\n TextureFeature,\n TextureFormatInfo,\n TextureFormatCompressed\n} from './texture-formats';\n/* eslint-disable camelcase */\n\n// Define local device feature strings to optimize minification\nconst texture_compression_bc: TextureFeature = 'texture-compression-bc';\nconst texture_compression_astc: TextureFeature = 'texture-compression-astc';\nconst texture_compression_etc2: TextureFeature = 'texture-compression-etc2';\nconst texture_compression_etc1_webgl: TextureFeature = 'texture-compression-etc1-webgl';\nconst texture_compression_pvrtc_webgl: TextureFeature = 'texture-compression-pvrtc-webgl';\nconst texture_compression_atc_webgl: TextureFeature = 'texture-compression-atc-webgl';\n\nconst float32_renderable: TextureFeature = 'float32-renderable-webgl';\nconst float16_renderable: TextureFeature = 'float16-renderable-webgl';\nconst rgb9e5ufloat_renderable: TextureFeature = 'rgb9e5ufloat-renderable-webgl';\nconst snorm8_renderable: TextureFeature = 'snorm8-renderable-webgl';\nconst norm16_renderable: TextureFeature = 'norm16-renderable-webgl';\nconst snorm16_renderable: TextureFeature = 'snorm16-renderable-webgl';\n\nconst float32_filterable: TextureFeature = 'float32-filterable';\nconst float16_filterable: TextureFeature = 'float16-filterable-webgl';\n\n/** https://www.w3.org/TR/webgpu/#texture-format-caps */\n\n/** Internal type representing texture capabilities */\ntype TextureFormatDefinition = Partial<TextureFormatInfo> & {\n /** for compressed texture formats */\n f?: TextureFeature;\n /** renderable if feature is present. false means the spec does not support this format */\n render?: TextureFeature | false;\n /** filterable if feature is present. false means the spec does not support this format */\n filter?: TextureFeature | false;\n blend?: TextureFeature | false;\n store?: TextureFeature | false;\n\n /** (bytes per pixel), for memory usage calculations. */\n b?: number;\n /** channels */\n c?: number;\n bpp?: number;\n /** packed */\n p?: number;\n\n /** If not supported on WebGPU */\n wgpu?: false;\n};\n\nexport function getTextureFormatDefinition(format: TextureFormat): TextureFormatDefinition {\n const info = TEXTURE_FORMAT_TABLE[format];\n if (!info) {\n throw new Error(`Unsupported texture format ${format}`);\n }\n return info;\n}\n\nexport function getTextureFormatTable(): Readonly<Record<TextureFormat, TextureFormatDefinition>> {\n return TEXTURE_FORMAT_TABLE;\n}\n\n// prettier-ignore\nconst TEXTURE_FORMAT_COLOR_DEPTH_TABLE: Readonly<Record<TextureFormatColorUncompressed | TextureFormatDepthStencil, TextureFormatDefinition>> = {\n // 8-bit formats\n 'r8unorm': {},\n 'rg8unorm': {},\n 'rgb8unorm-webgl': {},\n 'rgba8unorm': {},\n 'rgba8unorm-srgb': {},\n\n 'r8snorm': {render: snorm8_renderable},\n 'rg8snorm': {render: snorm8_renderable},\n 'rgb8snorm-webgl': {},\n 'rgba8snorm': {render: snorm8_renderable},\n\n 'r8uint': {},\n 'rg8uint': {},\n 'rgba8uint': {},\n\n 'r8sint': {},\n 'rg8sint': {},\n 'rgba8sint': {},\n\n 'bgra8unorm': {},\n 'bgra8unorm-srgb': {},\n\n\n 'r16unorm': {f: norm16_renderable},\n 'rg16unorm': {render: norm16_renderable},\n 'rgb16unorm-webgl': {f: norm16_renderable}, // rgb not renderable\n 'rgba16unorm': {render: norm16_renderable},\n\n 'r16snorm': {f: snorm16_renderable},\n 'rg16snorm': {render: snorm16_renderable},\n 'rgb16snorm-webgl': {f: norm16_renderable}, // rgb not renderable\n 'rgba16snorm': {render: snorm16_renderable},\n\n 'r16uint': {},\n 'rg16uint': {},\n 'rgba16uint': {},\n\n 'r16sint': {},\n 'rg16sint': {},\n 'rgba16sint': {},\n\n 'r16float': {render: float16_renderable, filter: 'float16-filterable-webgl'},\n 'rg16float': {render: float16_renderable, filter: float16_filterable},\n 'rgba16float': {render: float16_renderable, filter: float16_filterable},\n\n 'r32uint': {},\n 'rg32uint': {},\n 'rgba32uint': {},\n\n 'r32sint': {},\n 'rg32sint': {},\n 'rgba32sint': {},\n\n 'r32float': {render: float32_renderable, filter: float32_filterable},\n 'rg32float': {render: false, filter: float32_filterable},\n 'rgb32float-webgl': {render: float32_renderable, filter: float32_filterable},\n 'rgba32float': {render: float32_renderable, filter: float32_filterable},\n\n // Packed 16-bit formats\n 'rgba4unorm-webgl': {channels: 'rgba', bitsPerChannel: [4, 4, 4, 4], packed: true},\n 'rgb565unorm-webgl': {channels: 'rgb', bitsPerChannel: [5, 6, 5, 0], packed: true},\n 'rgb5a1unorm-webgl': {channels: 'rgba', bitsPerChannel: [5, 5, 5, 1], packed: true},\n\n // Packed 32 bit formats\n 'rgb9e5ufloat': {channels: 'rgb', packed: true, render: rgb9e5ufloat_renderable}, // , filter: true},\n 'rg11b10ufloat': {channels: 'rgb', bitsPerChannel: [11, 11, 10, 0], packed: true, p: 1,render: float32_renderable},\n 'rgb10a2unorm': {channels: 'rgba', bitsPerChannel: [10, 10, 10, 2], packed: true, p: 1},\n 'rgb10a2uint': {channels: 'rgba', bitsPerChannel: [10, 10, 10, 2], packed: true, p: 1},\n\n // Depth/stencil Formats\n \n // Depth and stencil formats\n stencil8: {attachment: 'stencil', bitsPerChannel: [8, 0, 0, 0], dataType: 'uint8'},\n 'depth16unorm': {attachment: 'depth', bitsPerChannel: [16, 0, 0, 0], dataType: 'uint16'},\n 'depth24plus': {attachment: 'depth', bitsPerChannel: [24, 0, 0, 0], dataType: 'uint32'},\n 'depth32float': {attachment: 'depth', bitsPerChannel: [32, 0, 0, 0], dataType: 'float32'},\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': {attachment: 'depth-stencil', bitsPerChannel: [24, 8, 0, 0], packed: true},\n // \"depth32float-stencil8\" feature\n 'depth32float-stencil8': {attachment: 'depth-stencil', bitsPerChannel: [32, 8, 0, 0], packed: true},\n};\n\n// prettier-ignore\nconst TEXTURE_FORMAT_COMPRESSED_TABLE: Readonly<Record<TextureFormatCompressed, TextureFormatDefinition>> = {\n\n // BC compressed formats: check device.features.has(\"texture-compression-bc\");\n\n 'bc1-rgb-unorm-webgl': {f: texture_compression_bc},\n 'bc1-rgb-unorm-srgb-webgl': {f: texture_compression_bc},\n\n 'bc1-rgba-unorm': {f: texture_compression_bc},\n 'bc1-rgba-unorm-srgb': {f: texture_compression_bc},\n 'bc2-rgba-unorm': {f: texture_compression_bc},\n 'bc2-rgba-unorm-srgb': {f: texture_compression_bc},\n 'bc3-rgba-unorm': {f: texture_compression_bc},\n 'bc3-rgba-unorm-srgb': {f: texture_compression_bc},\n 'bc4-r-unorm': {f: texture_compression_bc},\n 'bc4-r-snorm': {f: texture_compression_bc},\n 'bc5-rg-unorm': {f: texture_compression_bc},\n 'bc5-rg-snorm': {f: texture_compression_bc},\n 'bc6h-rgb-ufloat': {f: texture_compression_bc},\n 'bc6h-rgb-float': {f: texture_compression_bc},\n 'bc7-rgba-unorm': {f: texture_compression_bc},\n 'bc7-rgba-unorm-srgb': {f: texture_compression_bc},\n\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\n 'etc2-rgb8unorm': {f: texture_compression_etc2},\n 'etc2-rgb8unorm-srgb': {f: texture_compression_etc2},\n 'etc2-rgb8a1unorm': {f: texture_compression_etc2},\n 'etc2-rgb8a1unorm-srgb': {f: texture_compression_etc2},\n 'etc2-rgba8unorm': {f: texture_compression_etc2},\n 'etc2-rgba8unorm-srgb': {f: texture_compression_etc2},\n\n 'eac-r11unorm': {f: texture_compression_etc2},\n 'eac-r11snorm': {f: texture_compression_etc2},\n 'eac-rg11unorm': {f: texture_compression_etc2},\n 'eac-rg11snorm': {f: texture_compression_etc2},\n\n // X_ASTC compressed formats: device.features.has(\"texture-compression-astc\")\n\n 'astc-4x4-unorm': {f: texture_compression_astc},\n 'astc-4x4-unorm-srgb': {f: texture_compression_astc},\n 'astc-5x4-unorm': {f: texture_compression_astc},\n 'astc-5x4-unorm-srgb': {f: texture_compression_astc},\n 'astc-5x5-unorm': {f: texture_compression_astc},\n 'astc-5x5-unorm-srgb': {f: texture_compression_astc},\n 'astc-6x5-unorm': {f: texture_compression_astc},\n 'astc-6x5-unorm-srgb': {f: texture_compression_astc},\n 'astc-6x6-unorm': {f: texture_compression_astc},\n 'astc-6x6-unorm-srgb': {f: texture_compression_astc},\n 'astc-8x5-unorm': {f: texture_compression_astc},\n 'astc-8x5-unorm-srgb': {f: texture_compression_astc},\n 'astc-8x6-unorm': {f: texture_compression_astc},\n 'astc-8x6-unorm-srgb': {f: texture_compression_astc},\n 'astc-8x8-unorm': {f: texture_compression_astc},\n 'astc-8x8-unorm-srgb': {f: texture_compression_astc},\n 'astc-10x5-unorm': {f: texture_compression_astc},\n 'astc-10x5-unorm-srgb': {f: texture_compression_astc},\n 'astc-10x6-unorm': {f: texture_compression_astc},\n 'astc-10x6-unorm-srgb': {f: texture_compression_astc},\n 'astc-10x8-unorm': {f: texture_compression_astc},\n 'astc-10x8-unorm-srgb': {f: texture_compression_astc},\n 'astc-10x10-unorm': {f: texture_compression_astc},\n 'astc-10x10-unorm-srgb': {f: texture_compression_astc},\n 'astc-12x10-unorm': {f: texture_compression_astc},\n 'astc-12x10-unorm-srgb': {f: texture_compression_astc},\n 'astc-12x12-unorm': {f: texture_compression_astc},\n 'astc-12x12-unorm-srgb': {f: texture_compression_astc},\n\n // WEBGL_compressed_texture_pvrtc\n\n 'pvrtc-rgb4unorm-webgl': {f: texture_compression_pvrtc_webgl},\n 'pvrtc-rgba4unorm-webgl': {f: texture_compression_pvrtc_webgl},\n 'pvrtc-rbg2unorm-webgl': {f: texture_compression_pvrtc_webgl},\n 'pvrtc-rgba2unorm-webgl': {f: texture_compression_pvrtc_webgl},\n\n // WEBGL_compressed_texture_etc1\n\n 'etc1-rbg-unorm-webgl': {f: texture_compression_etc1_webgl},\n\n // WEBGL_compressed_texture_atc\n\n 'atc-rgb-unorm-webgl': {f: texture_compression_atc_webgl},\n 'atc-rgba-unorm-webgl': {f: texture_compression_atc_webgl},\n 'atc-rgbai-unorm-webgl': {f: texture_compression_atc_webgl}\n};\n\nexport const TEXTURE_FORMAT_TABLE: Readonly<Record<TextureFormat, TextureFormatDefinition>> = {\n ...TEXTURE_FORMAT_COLOR_DEPTH_TABLE,\n ...TEXTURE_FORMAT_COMPRESSED_TABLE\n};\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {NormalizedDataType} from '../data-types/data-types';\nimport {getDataTypeInfo} from '../data-types/decode-data-types';\nimport type {\n TextureFormat,\n TextureFormatCompressed,\n TextureFormatInfo,\n TextureFormatCapabilities,\n TextureFormatColor\n} from './texture-formats';\nimport {getTextureFormatDefinition} from './texture-format-table';\n\n// prettier-ignore\nconst COMPRESSED_TEXTURE_FORMAT_PREFIXES = [\n 'bc1', 'bc2', 'bc3', 'bc4', 'bc5', 'bc6', 'bc7', 'etc1', 'etc2', 'eac', 'atc', 'astc', 'pvrtc'\n];\n\nconst RGB_FORMAT_REGEX = /^(r|rg|rgb|rgba|bgra)([0-9]*)([a-z]*)(-srgb)?(-webgl)?$/;\n\nexport class TextureFormatDecoder {\n /** Returns information about a texture format, e.g. attatchment type, components, byte length and flags (integer, signed, normalized) */\n getInfo(format: TextureFormat): TextureFormatInfo {\n return getTextureFormatInfo(format);\n }\n\n /** Checks if a texture format is color */\n isColor(format: TextureFormat): format is TextureFormatColor {\n return format.startsWith('rgba') || format.startsWith('bgra') || format.startsWith('rgb');\n }\n\n /** Checks if a texture format is depth or stencil */\n isDepthStencil(format: TextureFormat): boolean {\n return format.startsWith('depth') || format.startsWith('stencil');\n }\n\n /** Checks if a texture format is compressed */\n isCompressed(format: TextureFormat): format is TextureFormatCompressed {\n return COMPRESSED_TEXTURE_FORMAT_PREFIXES.some(prefix => (format as string).startsWith(prefix));\n }\n\n /**\n * Returns the \"static\" capabilities of a texture format.\n * @note Needs to be checked against current device\n */\n getCapabilities(format: TextureFormat): TextureFormatCapabilities {\n const info = getTextureFormatDefinition(format);\n\n const formatCapabilities: Required<TextureFormatCapabilities> = {\n format,\n create: info.f ?? true,\n render: info.render ?? true,\n filter: info.filter ?? true,\n blend: info.blend ?? true,\n store: info.store ?? true\n };\n\n const formatInfo = getTextureFormatInfo(format);\n const isDepthStencil = format.startsWith('depth') || format.startsWith('stencil');\n const isSigned = formatInfo?.signed;\n const isInteger = formatInfo?.integer;\n const isWebGLSpecific = formatInfo?.webgl;\n\n // signed formats are not renderable\n formatCapabilities.render &&= !isSigned;\n // signed and integer formats are not filterable\n formatCapabilities.filter &&= !isDepthStencil && !isSigned && !isInteger && !isWebGLSpecific;\n\n return formatCapabilities;\n }\n}\n\nexport const textureFormatDecoder = new TextureFormatDecoder();\n\n// HELPERS\n\n/**\n * Decodes a texture format, returning e.g. attatchment type, components, byte length and flags (integer, signed, normalized)\n */\nfunction getTextureFormatInfo(format: TextureFormat): TextureFormatInfo {\n let formatInfo: TextureFormatInfo = getTextureFormatInfoUsingTable(format);\n\n if (textureFormatDecoder.isCompressed(format)) {\n formatInfo.channels = 'rgb';\n formatInfo.components = 3;\n formatInfo.bytesPerPixel = 1;\n formatInfo.srgb = false;\n formatInfo.compressed = true;\n\n const blockSize = getCompressedTextureBlockSize(format);\n if (blockSize) {\n formatInfo.blockWidth = blockSize.blockWidth;\n formatInfo.blockHeight = blockSize.blockHeight;\n }\n }\n\n // Fill in missing information that can be derived from the format string\n const matches = RGB_FORMAT_REGEX.exec(format as string);\n if (matches) {\n const [, channels, length, type, srgb, suffix] = matches;\n const dataType = `${type}${length}` as NormalizedDataType;\n const decodedType = getDataTypeInfo(dataType);\n const bits = decodedType.byteLength * 8;\n const components = channels.length as 1 | 2 | 3 | 4;\n const bitsPerChannel: [number, number, number, number] = [\n bits,\n components >= 2 ? bits : 0,\n components >= 3 ? bits : 0,\n components >= 4 ? bits : 0\n ];\n\n formatInfo = {\n format,\n attachment: formatInfo.attachment,\n dataType: decodedType.signedType,\n components,\n channels: channels as 'r' | 'rg' | 'rgb' | 'rgba',\n integer: decodedType.integer,\n signed: decodedType.signed,\n normalized: decodedType.normalized,\n bitsPerChannel,\n bytesPerPixel: decodedType.byteLength * channels.length,\n packed: formatInfo.packed,\n srgb: formatInfo.srgb\n };\n\n if (suffix === '-webgl') {\n formatInfo.webgl = true;\n }\n // dataType - overwritten by decodedType\n if (srgb === '-srgb') {\n formatInfo.srgb = true;\n }\n }\n\n if (format.endsWith('-webgl')) {\n formatInfo.webgl = true;\n }\n if (format.endsWith('-srgb')) {\n formatInfo.srgb = true;\n }\n\n return formatInfo;\n}\n\n/** Decode texture format info from the table */\nfunction getTextureFormatInfoUsingTable(format: TextureFormat): TextureFormatInfo {\n const info = getTextureFormatDefinition(format);\n\n const bytesPerPixel = info.bytesPerPixel || 1;\n const bitsPerChannel = info.bitsPerChannel || [8, 8, 8, 8];\n delete info.bitsPerChannel;\n delete info.bytesPerPixel;\n delete info.f;\n delete info.render;\n delete info.filter;\n delete info.blend;\n delete info.store;\n\n const formatInfo: TextureFormatInfo = {\n ...info,\n format,\n attachment: info.attachment || 'color',\n channels: info.channels || 'r',\n components: (info.components || info.channels?.length || 1) as 1 | 2 | 3 | 4,\n bytesPerPixel,\n bitsPerChannel,\n dataType: info.dataType || 'uint8',\n srgb: info.srgb ?? false,\n packed: info.packed ?? false,\n webgl: info.webgl ?? false,\n integer: info.integer ?? false,\n signed: info.signed ?? false,\n normalized: info.normalized ?? false,\n compressed: info.compressed ?? false\n };\n\n return formatInfo;\n}\n\n/** Parses ASTC block widths from format string */\nfunction getCompressedTextureBlockSize(\n format: TextureFormatCompressed\n): {blockWidth: number; blockHeight: number} | null {\n const REGEX = /.*-(\\d+)x(\\d+)-.*/;\n const matches = REGEX.exec(format as string);\n if (matches) {\n const [, blockWidth, blockHeight] = matches;\n return {blockWidth: Number(blockWidth), blockHeight: Number(blockHeight)};\n }\n return null;\n}\n\n/*\n'r8unorm':\t{s: \"float\"}, // \t\u2713\t\u2713\t\u2713\t},\n'r8snorm':\t{s: \"float\"}, // \t\t\u2713\t\t},\n'r8uint':\t{s: \"uint\"}, // \t\u2713\t\u2713\t\t},\n'r8sint':\t{s: \"sint\"}, // \t\u2713\t\u2713\t\t},\n'rg8unorm':\t{s: \"float\"}, // \t\u2713\t\u2713\t\u2713\t},\n'rg8snorm':\t{s: \"float\"}, // \t\t\u2713\t\t},\n'rg8uint':\t{s: \"uint\"}, // \t\u2713\t\u2713\t\t},\n'rg8sint':\t{s: \"sint\"}, // \t\u2713\t\u2713\t\t},\n'rgba8unorm':\t{s: \"float\"}, // \t\u2713\t\u2713\t\u2713\t\u2713},\n'rgba8unorm-srgb': {s: \"float\"}, // \t\u2713\t\u2713\t\u2713\t},\n'rgba8snorm':\t{s: \"float\"}, // \t\t\u2713\t\t\u2713},\n'rgba8uint':\t{s: \"uint\"}, // \t\u2713\t\u2713\t\t\u2713},\n'rgba8sint':\t{s: \"sint\"}, // \t\u2713\t\u2713\t\t\u2713},\n'bgra8unorm':\t{s: \"float\"}, // \t\u2713\t\u2713\t\u2713\t},\n'bgra8unorm-srgb': {s: \"float\"}, // \t\u2713\t\u2713\t\u2713\t},\n// 16-bit per component\t\t\t\t\t\n'r16uint': {s: \"uint\"}, // \t\u2713\t\u2713\t\t},\n'r16sint': {s: \"sint\"}, // \t\u2713\t\u2713\t\t},\n'r16float': {s: \"float\"}, // \t\u2713\t\u2713\t\u2713\t},\n'rg16uint': {s: \"uint\"}, // \t\u2713\t\u2713\t\t},\n'rg16sint': {s: \"sint\"}, // \t\u2713\t\u2713\t\t},\n'rg16float': {s: \"float\"}, // \t\u2713\t\u2713\t\u2713\t},\n'rgba16uint': {s: \"uint\"}, // \t\u2713\t\u2713\t\t\u2713},\n'rgba16sint': {s: \"sint\"}, // \t\u2713\t\u2713\t\t\u2713},\n'rgba16float': {s: \"float\"}, // \t\u2713\t\u2713\t\u2713\t\u2713},\n// 32-bit per component\t\t\t\t\t\n'r32uint': {s: \"uint\"}, // \t\u2713\t\t\t\u2713},\n'r32sint': {s: \"sint\"}, // \t\u2713\t\t\t\u2713},\n'r32float': {\"unfilterable-float\"\t\u2713\t\u2713\t\t\u2713},\n'rg32uint': {s: \"uint\"}, // \t\u2713\t\t\t\u2713},\n'rg32sint': {s: \"sint\"}, // \t\u2713\t\t\t\u2713},\n'rg32float': {\"unfilterable-float\"\t\u2713\t\t\t\u2713},\n'rgba32uint': {s: \"uint\"}, // \t\u2713\t\t\t\u2713},\n'rgba32sint': {s: \"sint\"}, // \t\u2713\t\t\t\u2713},\n'rgba32float': {\"unfilterable-float\"\t\u2713\t\t\t\u2713},\n// mixed component width\t\t\t\t\t\n'rgb10a2unorm': {s: \"float\"}, // \t\u2713\t\u2713\t\u2713\t}\n'rg11b10ufloat': {s: \"float\"}, // \t\t\u2713\t\t}\n// Format\tBytes per texel\tAspect\tGPUTextureSampleType\tValid image copy source\tValid image copy destination\n'stencil8': {1 \u2212 4\tstencil\t\"uint\"\t\u2713}\n'depth16unorm': {2\tdepth\t\"depth\"\t\u2713}\n'depth24plus': {4\tdepth\t\"depth\"\t\u2717}\n'depth24plus': {stencil8\t4 \u2212 8\tdepth\t\"depth\"\t\u2717}\n'stencil': {s: \"uint\"}, // \t\u2713}\n'depth32float': {4\tdepth\t\"depth\"\t\u2713\t\u2717}\n'depth24unorm': {stencil8\t4\tdepth\t\"depth\"\t\u2717}\n'stencil': {s: \"uint\"}, // \t\u2713}\n'depth32float': {stencil8}\n\n// Format\tBytes per block\tGPUTextureSampleType\tBlock Size\tFeature\n'rgb9e5ufloat': {c: 4, s: \"float\",\tbpp: 4/(1*1)},\n\n'bc1-rgba-unorm': {c: 4. s: \"float\", bpp: 8/(4 * 4) f: 'texture-compression-bc'},\n'bc1-rgba-unorm-srgb': {c: 4. s: \"float\", bpp: 8/(4 * 4) f: 'texture-compression-bc'},\n'bc2-rgba-unorm': {c: 4. s: \"float\", bpp: 16/(4 * 4) f: 'texture-compression-bc'},\n'bc2-rgba-unorm-srgb': {c: 4. s: \"float\", bpp: 16/(4 * 4) f: 'texture-compression-bc'},\n'bc3-rgba-unorm': {c: 4. s: \"float\", bpp: 16/(4 * 4) f: 'texture-compression-bc'},\n'bc3-rgba-unorm-srgb': {c: 4. s: \"float\", bpp: 16/(4 * 4) f: 'texture-compression-bc'},\n'bc4-r-unorm': {c: 1. s: \"float\", bpp: 8/(4 * 4) f: 'texture-compression-bc'},\n'bc4-r-snorm': {c: 1. s: \"float\", bpp: 8/(4 * 4) f: 'texture-compression-bc'},\n'bc5-rg-unorm': {c: 2. s: \"float\", bpp: 16/(4 * 4) f: 'texture-compression-bc'},\n'bc5-rg-snorm': { },\n'bc6h-rgb-ufloat': {\t16 },\n'bc6h-rgb-float': { },\n'bc7-rgba-unorm': {\t16 },\n'bc7-rgba-unorm-srgb': { },\n\n'etc2-rgb8unorm': {\t8\t\"float\"\t4 \u00D7 4\ttexture-compression-etc2 },\n'etc2-rgb8unorm-srgb': { },\n'etc2-rgb8a1unorm': {\t8 },\n'etc2-rgb8a1unorm-srgb': { },\n'etc2-rgba8unorm': {\t16 },\n'etc2-rgba8unorm-srgb': { },\n\n'eac-r11unorm': {\t8 },\n'eac-r11snorm': { },\n'eac-rg11unorm': {\t16 },\n'eac-rg11snorm': { },\n\n'astc-4x4-unorm': {\t16\t\"float\"\t4 \u00D7 4\ttexture-compression-astc },\n'astc-4x4-unorm-srgb': { },\n'astc-5x4-unorm': {\t16\t5 \u00D7 4 },\n'astc-5x4-unorm-srgb': { },\n'astc-5x5-unorm': {\t16\t5 \u00D7 5 },\n'astc-5x5-unorm-srgb': { },\n'astc-6x5-unorm': {\t16\t6 \u00D7 5 },\n'astc-6x5-unorm-srgb': { },\n'astc-6x6-unorm': {\t16\t6 \u00D7 6 },\n'astc-6x6-unorm-srgb': { },\n'astc-8x5-unorm': {\t16\t8 \u00D7 5 },\n'astc-8x5-unorm-srgb': { },\n'astc-8x6-unorm': {\t16\t8 \u00D7 6 },\n'astc-8x6-unorm-srgb': { },\n'astc-8x8-unorm': {\t16\t8 \u00D7 8 },\n'astc-8x8-unorm-srgb': { },\n'astc-10x5-unorm': {\t16\t10 \u00D7 5 },\n'astc-10x5-unorm-srgb': { },\n'astc-10x6-unorm': {\t16\t10 \u00D7 6 },\n'astc-10x6-unorm-srgb': { },\n'astc-10x8-unorm': {\t16\t10 \u00D7 8 },\n'astc-10x8-unorm-srgb': { },\n'astc-10x10-unorm': {\t16\t10 \u00D7 10 },\n'astc-10x10-unorm-srgb': { },\n'astc-12x10-unorm': {\t16\t12 \u00D7 10 },\n'astc-12x10-unorm-srgb': { },\n'astc-12x12-unorm': {\t16 },\n*/\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n/**\n * Built-in data types that can be used to initialize textures\n * @note ImageData can be used for contiguous 8 bit data via Uint8ClampedArray\n */\nexport type ExternalImage =\n | ImageBitmap\n | ImageData\n | HTMLImageElement\n | HTMLVideoElement\n | VideoFrame\n | HTMLCanvasElement\n | OffscreenCanvas;\n\nexport type ExternalImageData = {\n data: ArrayBuffer | SharedArrayBuffer | ArrayBufferView;\n byteOffset?: number;\n bytesPerRow?: number;\n rowsPerImage?: number;\n};\n\n/** Check if data is an external image */\nexport function isExternalImage(data: unknown): data is ExternalImage {\n return (\n (typeof ImageData !== 'undefined' && data instanceof ImageData) ||\n (typeof ImageBitmap !== 'undefined' && data instanceof ImageBitmap) ||\n (typeof HTMLImageElement !== 'undefined' && data instanceof HTMLImageElement) ||\n (typeof HTMLVideoElement !== 'undefined' && data instanceof HTMLVideoElement) ||\n (typeof VideoFrame !== 'undefined' && data instanceof VideoFrame) ||\n (typeof HTMLCanvasElement !== 'undefined' && data instanceof HTMLCanvasElement) ||\n (typeof OffscreenCanvas !== 'undefined' && data instanceof OffscreenCanvas)\n );\n}\n\n/** Determine size (width and height) of provided image data */\nexport function getExternalImageSize(data: ExternalImage): {width: number; height: number} {\n if (\n (typeof ImageData !== 'undefined' && data instanceof ImageData) ||\n (typeof ImageBitmap !== 'undefined' && data instanceof ImageBitmap) ||\n (typeof HTMLCanvasElement !== 'undefined' && data instanceof HTMLCanvasElement) ||\n (typeof OffscreenCanvas !== 'undefined' && data instanceof OffscreenCanvas)\n ) {\n return {width: data.width, height: data.height};\n }\n if (typeof HTMLImageElement !== 'undefined' && data instanceof HTMLImageElement) {\n return {width: data.naturalWidth, height: data.naturalHeight};\n }\n if (typeof HTMLVideoElement !== 'undefined' && data instanceof HTMLVideoElement) {\n return {width: data.videoWidth, height: data.videoHeight};\n }\n if (typeof VideoFrame !== 'undefined' && data instanceof VideoFrame) {\n // TODO: is this the right choice for width and height?\n return {width: data.displayWidth, height: data.displayHeight};\n }\n throw new Error('Unknown image type');\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {StatsManager, lumaStats} from '../utils/stats-manager';\nimport {log} from '../utils/log';\nimport {uid} from '../utils/uid';\nimport type {VertexFormat, VertexFormatInfo} from '../shadertypes/vertex-arrays/vertex-formats';\nimport type {TextureFormat, TextureFormatInfo} from '../shadertypes/textures/texture-formats';\nimport type {CanvasContext, CanvasContextProps} from './canvas-context';\nimport type {BufferProps} from './resources/buffer';\nimport {Buffer} from './resources/buffer';\nimport type {RenderPipeline, RenderPipelineProps} from './resources/render-pipeline';\nimport type {ComputePipeline, ComputePipelineProps} from './resources/compute-pipeline';\nimport type {Sampler, SamplerProps} from './resources/sampler';\nimport type {Shader, ShaderProps} from './resources/shader';\nimport type {Texture, TextureProps} from './resources/texture';\nimport type {ExternalTexture, ExternalTextureProps} from './resources/external-texture';\nimport type {Framebuffer, FramebufferProps} from './resources/framebuffer';\nimport type {RenderPass, RenderPassProps} from './resources/render-pass';\nimport type {ComputePass, ComputePassProps} from './resources/compute-pass';\nimport type {CommandEncoder, CommandEncoderProps} from './resources/command-encoder';\nimport type {CommandBuffer} from './resources/command-buffer';\nimport type {VertexArray, VertexArrayProps} from './resources/vertex-array';\nimport type {TransformFeedback, TransformFeedbackProps} from './resources/transform-feedback';\nimport type {QuerySet, QuerySetProps} from './resources/query-set';\n\nimport {getVertexFormatInfo} from '../shadertypes/vertex-arrays/decode-vertex-format';\nimport {textureFormatDecoder} from '../shadertypes/textures/texture-format-decoder';\nimport type {ExternalImage} from '../image-utils/image-types';\nimport {isExternalImage, getExternalImageSize} from '../image-utils/image-types';\n\n/**\n * Identifies the GPU vendor and driver.\n * @note Chrome WebGPU does not provide much information, though more can be enabled with\n * @see https://developer.chrome.com/blog/new-in-webgpu-120#adapter_information_updates\n * chrome://flags/#enable-webgpu-developer-features\n */\nexport type DeviceInfo = {\n /** Type of device */\n type: 'webgl' | 'webgpu' | 'null' | 'unknown';\n /** Vendor (name of GPU vendor, Apple, nVidia etc */\n vendor: string;\n /** Renderer (usually driver name) */\n renderer: string;\n /** version of driver */\n version: string;\n /** family of GPU */\n gpu: 'nvidia' | 'amd' | 'intel' | 'apple' | 'software' | 'unknown';\n /** Type of GPU () */\n gpuType: 'discrete' | 'integrated' | 'cpu' | 'unknown';\n /** GPU architecture */\n gpuArchitecture?: string; // 'common-3' on Apple\n /** GPU driver backend. Can sometimes be sniffed */\n gpuBackend?: 'opengl' | 'opengles' | 'metal' | 'd3d11' | 'd3d12' | 'vulkan' | 'unknown';\n /** If this is a fallback adapter */\n fallback?: boolean;\n /** Shader language supported by device.createShader() */\n shadingLanguage: 'wgsl' | 'glsl';\n /** Highest supported shader language version: GLSL 3.00 = 300, WGSL 1.00 = 100 */\n shadingLanguageVersion: number;\n};\n\n/** Limits for a device (max supported sizes of resources, max number of bindings etc) */\nexport abstract class DeviceLimits {\n /** max number of TextureDimension1D */\n abstract maxTextureDimension1D: number;\n /** max number of TextureDimension2D */\n abstract maxTextureDimension2D: number;\n /** max number of TextureDimension3D */\n abstract maxTextureDimension3D: number;\n /** max number of TextureArrayLayers */\n abstract maxTextureArrayLayers: number;\n /** max number of BindGroups */\n abstract maxBindGroups: number;\n /** max number of DynamicUniformBuffers per PipelineLayout */\n abstract maxDynamicUniformBuffersPerPipelineLayout: number;\n /** max number of DynamicStorageBuffers per PipelineLayout */\n abstract maxDynamicStorageBuffersPerPipelineLayout: number;\n /** max number of SampledTextures per ShaderStage */\n abstract maxSampledTexturesPerShaderStage: number;\n /** max number of Samplers per ShaderStage */\n abstract maxSamplersPerShaderStage: number;\n /** max number of StorageBuffers per ShaderStage */\n abstract maxStorageBuffersPerShaderStage: number;\n /** max number of StorageTextures per ShaderStage */\n abstract maxStorageTexturesPerShaderStage: number;\n /** max number of UniformBuffers per ShaderStage */\n abstract maxUniformBuffersPerShaderStage: number;\n /** max number of UniformBufferBindingSize */\n abstract maxUniformBufferBindingSize: number;\n /** max number of StorageBufferBindingSize */\n abstract maxStorageBufferBindingSize: number;\n /** min UniformBufferOffsetAlignment */\n abstract minUniformBufferOffsetAlignment: number;\n /** min StorageBufferOffsetAlignment */\n abstract minStorageBufferOffsetAlignment: number;\n /** max number of VertexBuffers */\n abstract maxVertexBuffers: number;\n /** max number of VertexAttributes */\n abstract maxVertexAttributes: number;\n /** max number of VertexBufferArrayStride */\n abstract maxVertexBufferArrayStride: number;\n /** max number of InterStageShaderComponents */\n abstract maxInterStageShaderVariables: number;\n /** max number of ComputeWorkgroupStorageSize */\n abstract maxComputeWorkgroupStorageSize: number;\n /** max number of ComputeInvocations per Workgroup */\n abstract maxComputeInvocationsPerWorkgroup: number;\n /** max ComputeWorkgroupSizeX */\n abstract maxComputeWorkgroupSizeX: number;\n /** max ComputeWorkgroupSizeY */\n abstract maxComputeWorkgroupSizeY: number;\n /** max ComputeWorkgroupSizeZ */\n abstract maxComputeWorkgroupSizeZ: number;\n /** max ComputeWorkgroupsPerDimension */\n abstract maxComputeWorkgroupsPerDimension: number;\n}\n\n/** Set-like class for features (lets apps check for WebGL / WebGPU extensions) */\nexport class DeviceFeatures {\n protected features: Set<DeviceFeature>;\n protected disabledFeatures?: Partial<Record<DeviceFeature, boolean>>;\n\n constructor(\n features: DeviceFeature[] = [],\n disabledFeatures: Partial<Record<DeviceFeature, boolean>>\n ) {\n this.features = new Set<DeviceFeature>(features);\n this.disabledFeatures = disabledFeatures || {};\n }\n\n *[Symbol.iterator](): IterableIterator<DeviceFeature> {\n yield* this.features;\n }\n\n has(feature: DeviceFeature): boolean {\n return !this.disabledFeatures?.[feature] && this.features.has(feature);\n }\n}\n\n/** Device feature names */\nexport type DeviceFeature =\n | WebGPUDeviceFeature\n | WebGLDeviceFeature\n | WebGLCompressedTextureFeatures;\n// | ChromeExperimentalFeatures\n\n/** Chrome-specific extensions. Expected to eventually become standard features. */\n// export type ChromeExperimentalFeatures = ;\n\nexport type WebGPUDeviceFeature =\n | 'depth-clip-control'\n | 'depth32float-stencil8'\n | 'texture-compression-bc'\n | 'texture-compression-bc-sliced-3d'\n | 'texture-compression-etc2'\n | 'texture-compression-astc'\n | 'texture-compression-astc-sliced-3d'\n | 'timestamp-query'\n | 'indirect-first-instance'\n | 'shader-f16'\n | 'rg11b10ufloat-renderable' // Is the rg11b10ufloat texture format renderable?\n | 'bgra8unorm-storage' // Can the bgra8unorm texture format be used in storage buffers?\n | 'float32-filterable' // Is the float32 format filterable?\n | 'float32-blendable' // Is the float32 format blendable?\n | 'clip-distances'\n | 'dual-source-blending'\n | 'subgroups';\n// | 'depth-clamping' // removed from the WebGPU spec...\n// | 'pipeline-statistics-query' // removed from the WebGPU spec...\n\nexport type WebGLDeviceFeature =\n // webgl extension features\n | 'timer-query-webgl' // unify with WebGPU timestamp-query?\n | 'compilation-status-async-webgl' // Non-blocking shader compile/link status query available\n | 'provoking-vertex-webgl' // parameters.provokingVertex\n | 'polygon-mode-webgl' // parameters.polygonMode and parameters.polygonOffsetLine\n\n // GLSL extension features\n | 'shader-noperspective-interpolation-webgl' // Vertex outputs & fragment inputs can have a `noperspective` interpolation qualifier.\n | 'shader-conservative-depth-webgl' // GLSL `gl_FragDepth` qualifiers `depth_unchanged` etc can enable early depth test\n | 'shader-clip-cull-distance-webgl' // Makes gl_ClipDistance and gl_CullDistance available in shaders\n\n // texture rendering\n | 'float32-renderable-webgl'\n | 'float16-renderable-webgl'\n | 'rgb9e5ufloat-renderable-webgl'\n | 'snorm8-renderable-webgl'\n | 'norm16-renderable-webgl'\n | 'snorm16-renderable-webgl'\n\n // texture filtering\n | 'float16-filterable-webgl'\n | 'texture-filterable-anisotropic-webgl'\n\n // texture storage bindings\n | 'bgra8unorm-storage'\n\n // texture blending\n | 'texture-blend-float-webgl';\n\ntype WebGLCompressedTextureFeatures =\n | 'texture-compression-bc5-webgl'\n | 'texture-compression-bc7-webgl'\n | 'texture-compression-etc1-webgl'\n | 'texture-compression-pvrtc-webgl'\n | 'texture-compression-atc-webgl';\n\n/** Texture format capabilities that have been checked against a specific device */\nexport type DeviceTextureFormatCapabilities = {\n format: TextureFormat;\n /** Can the format be created and sampled?*/\n create: boolean;\n /** Is the format renderable. */\n render: boolean;\n /** Is the format filterable. */\n filter: boolean;\n /** Is the format blendable. */\n blend: boolean;\n /** Is the format storeable. */\n store: boolean;\n};\n\n/** Device properties */\nexport type DeviceProps = {\n /** string id for debugging. Stored on the object, used in logging and set on underlying GPU objects when feasible. */\n id?: string;\n /** Properties for creating a default canvas context */\n createCanvasContext?: CanvasContextProps | true;\n /** Control which type of GPU is preferred on systems with both integrated and discrete GPU. Defaults to \"high-performance\" / discrete GPU. */\n powerPreference?: 'default' | 'high-performance' | 'low-power';\n /** Hints that device creation should fail if no hardware GPU is available (if the system performance is \"low\"). */\n failIfMajorPerformanceCaveat?: boolean;\n\n /** WebGL specific: Properties passed through to WebGL2RenderingContext creation: `canvas.getContext('webgl2', props.webgl)` */\n webgl?: WebGLContextProps;\n\n // CALLBACKS\n\n /** Error handler. If it returns a probe logger style function, it will be called at the site of the error to optimize console error links. */\n onError?: (error: Error, context?: unknown) => unknown;\n /** Called when the size of a CanvasContext's canvas changes */\n onResize?: (ctx: CanvasContext, info: {oldPixelSize: [number, number]}) => unknown;\n /** Called when the absolute position of a CanvasContext's canvas changes. Must set `CanvasContextProps.trackPosition: true` */\n onPositionChange?: (ctx: CanvasContext, info: {oldPosition: [number, number]}) => unknown;\n /** Called when the visibility of a CanvasContext's canvas changes */\n onVisibilityChange?: (ctx: CanvasContext) => unknown;\n /** Called when the device pixel ratio of a CanvasContext's canvas changes */\n onDevicePixelRatioChange?: (ctx: CanvasContext, info: {oldRatio: number}) => unknown;\n\n // DEBUG SETTINGS\n\n /** Turn on implementation defined checks that slow down execution but help break where errors occur */\n debug?: boolean;\n /** Show shader source in browser? The default is `'error'`, meaning that logs are shown when shader compilation has errors */\n debugShaders?: 'never' | 'errors' | 'warnings' | 'always';\n /** Renders a small version of updated Framebuffers into the primary canvas context. Can be set in console luma.log.set('debug-framebuffers', true) */\n debugFramebuffers?: boolean;\n /** Traces resource caching, reuse, and destroys in the PipelineFactory */\n debugFactories?: boolean;\n /** WebGL specific - Trace WebGL calls (instruments WebGL2RenderingContext at the expense of performance). Can be set in console luma.log.set('debug-webgl', true) */\n debugWebGL?: boolean;\n /** WebGL specific - Initialize the SpectorJS WebGL debugger. Can be set in console luma.log.set('debug-spectorjs', true) */\n debugSpectorJS?: boolean;\n /** WebGL specific - SpectorJS URL. Override if CDN is down or different SpectorJS version is desired. */\n debugSpectorJSUrl?: string;\n\n // EXPERIMENTAL SETTINGS - subject to change\n\n /** adapter.create() returns the existing Device if the provided canvas' WebGL context is already associated with a Device. */\n _reuseDevices?: boolean;\n /** WebGPU specific - Request a Device with the highest limits supported by platform. On WebGPU devices can be created with minimal limits. */\n _requestMaxLimits?: boolean;\n /** Disable specific features */\n _disabledFeatures?: Partial<Record<DeviceFeature, boolean>>;\n /** WebGL specific - Initialize all features on startup */\n _initializeFeatures?: boolean;\n /** Enable shader caching (via ShaderFactory) */\n _cacheShaders?: boolean;\n /** Enable shader caching (via PipelineFactory) */\n _cachePipelines?: boolean;\n /** Never destroy cached shaders and pipelines */\n _cacheDestroyPolicy?: 'unused' | 'never';\n\n /** @deprecated Internal, Do not use directly! Use `luma.attachDevice()` to attach to pre-created contexts/devices. */\n _handle?: unknown; // WebGL2RenderingContext | GPUDevice | null;\n};\n\n/** WebGL independent copy of WebGLContextAttributes */\ntype WebGLContextProps = {\n /** indicates if the canvas contains an alpha buffer. */\n alpha?: boolean;\n /** hints the user agent to reduce the latency by desynchronizing the canvas paint cycle from the event loop */\n desynchronized?: boolean;\n /** indicates whether or not to perform anti-aliasing. */\n antialias?: boolean;\n /** indicates that the render target has a stencil buffer of at least `8` bits. */\n stencil?: boolean;\n /** indicates that the drawing buffer has a depth buffer of at least 16 bits. */\n depth?: boolean;\n /** indicates if a context will be created if the system performance is low or if no hardware GPU is available. */\n failIfMajorPerformanceCaveat?: boolean;\n /** Selects GPU */\n powerPreference?: 'default' | 'high-performance' | 'low-power';\n /** page compositor will assume the drawing buffer contains colors with pre-multiplied alpha. */\n premultipliedAlpha?: boolean;\n /** buffers will not be cleared and will preserve their values until cleared or overwritten by the author. */\n preserveDrawingBuffer?: boolean;\n};\n\n/**\n * Create and attach devices for a specific backend. Currently static methods on each device\n */\nexport interface DeviceFactory {\n // new (props: DeviceProps): Device; Constructor isn't used\n type: string;\n isSupported(): boolean;\n create(props: DeviceProps): Promise<Device>;\n attach?(handle: unknown): Device;\n}\n\n/**\n * WebGPU Device/WebGL context abstraction\n */\nexport abstract class Device {\n static defaultProps: Required<DeviceProps> = {\n id: null!,\n powerPreference: 'high-performance',\n failIfMajorPerformanceCaveat: false,\n createCanvasContext: undefined!,\n // WebGL specific\n webgl: {},\n\n // Callbacks\n // eslint-disable-next-line handle-callback-err\n onError: (error: Error, context: unknown) => {},\n onResize: (context: CanvasContext, info: {oldPixelSize: [number, number]}) => {\n const [width, height] = context.getDevicePixelSize();\n log.log(1, `${context} resized => ${width}x${height}px`)();\n },\n onPositionChange: (context: CanvasContext, info: {oldPosition: [number, number]}) => {\n const [left, top] = context.getPosition();\n log.log(1, `${context} repositioned => ${left},${top}`)();\n },\n onVisibilityChange: (context: CanvasContext) =>\n log.log(1, `${context} Visibility changed ${context.isVisible}`)(),\n onDevicePixelRatioChange: (context: CanvasContext, info: {oldRatio: number}) =>\n log.log(1, `${context} DPR changed ${info.oldRatio} => ${context.devicePixelRatio}`)(),\n\n // Debug flags\n debug: log.get('debug') || undefined!,\n debugShaders: log.get('debug-shaders') || undefined!,\n debugFramebuffers: Boolean(log.get('debug-framebuffers')),\n debugFactories: Boolean(log.get('debug-factories')),\n debugWebGL: Boolean(log.get('debug-webgl')),\n debugSpectorJS: undefined!, // Note: log setting is queried by the spector.js code\n debugSpectorJSUrl: undefined!,\n\n // Experimental\n _reuseDevices: false,\n _requestMaxLimits: true,\n _cacheShaders: false,\n _cachePipelines: false,\n _cacheDestroyPolicy: 'unused',\n // TODO - Change these after confirming things work as expected\n _initializeFeatures: true,\n _disabledFeatures: {\n 'compilation-status-async-webgl': true\n },\n\n // INTERNAL\n _handle: undefined!\n };\n\n get [Symbol.toStringTag](): string {\n return 'Device';\n }\n\n toString(): string {\n return `Device(${this.id})`;\n }\n\n /** id of this device, primarily for debugging */\n readonly id: string;\n /** type of this device */\n abstract readonly type: 'webgl' | 'webgpu' | 'null' | 'unknown';\n abstract readonly handle: unknown;\n abstract commandEncoder: CommandEncoder;\n\n /** A copy of the device props */\n readonly props: Required<DeviceProps>;\n /** Available for the application to store data on the device */\n userData: {[key: string]: unknown} = {};\n /** stats */\n readonly statsManager: StatsManager = lumaStats;\n /** An abstract timestamp used for change tracking */\n timestamp: number = 0;\n\n /** True if this device has been reused during device creation (app has multiple references) */\n _reused: boolean = false;\n /** Used by other luma.gl modules to store data on the device */\n _lumaData: {[key: string]: unknown} = {};\n\n // Capabilities\n\n /** Information about the device (vendor, versions etc) */\n abstract info: DeviceInfo;\n /** Optional capability discovery */\n abstract features: DeviceFeatures;\n /** WebGPU style device limits */\n abstract get limits(): DeviceLimits;\n\n // Texture helpers\n\n /** Optimal TextureFormat for displaying 8-bit depth, standard dynamic range content on this system. */\n abstract preferredColorFormat: 'rgba8unorm' | 'bgra8unorm';\n /** Default depth format used on this system */\n abstract preferredDepthFormat: 'depth16' | 'depth24plus' | 'depth32float';\n\n protected _textureCaps: Partial<Record<TextureFormat, DeviceTextureFormatCapabilities>> = {};\n\n constructor(props: DeviceProps) {\n this.props = {...Device.defaultProps, ...props};\n this.id = this.props.id || uid(this[Symbol.toStringTag].toLowerCase());\n }\n\n abstract destroy(): void;\n\n getVertexFormatInfo(format: VertexFormat): VertexFormatInfo {\n return getVertexFormatInfo(format);\n }\n\n isVertexFormatSupported(format: VertexFormat): boolean {\n return true;\n }\n\n /** Returns information about a texture format, such as data type, channels, bits per channel, compression etc */\n getTextureFormatInfo(format: TextureFormat): TextureFormatInfo {\n return textureFormatDecoder.getInfo(format);\n }\n\n /** Determines what operations are supported on a texture format on this particular device (checks against supported device features) */\n getTextureFormatCapabilities(format: TextureFormat): DeviceTextureFormatCapabilities {\n let textureCaps = this._textureCaps[format];\n if (!textureCaps) {\n const capabilities = this._getDeviceTextureFormatCapabilities(format);\n textureCaps = this._getDeviceSpecificTextureFormatCapabilities(capabilities);\n this._textureCaps[format] = textureCaps;\n }\n return textureCaps;\n }\n\n /** Return the implementation specific alignment for a texture format. 1 on WebGL, 256 on WebGPU */\n abstract getTextureByteAlignment(): number;\n\n /** Calculates the number of mip levels for a texture of width, height and in case of 3d textures only, depth */\n getMipLevelCount(width: number, height: number, depth3d: number = 1): number {\n const maxSize = Math.max(width, height, depth3d);\n return 1 + Math.floor(Math.log2(maxSize));\n }\n\n /** Check if data is an external image */\n isExternalImage(data: unknown): data is ExternalImage {\n return isExternalImage(data);\n }\n\n /** Get the size of an external image */\n getExternalImageSize(data: ExternalImage): {width: number; height: number} {\n return getExternalImageSize(data);\n }\n\n /** Check if device supports a specific texture format (creation and `nearest` sampling) */\n isTextureFormatSupported(format: TextureFormat): boolean {\n return this.getTextureFormatCapabilities(format).create;\n }\n\n /** Check if linear filtering (sampler interpolation) is supported for a specific texture format */\n isTextureFormatFilterable(format: TextureFormat): boolean {\n return this.getTextureFormatCapabilities(format).filter;\n }\n\n /** Check if device supports rendering to a framebuffer color attachment of a specific texture format */\n isTextureFormatRenderable(format: TextureFormat): boolean {\n return this.getTextureFormatCapabilities(format).render;\n }\n\n /** Check if a specific texture format is GPU compressed */\n isTextureFormatCompressed(format: TextureFormat): boolean {\n return textureFormatDecoder.isCompressed(format);\n }\n\n // DEBUG METHODS\n\n pushDebugGroup(groupLabel: string): void {\n this.commandEncoder.pushDebugGroup(groupLabel);\n }\n\n popDebugGroup(): void {\n this.commandEncoder?.popDebugGroup();\n }\n\n insertDebugMarker(markerLabel: string): void {\n this.commandEncoder?.insertDebugMarker(markerLabel);\n }\n\n // Device loss\n\n /** `true` if device is already lost */\n abstract get isLost(): boolean;\n\n /** Promise that resolves when device is lost */\n abstract readonly lost: Promise<{reason: 'destroyed'; message: string}>;\n\n /**\n * Trigger device loss.\n * @returns `true` if context loss could actually be triggered.\n * @note primarily intended for testing how application reacts to device loss\n */\n loseDevice(): boolean {\n return false;\n }\n\n /** A monotonic counter for tracking buffer and texture updates */\n incrementTimestamp(): number {\n return this.timestamp++;\n }\n\n /**\n * Reports Device errors in a way that optimizes for developer experience / debugging.\n * - Logs so that the console error links directly to the source code that generated the error.\n * - Includes the object that reported the error in the log message, even if the error is asynchronous.\n *\n * Conventions when calling reportError():\n * - Always call the returned function - to ensure error is logged, at the error site\n * - Follow with a call to device.debug() - to ensure that the debugger breaks at the error site\n *\n * @param error - the error to report. If needed, just create a new Error object with the appropriate message.\n * @param context - pass `this` as context, otherwise it may not be available in the debugger for async errors.\n * @returns the logger function returned by device.props.onError() so that it can be called from the error site.\n *\n * @example\n * device.reportError(new Error(...), this)();\n * device.debug();\n */\n reportError(error: Error, context: unknown, ...args: unknown[]): () => unknown {\n // Call the error handler\n const isHandled = this.props.onError(error, context);\n if (!isHandled) {\n // Note: Returns a function that must be called: `device.reportError(...)()`\n return log.error(error.message, context, ...args);\n }\n return () => {};\n }\n\n /** Break in the debugger - if device.props.debug is true */\n debug(): void {\n if (this.props.debug) {\n // @ts-ignore\n debugger; // eslint-disable-line\n } else {\n // TODO(ibgreen): Does not appear to be printed in the console\n const message = `\\\n'Type luma.log.set({debug: true}) in console to enable debug breakpoints',\nor create a device with the 'debug: true' prop.`;\n log.once(0, message)();\n }\n }\n\n // Canvas context\n\n /** Default / primary canvas context. Can be null as WebGPU devices can be created without a CanvasContext */\n abstract canvasContext: CanvasContext | null;\n\n /** Returns the default / primary canvas context. Throws an error if no canvas context is available (a WebGPU compute device) */\n getDefaultCanvasContext(): CanvasContext {\n if (!this.canvasContext) {\n throw new Error('Device has no default CanvasContext. See props.createCanvasContext');\n }\n return this.canvasContext;\n }\n\n /** Creates a new CanvasContext (WebGPU only) */\n abstract createCanvasContext(props?: CanvasContextProps): CanvasContext;\n\n /** Call after rendering a frame (necessary e.g. on WebGL OffscreenCanvas) */\n abstract submit(commandBuffer?: CommandBuffer): void;\n\n // Resource creation\n\n /** Create a buffer */\n abstract createBuffer(props: BufferProps | ArrayBuffer | ArrayBufferView): Buffer;\n\n /** Create a texture */\n abstract createTexture(props: TextureProps): Texture;\n\n /** Create a temporary texture view of a video source */\n abstract createExternalTexture(props: ExternalTextureProps): ExternalTexture;\n\n /** Create a sampler */\n abstract createSampler(props: SamplerProps): Sampler;\n\n /** Create a Framebuffer. Must have at least one attachment. */\n abstract createFramebuffer(props: FramebufferProps): Framebuffer;\n\n /** Create a shader */\n abstract createShader(props: ShaderProps): Shader;\n\n /** Create a render pipeline (aka program) */\n abstract createRenderPipeline(props: RenderPipelineProps): RenderPipeline;\n\n /** Create a compute pipeline (aka program). WebGPU only. */\n abstract createComputePipeline(props: ComputePipelineProps): ComputePipeline;\n\n /** Create a vertex array */\n abstract createVertexArray(props: VertexArrayProps): VertexArray;\n\n abstract createCommandEncoder(props?: CommandEncoderProps): CommandEncoder;\n\n /** Create a transform feedback (immutable set of output buffer bindings). WebGL only. */\n abstract createTransformFeedback(props: TransformFeedbackProps): TransformFeedback;\n\n abstract createQuerySet(props: QuerySetProps): QuerySet;\n\n /** Create a RenderPass using the default CommandEncoder */\n beginRenderPass(props?: RenderPassProps): RenderPass {\n return this.commandEncoder.beginRenderPass(props);\n }\n\n /** Create a ComputePass using the default CommandEncoder*/\n beginComputePass(props?: ComputePassProps): ComputePass {\n return this.commandEncoder.beginComputePass(props);\n }\n\n /**\n * Determines what operations are supported on a texture format, checking against supported device features\n * Subclasses override to apply additional checks\n */\n protected abstract _getDeviceSpecificTextureFormatCapabilities(\n format: DeviceTextureFormatCapabilities\n ): DeviceTextureFormatCapabilities;\n\n // DEPRECATED METHODS\n\n /** @deprecated Use getDefaultCanvasContext() */\n getCanvasContext(): CanvasContext {\n return this.getDefaultCanvasContext();\n }\n\n // WebGL specific HACKS - enables app to remove webgl import\n // Use until we have a better way to handle these\n\n /** @deprecated - will be removed - should use command encoder */\n readPixelsToArrayWebGL(\n source: Framebuffer | Texture,\n options?: {\n sourceX?: number;\n sourceY?: number;\n sourceFormat?: number;\n sourceAttachment?: number;\n target?: Uint8Array | Uint16Array | Float32Array;\n // following parameters are auto deduced if not provided\n sourceWidth?: number;\n sourceHeight?: number;\n sourceType?: number;\n }\n ): Uint8Array | Uint16Array | Float32Array {\n throw new Error('not implemented');\n }\n\n /** @deprecated - will be removed - should use command encoder */\n readPixelsToBufferWebGL(\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 throw new Error('not implemented');\n }\n\n /** @deprecated - will be removed - should use WebGPU parameters (pipeline) */\n setParametersWebGL(parameters: any): void {\n throw new Error('not implemented');\n }\n\n /** @deprecated - will be removed - should use WebGPU parameters (pipeline) */\n getParametersWebGL(parameters: any): void {\n throw new Error('not implemented');\n }\n\n /** @deprecated - will be removed - should use WebGPU parameters (pipeline) */\n withParametersWebGL(parameters: any, func: any): any {\n throw new Error('not implemented');\n }\n\n /** @deprecated - will be removed - should use clear arguments in RenderPass */\n clearWebGL(options?: {framebuffer?: Framebuffer; color?: any; depth?: any; stencil?: any}): void {\n throw new Error('not implemented');\n }\n\n /** @deprecated - will be removed - should use for debugging only */\n resetWebGL(): void {\n throw new Error('not implemented');\n }\n\n // IMPLEMENTATION\n\n /** Helper to get the canvas context props */\n static _getCanvasContextProps(props: DeviceProps): CanvasContextProps | undefined {\n return props.createCanvasContext === true ? {} : props.createCanvasContext;\n }\n\n protected _getDeviceTextureFormatCapabilities(\n format: TextureFormat\n ): DeviceTextureFormatCapabilities {\n const genericCapabilities = textureFormatDecoder.getCapabilities(format);\n\n // Check standard features\n const checkFeature = (feature: DeviceFeature | boolean | undefined) =>\n (typeof feature === 'string' ? this.features.has(feature) : feature) ?? true;\n\n const supported = checkFeature(genericCapabilities.create);\n return {\n format,\n create: supported,\n render: supported && checkFeature(genericCapabilities.render),\n filter: supported && checkFeature(genericCapabilities.filter),\n blend: supported && checkFeature(genericCapabilities.blend),\n store: supported && checkFeature(genericCapabilities.store)\n } as const satisfies DeviceTextureFormatCapabilities;\n }\n\n /** Subclasses use this to support .createBuffer() overloads */\n protected _normalizeBufferProps(props: BufferProps | ArrayBuffer | ArrayBufferView): BufferProps {\n if (props instanceof ArrayBuffer || ArrayBuffer.isView(props)) {\n props = {data: props};\n }\n\n // TODO(ibgreen) - fragile, as this is done before we merge with default options\n // inside the Buffer constructor\n\n const newProps = {...props};\n // Deduce indexType\n const usage = props.usage || 0;\n if (usage & Buffer.INDEX) {\n if (!props.indexType) {\n if (props.data instanceof Uint32Array) {\n newProps.indexType = 'uint32';\n } else if (props.data instanceof Uint16Array) {\n newProps.indexType = 'uint16';\n }\n }\n if (!newProps.indexType) {\n throw new Error('indices buffer content must be of type uint16 or uint32');\n }\n }\n\n return newProps;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Log} from '@probe.gl/log';\nimport type {DeviceProps} from './device';\nimport {Device} from './device';\nimport {Adapter} from './adapter';\nimport {StatsManager, lumaStats} from '../utils/stats-manager';\nimport {log} from '../utils/log';\n\ndeclare global {\n // eslint-disable-next-line no-var\n var luma: Luma;\n}\n\nconst STARTUP_MESSAGE = 'set luma.log.level=1 (or higher) to trace rendering';\n\nconst ERROR_MESSAGE =\n 'No matching device found. Ensure `@luma.gl/webgl` and/or `@luma.gl/webgpu` modules are imported.';\n\n/** Properties for creating a new device */\nexport type CreateDeviceProps = {\n /** Selects the type of device. `best-available` uses webgpu if available, then webgl. */\n type?: 'webgl' | 'webgpu' | 'null' | 'unknown' | 'best-available';\n /** List of adapters. Will also search any pre-registered adapters */\n adapters?: Adapter[];\n /**\n * Whether to wait for page to be loaded so that CanvasContext's can access the DOM.\n * The browser only supports one 'load' event listener so it may be necessary for the application to set this to false to avoid conflicts.\n */\n waitForPageLoad?: boolean;\n} & DeviceProps;\n\n/** Properties for attaching an existing WebGL context or WebGPU device to a new luma Device */\nexport type AttachDeviceProps = {\n /** List of adapters. Will also search any pre-registered adapters */\n adapters?: Adapter[];\n} & DeviceProps;\n\n/**\n * Entry point to the luma.gl GPU abstraction\n * Register WebGPU and/or WebGL adapters (controls application bundle size)\n * Run-time selection of the first available Device\n */\nexport class Luma {\n static defaultProps: Required<CreateDeviceProps> = {\n ...Device.defaultProps,\n type: 'best-available',\n adapters: undefined!,\n waitForPageLoad: true\n };\n\n /** Global stats for all devices */\n readonly stats: StatsManager = lumaStats;\n\n /**\n * Global log\n *\n * Assign luma.log.level in console to control logging: \\\n * 0: none, 1: minimal, 2: verbose, 3: attribute/uniforms, 4: gl logs\n * luma.log.break[], set to gl funcs, luma.log.profile[] set to model names`;\n */\n readonly log: Log = log;\n\n /** Version of luma.gl */\n readonly VERSION: string =\n // Version detection using build plugin\n // @ts-expect-error no-undef\n typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'running from source';\n\n spector: unknown;\n\n protected preregisteredAdapters = new Map<string, Adapter>();\n\n constructor() {\n if (globalThis.luma) {\n if (globalThis.luma.VERSION !== this.VERSION) {\n log.error(`Found luma.gl ${globalThis.luma.VERSION} while initialzing ${this.VERSION}`)();\n log.error(`'yarn why @luma.gl/core' can help identify the source of the conflict`)();\n throw new Error(`luma.gl - multiple versions detected: see console log`);\n }\n\n log.error('This version of luma.gl has already been initialized')();\n }\n\n log.log(1, `${this.VERSION} - ${STARTUP_MESSAGE}`)();\n\n globalThis.luma = this;\n }\n\n /** Creates a device. Asynchronously. */\n async createDevice(props_: CreateDeviceProps = {}): Promise<Device> {\n const props: Required<CreateDeviceProps> = {...Luma.defaultProps, ...props_};\n\n const adapter = this.selectAdapter(props.type, props.adapters);\n if (!adapter) {\n throw new Error(ERROR_MESSAGE);\n }\n\n // Wait for page to load so that CanvasContext's can access the DOM.\n if (props.waitForPageLoad) {\n await adapter.pageLoaded;\n }\n\n return await adapter.create(props);\n }\n\n /**\n * Attach to an existing GPU API handle (WebGL2RenderingContext or GPUDevice).\n * @param handle Externally created WebGL context or WebGPU device\n */\n async attachDevice(handle: unknown, props: AttachDeviceProps): Promise<Device> {\n const type = this._getTypeFromHandle(handle, props.adapters);\n\n const adapter = type && this.selectAdapter(type, props.adapters);\n if (!adapter) {\n throw new Error(ERROR_MESSAGE);\n }\n\n return await adapter?.attach?.(handle, props);\n }\n\n /**\n * Global adapter registration.\n * @deprecated Use props.adapters instead\n */\n registerAdapters(adapters: Adapter[]): void {\n for (const deviceClass of adapters) {\n this.preregisteredAdapters.set(deviceClass.type, deviceClass);\n }\n }\n\n /** Get type strings for supported Devices */\n getSupportedAdapters(adapters: Adapter[] = []): string[] {\n const adapterMap = this._getAdapterMap(adapters);\n return Array.from(adapterMap)\n .map(([, adapter]) => adapter)\n .filter(adapter => adapter.isSupported?.())\n .map(adapter => adapter.type);\n }\n\n /** Get type strings for best available Device */\n getBestAvailableAdapterType(adapters: Adapter[] = []): 'webgpu' | 'webgl' | 'null' | null {\n const KNOWN_ADAPTERS: ('webgpu' | 'webgl' | 'null')[] = ['webgpu', 'webgl', 'null'];\n const adapterMap = this._getAdapterMap(adapters);\n for (const type of KNOWN_ADAPTERS) {\n if (adapterMap.get(type)?.isSupported?.()) {\n return type;\n }\n }\n return null;\n }\n\n /** Select adapter of type from registered adapters */\n selectAdapter(type: string, adapters: Adapter[] = []): Adapter | null {\n let selectedType: string | null = type;\n if (type === 'best-available') {\n selectedType = this.getBestAvailableAdapterType(adapters);\n }\n\n const adapterMap = this._getAdapterMap(adapters);\n return (selectedType && adapterMap.get(selectedType)) || null;\n }\n\n /**\n * Override `HTMLCanvasContext.getCanvas()` to always create WebGL2 contexts with additional WebGL1 compatibility.\n * Useful when attaching luma to a context from an external library does not support creating WebGL2 contexts.\n */\n enforceWebGL2(enforce: boolean = true, adapters: Adapter[] = []): void {\n const adapterMap = this._getAdapterMap(adapters);\n const webgl2Adapter = adapterMap.get('webgl');\n if (!webgl2Adapter) {\n log.warn('enforceWebGL2: webgl adapter not found')();\n }\n (webgl2Adapter as any)?.enforceWebGL2?.(enforce);\n }\n\n // DEPRECATED\n\n /** @deprecated */\n setDefaultDeviceProps(props: CreateDeviceProps): void {\n Object.assign(Luma.defaultProps, props);\n }\n\n // HELPERS\n\n /** Convert a list of adapters to a map */\n protected _getAdapterMap(adapters: Adapter[] = []): Map<string, Adapter> {\n const map = new Map(this.preregisteredAdapters);\n for (const adapter of adapters) {\n map.set(adapter.type, adapter);\n }\n return map;\n }\n\n /** Get type of a handle (for attachDevice) */\n protected _getTypeFromHandle(\n handle: unknown,\n adapters: Adapter[] = []\n ): 'webgpu' | 'webgl' | 'null' | null {\n // TODO - delegate handle identification to adapters\n\n // WebGL\n if (handle instanceof WebGL2RenderingContext) {\n return 'webgl';\n }\n\n if (typeof GPUDevice !== 'undefined' && handle instanceof GPUDevice) {\n return 'webgpu';\n }\n\n // TODO - WebGPU does not yet seem to have a stable in-browser API, so we \"sniff\" for members instead\n if ((handle as any)?.queue) {\n return 'webgpu';\n }\n\n // null\n if (handle === null) {\n return 'null';\n }\n\n if (handle instanceof WebGLRenderingContext) {\n log.warn('WebGL1 is not supported', handle)();\n } else {\n log.warn('Unknown handle type', handle)();\n }\n\n return null;\n }\n}\n\n/**\n * Entry point to the luma.gl GPU abstraction\n * Register WebGPU and/or WebGL adapters (controls application bundle size)\n * Run-time selection of the first available Device\n */\nexport const luma = new Luma();\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {isBrowser} from '@probe.gl/env';\nimport {Device, DeviceProps} from './device';\n\n/**\n * Create and attach devices for a specific backend.\n */\nexport abstract class Adapter {\n // new (props: DeviceProps): Device; Constructor isn't used\n abstract type: string;\n /** Check if this backend is supported */\n abstract isSupported(): boolean;\n /** Check if the given handle is a valid device handle for this backend */\n abstract isDeviceHandle(handle: unknown): boolean;\n /** Create a new device for this backend */\n abstract create(props: DeviceProps): Promise<Device>;\n /** Attach a Device to a valid handle for this backend (GPUDevice, WebGL2RenderingContext etc) */\n abstract attach(handle: unknown, props: DeviceProps): Promise<Device>;\n\n /**\n * Page load promise\n * Resolves when the DOM is loaded.\n * @note Since are be limitations on number of `load` event listeners,\n * it is recommended avoid calling this accessor until actually needed.\n * I.e. we don't call it unless you know that you will be looking up a string in the DOM.\n */\n get pageLoaded(): Promise<void> {\n return getPageLoadPromise();\n }\n}\n\n// HELPER FUNCTIONS\n\nconst isPage: boolean = isBrowser() && typeof document !== 'undefined';\nconst isPageLoaded: () => boolean = () => isPage && document.readyState === 'complete';\nlet pageLoadPromise: Promise<void> | null = null;\n\n/** Returns a promise that resolves when the page is loaded */\nfunction getPageLoadPromise(): Promise<void> {\n if (!pageLoadPromise) {\n if (isPageLoaded() || typeof window === 'undefined') {\n pageLoadPromise = Promise.resolve();\n } else {\n pageLoadPromise = new Promise(resolve => window.addEventListener('load', () => resolve()));\n }\n }\n return pageLoadPromise;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {isBrowser} from '@probe.gl/env';\nimport type {Device} from './device';\nimport type {Framebuffer} from './resources/framebuffer';\nimport type {TextureFormatDepthStencil} from '../shadertypes/textures/texture-formats';\nimport {uid} from '../utils/uid';\nimport {withResolvers} from '../utils/promise-utils';\n\n/** Properties for a CanvasContext */\nexport type CanvasContextProps = {\n /** Identifier, for debugging */\n id?: string;\n /** If a canvas not supplied, one will be created and added to the DOM. If a string, a canvas with that id will be looked up in the DOM */\n canvas?: HTMLCanvasElement | OffscreenCanvas | string | null;\n /** If new canvas is created, it will be created in the specified container, otherwise is appended as a child of document.body */\n container?: HTMLElement | string | null;\n /** Width in pixels of the canvas - used when creating a new canvas */\n width?: number;\n /** Height in pixels of the canvas - used when creating a new canvas */\n height?: number;\n /** Visibility (only used if new canvas is created). */\n visible?: boolean;\n /** Whether to size the drawing buffer to the pixel size during auto resize. If a number is provided it is used as a static pixel ratio */\n useDevicePixels?: boolean | number;\n /** Whether to track window resizes. */\n autoResize?: boolean;\n /** @see https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/configure#alphamode */\n alphaMode?: 'opaque' | 'premultiplied';\n /** @see https://developer.mozilla.org/en-US/docs/Web/API/GPUCanvasContext/configure#colorspace */\n colorSpace?: 'srgb'; // GPUPredefinedColorSpace\n /** Whether to track position changes. Calls this.device.onPositionChange */\n trackPosition?: boolean;\n};\n\nexport type MutableCanvasContextProps = {\n /** Whether to size the drawing buffer to the pixel size during auto resize. If a number is provided it is used as a static pixel ratio */\n useDevicePixels?: boolean | number;\n};\n\n/**\n * Manages a canvas. Supports both HTML or offscreen canvas\n * - Creates a new canvas or looks up a canvas from the DOM\n * - Provides check for DOM loaded\n * @todo commit() @see https://github.com/w3ctag/design-reviews/issues/288\n * @todo transferControlToOffscreen: @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/transferControlToOffscreen\n */\nexport abstract class CanvasContext {\n static isHTMLCanvas(canvas: unknown): canvas is HTMLCanvasElement {\n return typeof HTMLCanvasElement !== 'undefined' && canvas instanceof HTMLCanvasElement;\n }\n\n static isOffscreenCanvas(canvas: unknown): canvas is OffscreenCanvas {\n return typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas;\n }\n\n static defaultProps: Required<CanvasContextProps> = {\n id: undefined!,\n canvas: null,\n width: 800,\n height: 600,\n useDevicePixels: true,\n autoResize: true,\n container: null,\n visible: true,\n alphaMode: 'opaque',\n colorSpace: 'srgb',\n trackPosition: false\n };\n\n abstract readonly device: Device;\n abstract readonly handle: unknown;\n readonly id: string;\n\n readonly props: Required<CanvasContextProps>;\n readonly canvas: HTMLCanvasElement | OffscreenCanvas;\n /** Handle to HTML canvas */\n readonly htmlCanvas?: HTMLCanvasElement;\n /** Handle to wrapped OffScreenCanvas */\n readonly offscreenCanvas?: OffscreenCanvas;\n readonly type: 'html-canvas' | 'offscreen-canvas' | 'node';\n\n /** Promise that resolved once the resize observer has updated the pixel size */\n initialized: Promise<void>;\n isInitialized: boolean = false;\n\n /** Visibility is automatically updated (via an IntersectionObserver) */\n isVisible: boolean = true;\n\n /** Width of canvas in CSS units (tracked by a ResizeObserver) */\n cssWidth: number;\n /** Height of canvas in CSS units (tracked by a ResizeObserver) */\n cssHeight: number;\n\n /** Device pixel ratio. Automatically updated via media queries */\n devicePixelRatio: number;\n /** Exact width of canvas in physical pixels (tracked by a ResizeObserver) */\n devicePixelWidth: number;\n /** Exact height of canvas in physical pixels (tracked by a ResizeObserver) */\n devicePixelHeight: number;\n\n /** Width of drawing buffer: automatically tracks this.pixelWidth if props.autoResize is true */\n drawingBufferWidth: number;\n /** Height of drawing buffer: automatically tracks this.pixelHeight if props.autoResize is true */\n drawingBufferHeight: number;\n\n protected _initializedResolvers = withResolvers<void>();\n protected readonly _resizeObserver: ResizeObserver | undefined;\n protected readonly _intersectionObserver: IntersectionObserver | undefined;\n protected _position: [number, number];\n protected destroyed = false;\n\n abstract get [Symbol.toStringTag](): string;\n\n toString(): string {\n return `${this[Symbol.toStringTag]}(${this.id})`;\n }\n\n constructor(props?: CanvasContextProps) {\n this.props = {...CanvasContext.defaultProps, ...props};\n props = this.props;\n\n this.initialized = this._initializedResolvers.promise;\n\n // Create a canvas element if needed\n if (!isBrowser()) {\n // TODO - does this prevent app from using jsdom style polyfills?\n this.canvas = {width: props.width || 1, height: props.height || 1} as OffscreenCanvas;\n } else if (!props.canvas) {\n this.canvas = createCanvasElement(props);\n } else if (typeof props.canvas === 'string') {\n this.canvas = getCanvasFromDOM(props.canvas);\n } else {\n this.canvas = props.canvas;\n }\n\n if (CanvasContext.isHTMLCanvas(this.canvas)) {\n this.id = props.id || this.canvas.id;\n this.type = 'html-canvas';\n this.htmlCanvas = this.canvas;\n } else if (CanvasContext.isOffscreenCanvas(this.canvas)) {\n this.id = props.id || 'offscreen-canvas';\n this.type = 'offscreen-canvas';\n this.offscreenCanvas = this.canvas;\n } else {\n // TODO - Node.js support is currently untested (was used for headless-gl in luma v8)\n this.id = props.id || 'node-canvas-context';\n this.type = 'node';\n }\n\n // Initialize size variables to some sane values (these will be updated by ResizeObserver)\n this.cssWidth = this.htmlCanvas?.clientWidth || this.canvas.width;\n this.cssHeight = this.htmlCanvas?.clientHeight || this.canvas.height;\n this.devicePixelWidth = this.canvas.width;\n this.devicePixelHeight = this.canvas.height;\n this.drawingBufferWidth = this.canvas.width;\n this.drawingBufferHeight = this.canvas.height;\n this.devicePixelRatio = globalThis.devicePixelRatio || 1;\n this._position = [0, 0];\n\n if (CanvasContext.isHTMLCanvas(this.canvas)) {\n // Track visibility changes\n this._intersectionObserver = new IntersectionObserver(entries =>\n this._handleIntersection(entries)\n );\n this._intersectionObserver.observe(this.canvas);\n\n // Track size changes\n this._resizeObserver = new ResizeObserver(entries => this._handleResize(entries));\n try {\n this._resizeObserver.observe(this.canvas, {box: 'device-pixel-content-box'});\n } catch {\n // Safari fallback\n this._resizeObserver.observe(this.canvas, {box: 'content-box'});\n }\n\n // Track device pixel ratio changes.\n // Defer call to after construction completes to ensure `this.device` is available.\n setTimeout(() => this._observeDevicePixelRatio(), 0);\n\n // Track top/left position changes\n if (this.props.trackPosition) {\n this._trackPosition();\n }\n }\n }\n\n destroy() {\n this.destroyed = true;\n }\n\n setProps(props: MutableCanvasContextProps): this {\n if ('useDevicePixels' in props) {\n this.props.useDevicePixels = props.useDevicePixels || false;\n this._updateDrawingBufferSize();\n }\n return this;\n }\n\n /** Returns a framebuffer with properly resized current 'swap chain' textures */\n abstract getCurrentFramebuffer(options?: {\n depthStencilFormat?: TextureFormatDepthStencil | false;\n }): Framebuffer;\n\n // SIZE METHODS\n\n /**\n * Returns the size covered by the canvas in CSS pixels\n * @note This can be different from the actual device pixel size of a canvas due to DPR scaling, and rounding to integer pixels\n * @note This is independent of the canvas' internal drawing buffer size (.width, .height).\n */\n getCSSSize(): [number, number] {\n return [this.cssWidth, this.cssHeight];\n }\n\n getPosition() {\n return this._position;\n }\n\n /**\n * Returns the size covered by the canvas in actual device pixels.\n * @note This can be different from the 'CSS' size of a canvas due to DPR scaling, and rounding to integer pixels\n * @note This is independent of the canvas' internal drawing buffer size (.width, .height).\n */\n getDevicePixelSize(): [number, number] {\n return [this.devicePixelWidth, this.devicePixelHeight];\n }\n\n /** Get the drawing buffer size (number of pixels GPU is rendering into, can be different from CSS size) */\n getDrawingBufferSize(): [number, number] {\n return [this.drawingBufferWidth, this.drawingBufferHeight];\n }\n\n /** Returns the biggest allowed framebuffer size. @todo Allow the application to limit this? */\n getMaxDrawingBufferSize(): [number, number] {\n const maxTextureDimension = this.device.limits.maxTextureDimension2D;\n return [maxTextureDimension, maxTextureDimension];\n }\n\n /** Update the canvas drawing buffer size. Called automatically if props.autoResize is true. */\n setDrawingBufferSize(width: number, height: number) {\n this.canvas.width = width;\n this.canvas.height = height;\n\n this.drawingBufferWidth = width;\n this.drawingBufferHeight = height;\n }\n\n /**\n * Returns the current DPR (number of physical pixels per CSS pixel), if props.useDevicePixels is true\n * @note This can be a fractional (non-integer) number, e.g. when the user zooms in the browser.\n * @note This function handles the non-HTML canvas cases\n */\n getDevicePixelRatio(): number {\n const dpr = typeof window !== 'undefined' && window.devicePixelRatio;\n return dpr || 1;\n }\n\n // DEPRECATED METHODS\n\n /**\n * Maps CSS pixel position to device pixel position\n */\n cssToDevicePixels(\n cssPixel: [number, number],\n yInvert: boolean = true\n ): {\n x: number;\n y: number;\n width: number;\n height: number;\n } {\n const ratio = this.cssToDeviceRatio();\n const [width, height] = this.getDrawingBufferSize();\n return scalePixels(cssPixel, ratio, width, height, yInvert);\n }\n\n /** @deprecated - use .getDevicePixelSize() */\n getPixelSize() {\n return this.getDevicePixelSize();\n }\n\n /** @deprecated - TODO which values should we use for aspect */\n getAspect(): number {\n const [width, height] = this.getDevicePixelSize();\n return width / height;\n }\n\n /** @deprecated Returns multiplier need to convert CSS size to Device size */\n cssToDeviceRatio(): number {\n try {\n const [drawingBufferWidth] = this.getDrawingBufferSize();\n const [cssWidth] = this.getCSSSize();\n return cssWidth ? drawingBufferWidth / cssWidth : 1;\n } catch {\n return 1;\n }\n }\n\n /** @deprecated Use canvasContext.setDrawingBufferSize() */\n resize(size: {width: number; height: number}): void {\n this.setDrawingBufferSize(size.width, size.height);\n }\n\n // SUBCLASS OVERRIDES\n\n /**\n * Performs platform specific updates (WebGPU vs WebGL)\n * Can be called after changes to size or props,\n * to give implementation an opportunity to update configurations.\n */\n protected abstract _updateDevice(): void;\n\n // IMPLEMENTATION\n\n /**\n * Allows subclass constructor to override the canvas id for auto created canvases.\n * This can really help when debugging DOM in apps that create multiple devices\n */\n protected _setAutoCreatedCanvasId(id: string) {\n if (this.htmlCanvas?.id === 'lumagl-auto-created-canvas') {\n this.htmlCanvas.id = id;\n }\n }\n\n /** reacts to an observed intersection */\n protected _handleIntersection(entries: IntersectionObserverEntry[]) {\n const entry = entries.find(entry_ => entry_.target === this.canvas);\n if (!entry) {\n return;\n }\n // TODO - store intersection rectangle?\n const isVisible = entry.isIntersecting;\n if (this.isVisible !== isVisible) {\n this.isVisible = isVisible;\n this.device.props.onVisibilityChange(this);\n }\n }\n\n /**\n * Reacts to an observed resize by using the most accurate pixel size information the browser can provide\n * @see https://web.dev/articles/device-pixel-content-box\n * @see https://webgpufundamentals.org/webgpu/lessons/webgpu-resizing-the-canvas.html\n */\n protected _handleResize(entries: ResizeObserverEntry[]) {\n const entry = entries.find(entry_ => entry_.target === this.canvas);\n if (!entry) {\n return;\n }\n\n // Update CSS size using content box size\n this.cssWidth = entry.contentBoxSize[0].inlineSize;\n this.cssHeight = entry.contentBoxSize[0].blockSize;\n\n // Update our drawing buffer size variables, saving the old values for logging\n const oldPixelSize = this.getDevicePixelSize();\n\n // Use the most accurate drawing buffer size information the current browser can provide\n // Note: content box sizes are guaranteed to be integers\n // Note: Safari falls back to contentBoxSize\n const devicePixelWidth =\n entry.devicePixelContentBoxSize?.[0].inlineSize ||\n entry.contentBoxSize[0].inlineSize * devicePixelRatio;\n\n const devicePixelHeight =\n entry.devicePixelContentBoxSize?.[0].blockSize ||\n entry.contentBoxSize[0].blockSize * devicePixelRatio;\n\n // Make sure we don't overflow the maximum supported texture size\n const [maxDevicePixelWidth, maxDevicePixelHeight] = this.getMaxDrawingBufferSize();\n this.devicePixelWidth = Math.max(1, Math.min(devicePixelWidth, maxDevicePixelWidth));\n this.devicePixelHeight = Math.max(1, Math.min(devicePixelHeight, maxDevicePixelHeight));\n\n this._updateDrawingBufferSize();\n\n // Inform the device\n this.device.props.onResize(this, {oldPixelSize});\n }\n\n protected _updateDrawingBufferSize() {\n // Update the canvas drawing buffer size\n if (this.props.autoResize) {\n if (typeof this.props.useDevicePixels === 'number') {\n const dpr = this.props.useDevicePixels;\n this.setDrawingBufferSize(this.cssWidth * dpr, this.cssHeight * dpr);\n } else if (this.props.useDevicePixels) {\n this.setDrawingBufferSize(this.devicePixelWidth, this.devicePixelHeight);\n } else {\n this.setDrawingBufferSize(this.cssWidth, this.cssHeight);\n }\n\n // Inform the subclass\n this._updateDevice();\n }\n\n // Resolve the initialized promise\n this._initializedResolvers.resolve();\n this.isInitialized = true;\n\n this.updatePosition();\n }\n\n /** Monitor DPR changes */\n _observeDevicePixelRatio() {\n const oldRatio = this.devicePixelRatio;\n this.devicePixelRatio = window.devicePixelRatio;\n\n this.updatePosition();\n\n // Inform the device\n this.device.props.onDevicePixelRatioChange(this, {oldRatio});\n // Set up a one time query against the current resolution.\n matchMedia(`(resolution: ${this.devicePixelRatio}dppx)`).addEventListener(\n 'change',\n () => this._observeDevicePixelRatio(),\n {once: true}\n );\n }\n\n /** Start tracking positions with a timer */\n _trackPosition(intervalMs: number = 100): void {\n const intervalId = setInterval(() => {\n if (this.destroyed) {\n clearInterval(intervalId);\n } else {\n this.updatePosition();\n }\n }, intervalMs);\n }\n\n /**\n * Calculated the absolute position of the canvas\n * @note - getBoundingClientRect() is normally cheap but can be expensive\n * if called before browser has finished a reflow. Should not be the case here.\n */\n updatePosition() {\n const newRect = this.htmlCanvas?.getBoundingClientRect();\n if (newRect) {\n // We only track position since we rely on the more precise ResizeObserver for size\n const position: [number, number] = [newRect.left, newRect.top];\n this._position ??= position;\n const positionChanged =\n position[0] !== this._position[0] || position[1] !== this._position[1];\n if (positionChanged) {\n const oldPosition = this._position;\n this._position = position;\n this.device.props.onPositionChange?.(this, {oldPosition});\n }\n }\n }\n}\n\n// HELPER FUNCTIONS\n\n/** Get a container element from a string or DOM element */\nfunction getContainer(container: HTMLElement | string | null): HTMLElement {\n if (typeof container === 'string') {\n const element = document.getElementById(container);\n if (!element) {\n throw new Error(`${container} is not an HTML element`);\n }\n return element;\n }\n if (container) {\n return container;\n }\n return document.body;\n}\n\n/** Get a Canvas element from DOM id */\nfunction getCanvasFromDOM(canvasId: string): HTMLCanvasElement {\n const canvas = document.getElementById(canvasId);\n if (!CanvasContext.isHTMLCanvas(canvas)) {\n throw new Error('Object is not a canvas element');\n }\n return canvas;\n}\n\n/** Create a new canvas */\nfunction createCanvasElement(props: CanvasContextProps) {\n const {width, height} = props;\n const newCanvas = document.createElement('canvas');\n newCanvas.id = uid('lumagl-auto-created-canvas');\n newCanvas.width = width || 1;\n newCanvas.height = height || 1;\n newCanvas.style.width = Number.isFinite(width) ? `${width}px` : '100%';\n newCanvas.style.height = Number.isFinite(height) ? `${height}px` : '100%';\n if (!props?.visible) {\n newCanvas.style.visibility = 'hidden';\n }\n // Insert the canvas in the DOM\n const container = getContainer(props?.container || null);\n container.insertBefore(newCanvas, container.firstChild);\n\n return newCanvas;\n}\n\n/**\n * Scales pixels linearly, handles edge cases\n * @param pixel\n * @param ratio\n * @param width\n * @param height\n * @param yInvert\n * @returns\n */\nfunction scalePixels(\n pixel: [number, number],\n ratio: number,\n width: number,\n height: number,\n yInvert: boolean\n): {\n x: number;\n y: number;\n width: number;\n height: number;\n} {\n const point = pixel;\n\n const x = scaleX(point[0], ratio, width);\n let y = scaleY(point[1], ratio, height, yInvert);\n\n // Find boundaries of next pixel to provide valid range of device pixel locations\n\n let t = scaleX(point[0] + 1, ratio, width);\n // If next pixel's position is clamped to boundary, use it as is, otherwise subtract 1 for current pixel boundary\n const xHigh = t === width - 1 ? t : t - 1;\n\n t = scaleY(point[1] + 1, ratio, height, yInvert);\n let yHigh;\n if (yInvert) {\n // If next pixel's position is clamped to boundary, use it as is, otherwise clamp it to valid range\n t = t === 0 ? t : t + 1;\n // swap y and yHigh\n yHigh = y;\n y = t;\n } else {\n // If next pixel's position is clamped to boundary, use it as is, otherwise clamp it to valid range\n yHigh = t === height - 1 ? t : t - 1;\n // y remains same\n }\n return {\n x,\n y,\n // when ratio < 1, current css pixel and next css pixel may point to same device pixel, set width/height to 1 in those cases.\n width: Math.max(xHigh - x + 1, 1),\n height: Math.max(yHigh - y + 1, 1)\n };\n}\n\nfunction scaleX(x: number, ratio: number, width: number): number {\n // since we are rounding to nearest, when ratio > 1, edge pixels may point to out of bounds value, clamp to the limit\n const r = Math.min(Math.round(x * ratio), width - 1);\n return r;\n}\n\nfunction scaleY(y: number, ratio: number, height: number, yInvert: boolean): number {\n // since we are rounding to nearest, when ratio > 1, edge pixels may point to out of bounds value, clamp to the limit\n return yInvert\n ? Math.max(0, height - 1 - Math.round(y * ratio))\n : Math.min(Math.round(y * ratio), height - 1);\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// TODO - replace with Promise.withResolvers once we upgrade TS baseline\nexport function withResolvers<T>(): {\n promise: Promise<T>;\n resolve: (t: T) => void;\n reject: (error: Error) => void;\n} {\n let resolve: (t: T) => void;\n let reject: (error: Error) => void;\n const promise = new Promise<T>((_resolve, _reject) => {\n resolve = _resolve;\n reject = _reject;\n });\n // @ts-expect-error - in fact these are no used before initialized\n return {promise, resolve, reject};\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Device} from '../device';\nimport {CompareFunction} from '../types/parameters';\nimport {Resource, ResourceProps} from './resource';\n\n/** Edge values sampling mode */\nexport type SamplerAddressMode = 'clamp-to-edge' | 'repeat' | 'mirror-repeat';\n\n/** Sampler filtering mode */\nexport type SamplerFilterMode = 'nearest' | 'linear';\n\n/**\n * Properties for initializing a sampler\n */\nexport type SamplerProps = ResourceProps & {\n /** Comparison / shadow samplers are used with depth textures. See the `Sampler.compare` field */\n type?: 'color-sampler' | 'comparison-sampler';\n /** Edge value sampling in X direction */\n addressModeU?: 'clamp-to-edge' | 'repeat' | 'mirror-repeat';\n /** Edge value sampling in Y direction */\n addressModeV?: 'clamp-to-edge' | 'repeat' | 'mirror-repeat';\n /** Edge value sampling in Z direction */\n addressModeW?: 'clamp-to-edge' | 'repeat' | 'mirror-repeat';\n\n /** Magnification: the area of the fragment in texture space is smaller than a texel */\n magFilter?: 'nearest' | 'linear';\n /** Minification: the area of the fragment in texture space is larger than a texel */\n minFilter?: 'nearest' | 'linear';\n /** mipmapping: select between multiple mipmaps based on angle and size of the texture relative to the screen. */\n mipmapFilter?: 'none' | 'nearest' | 'linear';\n /** Affects the mipmap image selection */\n lodMinClamp?: number;\n /** Affects the mipmap image selection */\n lodMaxClamp?: number;\n /** Maximum number of samples that can be taken of the texture during any one texture fetch */\n maxAnisotropy?: number;\n /** How to compare reference values provided in shader shadow sampler calls with those pulled from the texture */\n compare?: CompareFunction;\n};\n\nexport type SamplerParameters = Omit<SamplerProps, keyof ResourceProps>;\n\n/** Immutable Sampler object */\nexport abstract class Sampler extends Resource<SamplerProps> {\n static override defaultProps: Required<SamplerProps> = {\n ...Resource.defaultProps,\n type: 'color-sampler',\n addressModeU: 'clamp-to-edge',\n addressModeV: 'clamp-to-edge',\n addressModeW: 'clamp-to-edge',\n magFilter: 'nearest',\n minFilter: 'nearest',\n mipmapFilter: 'none',\n lodMinClamp: 0,\n lodMaxClamp: 32, // Per WebGPU spec\n compare: 'less-equal',\n maxAnisotropy: 1\n };\n\n override get [Symbol.toStringTag](): string {\n return 'Sampler';\n }\n\n constructor(device: Device, props: SamplerProps) {\n props = Sampler.normalizeProps(device, props);\n super(device, props, Sampler.defaultProps);\n }\n\n protected static normalizeProps(device: Device, props: SamplerProps): SamplerProps {\n return props;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {TypedArray} from '@math.gl/types';\nimport type {Device} from '../device';\nimport type {TextureFormat} from '../../shadertypes/textures/texture-formats';\nimport type {TextureView, TextureViewProps} from './texture-view';\nimport {Resource, ResourceProps} from './resource';\nimport {Sampler, SamplerProps} from './sampler';\nimport {ExternalImage} from '../../image-utils/image-types';\nimport {log} from '../../utils/log';\n\n/** Options for Texture.copyExternalImage */\nexport type CopyExternalImageOptions = {\n /** Image */\n image: ExternalImage;\n /** Copy from image x offset (default 0) */\n sourceX?: number;\n /** Copy from image y offset (default 0) */\n sourceY?: number;\n /** Copy area width (default 1) */\n width?: number;\n /** Copy area height (default 1) */\n height?: number;\n /** Copy depth, number of layers/depth slices(default 1) */\n depth?: number;\n /** Start copying into offset x (default 0) */\n x?: number;\n /** Start copying into offset y (default 0) */\n y?: number;\n /** Start copying into layer / depth slice z (default 0) */\n z?: number;\n /** Which mip-level to copy into (default 0) */\n mipLevel?: number;\n /** When copying into depth stencil textures (default 'all') */\n aspect?: 'all' | 'stencil-only' | 'depth-only';\n /** Specific color space of image data */\n colorSpace?: 'srgb';\n /** load as premultiplied alpha */\n premultipliedAlpha?: boolean;\n /** Whether to flip the image vertically */\n flipY?: boolean;\n};\n\n/** Options for copyImageData */\nexport type CopyImageDataOptions = {\n /** Data to copy (array of bytes) */\n data: ArrayBuffer | SharedArrayBuffer | ArrayBufferView;\n /** Offset into the data (in addition to any offset built-in to the ArrayBufferView) */\n byteOffset?: number;\n /** The stride, in bytes, between the beginning of each texel block row and the subsequent texel block row. Required if there are multiple texel block rows (i.e. the copy height or depth is more than one block). */\n bytesPerRow?: number;\n /** Number or rows per image (needed if multiple images are being set) */\n rowsPerImage?: number;\n /** Start copying into offset x (default 0) */\n x?: number;\n /** Start copying into offset y (default 0) */\n y?: number;\n /** Start copying from depth layer z (default 0) */\n z?: number;\n /** Which mip-level to copy into (default 0) */\n mipLevel?: number;\n /** When copying into depth stencil textures (default 'all') */\n aspect?: 'all' | 'stencil-only' | 'depth-only';\n};\n\nconst BASE_DIMENSIONS: Record<string, '1d' | '2d' | '3d'> = {\n '1d': '1d',\n '2d': '2d',\n '2d-array': '2d',\n cube: '2d',\n 'cube-array': '2d',\n '3d': '3d'\n};\n\n/** Texture properties */\nexport type TextureProps = ResourceProps & {\n /** @deprecated Use AsyncTexture to create textures with data. */\n data?: ExternalImage | TypedArray | null;\n /** Dimension of this texture. Defaults to '2d' */\n dimension?: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';\n /** The format (bit layout) of the textures pixel data */\n format?: TextureFormat;\n /** Width in texels */\n width: number;\n /** Width in texels */\n height: number;\n /** Number of depth layers */\n depth?: number;\n /** How this texture will be used. Defaults to TEXTURE | COPY_DST | RENDER_ATTACHMENT */\n usage?: number;\n /** How many mip levels */\n mipLevels?: number;\n /** Multi sampling */\n samples?: number;\n\n /** Sampler (or SamplerProps) for the default sampler for this texture. Used if no sampler provided. Note that other samplers can still be used. */\n sampler?: Sampler | SamplerProps;\n /** Props for the default TextureView for this texture. Note that other views can still be created and used. */\n view?: TextureViewProps;\n};\n\n/**\n * Abstract Texture interface\n * Texture Object\n * https://gpuweb.github.io/gpuweb/#gputexture\n */\nexport abstract class Texture extends Resource<TextureProps> {\n /** The texture can be bound for use as a sampled texture in a shader */\n static SAMPLE = 0x04;\n /** The texture can be bound for use as a storage texture in a shader */\n static STORAGE = 0x08;\n /** The texture can be used as a color or depth/stencil attachment in a render pass */\n static RENDER = 0x10;\n /** The texture can be used as the source of a copy operation */\n static COPY_SRC = 0x01;\n /** he texture can be used as the destination of a copy or write operation */\n static COPY_DST = 0x02;\n\n /** @deprecated Use Texture.SAMPLE */\n static TEXTURE = 0x04;\n /** @deprecated Use Texture.RENDER */\n static RENDER_ATTACHMENT = 0x10;\n\n /** dimension of this texture */\n readonly dimension: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';\n /** base dimension of this texture */\n readonly baseDimension: '1d' | '2d' | '3d';\n /** format of this texture */\n readonly format: TextureFormat;\n /** width in pixels of this texture */\n width: number;\n /** height in pixels of this texture */\n height: number;\n /** depth of this texture */\n depth: number;\n /** mip levels in this texture */\n mipLevels: number;\n /** Default sampler for this texture */\n abstract sampler: Sampler;\n /** Default view for this texture */\n abstract view: TextureView;\n\n /** \"Time\" of last update. Monotonically increasing timestamp. TODO move to AsyncTexture? */\n updateTimestamp: number;\n\n override get [Symbol.toStringTag](): string {\n return 'Texture';\n }\n\n override toString(): string {\n return `Texture(${this.id},${this.format},${this.width}x${this.height})`;\n }\n\n /** Do not use directly. Create with device.createTexture() */\n constructor(device: Device, props: TextureProps) {\n props = Texture.normalizeProps(device, props);\n super(device, props, Texture.defaultProps);\n this.dimension = this.props.dimension;\n this.baseDimension = BASE_DIMENSIONS[this.dimension];\n this.format = this.props.format;\n\n // Size\n this.width = this.props.width;\n this.height = this.props.height;\n this.depth = this.props.depth;\n this.mipLevels = this.props.mipLevels;\n\n // Calculate size, if not provided\n if (this.props.width === undefined || this.props.height === undefined) {\n if (device.isExternalImage(props.data)) {\n const size = device.getExternalImageSize(props.data);\n this.width = size?.width || 1;\n this.height = size?.height || 1;\n } else {\n this.width = 1;\n this.height = 1;\n if (this.props.width === undefined || this.props.height === undefined) {\n log.warn(\n `${this} created with undefined width or height. This is deprecated. Use AsyncTexture instead.`\n )();\n }\n }\n }\n\n // TODO - perhaps this should be set on async write completion?\n this.updateTimestamp = device.incrementTimestamp();\n }\n\n /** Set sampler props associated with this texture */\n setSampler(sampler: Sampler | SamplerProps): void {\n this.sampler = sampler instanceof Sampler ? sampler : this.device.createSampler(sampler);\n }\n /** Create a texture view for this texture */\n abstract createView(props: TextureViewProps): TextureView;\n /** Copy an image (e.g an ImageBitmap) into the texture */\n abstract copyExternalImage(options: CopyExternalImageOptions): {width: number; height: number};\n /** Copy raw image data (bytes) into the texture */\n abstract copyImageData(options: CopyImageDataOptions): void;\n /** Generate mipmaps (WebGL only) */\n abstract generateMipmapsWebGL(): void;\n\n /**\n * Create a new texture with the same parameters and optionally a different size\n * @note Textures are immutable and cannot be resized after creation, but we can create a similar texture with the same parameters but a new size.\n * @note Does not copy contents of the texture\n */\n clone(size?: {width: number; height: number}): Texture {\n return this.device.createTexture({...this.props, ...size});\n }\n\n /** Ensure we have integer coordinates */\n protected static normalizeProps(device: Device, props: TextureProps): TextureProps {\n const newProps = {...props};\n\n // Ensure we have integer coordinates\n const {width, height} = newProps;\n if (typeof width === 'number') {\n newProps.width = Math.max(1, Math.ceil(width));\n }\n if (typeof height === 'number') {\n newProps.height = Math.max(1, Math.ceil(height));\n }\n return newProps;\n }\n\n // HELPERS\n\n /** Initialize texture with supplied props */\n // eslint-disable-next-line max-statements\n _initializeData(data: TextureProps['data']): void {\n // Store opts for accessors\n\n if (this.device.isExternalImage(data)) {\n this.copyExternalImage({\n image: data,\n width: this.width,\n height: this.height,\n depth: this.depth,\n mipLevel: 0,\n x: 0,\n y: 0,\n z: 0,\n aspect: 'all',\n colorSpace: 'srgb',\n premultipliedAlpha: false,\n flipY: false\n });\n } else if (data) {\n this.copyImageData({\n data,\n // width: this.width,\n // height: this.height,\n // depth: this.depth,\n mipLevel: 0,\n x: 0,\n y: 0,\n z: 0,\n aspect: 'all'\n });\n }\n }\n\n _normalizeCopyImageDataOptions(options_: CopyImageDataOptions): Required<CopyImageDataOptions> {\n const {width, height, depth} = this;\n const options = {...Texture.defaultCopyDataOptions, width, height, depth, ...options_};\n\n const info = this.device.getTextureFormatInfo(this.format);\n if (!options_.bytesPerRow && !info.bytesPerPixel) {\n throw new Error(`bytesPerRow must be provided for texture format ${this.format}`);\n }\n options.bytesPerRow = options_.bytesPerRow || width * (info.bytesPerPixel || 4);\n options.rowsPerImage = options_.rowsPerImage || height;\n\n // WebGL will error if we try to copy outside the bounds of the texture\n // options.width = Math.min(options.width, this.width - options.x);\n // options.height = Math.min(options.height, this.height - options.y);\n return options;\n }\n\n _normalizeCopyExternalImageOptions(\n options_: CopyExternalImageOptions\n ): Required<CopyExternalImageOptions> {\n const size = this.device.getExternalImageSize(options_.image);\n const options = {...Texture.defaultCopyExternalImageOptions, ...size, ...options_};\n // WebGL will error if we try to copy outside the bounds of the texture\n options.width = Math.min(options.width, this.width - options.x);\n options.height = Math.min(options.height, this.height - options.y);\n return options;\n }\n\n /** Default options */\n static override defaultProps: Required<TextureProps> = {\n ...Resource.defaultProps,\n data: null,\n dimension: '2d',\n format: 'rgba8unorm',\n usage: Texture.TEXTURE | Texture.RENDER_ATTACHMENT | Texture.COPY_DST,\n width: undefined!,\n height: undefined!,\n depth: 1,\n mipLevels: 1,\n samples: undefined!,\n sampler: {},\n view: undefined!\n };\n\n protected static defaultCopyDataOptions: Required<CopyImageDataOptions> = {\n data: undefined!,\n byteOffset: 0,\n bytesPerRow: undefined!,\n rowsPerImage: undefined!,\n mipLevel: 0,\n x: 0,\n y: 0,\n z: 0,\n aspect: 'all'\n };\n\n /** Default options */\n protected static defaultCopyExternalImageOptions: Required<CopyExternalImageOptions> = {\n image: undefined!,\n sourceX: 0,\n sourceY: 0,\n width: undefined!,\n height: undefined!,\n depth: 1,\n mipLevel: 0,\n x: 0,\n y: 0,\n z: 0,\n aspect: 'all',\n colorSpace: 'srgb',\n premultipliedAlpha: false,\n flipY: false\n };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Device} from '../device';\nimport type {Texture} from './texture';\nimport type {TextureFormat} from '../../shadertypes/textures/texture-formats';\nimport {Resource, ResourceProps} from './resource';\n\n/** Properties for initializing a texture view */\nexport type TextureViewProps = ResourceProps & {\n /** The format of the texture view. Must be either the format of the texture or one of the viewFormats specified during its creation. */\n format?: TextureFormat;\n /** The dimension to view the texture as. */\n dimension?: '1d' | '2d' | '2d-array' | 'cube' | 'cube-array' | '3d';\n /** Which aspect(s) of the texture are accessible to the texture view. default \"all\"*/\n aspect?: 'all' | 'stencil-only' | 'depth-only';\n /** The first (most detailed) mipmap level accessible to the texture view. default 0*/\n baseMipLevel?: number;\n /** How many mipmap levels, starting with baseMipLevel, are accessible to the texture view. */\n mipLevelCount: number;\n /** The index of the first array layer accessible to the texture view. default 0 */\n baseArrayLayer?: number;\n /** How many array layers, starting with baseArrayLayer, are accessible to the texture view. */\n arrayLayerCount: number;\n};\n\n/** Immutable TextureView object */\nexport abstract class TextureView extends Resource<TextureViewProps> {\n abstract texture: Texture;\n\n override get [Symbol.toStringTag](): string {\n return 'TextureView';\n }\n\n /** Should not be constructed directly. Use `texture.createView(props)` */\n constructor(device: Device, props: TextureViewProps & {texture: Texture}) {\n super(device, props, TextureView.defaultProps);\n }\n\n static override defaultProps: Required<TextureViewProps> = {\n ...Resource.defaultProps,\n format: undefined!,\n dimension: undefined!,\n aspect: 'all',\n baseMipLevel: 0,\n mipLevelCount: undefined!,\n baseArrayLayer: 0,\n arrayLayerCount: undefined!\n };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Device} from '../device';\nimport {Resource, ResourceProps} from './resource';\n\nexport type ExternalTextureProps = ResourceProps & {\n source: HTMLVideoElement; // | null;\n colorSpace?: 'srgb';\n};\nexport abstract class ExternalTexture extends Resource<ExternalTextureProps> {\n override get [Symbol.toStringTag](): string {\n return 'ExternalTexture';\n }\n\n constructor(device: Device, props: ExternalTextureProps) {\n super(device, props, ExternalTexture.defaultProps);\n }\n\n static override defaultProps: Required<ExternalTextureProps> = {\n ...Resource.defaultProps,\n source: undefined!,\n colorSpace: 'srgb'\n };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {CompilerMessage} from '../adapter/types/compiler-message';\n\n/** @returns annotated errors or warnings */\nexport function formatCompilerLog(\n shaderLog: readonly CompilerMessage[],\n source: string,\n options?: {\n /** Include source code in the log. Either just the lines before issues or all source code */\n showSourceCode?: 'no' | 'issues' | 'all';\n html?: boolean;\n }\n): string {\n let formattedLog = '';\n const lines = source.split(/\\r?\\n/);\n const log = shaderLog.slice().sort((a, b) => a.lineNum - b.lineNum);\n\n switch (options?.showSourceCode || 'no') {\n case 'all':\n // Parse the error - note: browser and driver dependent\n let currentMessage = 0;\n for (let lineNum = 1; lineNum <= lines.length; lineNum++) {\n formattedLog += getNumberedLine(lines[lineNum - 1], lineNum, options);\n while (log.length > currentMessage && log[currentMessage].lineNum === lineNum) {\n const message = log[currentMessage++];\n formattedLog += formatCompilerMessage(message, lines, message.lineNum, {\n ...options,\n inlineSource: false\n });\n }\n }\n // Print any remaining messages\n while (log.length > currentMessage) {\n const message = log[currentMessage++];\n formattedLog += formatCompilerMessage(message, [], 0, {\n ...options,\n inlineSource: false\n });\n }\n return formattedLog;\n\n case 'issues':\n case 'no':\n // Parse the error - note: browser and driver dependent\n for (const message of shaderLog) {\n formattedLog += formatCompilerMessage(message, lines, message.lineNum, {\n inlineSource: options?.showSourceCode !== 'no'\n });\n }\n return formattedLog;\n }\n}\n\n// Helpers\n\n/** Format one message */\nfunction formatCompilerMessage(\n message: CompilerMessage,\n lines: readonly string[],\n lineNum: number,\n options: {\n inlineSource?: boolean;\n html?: boolean;\n }\n): string {\n if (options?.inlineSource) {\n const numberedLines = getNumberedLines(lines, lineNum);\n // If we got error position on line add a `^^^` indicator on next line\n const positionIndicator = message.linePos > 0 ? `${' '.repeat(message.linePos + 5)}^^^\\n` : '';\n return `\n${numberedLines}${positionIndicator}${message.type.toUpperCase()}: ${message.message}\n\n`;\n }\n const color = message.type === 'error' ? 'red' : '#8B4000'; // dark orange\n return options?.html\n ? `<div class='luma-compiler-log-error' style=\"color:${color};\"><b> ${message.type.toUpperCase()}: ${\n message.message\n }</b></div>`\n : `${message.type.toUpperCase()}: ${message.message}`;\n}\n\nfunction getNumberedLines(\n lines: readonly string[],\n lineNum: number,\n options?: {html?: boolean}\n): string {\n let numberedLines = '';\n for (let lineIndex = lineNum - 2; lineIndex <= lineNum; lineIndex++) {\n const sourceLine = lines[lineIndex - 1];\n if (sourceLine !== undefined) {\n numberedLines += getNumberedLine(sourceLine, lineNum, options);\n }\n }\n return numberedLines;\n}\n\nfunction getNumberedLine(line: string, lineNum: number, options?: {html?: boolean}): string {\n const escapedLine = options?.html ? escapeHTML(line) : line;\n return `${padLeft(String(lineNum), 4)}: ${escapedLine}${options?.html ? '<br/>' : '\\n'}`;\n}\n\n/**\n * Pads a string with a number of spaces (space characters) to the left\n * @param {String} string - string to pad\n * @param {Number} digits - number of spaces to add\n * @return {String} string - The padded string\n */\nfunction padLeft(string: string, paddedLength: number): string {\n let result = '';\n for (let i = string.length; i < paddedLength; ++i) {\n result += ' ';\n }\n return result + string;\n}\n\nfunction escapeHTML(unsafe: string): string {\n return unsafe\n .replaceAll('&', '&amp;')\n .replaceAll('<', '&lt;')\n .replaceAll('>', '&gt;')\n .replaceAll('\"', '&quot;')\n .replaceAll(\"'\", '&#039;');\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Device} from '../device';\nimport {Resource, ResourceProps} from './resource';\n// import { log } from '../../utils/log';\nimport {uid} from '../../utils/uid';\nimport {CompilerMessage} from '../types/compiler-message';\nimport {formatCompilerLog} from '../../adapter-utils/format-compiler-log';\n\n/**\n * Properties for a Shader\n */\nexport type ShaderProps = ResourceProps & {\n /** Shader language (defaults to auto) */\n language?: 'glsl' | 'wgsl' | 'auto';\n /** Which stage are we compiling? Required for GLSL. Ignored for WGSL. */\n stage?: 'vertex' | 'fragment' | 'compute';\n /** Shader source code */\n source: string;\n /** Optional shader source map (WebGPU only) */\n sourceMap?: string | null;\n /** Optional shader entry point (WebGPU only) */\n entryPoint?: string;\n /** Show shader source in browser? Overrides the device.props.debugShaders setting */\n debugShaders?: 'never' | 'errors' | 'warnings' | 'always';\n};\n\n/**\n * Immutable Shader object\n * In WebGPU the handle can be copied between threads\n */\nexport abstract class Shader extends Resource<ShaderProps> {\n override get [Symbol.toStringTag](): string {\n return 'Shader';\n }\n\n /** The stage of this shader */\n readonly stage: 'vertex' | 'fragment' | 'compute';\n /** The source code of this shader */\n readonly source: string;\n /** The compilation status of the shader. 'pending' if compilation is asynchronous, and on production */\n compilationStatus: 'pending' | 'success' | 'error' = 'pending';\n\n /** Create a new Shader instance */\n constructor(device: Device, props: ShaderProps) {\n props = {...props, debugShaders: props.debugShaders || device.props.debugShaders || 'errors'};\n super(device, {id: getShaderIdFromProps(props), ...props}, Shader.defaultProps);\n this.stage = this.props.stage;\n this.source = this.props.source;\n }\n\n abstract get asyncCompilationStatus(): Promise<'pending' | 'success' | 'error'>;\n\n /** Get compiler log asynchronously */\n abstract getCompilationInfo(): Promise<readonly CompilerMessage[]>;\n\n /** Get compiler log synchronously (WebGL only) */\n getCompilationInfoSync(): readonly CompilerMessage[] | null {\n return null;\n }\n\n /** Get translated shader source in host platform's native language (HLSL, GLSL, and even GLSL ES), if available */\n getTranslatedSource(): string | null {\n return null;\n }\n\n // PORTABLE HELPERS\n\n /** In browser logging of errors */\n async debugShader(): Promise<void> {\n const trigger = this.props.debugShaders;\n switch (trigger) {\n case 'never':\n return;\n case 'errors':\n // On WebGL - Don't extract the log unless errors\n if (this.compilationStatus === 'success') {\n return;\n }\n break;\n case 'warnings':\n case 'always':\n break;\n }\n\n const messages = await this.getCompilationInfo();\n if (trigger === 'warnings' && messages?.length === 0) {\n return;\n }\n this._displayShaderLog(messages, this.id);\n }\n\n // PRIVATE\n\n /**\n * In-browser UI logging of errors\n * TODO - this HTML formatting code should not be in Device, should be pluggable\n */\n protected _displayShaderLog(messages: readonly CompilerMessage[], shaderId: string): void {\n // Return if under Node.js / incomplete `document` polyfills\n if (typeof document === 'undefined' || !document?.createElement) {\n return;\n }\n\n const shaderName: string = shaderId; // getShaderName(this.source) || ;\n const shaderTitle: string = `${this.stage} shader \"${shaderName}\"`;\n let htmlLog = formatCompilerLog(messages, this.source, {showSourceCode: 'all', html: true});\n // Show translated source if available\n const translatedSource = this.getTranslatedSource();\n if (translatedSource) {\n htmlLog += `<br /><br /><h1>Translated Source</h1><br /><br /><code style=\"user-select:text;\"><pre>${translatedSource}</pre></code>`;\n }\n // Make it clickable so we can copy to clipboard\n const button = document.createElement('Button');\n button.innerHTML = `\n<h1>Compilation error in ${shaderTitle}</h1><br /><br />\n<code style=\"user-select:text;\"><pre>\n${htmlLog}\n</pre></code>`;\n button.style.top = '10px';\n button.style.left = '10px';\n button.style.position = 'absolute';\n button.style.zIndex = '9999';\n button.style.width = '100%';\n button.style.textAlign = 'left';\n document.body.appendChild(button);\n\n const errors = document.getElementsByClassName('luma-compiler-log-error');\n errors[0]?.scrollIntoView();\n\n // TODO - add a small embedded copy button (instead of main button)\n button.onclick = () => {\n // const source = this.source.replaceAll('\\n', '<br />');\n const dataURI = `data:text/plain,${encodeURIComponent(this.source)}`;\n navigator.clipboard.writeText(dataURI);\n };\n\n // TODO - add a small embedded close button\n }\n\n static override defaultProps: Required<ShaderProps> = {\n ...Resource.defaultProps,\n language: 'auto',\n stage: undefined!,\n source: '',\n sourceMap: null,\n entryPoint: 'main',\n debugShaders: undefined!\n };\n}\n\n// HELPERS\n\n/** Deduce an id, from shader source, or supplied id, or shader type */\nfunction getShaderIdFromProps(props: ShaderProps): string {\n return getShaderName(props.source) || props.id || uid(`unnamed ${props.stage}-shader`);\n}\n\n/** Extracts GLSLIFY style naming of shaders: `#define SHADER_NAME ...` */\nfunction getShaderName(shader: string, defaultName: string = 'unnamed'): string {\n const SHADER_NAME_REGEXP = /#define[\\s*]SHADER_NAME[\\s*]([A-Za-z0-9_-]+)[\\s*]/;\n const match = SHADER_NAME_REGEXP.exec(shader);\n return match ? match[1] : defaultName;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {\n TextureFormatColor,\n TextureFormatDepthStencil,\n TextureFormat\n} from '../../shadertypes/textures/texture-formats';\nimport type {Device} from '../device';\nimport {Resource, ResourceProps} from './resource';\nimport {Texture} from './texture';\nimport {TextureView} from './texture-view';\nimport {log} from '../../utils/log';\n\nexport type FramebufferProps = ResourceProps & {\n width?: number;\n height?: number;\n colorAttachments?: (TextureView | Texture | TextureFormatColor)[];\n depthStencilAttachment?: (TextureView | Texture | TextureFormatDepthStencil) | null;\n};\n\n/**\n * Create new textures with correct size for all attachments.\n * @note resize() destroys existing textures (if size has changed).\n */\nexport abstract class Framebuffer extends Resource<FramebufferProps> {\n override get [Symbol.toStringTag](): string {\n return 'Framebuffer';\n }\n\n /** Width of all attachments in this framebuffer */\n width: number;\n /** Height of all attachments in this framebuffer */\n height: number;\n /** Color attachments */\n abstract colorAttachments: TextureView[];\n /** Depth-stencil attachment, if provided */\n abstract depthStencilAttachment: TextureView | null;\n\n constructor(device: Device, props: FramebufferProps = {}) {\n super(device, props, Framebuffer.defaultProps);\n this.width = this.props.width;\n this.height = this.props.height;\n }\n\n /**\n * Create a copy of this framebuffer with new attached textures, with same props but of the specified size.\n * @note Does not copy contents of the attached textures.\n */\n clone(size?: {width: number; height: number}): Framebuffer {\n const colorAttachments = this.colorAttachments.map(colorAttachment =>\n colorAttachment.texture.clone(size)\n );\n\n const depthStencilAttachment =\n this.depthStencilAttachment && this.depthStencilAttachment.texture.clone(size);\n\n return this.device.createFramebuffer({...this.props, colorAttachments, depthStencilAttachment});\n }\n\n /**\n * Resizes all attachments\n * @note resize() destroys existing textures (if size has changed).\n * @deprecated Use framebuffer.clone()\n */\n resize(size: {width: number; height: number}): void;\n resize(size: [width: number, height: number]): void;\n resize(): void;\n resize(size?: {width: number; height: number} | [width: number, height: number]): void {\n let updateSize: boolean = !size;\n if (size) {\n const [width, height] = Array.isArray(size) ? size : [size.width, size.height];\n updateSize = updateSize || height !== this.height || width !== this.width;\n this.width = width;\n this.height = height;\n }\n if (updateSize) {\n log.log(2, `Resizing framebuffer ${this.id} to ${this.width}x${this.height}`)();\n this.resizeAttachments(this.width, this.height);\n }\n }\n\n /** Auto creates any textures */\n protected autoCreateAttachmentTextures(): void {\n if (this.props.colorAttachments.length === 0 && !this.props.depthStencilAttachment) {\n throw new Error('Framebuffer has noattachments');\n }\n\n this.colorAttachments = this.props.colorAttachments.map((attachment, index) => {\n if (typeof attachment === 'string') {\n const texture = this.createColorTexture(attachment, index);\n this.attachResource(texture);\n return texture.view;\n }\n if (attachment instanceof Texture) {\n return attachment.view;\n }\n return attachment;\n });\n\n const attachment = this.props.depthStencilAttachment;\n if (attachment) {\n if (typeof attachment === 'string') {\n const texture = this.createDepthStencilTexture(attachment);\n this.attachResource(texture);\n this.depthStencilAttachment = texture.view;\n } else if (attachment instanceof Texture) {\n this.depthStencilAttachment = attachment.view;\n } else {\n this.depthStencilAttachment = attachment;\n }\n }\n }\n\n /** Create a color texture */\n protected createColorTexture(format: TextureFormat, index: number): Texture {\n return this.device.createTexture({\n id: `${this.id}-color-attachment-${index}`,\n usage: Texture.RENDER_ATTACHMENT,\n format,\n width: this.width,\n height: this.height,\n // TODO deprecated? - luma.gl v8 compatibility\n sampler: {\n magFilter: 'linear',\n minFilter: 'linear'\n }\n });\n }\n\n /** Create depth stencil texture */\n protected createDepthStencilTexture(format: TextureFormat): Texture {\n return this.device.createTexture({\n id: `${this.id}-depth-stencil-attachment`,\n usage: Texture.RENDER_ATTACHMENT,\n format,\n width: this.width,\n height: this.height\n });\n }\n\n /**\n * Default implementation of resize\n * Creates new textures with correct size for all attachments.\n * and destroys existing textures if owned\n */\n protected resizeAttachments(width: number, height: number): void {\n for (let i = 0; i < this.colorAttachments.length; ++i) {\n if (this.colorAttachments[i]) {\n const resizedTexture = this.colorAttachments[i].texture.clone({\n width,\n height\n });\n this.destroyAttachedResource(this.colorAttachments[i]);\n this.colorAttachments[i] = resizedTexture.view;\n this.attachResource(resizedTexture.view);\n }\n }\n\n if (this.depthStencilAttachment) {\n const resizedTexture = this.depthStencilAttachment.texture.clone({\n width,\n height\n });\n this.destroyAttachedResource(this.depthStencilAttachment);\n this.depthStencilAttachment = resizedTexture.view;\n this.attachResource(resizedTexture);\n }\n\n this.updateAttachments();\n }\n\n /** Implementation is expected to update any underlying binding (WebGL framebuffer attachment) */\n protected abstract updateAttachments(): void;\n\n static override defaultProps: Required<FramebufferProps> = {\n ...Resource.defaultProps,\n width: 1,\n height: 1,\n colorAttachments: [], // ['rgba8unorm'],\n depthStencilAttachment: null // 'depth24plus-stencil8'\n };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Device} from '../device';\nimport type {UniformValue} from '../types/uniforms';\nimport type {PrimitiveTopology, RenderPipelineParameters} from '../types/parameters';\nimport type {ShaderLayout, Binding} from '../types/shader-layout';\nimport type {BufferLayout} from '../types/buffer-layout';\nimport type {\n TextureFormatColor,\n TextureFormatDepthStencil\n} from '@luma.gl/core/shadertypes/textures/texture-formats';\nimport type {Shader} from './shader';\nimport type {RenderPass} from './render-pass';\nimport {Resource, ResourceProps} from './resource';\nimport {VertexArray} from './vertex-array';\nimport {TransformFeedback} from './transform-feedback';\n\nexport type RenderPipelineProps = ResourceProps & {\n // Shaders and shader layout\n\n /** Compiled vertex shader */\n vs?: Shader | null;\n /** Name of vertex shader stage main function (defaults to 'main'). WGSL only */\n vertexEntryPoint?: string; //\n /** Constant values to apply to compiled vertex shader. Do not require re-compilation. (WGSL only) */\n vsConstants?: Record<string, number>; // WGSL only\n /** Compiled fragment shader */\n fs?: Shader | null;\n /** Name of fragment shader stage main function (defaults to 'main'). WGSL only */\n fragmentEntryPoint?: string; // WGSL only\n /** Constant values to apply to compiled fragment shader. Do not require re-compilation. (WGSL only) */\n fsConstants?: Record<string, number>;\n\n /** Describes the attributes and bindings exposed by the pipeline shader(s). */\n shaderLayout?: ShaderLayout | null;\n /** Describes the buffers accepted by this pipeline and how they are mapped to shader attributes. */\n bufferLayout?: BufferLayout[]; // Record<string, Omit<BufferLayout, 'name'>\n\n /** Determines how vertices are read from the 'vertex' attributes */\n topology?: PrimitiveTopology;\n\n // color attachment information (needed on WebGPU)\n\n /** Color attachments expected by this pipeline. Defaults to [device.preferredColorFormat]. Array needs not be contiguous. */\n colorAttachmentFormats?: (TextureFormatColor | null)[];\n /** Depth attachment expected by this pipeline. Defaults to device.preferredDepthFormat, if depthWriteEnables parameter is set */\n depthStencilAttachmentFormat?: TextureFormatDepthStencil;\n\n /** Parameters that are controlled by pipeline */\n parameters?: RenderPipelineParameters;\n\n // Dynamic bindings (TODO - pipelines should be immutable, move to RenderPass)\n\n /** Buffers, Textures, Samplers for the shader bindings */\n bindings?: Record<string, Binding>;\n /** @deprecated uniforms (WebGL only) */\n uniforms?: Record<string, UniformValue>;\n};\n\n/**\n * A compiled and linked shader program\n */\nexport abstract class RenderPipeline extends Resource<RenderPipelineProps> {\n override get [Symbol.toStringTag](): string {\n return 'RenderPipeline';\n }\n\n abstract readonly vs: Shader;\n abstract readonly fs: Shader | null;\n\n /** The merged layout */\n shaderLayout: ShaderLayout;\n /** Buffer map describing buffer interleaving etc */\n readonly bufferLayout: BufferLayout[];\n /** The linking status of the pipeline. 'pending' if linking is asynchronous, and on production */\n linkStatus: 'pending' | 'success' | 'error' = 'pending';\n /** The hash of the pipeline */\n hash: string = '';\n\n constructor(device: Device, props: RenderPipelineProps) {\n super(device, props, RenderPipeline.defaultProps);\n this.shaderLayout = this.props.shaderLayout!;\n this.bufferLayout = this.props.bufferLayout || [];\n }\n\n /** Set bindings (stored on pipeline and set before each call) */\n abstract setBindings(\n bindings: Record<string, Binding>,\n options?: {disableWarnings?: boolean}\n ): void;\n\n /** Draw call. Returns false if the draw call was aborted (due to resources still initializing) */\n abstract draw(options: {\n /** Render pass to draw into (targeting screen or framebuffer) */\n renderPass?: RenderPass;\n /** Parameters to be set during draw call. Note that most parameters can only be overridden in WebGL. */\n parameters?: RenderPipelineParameters;\n /** Topology. Note can only be overridden in WebGL. */\n topology?: PrimitiveTopology;\n /** vertex attributes */\n vertexArray: VertexArray;\n /** Use instanced rendering? */\n isInstanced?: boolean;\n /** Number of \"rows\" in 'instance' buffers */\n instanceCount?: number;\n /** Number of \"rows\" in 'vertex' buffers */\n vertexCount?: number;\n /** Number of \"rows\" in index buffer */\n indexCount?: number;\n /** First vertex to draw from */\n firstVertex?: number;\n /** First index to draw from */\n firstIndex?: number;\n /** First instance to draw from */\n firstInstance?: number;\n baseVertex?: number;\n /** Transform feedback. WebGL only. */\n transformFeedback?: TransformFeedback;\n }): boolean;\n\n static override defaultProps: Required<RenderPipelineProps> = {\n ...Resource.defaultProps,\n\n vs: null,\n vertexEntryPoint: 'vertexMain',\n vsConstants: {},\n\n fs: null,\n fragmentEntryPoint: 'fragmentMain',\n fsConstants: {},\n\n shaderLayout: null,\n bufferLayout: [],\n topology: 'triangle-list',\n\n colorAttachmentFormats: undefined!,\n depthStencilAttachmentFormat: undefined!,\n\n parameters: {},\n\n bindings: {},\n uniforms: {}\n };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {NumberArray4, TypedArray} from '@math.gl/types';\nimport type {Device} from '../device';\nimport type {RenderPassParameters} from '../types/parameters';\n// import {Binding} from '../types/shader-layout';\nimport {Resource, ResourceProps} from './resource';\nimport {Framebuffer} from './framebuffer';\nimport {QuerySet} from './query-set';\n\n/**\n * Properties for a RenderPass instance is a required parameter to all draw calls.\n */\nexport type RenderPassProps = ResourceProps & {\n /** Framebuffer specifies which textures to render into. Default gets framebuffer from canvas context. */\n framebuffer?: Framebuffer | null;\n /** Control viewport, scissor rect, blend constant and stencil ref */\n parameters?: RenderPassParameters;\n\n // TODO - API needs to be able to control multiple render targets\n\n /** Clear value for color attachment, or false to preserve the previous value */\n clearColor?: NumberArray4 | TypedArray | false;\n /** Experimental: Clear color values for multiple color attachments. Must specify typed arrays. props.clearColor will be ignored. */\n clearColors?: (TypedArray | false)[];\n /** Clear value for depth attachment (true === `1`), or false to preserve the previous value. Must be between 0.0 (near) and 1.0 (far), inclusive. */\n clearDepth?: number | false;\n /** Clear value for stencil attachment (true === `0`), or false to preserve the previous value. Converted to the type and number of LSBs as the number of bits in the stencil aspect */\n clearStencil?: number | false;\n\n /** Indicates that the depth component is read only. */\n depthReadOnly?: boolean;\n /** Indicates that the stencil component is read only. */\n stencilReadOnly?: boolean;\n\n /** Whether to disable / discard the output of the rasterizer */\n discard?: boolean;\n\n /** QuerySet to write begin/end timestamps to */\n occlusionQuerySet?: QuerySet;\n /** QuerySet to write begin/end timestamps to */\n timestampQuerySet?: QuerySet;\n /** QuerySet index to write begin timestamp to. No timestamp is written if not provided. */\n beginTimestampIndex?: number;\n /** QuerySet index to write end timestamp to. No timestamp is written if not provided. */\n endTimestampIndex?: number;\n};\n\n/**\n * A RenderPass instance is a required parameter to all draw calls.\n *\n * It holds a combination of\n * - render targets (specified via a framebuffer)\n * - clear colors, read/write, discard information for the framebuffer attachments\n * - a couple of mutable parameters ()\n */\nexport abstract class RenderPass extends Resource<RenderPassProps> {\n /** TODO - should be [0, 0, 0, 0], update once deck.gl tests run clean */\n static defaultClearColor: [number, number, number, number] = [0, 0, 0, 1];\n /** Depth 1.0 represents the far plance */\n static defaultClearDepth = 1;\n /** Clears all stencil bits */\n static defaultClearStencil = 0;\n\n override get [Symbol.toStringTag](): string {\n return 'RenderPass';\n }\n\n constructor(device: Device, props: RenderPassProps) {\n props = RenderPass.normalizeProps(device, props);\n super(device, props, RenderPass.defaultProps);\n }\n\n /** Call when rendering is done in this pass. */\n abstract end(): void;\n\n /** A few parameters can be changed at any time (viewport, scissorRect, blendColor, stencilReference) */\n abstract setParameters(parameters: RenderPassParameters): void;\n\n // executeBundles(bundles: Iterable<GPURenderBundle>): void;\n\n /** Being an occlusion query. Value will be stored in the occlusionQuerySet at the index. Occlusion queries cannot be nested. */\n abstract beginOcclusionQuery(queryIndex: number): void;\n /** End an occlusion query. Stores result in the index specified in beginOcclusionQuery. */\n abstract endOcclusionQuery(): void;\n\n /** Begins a labeled debug group containing subsequent commands */\n abstract pushDebugGroup(groupLabel: string): void;\n /** Ends the labeled debug group most recently started by pushDebugGroup() */\n abstract popDebugGroup(): void;\n /** Marks a point in a stream of commands with a label */\n abstract insertDebugMarker(markerLabel: string): void;\n\n protected static normalizeProps(device: Device, props: RenderPassProps): RenderPassProps {\n return props;\n }\n\n /** Default properties for RenderPass */\n static override defaultProps: Required<RenderPassProps> = {\n ...Resource.defaultProps,\n framebuffer: null,\n parameters: undefined!,\n clearColor: RenderPass.defaultClearColor,\n clearColors: undefined!,\n clearDepth: RenderPass.defaultClearDepth,\n clearStencil: RenderPass.defaultClearStencil,\n depthReadOnly: false,\n stencilReadOnly: false,\n discard: false,\n\n occlusionQuerySet: undefined!,\n timestampQuerySet: undefined!,\n beginTimestampIndex: undefined!,\n endTimestampIndex: undefined!\n };\n}\n\n// TODO - Can we align WebGL implementation with WebGPU API?\n// In WebGPU the following methods are on the renderpass instead of the renderpipeline\n// luma.gl keeps them on the pipeline for now, but that has some issues.\n\n// abstract setPipeline(pipeline: RenderPipeline): void {}\n// abstract setIndexBuffer()\n// abstract setVertexBuffer(slot: number, buffer: Buffer, offset: number): void;\n// abstract setBindings(bindings: Record<string, Binding>): void;\n// abstract setParameters(parameters: RenderPassParameters);\n// abstract draw(options: {\n// abstract drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): void;\n// abstract drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): void;\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Resource, ResourceProps} from './resource';\nimport type {ComputeShaderLayout, Binding} from '../types/shader-layout';\nimport type {Device} from '../device';\nimport type {Shader} from './shader';\n\n/**\n * Properties for a compute pipeline\n */\nexport type ComputePipelineProps = ResourceProps & {\n handle?: unknown;\n /** Compiled shader object */\n shader: Shader;\n /** The entry point, defaults to main */\n entryPoint?: string;\n /** These are WGSL constant values - different from GLSL defines in that shader does not need to be recompiled */\n constants?: Record<string, number>;\n /** Describes the attributes and bindings exposed by the pipeline shader(s). */\n shaderLayout?: ComputeShaderLayout | null;\n};\n\n/**\n * A compiled and linked shader program for compute\n */\nexport abstract class ComputePipeline extends Resource<ComputePipelineProps> {\n override get [Symbol.toStringTag](): string {\n return 'ComputePipeline';\n }\n\n hash: string = '';\n /** The merged shader layout */\n shaderLayout: ComputeShaderLayout;\n\n constructor(device: Device, props: ComputePipelineProps) {\n super(device, props, ComputePipeline.defaultProps);\n this.shaderLayout = props.shaderLayout!;\n }\n\n /**\n * @todo Use renderpass.setBindings() ?\n * @todo Do we want to expose BindGroups in the API and remove this?\n */\n abstract setBindings(bindings: Record<string, Binding>): void;\n\n static override defaultProps: Required<ComputePipelineProps> = {\n ...Resource.defaultProps,\n shader: undefined!,\n entryPoint: undefined!,\n constants: {},\n shaderLayout: undefined!\n };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Resource, ResourceProps} from './resource';\nimport {ComputePipeline} from './compute-pipeline';\nimport type {Device} from '../device';\nimport {Buffer} from './buffer';\nimport {QuerySet} from './query-set';\n\nexport type ComputePassProps = ResourceProps & {\n /** QuerySet to write beging/end timestamps to */\n timestampQuerySet?: QuerySet;\n /** QuerySet index to write begin timestamp to. No timestamp is written if not provided. */\n beginTimestampIndex?: number;\n /** QuerySet index to write end timestamp to. No timestamp is written if not provided. */\n endTimestampIndex?: number;\n};\n\nexport abstract class ComputePass extends Resource<ComputePassProps> {\n constructor(device: Device, props: ComputePassProps) {\n super(device, props, ComputePass.defaultProps);\n }\n\n abstract override destroy(): void;\n\n abstract end(): void;\n\n abstract setPipeline(pipeline: ComputePipeline): void;\n\n /** Sets an array of bindings (uniform buffers, samplers, textures, ...) */\n // abstract setBindings(bindings: Binding[]): void;\n\n /**\n * Dispatch work to be performed with the current ComputePipeline.\n * @param x X dimension of the grid of workgroups to dispatch.\n * @param y Y dimension of the grid of workgroups to dispatch.\n * @param z Z dimension of the grid of workgroups to dispatch.\n */\n abstract dispatch(x: number, y?: number, z?: number): void;\n\n /**\n * Dispatch work to be performed with the current ComputePipeline.\n * @param indirectBuffer buffer must be a tightly packed block of three 32-bit unsigned integer values (12 bytes total), given in the same order as the arguments for dispatch()\n * @param indirectOffset\n */\n abstract dispatchIndirect(indirectBuffer: Buffer, indirectOffset?: number): void;\n\n /** Begins a labeled debug group containing subsequent commands */\n abstract pushDebugGroup(groupLabel: string): void;\n /** Ends the labeled debug group most recently started by pushDebugGroup() */\n abstract popDebugGroup(): void;\n /** Marks a point in a stream of commands with a label */\n abstract insertDebugMarker(markerLabel: string): void;\n\n static override defaultProps: Required<ComputePassProps> = {\n ...Resource.defaultProps,\n timestampQuerySet: undefined!,\n beginTimestampIndex: undefined!,\n endTimestampIndex: undefined!\n };\n\n override get [Symbol.toStringTag](): string {\n return 'ComputePass';\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// import type {TypedArray} from '@math.gl/types';\nimport {Device} from '../device';\nimport {Resource, ResourceProps} from './resource';\nimport {Buffer} from './buffer';\nimport {Texture} from './texture';\nimport {QuerySet} from './query-set';\nimport type {RenderPass, RenderPassProps} from './render-pass';\nimport type {ComputePass, ComputePassProps} from './compute-pass';\nimport type {CommandBuffer, CommandBufferProps} from './command-buffer';\n\n// WEBGPU COMMAND ENCODER OPERATIONS\n\nexport type CopyBufferToBufferOptions = {\n sourceBuffer: Buffer;\n sourceOffset?: number;\n destinationBuffer: Buffer;\n destinationOffset?: number;\n size: number;\n};\n\nexport type CopyBufferToTextureOptions = {\n sourceBuffer: Buffer;\n byteOffset?: number;\n destinationTexture: Texture;\n mipLevel?: number; // = 0;\n origin?: [number, number, number] | number[];\n aspect?: 'all' | 'stencil-only' | 'depth-only';\n bytesPerRow: number;\n rowsPerImage: number;\n size: [number, number, number] | number[];\n};\n\nexport type CopyTextureToBufferOptions = {\n /** Texture to copy to/from. */\n sourceTexture: Texture;\n /** Mip-map level of the texture to copy to/from. (Default 0) */\n mipLevel?: number;\n /** Defines the origin of the copy - the minimum corner of the texture sub-region to copy to/from.\n * Together with `copySize`, defines the full copy sub-region.\n */\n /** Defines which aspects of the texture to copy to/from. */\n aspect?: 'all' | 'stencil-only' | 'depth-only';\n\n /** Width to copy */\n width?: number;\n height?: number;\n depthOrArrayLayers?: number;\n origin?: number[];\n\n /** Destination buffer */\n destinationBuffer: Buffer;\n /** Offset, in bytes, from the beginning of the buffer to the start of the image data (default 0) */\n byteOffset?: number;\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?: number;\n /**\n * Number of block rows per single image of the texture.\n * rowsPerImage &times; 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?: number;\n};\n\nexport type CopyTextureToTextureOptions = {\n /** Texture to copy to/from. */\n sourceTexture: Texture;\n /** Mip-map level of the texture to copy to/from. (Default 0) */\n mipLevel?: number;\n /** Defines the origin of the copy - the minimum corner of the texture sub-region to copy from. */\n origin?: number[];\n /** Defines which aspects of the {@link GPUImageCopyTexture#texture} to copy to/from. */\n aspect?: 'all' | 'stencil-only' | 'depth-only';\n\n /** Texture to copy to/from. */\n destinationTexture: Texture;\n /** Mip-map level of the texture to copy to/from. (Default 0) */\n destinationMipLevel?: number;\n /** Defines the origin of the copy - the minimum corner of the texture sub-region to copy to. */\n destinationOrigin?: number[];\n /** Defines which aspects of the {@link GPUImageCopyTexture#texture} to copy to/from. */\n destinationAspect?: 'all' | 'stencil-only' | 'depth-only';\n\n /** Width to copy */\n width?: number;\n height?: number;\n depthOrArrayLayers?: number;\n};\n\n// ADDITIONAL COMMAND ENCODER OPERATIONS DEFINED BY LUMA.GL\n\n/** Options for clearing a texture mip level */\nexport type ClearTextureOptions = {\n /** Texture to Clear. */\n texture: Texture;\n /** Mip-map level of the texture clear. (Default 0) */\n mipLevel?: number;\n /** Defines which aspects of the Texture to clear. */\n aspect?: 'all' | 'stencil-only' | 'depth-only';\n};\n\n// export type WriteBufferOptions = {\n// buffer: Buffer;\n// bufferOffset?: number;\n// data: BufferSource;\n// dataOffset?: number;\n// size?: number;\n// };\n\n// export type WriteTextureOptions = {\n// destination: Texture;\n// mipLevel?: number; // = 0;\n// origin?: [number, number, number] | number[];\n// aspect?: 'all' | 'stencil-only' | 'depth-only';\n// data: BufferSource;\n// // dataLayout;\n// offset: number;\n// bytesPerRow: number;\n// rowsPerImage: number;\n// size: [number, number, number] | number[];\n// };\n\nexport type CommandEncoderProps = ResourceProps & {\n measureExecutionTime?: boolean;\n};\n\n/**\n * Encodes commands to queue that can be executed later\n */\nexport abstract class CommandEncoder extends Resource<CommandEncoderProps> {\n override get [Symbol.toStringTag](): string {\n return 'CommandEncoder';\n }\n\n constructor(device: Device, props: CommandEncoderProps) {\n super(device, props, CommandEncoder.defaultProps);\n }\n\n /** Completes recording of the commands sequence */\n abstract finish(props?: CommandBufferProps): CommandBuffer;\n\n /** Create a RenderPass using the default CommandEncoder */\n abstract beginRenderPass(props?: RenderPassProps): RenderPass;\n\n /** Create a ComputePass using the default CommandEncoder*/\n abstract beginComputePass(props?: ComputePassProps): ComputePass;\n\n /** Add a command that that copies data from a sub-region of a Buffer to a sub-region of another Buffer. */\n abstract copyBufferToBuffer(options: CopyBufferToBufferOptions): void;\n\n /** Add a command that copies data from a sub-region of a GPUBuffer to a sub-region of one or multiple continuous texture subresources. */\n abstract copyBufferToTexture(options: CopyBufferToTextureOptions): void;\n\n /** Add a command that copies data from a sub-region of one or multiple continuous texture subresources to a sub-region of a Buffer. */\n abstract copyTextureToBuffer(options: CopyTextureToBufferOptions): void;\n\n /** Add a command that copies data from a sub-region of one or multiple contiguous texture subresources to another sub-region of one or multiple continuous texture subresources. */\n abstract copyTextureToTexture(options: CopyTextureToTextureOptions): void;\n\n /** Add a command that clears a texture mip level. */\n // abstract clearTexture(options: ClearTextureOptions): void;\n\n // abstract readTexture(options: ReadTextureOptions): Promise<TypedArray>;\n\n /** Reads results from a query set into a GPU buffer. Values are 64 bits so byteLength must be querySet.props.count * 8 */\n abstract resolveQuerySet(\n querySet: QuerySet,\n destination: Buffer,\n options?: {\n firstQuery?: number;\n queryCount?: number;\n destinationOffset?: number;\n }\n ): void;\n\n /** Begins a labeled debug group containing subsequent commands */\n abstract pushDebugGroup(groupLabel: string): void;\n /** Ends the labeled debug group most recently started by pushDebugGroup() */\n abstract popDebugGroup(): void;\n /** Marks a point in a stream of commands with a label */\n abstract insertDebugMarker(markerLabel: string): void;\n\n // TODO - luma.gl has these on the device, should we align with WebGPU API?\n // beginRenderPass(GPURenderPassDescriptor descriptor): GPURenderPassEncoder;\n // beginComputePass(optional GPUComputePassDescriptor descriptor = {}): GPUComputePassEncoder;\n\n static override defaultProps: Required<CommandEncoderProps> = {\n ...Resource.defaultProps,\n measureExecutionTime: undefined!\n };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Device} from '../device';\nimport {Resource, ResourceProps} from './resource';\n\n// interface Queue {\n// submit(commandBuffers);\n\n// // onSubmittedWorkDone(): Promise<undefined>;\n\n// writeBuffer(options: WriteBufferOptions): void;\n// writeTexture(options: WriteTextureOptions): void;\n\n// // copyExternalImageToTexture(\n// // GPUImageCopyExternalImage source,\n// // GPUImageCopyTextureTagged destination,\n// // GPUExtent3D copySize\n// // ): void;\n// }\n\nexport type CommandBufferProps = ResourceProps & {};\n\n/**\n * Encodes commands to queue that can be executed later\n */\nexport abstract class CommandBuffer extends Resource<CommandBufferProps> {\n override get [Symbol.toStringTag](): string {\n return 'CommandBuffer';\n }\n\n constructor(device: Device, props: CommandBufferProps) {\n super(device, props, CommandBuffer.defaultProps);\n }\n\n static override defaultProps: Required<CommandBufferProps> = {\n ...Resource.defaultProps\n };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {PrimitiveDataType} from './data-types';\nimport type {\n VariableShaderType,\n AttributeShaderType,\n AttributeShaderTypeInfo,\n VariableShaderTypeAlias,\n AttributeShaderTypeAlias\n} from './shader-types';\n\n/** Split a uniform type string into type and components */\nexport function getVariableShaderTypeInfo(format: VariableShaderType): {\n type: PrimitiveDataType;\n components: number;\n} {\n const decoded = UNIFORM_FORMATS[format];\n return decoded;\n}\n\n/** Decodes a vertex type, returning byte length and flags (integer, signed, normalized) */\nexport function getAttributeShaderTypeInfo(\n attributeType: AttributeShaderType\n): AttributeShaderTypeInfo {\n const [primitiveType, components] = TYPE_INFO[attributeType];\n const integer: boolean = primitiveType === 'i32' || primitiveType === 'u32';\n const signed: boolean = primitiveType !== 'u32';\n\n const byteLength = PRIMITIVE_TYPE_SIZES[primitiveType] * components;\n return {\n primitiveType,\n components,\n byteLength,\n integer,\n signed\n };\n}\n\nexport function makeShaderAttributeType(\n primitiveType: PrimitiveDataType,\n components: 1 | 2 | 3 | 4\n): AttributeShaderType {\n return components === 1 ? primitiveType : `vec${components}<${primitiveType}>`;\n}\n\nexport function resolveAttributeShaderTypeAlias(\n alias: AttributeShaderTypeAlias | AttributeShaderType\n): AttributeShaderType {\n return WGSL_ATTRIBUTE_TYPE_ALIAS_MAP[alias as AttributeShaderTypeAlias] || alias;\n}\n\nexport function resolveVariableShaderTypeAlias(\n alias: VariableShaderTypeAlias | VariableShaderType\n): VariableShaderType {\n return WGSL_VARIABLE_TYPE_ALIAS_MAP[alias as VariableShaderTypeAlias] || alias;\n}\n\n// TABLES\n\nconst PRIMITIVE_TYPE_SIZES: Record<PrimitiveDataType, 2 | 4> = {\n f32: 4,\n f16: 2,\n i32: 4,\n u32: 4\n // 'bool-webgl': 4,\n};\n\n/** All valid shader attribute types. A table guarantees exhaustive list and fast execution */\nconst TYPE_INFO: Record<AttributeShaderType, [PrimitiveDataType, components: 1 | 2 | 3 | 4]> = {\n f32: ['f32', 1],\n 'vec2<f32>': ['f32', 2],\n 'vec3<f32>': ['f32', 3],\n 'vec4<f32>': ['f32', 4],\n f16: ['f16', 1],\n 'vec2<f16>': ['f16', 2],\n 'vec3<f16>': ['f16', 3],\n 'vec4<f16>': ['f16', 4],\n i32: ['i32', 1],\n 'vec2<i32>': ['i32', 2],\n 'vec3<i32>': ['i32', 3],\n 'vec4<i32>': ['i32', 4],\n u32: ['u32', 1],\n 'vec2<u32>': ['u32', 2],\n 'vec3<u32>': ['u32', 3],\n 'vec4<u32>': ['u32', 4]\n};\n\n/** @todo These tables are quite big, consider parsing type strings instead */\nconst UNIFORM_FORMATS: Record<VariableShaderType, {type: PrimitiveDataType; components: number}> = {\n f32: {type: 'f32', components: 1},\n f16: {type: 'f16', components: 1},\n i32: {type: 'i32', components: 1},\n u32: {type: 'u32', components: 1},\n // 'bool-webgl': {type: 'bool-webgl', components: 1},\n 'vec2<f32>': {type: 'f32', components: 2},\n 'vec3<f32>': {type: 'f32', components: 3},\n 'vec4<f32>': {type: 'f32', components: 4},\n 'vec2<f16>': {type: 'f16', components: 2},\n 'vec3<f16>': {type: 'f16', components: 3},\n 'vec4<f16>': {type: 'f16', components: 4},\n 'vec2<i32>': {type: 'i32', components: 2},\n 'vec3<i32>': {type: 'i32', components: 3},\n 'vec4<i32>': {type: 'i32', components: 4},\n 'vec2<u32>': {type: 'u32', components: 2},\n 'vec3<u32>': {type: 'u32', components: 3},\n 'vec4<u32>': {type: 'u32', components: 4},\n\n 'mat2x2<f32>': {type: 'f32', components: 4},\n 'mat2x3<f32>': {type: 'f32', components: 6},\n 'mat2x4<f32>': {type: 'f32', components: 8},\n 'mat3x2<f32>': {type: 'f32', components: 6},\n 'mat3x3<f32>': {type: 'f32', components: 9},\n 'mat3x4<f32>': {type: 'f32', components: 12},\n 'mat4x2<f32>': {type: 'f32', components: 8},\n 'mat4x3<f32>': {type: 'f32', components: 12},\n 'mat4x4<f32>': {type: 'f32', components: 16},\n\n 'mat2x2<f16>': {type: 'f16', components: 4},\n 'mat2x3<f16>': {type: 'f16', components: 6},\n 'mat2x4<f16>': {type: 'f16', components: 8},\n 'mat3x2<f16>': {type: 'f16', components: 6},\n 'mat3x3<f16>': {type: 'f16', components: 9},\n 'mat3x4<f16>': {type: 'f16', components: 12},\n 'mat4x2<f16>': {type: 'f16', components: 8},\n 'mat4x3<f16>': {type: 'f16', components: 12},\n 'mat4x4<f16>': {type: 'f16', components: 16},\n\n 'mat2x2<i32>': {type: 'i32', components: 4},\n 'mat2x3<i32>': {type: 'i32', components: 6},\n 'mat2x4<i32>': {type: 'i32', components: 8},\n 'mat3x2<i32>': {type: 'i32', components: 6},\n 'mat3x3<i32>': {type: 'i32', components: 9},\n 'mat3x4<i32>': {type: 'i32', components: 12},\n 'mat4x2<i32>': {type: 'i32', components: 8},\n 'mat4x3<i32>': {type: 'i32', components: 12},\n 'mat4x4<i32>': {type: 'i32', components: 16},\n\n 'mat2x2<u32>': {type: 'u32', components: 4},\n 'mat2x3<u32>': {type: 'u32', components: 6},\n 'mat2x4<u32>': {type: 'u32', components: 8},\n 'mat3x2<u32>': {type: 'u32', components: 6},\n 'mat3x3<u32>': {type: 'u32', components: 9},\n 'mat3x4<u32>': {type: 'u32', components: 12},\n 'mat4x2<u32>': {type: 'u32', components: 8},\n 'mat4x3<u32>': {type: 'u32', components: 12},\n 'mat4x4<u32>': {type: 'u32', components: 16}\n};\n\n/** Predeclared aliases @see https://www.w3.org/TR/WGSL/#vector-types */\nexport const WGSL_ATTRIBUTE_TYPE_ALIAS_MAP: Record<AttributeShaderTypeAlias, AttributeShaderType> =\n {\n vec2i: 'vec2<i32>',\n vec3i: 'vec3<i32>',\n vec4i: 'vec4<i32>',\n vec2u: 'vec2<u32>',\n vec3u: 'vec3<u32>',\n vec4u: 'vec4<u32>',\n vec2f: 'vec2<f32>',\n vec3f: 'vec3<f32>',\n vec4f: 'vec4<f32>',\n // Requires the f16 extension.\n vec2h: 'vec2<f16>',\n vec3h: 'vec3<f16>',\n vec4h: 'vec4<f16>'\n };\n\n/** @todo These tables are quite big, consider parsing alias strings instead */\nexport const WGSL_VARIABLE_TYPE_ALIAS_MAP: Record<VariableShaderTypeAlias, VariableShaderType> = {\n ...WGSL_ATTRIBUTE_TYPE_ALIAS_MAP,\n mat2x2f: 'mat2x2<f32>',\n mat2x3f: 'mat2x3<f32>',\n mat2x4f: 'mat2x4<f32>',\n mat3x2f: 'mat3x2<f32>',\n mat3x3f: 'mat3x3<f32>',\n mat3x4f: 'mat3x4<f32>',\n mat4x2f: 'mat4x2<f32>',\n mat4x3f: 'mat4x3<f32>',\n mat4x4f: 'mat4x4<f32>',\n\n mat2x2i: 'mat2x2<i32>',\n mat2x3i: 'mat2x3<i32>',\n mat2x4i: 'mat2x4<i32>',\n mat3x2i: 'mat3x2<i32>',\n mat3x3i: 'mat3x3<i32>',\n mat3x4i: 'mat3x4<i32>',\n mat4x2i: 'mat4x2<i32>',\n mat4x3i: 'mat4x3<i32>',\n mat4x4i: 'mat4x4<i32>',\n\n mat2x2u: 'mat2x2<u32>',\n mat2x3u: 'mat2x3<u32>',\n mat2x4u: 'mat2x4<u32>',\n mat3x2u: 'mat3x2<u32>',\n mat3x3u: 'mat3x3<u32>',\n mat3x4u: 'mat3x4<u32>',\n mat4x2u: 'mat4x2<u32>',\n mat4x3u: 'mat4x3<u32>',\n mat4x4u: 'mat4x4<u32>',\n\n mat2x2h: 'mat2x2<f16>',\n mat2x3h: 'mat2x3<f16>',\n mat2x4h: 'mat2x4<f16>',\n mat3x2h: 'mat3x2<f16>',\n mat3x3h: 'mat3x3<f16>',\n mat3x4h: 'mat3x4<f16>',\n mat4x2h: 'mat4x2<f16>',\n mat4x3h: 'mat4x3<f16>',\n mat4x4h: 'mat4x4<f16>'\n};\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {log} from '../utils/log';\nimport type {PrimitiveDataType, NormalizedDataType} from '../shadertypes/data-types/data-types';\nimport type {AttributeShaderType} from '../shadertypes/data-types/shader-types';\nimport type {VertexFormat} from '../shadertypes/vertex-arrays/vertex-formats';\nimport {getAttributeShaderTypeInfo} from '../shadertypes/data-types/decode-shader-types';\nimport {\n getVertexFormatInfo,\n getCompatibleVertexFormat\n} from '../shadertypes/vertex-arrays/decode-vertex-format';\nimport type {ShaderLayout, AttributeDeclaration} from '../adapter/types/shader-layout';\nimport type {BufferLayout} from '../adapter/types/buffer-layout';\n\n/** Resolved info for a buffer / attribute combination to help backend configure it correctly */\nexport type AttributeInfo = {\n /** Attribute name */\n attributeName: string;\n /** Location in shader */\n location: number;\n /** Type / precision used in shader (buffer values may be converted) */\n shaderType: AttributeShaderType;\n /** Calculations are done in this type in the shader's attribute declaration */\n primitiveType: PrimitiveDataType;\n /** Components refer to the number of components in the shader's attribute declaration */\n shaderComponents: 1 | 2 | 3 | 4;\n /** It is the shader attribute declaration that determines whether GPU will process as integer or float */\n integer: boolean;\n\n /** BufferName */\n bufferName: string;\n /** Format of buffer data */\n vertexFormat: VertexFormat;\n /** Memory data type refers to the data type in the buffer */\n bufferDataType: NormalizedDataType;\n /** Components refer to the number of components in the buffer's vertex format */\n bufferComponents: 1 | 2 | 3 | 4;\n /** Normalization is encoded in the buffer layout's vertex format... */\n normalized: boolean;\n\n /** If not specified, the step mode is inferred from the attribute name in the shader (contains string instance) */\n stepMode: 'vertex' | 'instance';\n\n /** The byteOffset is encoded in or calculated from the buffer layout */\n byteOffset: number;\n /** The byteStride is encoded in or calculated from the buffer layout */\n byteStride: number;\n};\n\ntype BufferAttributeInfo = {\n attributeName: string;\n bufferName: string;\n stepMode?: 'vertex' | 'instance';\n vertexFormat: VertexFormat;\n byteOffset: number;\n byteStride: number;\n};\n\n/**\n * Map from \"attribute names\" to \"resolved attribute infos\"\n * containing information about both buffer layouts and shader attribute declarations\n */\nexport function getAttributeInfosFromLayouts(\n shaderLayout: ShaderLayout,\n bufferLayout: BufferLayout[]\n): Record<string, AttributeInfo> {\n const attributeInfos: Record<string, AttributeInfo> = {};\n for (const attribute of shaderLayout.attributes) {\n const attributeInfo = getAttributeInfoFromLayouts(shaderLayout, bufferLayout, attribute.name);\n if (attributeInfo) {\n attributeInfos[attribute.name] = attributeInfo;\n }\n }\n return attributeInfos;\n}\n\n/**\n * Array indexed by \"location\" holding \"resolved attribute infos\"\n */\nexport function getAttributeInfosByLocation(\n shaderLayout: ShaderLayout,\n bufferLayout: BufferLayout[],\n maxVertexAttributes: number = 16\n): AttributeInfo[] {\n const attributeInfos = getAttributeInfosFromLayouts(shaderLayout, bufferLayout);\n const locationInfos: AttributeInfo[] = new Array(maxVertexAttributes).fill(null);\n for (const attributeInfo of Object.values(attributeInfos)) {\n locationInfos[attributeInfo.location] = attributeInfo;\n }\n return locationInfos;\n}\n\n/**\n * Get the combined information from a shader layout and a buffer layout for a specific attribute\n */\nfunction getAttributeInfoFromLayouts(\n shaderLayout: ShaderLayout,\n bufferLayout: BufferLayout[],\n name: string\n): AttributeInfo | null {\n const shaderDeclaration = getAttributeFromShaderLayout(shaderLayout, name);\n const bufferMapping: BufferAttributeInfo | null = getAttributeFromBufferLayout(\n bufferLayout,\n name\n );\n\n // TODO should no longer happen\n if (!shaderDeclaration) {\n // || !bufferMapping\n return null;\n }\n\n const attributeTypeInfo = getAttributeShaderTypeInfo(shaderDeclaration.type);\n const defaultVertexFormat = getCompatibleVertexFormat(attributeTypeInfo);\n const vertexFormat = bufferMapping?.vertexFormat || defaultVertexFormat;\n const vertexFormatInfo = getVertexFormatInfo(vertexFormat);\n\n return {\n attributeName: bufferMapping?.attributeName || shaderDeclaration.name,\n bufferName: bufferMapping?.bufferName || shaderDeclaration.name,\n location: shaderDeclaration.location,\n shaderType: shaderDeclaration.type,\n primitiveType: attributeTypeInfo.primitiveType,\n shaderComponents: attributeTypeInfo.components,\n vertexFormat,\n bufferDataType: vertexFormatInfo.type,\n bufferComponents: vertexFormatInfo.components,\n // normalized is a property of the buffer's vertex format\n normalized: vertexFormatInfo.normalized,\n // integer is a property of the shader declaration\n integer: attributeTypeInfo.integer,\n stepMode: bufferMapping?.stepMode || shaderDeclaration.stepMode || 'vertex',\n byteOffset: bufferMapping?.byteOffset || 0,\n byteStride: bufferMapping?.byteStride || 0\n };\n}\n\nfunction getAttributeFromShaderLayout(\n shaderLayout: ShaderLayout,\n name: string\n): AttributeDeclaration | null {\n const attribute = shaderLayout.attributes.find(attr => attr.name === name);\n if (!attribute) {\n log.warn(`shader layout attribute \"${name}\" not present in shader`);\n }\n return attribute || null;\n}\n\nfunction getAttributeFromBufferLayout(\n bufferLayouts: BufferLayout[],\n name: string\n): BufferAttributeInfo | null {\n // Check that bufferLayouts are valid (each either has format or attribute)\n checkBufferLayouts(bufferLayouts);\n\n let bufferLayoutInfo = getAttributeFromShortHand(bufferLayouts, name);\n if (bufferLayoutInfo) {\n return bufferLayoutInfo;\n }\n\n bufferLayoutInfo = getAttributeFromAttributesList(bufferLayouts, name);\n if (bufferLayoutInfo) {\n return bufferLayoutInfo;\n }\n\n // Didn't find...\n log.warn(`layout for attribute \"${name}\" not present in buffer layout`);\n return null;\n}\n\n/** Check that bufferLayouts are valid (each either has format or attribute) */\nfunction checkBufferLayouts(bufferLayouts: BufferLayout[]) {\n for (const bufferLayout of bufferLayouts) {\n if (\n (bufferLayout.attributes && bufferLayout.format) ||\n (!bufferLayout.attributes && !bufferLayout.format)\n ) {\n log.warn(`BufferLayout ${name} must have either 'attributes' or 'format' field`);\n }\n }\n}\n\n/** Get attribute from format shorthand if specified */\nfunction getAttributeFromShortHand(\n bufferLayouts: BufferLayout[],\n name: string\n): BufferAttributeInfo | null {\n for (const bufferLayout of bufferLayouts) {\n if (bufferLayout.format && bufferLayout.name === name) {\n return {\n attributeName: bufferLayout.name,\n bufferName: name,\n stepMode: bufferLayout.stepMode,\n vertexFormat: bufferLayout.format,\n // If offset is needed, use `attributes` field.\n byteOffset: 0,\n byteStride: bufferLayout.byteStride || 0\n };\n }\n }\n return null;\n}\n\n/**\n * Search attribute mappings (e.g. interleaved attributes) for buffer mapping.\n * Not the name of the buffer might be the same as one of the interleaved attributes.\n */\nfunction getAttributeFromAttributesList(\n bufferLayouts: BufferLayout[],\n name: string\n): BufferAttributeInfo | null {\n for (const bufferLayout of bufferLayouts) {\n let byteStride: number | undefined = bufferLayout.byteStride;\n\n // Calculate a default byte stride if not provided\n if (typeof bufferLayout.byteStride !== 'number') {\n for (const attributeMapping of bufferLayout.attributes || []) {\n const info = getVertexFormatInfo(attributeMapping.format);\n // @ts-ignore\n byteStride += info.byteLength;\n }\n }\n\n const attributeMapping = bufferLayout.attributes?.find(mapping => mapping.attribute === name);\n if (attributeMapping) {\n return {\n attributeName: attributeMapping.attribute,\n bufferName: bufferLayout.name,\n stepMode: bufferLayout.stepMode,\n vertexFormat: attributeMapping.format,\n byteOffset: attributeMapping.byteOffset,\n // @ts-ignore\n byteStride\n };\n }\n }\n\n return null;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {TypedArray} from '../../types';\nimport {\n AttributeInfo,\n getAttributeInfosByLocation\n} from '../../adapter-utils/get-attribute-from-layouts';\nimport type {Device} from '../device';\nimport type {Buffer} from './buffer';\nimport type {RenderPass} from './render-pass';\nimport {Resource, ResourceProps} from './resource';\nimport {ShaderLayout} from '../types/shader-layout';\nimport {BufferLayout} from '../types/buffer-layout';\n\n/** Properties for initializing a VertexArray */\nexport type VertexArrayProps = ResourceProps & {\n shaderLayout: ShaderLayout;\n bufferLayout: BufferLayout[];\n};\n\n/**\n * Stores attribute bindings.\n * Makes it easy to share a render pipeline and use separate vertex arrays.\n * @note On WebGL, VertexArray allows non-constant bindings to be performed in advance\n * reducing the number of WebGL calls per draw call.\n * @note On WebGPU this is just a convenience class that collects the bindings.\n */\nexport abstract class VertexArray extends Resource<VertexArrayProps> {\n static override defaultProps: Required<VertexArrayProps> = {\n ...Resource.defaultProps,\n shaderLayout: undefined!,\n bufferLayout: []\n };\n\n override get [Symbol.toStringTag](): string {\n return 'VertexArray';\n }\n\n /** Max number of vertex attributes */\n readonly maxVertexAttributes: number;\n /** Attribute infos indexed by location - TODO only needed by webgl module? */\n protected readonly attributeInfos: AttributeInfo[];\n\n /** Index buffer */\n indexBuffer: Buffer | null = null;\n /** Attributes indexed by buffer slot */\n attributes: (Buffer | TypedArray | null)[];\n\n constructor(device: Device, props: VertexArrayProps) {\n super(device, props, VertexArray.defaultProps);\n this.maxVertexAttributes = device.limits.maxVertexAttributes;\n this.attributes = new Array(this.maxVertexAttributes).fill(null);\n this.attributeInfos = getAttributeInfosByLocation(\n props.shaderLayout,\n props.bufferLayout,\n this.maxVertexAttributes\n );\n }\n\n /** Set attributes (stored on pipeline and set before each call) */\n abstract setIndexBuffer(indices: Buffer | null): void;\n /** Set attributes (stored on pipeline and set before each call) */\n abstract setBuffer(bufferSlot: number, buffer: Buffer | null): void;\n\n abstract bindBeforeRender(renderPass: RenderPass): void;\n abstract unbindAfterRender(renderPass: RenderPass): void;\n\n // DEPRECATED METHODS\n\n /** @deprecated Set constant attributes (WebGL only) */\n setConstantWebGL(location: number, value: TypedArray | null): void {\n this.device.reportError(new Error('constant attributes not supported'), this)();\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Device} from '../device';\nimport {PrimitiveTopology} from '../types/parameters';\nimport {ShaderLayout} from '../types/shader-layout';\nimport type {Buffer} from './buffer';\nimport {Resource, ResourceProps} from './resource';\n\n/** For bindRange */\nexport type BufferRange = {\n buffer: Buffer;\n byteOffset?: number;\n byteLength?: number;\n};\n\n/** Configures a set of output buffers for pipeline (WebGL only) */\nexport type TransformFeedbackProps = ResourceProps & {\n /** Layout of shader (for varyings) */\n layout: ShaderLayout;\n /** Buffer bindings (for varyings) */\n buffers: Record<string, Buffer | BufferRange>;\n};\n\n/** Holds a set of output buffers for pipeline (WebGL only) */\nexport abstract class TransformFeedback extends Resource<TransformFeedbackProps> {\n static override defaultProps: Required<TransformFeedbackProps> = {\n ...Resource.defaultProps,\n layout: undefined!,\n buffers: {}\n };\n\n get [Symbol.toStringTag](): string {\n return 'TransformFeedback';\n }\n\n constructor(device: Device, props: TransformFeedbackProps) {\n super(device, props, TransformFeedback.defaultProps);\n }\n\n abstract begin(topology?: PrimitiveTopology): void;\n abstract end(): void;\n\n abstract setBuffers(buffers: Record<string, Buffer | BufferRange>): void;\n abstract setBuffer(locationOrName: string | number, bufferOrRange: Buffer | BufferRange): void;\n abstract getBuffer(locationOrName: string | number): Buffer | BufferRange | null;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Device} from '../device';\nimport {Resource, ResourceProps} from './resource';\n\n/**\n * Properties for creating a QuerySet\n * - 'timestamp' - query the GPU timestamp counter at the start and end of render passes\n * timestamp queries are available if the 'timestamp-query' feature is present.\n * - 'occlusion' - query the number of fragment samples that pass all per-fragment tests for a set of drawing commands\n * including scissor, sample mask, alpha to coverage, stencil, and depth tests\n */\nexport type QuerySetProps = ResourceProps & {\n /**\n * The type of query set\n * occlusion - query the number of fragment samples that pass all the per-fragment tests for a set of drawing commands, including scissor, sample mask, alpha to coverage, stencil, and depth tests\n * timestamp - query the GPU timestamp counter at the start and end of render passes\n */\n type: 'occlusion' | 'timestamp';\n /** The number of queries managed by the query set */\n count: number;\n};\n\n/** Immutable QuerySet object */\nexport abstract class QuerySet extends Resource<QuerySetProps> {\n get [Symbol.toStringTag](): string {\n return 'QuerySet';\n }\n\n constructor(device: Device, props: QuerySetProps) {\n super(device, props, QuerySet.defaultProps);\n }\n\n static override defaultProps: Required<QuerySetProps> = {\n ...Resource.defaultProps,\n type: undefined!,\n count: undefined!\n };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {Device} from '../device';\nimport {ShaderLayout} from '../types/shader-layout';\nimport {Resource, ResourceProps} from './resource';\n\nexport type PipelineLayoutProps = ResourceProps & {\n shaderLayout: ShaderLayout;\n};\n\n/** Immutable PipelineLayout object */\nexport abstract class PipelineLayout extends Resource<PipelineLayoutProps> {\n get [Symbol.toStringTag](): string {\n return 'PipelineLayout';\n }\n\n constructor(device: Device, props: PipelineLayoutProps) {\n super(device, props, PipelineLayout.defaultProps);\n }\n\n static override defaultProps: Required<PipelineLayoutProps> = {\n ...Resource.defaultProps,\n shaderLayout: {\n attributes: [],\n bindings: []\n }\n };\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {TypedArray} from '../types';\n\nlet arrayBuffer: ArrayBuffer;\n\nexport function getScratchArrayBuffer(byteLength: number): ArrayBuffer {\n if (!arrayBuffer || arrayBuffer.byteLength < byteLength) {\n arrayBuffer = new ArrayBuffer(byteLength);\n }\n return arrayBuffer;\n}\n\nexport function getScratchArray(Type: any, length: number): TypedArray {\n const scratchArrayBuffer = getScratchArrayBuffer(Type.BYTES_PER_ELEMENT * length);\n return new Type(scratchArrayBuffer, 0, length); // arrayBuffer, byteOffset, length (in elements)\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {TypedArray, NumberArray} from '../types';\n\n/**\n * Check is an array is a typed array\n * @param value value to be tested\n * @returns input as TypedArray, or null\n * @todo this should be provided by @math.gl/types\n */\nexport function isTypedArray(value: unknown): value is TypedArray {\n return ArrayBuffer.isView(value) && !(value instanceof DataView);\n}\n\n/**\n * Check is an array is a numeric array (typed array or array of numbers)\n * @param value value to be tested\n * @returns input as NumberArray, or null\n * @todo this should be provided by @math.gl/types\n */\nexport function isNumberArray(value: unknown): value is NumberArray {\n if (Array.isArray(value)) {\n return value.length === 0 || typeof value[0] === 'number';\n }\n return isTypedArray(value);\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {PrimitiveDataType} from '../shadertypes/data-types/data-types';\nimport type {VariableShaderType} from '../shadertypes/data-types/shader-types';\nimport {alignTo} from '../shadertypes/data-types/decode-data-types';\nimport {getVariableShaderTypeInfo} from '../shadertypes/data-types/decode-shader-types';\n\nimport type {UniformValue} from '../adapter/types/uniforms';\nimport {getScratchArrayBuffer} from '../utils/array-utils-flat';\nimport {isNumberArray} from '../utils/is-array';\nimport {log} from '../utils/log';\n\n/**\n * Smallest buffer size that can be used for uniform buffers.\n * TODO - does this depend on device?\n */\nconst minBufferSize: number = 1024;\n\n/**\n * Std140 layout for uniform buffers\n * Supports manual listing of uniforms\n */\nexport class UniformBufferLayout {\n readonly layout: Record<string, {offset: number; size: number; type: PrimitiveDataType}> = {};\n\n /** number of bytes needed for buffer allocation */\n readonly byteLength: number;\n\n /** Create a new UniformBufferLayout given a map of attributes. */\n constructor(\n uniformTypes: Record<string, VariableShaderType>,\n uniformSizes: Record<string, number> = {}\n ) {\n /** number of 4 byte slots taken */\n let size: number = 0;\n\n // Add layout (type, size and offset) definitions for each uniform in the layout\n for (const [key, uniformType] of Object.entries(uniformTypes)) {\n const typeAndComponents = getVariableShaderTypeInfo(uniformType);\n const {type, components} = typeAndComponents;\n // Calculate total count for uniform arrays.\n const count = components * (uniformSizes?.[key] ?? 1);\n // First, align (bump) current offset to an even multiple of current object (1, 2, 4)\n size = alignTo(size, count);\n // Use the aligned size as the offset of the current uniform.\n const offset = size;\n // Then, add our object's padded size ((1, 2, multiple of 4) to the current offset\n size += count;\n this.layout[key] = {type, size: count, offset};\n }\n size += (4 - (size % 4)) % 4;\n\n const actualByteLength = size * 4;\n this.byteLength = Math.max(actualByteLength, minBufferSize);\n }\n\n /** Get the data for the complete buffer */\n getData(uniformValues: Record<string, UniformValue>): Uint8Array {\n // Allocate three typed arrays pointing at same memory\n const arrayBuffer = getScratchArrayBuffer(this.byteLength);\n const typedArrays = {\n i32: new Int32Array(arrayBuffer),\n u32: new Uint32Array(arrayBuffer),\n f32: new Float32Array(arrayBuffer),\n // TODO not implemented\n f16: new Uint16Array(arrayBuffer)\n };\n\n for (const [name, value] of Object.entries(uniformValues)) {\n const uniformLayout = this.layout[name];\n if (!uniformLayout) {\n log.warn(`Supplied uniform value ${name} not present in uniform block layout`)();\n // eslint-disable-next-line no-continue\n continue;\n }\n\n const {type, size, offset} = uniformLayout;\n const typedArray = typedArrays[type];\n if (size === 1) {\n if (typeof value !== 'number' && typeof value !== 'boolean') {\n log.warn(\n `Supplied value for single component uniform ${name} is not a number: ${value}`\n )();\n // eslint-disable-next-line no-continue\n continue;\n }\n // single value -> just set it\n typedArray[offset] = Number(value);\n } else {\n if (!isNumberArray(value)) {\n log.warn(\n `Supplied value for multi component / array uniform ${name} is not a numeric array: ${value}`\n )();\n // eslint-disable-next-line no-continue\n continue;\n }\n // vector/matrix -> copy the supplied (typed) array, starting from offset\n // TODO: we should limit or check size in case the supplied data overflows\n typedArray.set(value, offset);\n }\n }\n\n return new Uint8Array(arrayBuffer, 0, this.byteLength);\n }\n\n /** Does this layout have a field with specified name */\n has(name: string) {\n return Boolean(this.layout[name]);\n }\n\n /** Get offset and size for a field with specified name */\n get(name: string): {offset: number; size: number} | undefined {\n const layout = this.layout[name];\n return layout;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {isNumberArray} from './is-array';\n\n/** Test if two arrays are deep equal, with a length limit that defaults to 16 */\nexport function arrayEqual(a: unknown, b: unknown, limit: number = 16) {\n if (a !== b) {\n return false;\n }\n const arrayA = a;\n const arrayB = b;\n if (!isNumberArray(arrayA)) {\n return false;\n }\n if (isNumberArray(arrayB) && arrayA.length === arrayB.length) {\n for (let i = 0; i < arrayA.length; ++i) {\n if (arrayB[i] !== arrayA[i]) {\n return false;\n }\n }\n }\n return true;\n}\n\n/** Copy a value */\nexport function arrayCopy<T>(a: T): T {\n if (isNumberArray(a)) {\n return a.slice() as T;\n }\n return a;\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {VariableShaderType} from '../shadertypes/data-types/shader-types';\nimport type {UniformValue} from '../adapter/types/uniforms';\nimport {\n ShaderLayout,\n UniformInfo,\n UniformBufferBindingLayout\n} from '../adapter/types/shader-layout';\nimport {arrayEqual, arrayCopy} from '../utils/array-equal';\n\n/**\n * A uniform block holds values of the of uniform values for one uniform block / buffer.\n * It also does some book keeping on what has changed, to minimize unnecessary writes to uniform buffers.\n */\nexport class UniformBlock<\n TUniforms extends Record<string, UniformValue> = Record<string, UniformValue>\n> {\n name: string;\n\n uniforms: Record<keyof TUniforms, UniformValue> = {} as Record<keyof TUniforms, UniformValue>;\n modifiedUniforms: Record<keyof TUniforms, boolean> = {} as Record<keyof TUniforms, boolean>;\n modified: boolean = true;\n\n readonly bindingLayout: Record<string, UniformInfo> = {};\n needsRedraw: string | false = 'initialized';\n\n constructor(props?: {\n name?: string;\n shaderLayout?: ShaderLayout;\n uniformTypes?: Record<keyof TUniforms, Record<string, VariableShaderType>>;\n }) {\n this.name = props?.name || 'unnamed';\n\n // TODO - Extract uniform layout from the shaderLayout object\n if (props?.name && props?.shaderLayout) {\n const binding = props?.shaderLayout.bindings?.find(\n binding_ => binding_.type === 'uniform' && binding_.name === props?.name\n );\n if (!binding) {\n throw new Error(props?.name);\n }\n\n const uniformBlock = binding as UniformBufferBindingLayout;\n for (const uniform of uniformBlock.uniforms || []) {\n this.bindingLayout[uniform.name] = uniform;\n }\n }\n }\n\n /** Set a map of uniforms */\n setUniforms(uniforms: Partial<TUniforms>): void {\n for (const [key, value] of Object.entries(uniforms)) {\n this._setUniform(key, value);\n if (!this.needsRedraw) {\n this.setNeedsRedraw(`${this.name}.${key}=${value}`);\n }\n }\n }\n\n setNeedsRedraw(reason: string): void {\n this.needsRedraw = this.needsRedraw || reason;\n }\n\n /** Returns all uniforms */\n getAllUniforms(): Record<string, UniformValue> {\n // @ts-expect-error\n this.modifiedUniforms = {};\n this.needsRedraw = false;\n return (this.uniforms || {}) as Record<string, UniformValue>;\n }\n\n /** Set a single uniform */\n private _setUniform(key: keyof TUniforms, value: UniformValue) {\n if (arrayEqual(this.uniforms[key], value)) {\n return;\n }\n this.uniforms[key] = arrayCopy(value);\n this.modifiedUniforms[key] = true;\n this.modified = true;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {VariableShaderType} from '../shadertypes/data-types/shader-types';\nimport type {UniformValue} from '../adapter/types/uniforms';\nimport type {Device} from '../adapter/device';\nimport {Buffer} from '../adapter/resources/buffer';\nimport {log} from '../utils/log';\nimport {UniformBlock} from './uniform-block';\nimport {UniformBufferLayout} from './uniform-buffer-layout';\n\n/**\n * A uniform store holds a uniform values for one or more uniform blocks,\n * - It can generate binary data for any uniform buffer\n * - It can manage a uniform buffer for each block\n * - It can update managed uniform buffers with a single call\n * - It performs some book keeping on what has changed to minimize unnecessary writes to uniform buffers.\n */\nexport class UniformStore<\n TPropGroups extends Record<string, Record<string, unknown>> = Record<\n string,\n Record<string, unknown>\n >\n> {\n /** Stores the uniform values for each uniform block */\n uniformBlocks = new Map<keyof TPropGroups, UniformBlock>();\n /** Can generate data for a uniform buffer for each block from data */\n uniformBufferLayouts = new Map<keyof TPropGroups, UniformBufferLayout>();\n /** Actual buffer for the blocks */\n uniformBuffers = new Map<keyof TPropGroups, Buffer>();\n\n /**\n * Create a new UniformStore instance\n * @param blocks\n */\n constructor(\n blocks: Record<\n keyof TPropGroups,\n {\n uniformTypes?: Record<string, VariableShaderType>;\n uniformSizes?: Record<string, number>;\n defaultProps?: Record<string, unknown>;\n defaultUniforms?: Record<string, UniformValue>;\n }\n >\n ) {\n for (const [bufferName, block] of Object.entries(blocks)) {\n const uniformBufferName = bufferName as keyof TPropGroups;\n\n // Create a layout object to help us generate correctly formatted binary uniform buffers\n const uniformBufferLayout = new UniformBufferLayout(\n block.uniformTypes ?? {},\n block.uniformSizes ?? {}\n );\n this.uniformBufferLayouts.set(uniformBufferName, uniformBufferLayout);\n\n // Create a Uniform block to store the uniforms for each buffer.\n const uniformBlock = new UniformBlock({name: bufferName});\n uniformBlock.setUniforms(block.defaultUniforms || {});\n this.uniformBlocks.set(uniformBufferName, uniformBlock);\n }\n }\n\n /** Destroy any managed uniform buffers */\n destroy(): void {\n for (const uniformBuffer of this.uniformBuffers.values()) {\n uniformBuffer.destroy();\n }\n }\n\n /**\n * Set uniforms\n * Makes all properties partial\n */\n setUniforms(\n uniforms: Partial<{[group in keyof TPropGroups]: Partial<TPropGroups[group]>}>\n ): void {\n for (const [blockName, uniformValues] of Object.entries(uniforms)) {\n this.uniformBlocks.get(blockName)?.setUniforms(uniformValues);\n // We leverage logging in updateUniformBuffers(), even though slightly less efficient\n // this.updateUniformBuffer(blockName);\n }\n\n this.updateUniformBuffers();\n }\n\n /** Get the required minimum length of the uniform buffer */\n getUniformBufferByteLength(uniformBufferName: keyof TPropGroups): number {\n return this.uniformBufferLayouts.get(uniformBufferName)?.byteLength || 0;\n }\n\n /** Get formatted binary memory that can be uploaded to a buffer */\n getUniformBufferData(uniformBufferName: keyof TPropGroups): Uint8Array {\n const uniformValues = this.uniformBlocks.get(uniformBufferName)?.getAllUniforms() || {};\n // @ts-ignore\n return this.uniformBufferLayouts.get(uniformBufferName)?.getData(uniformValues);\n }\n\n /**\n * Creates an unmanaged uniform buffer (umnanaged means that application is responsible for destroying it)\n * The new buffer is initialized with current / supplied values\n */\n createUniformBuffer(\n device: Device,\n uniformBufferName: keyof TPropGroups,\n uniforms?: Partial<{[group in keyof TPropGroups]: Partial<TPropGroups[group]>}>\n ): Buffer {\n if (uniforms) {\n this.setUniforms(uniforms);\n }\n const byteLength = this.getUniformBufferByteLength(uniformBufferName);\n const uniformBuffer = device.createBuffer({\n usage: Buffer.UNIFORM | Buffer.COPY_DST,\n byteLength\n });\n // Note that this clears the needs redraw flag\n const uniformBufferData = this.getUniformBufferData(uniformBufferName);\n uniformBuffer.write(uniformBufferData);\n return uniformBuffer;\n }\n\n /** Get the managed uniform buffer. \"managed\" resources are destroyed when the uniformStore is destroyed. */\n getManagedUniformBuffer(device: Device, uniformBufferName: keyof TPropGroups): Buffer {\n if (!this.uniformBuffers.get(uniformBufferName)) {\n const byteLength = this.getUniformBufferByteLength(uniformBufferName);\n const uniformBuffer = device.createBuffer({\n usage: Buffer.UNIFORM | Buffer.COPY_DST,\n byteLength\n });\n this.uniformBuffers.set(uniformBufferName, uniformBuffer);\n }\n // this.updateUniformBuffers();\n // @ts-ignore\n return this.uniformBuffers.get(uniformBufferName);\n }\n\n /** Updates all uniform buffers where values have changed */\n updateUniformBuffers(): false | string {\n let reason: false | string = false;\n for (const uniformBufferName of this.uniformBlocks.keys()) {\n const bufferReason = this.updateUniformBuffer(uniformBufferName);\n reason ||= bufferReason;\n }\n if (reason) {\n log.log(3, `UniformStore.updateUniformBuffers(): ${reason}`)();\n }\n return reason;\n }\n\n /** Update one uniform buffer. Only updates if values have changed */\n updateUniformBuffer(uniformBufferName: keyof TPropGroups): false | string {\n const uniformBlock = this.uniformBlocks.get(uniformBufferName);\n let uniformBuffer = this.uniformBuffers.get(uniformBufferName);\n\n let reason: false | string = false;\n if (uniformBuffer && uniformBlock?.needsRedraw) {\n reason ||= uniformBlock.needsRedraw;\n // This clears the needs redraw flag\n const uniformBufferData = this.getUniformBufferData(uniformBufferName);\n\n uniformBuffer = this.uniformBuffers.get(uniformBufferName);\n uniformBuffer?.write(uniformBufferData);\n\n // logging - TODO - don't query the values unnecessarily\n const uniformValues = this.uniformBlocks.get(uniformBufferName)?.getAllUniforms();\n log.log(\n 4,\n `Writing to uniform buffer ${String(uniformBufferName)}`,\n uniformBufferData,\n uniformValues\n )();\n }\n return reason;\n }\n}\n", "// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport type ImageData = {\n /** Offset into the data (in addition to any offset built-in to the ArrayBufferView) */\n byteOffset?: number;\n /** The stride, in bytes, between the beginning of each texel block row and the subsequent texel block row. Required if there are multiple texel block rows (i.e. the copy height or depth is more than one block). */\n bytesPerRow?: number;\n /** Number or rows per image (needed if multiple images are being set) */\n rowsPerImage?: number;\n /** Bits per channel */\n bitsPerChannel: [number, number, number, number];\n};\n\nexport type PixelData = {\n arrayBuffer: ArrayBuffer;\n width: number;\n height: number;\n /** Bytes per pixel */\n bytesPerPixel: number;\n bytesPerRow: number;\n bitsPerChannel: [number, number, number, number];\n};\n\n/**\n * Extracts a single RGBA pixel value from PixelData at the given (x, y) coordinate.\n *\n * The pixel's data is assumed to be packed according to pixelData.bitsPerChannel.\n * The pixel data for a given row is padded to pixelData.bytesPerRow.\n *\n * @param pixelData - The metadata and data for the pixel buffer.\n * @param x - The x coordinate (0-based).\n * @param y - The y coordinate (0-based).\n * @returns A tuple [r, g, b, a] where each channel is the extracted numeric value.\n *\n* @example\n\nAssume you obtained an ArrayBuffer from copyTextureToBuffer and have the following metadata:\n\n const pixelData: PixelData = {\n bitsPerChannel: [5, 6, 5, 0], // For example, a 16-bit RGB565 format (no alpha)\n width: 800,\n height: 600,\n bytesPerPixel: 2, // 16 bits per pixel\n bytesPerRow: 1600, // Assuming no extra padding\n arrayBuffer: myTextureBuffer, // Obtained from copyTextureToBuffer\n };\n\nYou can then extract the pixel at (x, y) like so:\n\n const rgba = extractPixel(pixelData, x, y);\n console.log(\"Extracted RGBA:\", rgba);\n\nFor RGBA formats where all channels are present (e.g. [8, 8, 8, 8]), the function will extract a 4-channel pixel value.\n*/\n\nexport function readPixel(\n pixelData: PixelData,\n x: number,\n y: number,\n bitsPerChannel: [number, number, number, number]\n): [number, number, number, number] {\n if (x < 0 || x >= pixelData.width || y < 0 || y >= pixelData.height) {\n throw new Error('Coordinates out of bounds.');\n }\n\n // Compute the byte offset of the pixel in the buffer.\n const byteOffset = y * pixelData.bytesPerRow + x * pixelData.bytesPerPixel;\n\n // Create a Uint8Array view for this pixel's bytes.\n // We only need to view pixelData.bytesPerPixel bytes.\n const pixelDataView = new DataView(pixelData.arrayBuffer, byteOffset, pixelData.bytesPerPixel);\n\n let bitOffsetWithinPixel = 0;\n const channels: number[] = [];\n\n // Extract each of the four channels.\n for (let i = 0; i < 4; i++) {\n const bits = bitsPerChannel[i];\n // If a channel's bit width is zero or negative, consider it not present.\n if (bits <= 0) {\n channels.push(0);\n } else {\n const channelValue = readBitsFromDataView(pixelDataView, bitOffsetWithinPixel, bits);\n channels.push(channelValue);\n bitOffsetWithinPixel += bits;\n }\n }\n\n return [channels[0], channels[1], channels[2], channels[3]];\n}\n\n/**\n * Encodes an RGBA pixel into a DataView at a given bit offset according to a specified bit layout.\n *\n * The channels are written sequentially in the order R, G, B, A. For each channel, the number\n * of bits is taken from the bitsPerChannel array. Channel values are masked to fit within the specified width.\n *\n * @param dataView - The DataView into which the pixel will be encoded.\n * @param bitOffset - The bit offset in the DataView where the pixel should be written.\n * @param bitsPerChannel - A tuple specifying the number of bits for each channel: [R, G, B, A].\n * @param pixel - A tuple [r, g, b, a] containing the channel values (as numbers).\n *\n * @example\n\nAssume you want to encode a pixel into a packed format where:\n - Red uses 5 bits\n - Green uses 6 bits\n - Blue uses 5 bits\n - Alpha is not used (0 bits)\nAnd the pixel format is packed into 16 bits total.\n\nYou might have:\n const bitsPerChannel: [number, number, number, number] = [5, 6, 5, 0];\n const pixel: [number, number, number, number] = [15, 31, 15, 0]; // Example values\n const buffer = new ArrayBuffer(2); // 16 bits = 2 bytes\n const dataView = new DataView(buffer);\n\nNow encode the pixel at bit offset 0:\n encodePixel(dataView, 0, bitsPerChannel, pixel);\n\nThe dataView now contains the 16-bit packed pixel value in big-endian order.\n*/\nexport function writePixel(\n dataView: DataView,\n bitOffset: number,\n bitsPerChannel: [number, number, number, number],\n pixel: [number, number, number, number]\n): void {\n let currentBitOffset = bitOffset;\n for (let channel = 0; channel < 4; channel++) {\n const bits = bitsPerChannel[channel];\n // Clamp the channel value to the maximum allowed by the bit width.\n const maxValue = (1 << bits) - 1;\n const channelValue = pixel[channel] & maxValue;\n writeBitsToDataView(dataView, currentBitOffset, bits, channelValue);\n currentBitOffset += bits;\n }\n}\n\n/**\n * Reads a specified number of bits from a DataView starting at a given bit offset.\n *\n * For channels with a bit width of 8, 16, or 32 bits and when the bitOffset is byte-aligned,\n * this function uses DataView methods for fast extraction.\n *\n * Bits are assumed to be stored in big-endian order (i.e. the most-significant bit is at position 7 in each byte).\n *\n * @param dataView - The DataView containing the data.\n * @param bitOffset - The offset (in bits) within the data from which to start reading.\n * @param bitCount - The number of bits to read (supported range: 1 to 32).\n * @returns The extracted value as a number.\n */\nexport function readBitsFromDataView(\n dataView: DataView,\n bitOffset: number,\n bitCount: number\n): number {\n // Check if we can optimize when bitOffset is byte-aligned.\n if (bitOffset % 8 === 0) {\n const byteOffset = bitOffset / 8;\n if (bitCount === 8 && byteOffset + 1 <= dataView.byteLength) {\n return dataView.getUint8(byteOffset);\n } else if (bitCount === 16 && byteOffset + 2 <= dataView.byteLength) {\n // false for big-endian reading.\n return dataView.getUint16(byteOffset, false);\n } else if (bitCount === 32 && byteOffset + 4 <= dataView.byteLength) {\n return dataView.getUint32(byteOffset, false);\n }\n }\n\n // Fallback: bit-level extraction for non-aligned or non-standard bit widths.\n let value = 0;\n for (let i = 0; i < bitCount; i++) {\n const overallBitIndex = bitOffset + i;\n const byteIndex = Math.floor(overallBitIndex / 8);\n const bitIndex = overallBitIndex % 8;\n // Read the byte and extract the bit at position (7 - bitIndex).\n const byteValue = dataView.getUint8(byteIndex);\n const bit = (byteValue >> (7 - bitIndex)) & 1;\n value = (value << 1) | bit;\n }\n return value;\n}\n\n/**\n * Writes a specified number of bits from a value into a DataView at a given bit offset.\n *\n * For channels with a bit width of 8, 16, or 32 bits and when the bit offset is byte-aligned,\n * this function uses DataView methods for fast writing.\n *\n * Bits are assumed to be stored in big-endian order (i.e. the most-significant bit is at position 7 in each byte).\n *\n * @param dataView - The DataView to write into.\n * @param bitOffset - The bit offset at which to begin writing.\n * @param bitCount - The number of bits to write (supported range: 1 to 32).\n * @param value - The numeric value whose lower bitCount bits will be written.\n */\nexport function writeBitsToDataView(\n dataView: DataView,\n bitOffset: number,\n bitCount: number,\n value: number\n): void {\n // If the bitOffset is byte-aligned, we may optimize for common bit widths.\n if (bitOffset % 8 === 0) {\n const byteOffset = bitOffset / 8;\n if (bitCount === 8 && byteOffset + 1 <= dataView.byteLength) {\n dataView.setUint8(byteOffset, value & 0xff);\n return;\n } else if (bitCount === 16 && byteOffset + 2 <= dataView.byteLength) {\n dataView.setUint16(byteOffset, value & 0xffff, false); // big-endian\n return;\n } else if (bitCount === 32 && byteOffset + 4 <= dataView.byteLength) {\n dataView.setUint32(byteOffset, value, false); // big-endian\n return;\n }\n }\n\n // Fallback: write bit-by-bit.\n for (let i = 0; i < bitCount; i++) {\n const overallBitIndex = bitOffset + i;\n const byteIndex = Math.floor(overallBitIndex / 8);\n const bitIndex = overallBitIndex % 8;\n const mask = 1 << (7 - bitIndex);\n // Extract the i-th bit from value (starting from the most-significant bit)\n const bitValue = (value >> (bitCount - 1 - i)) & 1;\n // Read the current byte.\n let currentByte = dataView.getUint8(byteIndex);\n // Clear the target bit.\n currentByte &= ~mask;\n // Set the target bit if bitValue is 1.\n if (bitValue) {\n currentByte |= mask;\n }\n dataView.setUint8(byteIndex, currentByte);\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;gBAAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACIA,mBAAoB;AAKd,IAAO,eAAP,MAAmB;EACvB,QAAQ,oBAAI,IAAG;EAEf,SAASC,OAAY;AACnB,WAAO,KAAK,IAAIA,KAAI;EACtB;EAEA,IAAIA,OAAY;AACd,QAAI,CAAC,KAAK,MAAM,IAAIA,KAAI,GAAG;AACzB,WAAK,MAAM,IAAIA,OAAM,IAAI,mBAAM,EAAC,IAAIA,MAAI,CAAC,CAAC;IAC5C;AAEA,WAAO,KAAK,MAAM,IAAIA,KAAI;EAC5B;;AAIK,IAAM,YAA0B,IAAI,aAAY;;;ACtBvD,iBAAkB;AAGX,IAAM,MAAW,IAAI,eAAI,EAAC,IAAI,UAAS,CAAC;;;ACH/C,IAAM,cAAsC,CAAA;AAOtC,SAAU,IAAI,KAAa,MAAI;AACnC,cAAY,EAAE,IAAI,YAAY,EAAE,KAAK;AACrC,QAAM,QAAQ,YAAY,EAAE;AAC5B,SAAO,GAAG,MAAM;AAClB;;;ACIM,IAAgB,WAAhB,MAAwB;EAU5B,WAAQ;AACN,WAAO,GAAG,KAAK,OAAO,WAAW,KAAK,KAAK,YAAY,SAAS,KAAK;EACvE;;EAGA;EACS;EACA,WAAoC,CAAA;EAGrC;;EAGR,YAAqB;;EAEb,iBAAyB;;EAEzB,qBAAqB,oBAAI,IAAG;;;;EAKpC,YAAY,QAAgB,OAAc,cAA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;AACpC,UAAM,YAAY,KAAK,MAAM,kBAAkB,CAAC;AAChD,UAAM,WAAW,kBAAkB;AACnC,UAAM,OAAO,KAAM,IAAI;AAEvB,UAAM,WAAY,SAAU,WAAW,IAAI,IAAM;AAEjD,QAAI,cAAc,SAAS,SAAS,SAAS;AAE7C,mBAAe,CAAC;AAEhB,QAAI,UAAU;AACZ,qBAAe;IACjB;AACA,aAAS,SAAS,WAAW,WAAW;EAC1C;AACF;",
6
6
  "names": ["Buffer", "name", "name", "arrayBuffer", "Buffer", "Buffer", "import_env", "log", "attachment", "name", "attributeMapping", "arrayBuffer", "name", "Buffer"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luma.gl/core",
3
- "version": "9.2.0-alpha.6",
3
+ "version": "9.2.0-beta.2",
4
4
  "description": "The luma.gl core Device API",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -46,5 +46,5 @@
46
46
  "@probe.gl/stats": "^4.0.8",
47
47
  "@types/offscreencanvas": "^2019.6.4"
48
48
  },
49
- "gitHead": "63fe3fd0912c83f7c4a012016c57048a250b591f"
49
+ "gitHead": "03d6fda3d022f348513c01c5e953bc20be80d91a"
50
50
  }