@luma.gl/webgpu 9.0.0-alpha.14 → 9.0.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapter/helpers/accessor-to-format.js +100 -1
- package/dist/adapter/helpers/convert-texture-format.js +5 -6
- package/dist/adapter/helpers/generate-mipmaps.js +88 -92
- package/dist/adapter/helpers/get-bind-group.js +54 -48
- package/dist/adapter/helpers/get-vertex-buffer-layout.js +97 -84
- package/dist/adapter/helpers/webgpu-parameters.d.ts.map +1 -1
- package/dist/adapter/helpers/webgpu-parameters.js +181 -129
- package/dist/adapter/resources/webgpu-buffer.js +57 -73
- package/dist/adapter/resources/webgpu-command-encoder.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-command-encoder.js +47 -63
- package/dist/adapter/resources/webgpu-compute-pass.d.ts +1 -1
- package/dist/adapter/resources/webgpu-compute-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pass.js +51 -55
- package/dist/adapter/resources/webgpu-compute-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-compute-pipeline.js +22 -24
- package/dist/adapter/resources/webgpu-external-texture.js +26 -27
- package/dist/adapter/resources/webgpu-framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-framebuffer.js +89 -103
- package/dist/adapter/resources/webgpu-query.js +42 -1
- package/dist/adapter/resources/webgpu-render-pass.d.ts +1 -1
- package/dist/adapter/resources/webgpu-render-pass.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-render-pass.js +64 -89
- package/dist/adapter/resources/webgpu-render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-render-pipeline.js +158 -154
- package/dist/adapter/resources/webgpu-sampler.d.ts +1 -1
- package/dist/adapter/resources/webgpu-sampler.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-sampler.js +16 -22
- package/dist/adapter/resources/webgpu-shader.d.ts +1 -1
- package/dist/adapter/resources/webgpu-shader.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-shader.js +47 -58
- package/dist/adapter/resources/webgpu-texture.d.ts +0 -1
- package/dist/adapter/resources/webgpu-texture.d.ts.map +1 -1
- package/dist/adapter/resources/webgpu-texture.js +100 -103
- package/dist/adapter/webgpu-canvas-context.d.ts.map +1 -1
- package/dist/adapter/webgpu-canvas-context.js +77 -90
- package/dist/adapter/webgpu-device.js +215 -242
- package/dist/adapter/webgpu-types.js +0 -2
- package/dist/bundle.js +1 -2
- package/dist/dist.js +8051 -0
- package/dist/dist.min.js +1 -0
- package/dist/es5/adapter/helpers/accessor-to-format.js +2 -0
- package/dist/es5/adapter/helpers/accessor-to-format.js.map +1 -0
- package/dist/es5/adapter/helpers/convert-texture-format.js +13 -0
- package/dist/es5/adapter/helpers/convert-texture-format.js.map +1 -0
- package/dist/es5/adapter/helpers/generate-mipmaps.js +103 -0
- package/dist/es5/adapter/helpers/generate-mipmaps.js.map +1 -0
- package/dist/es5/adapter/helpers/get-bind-group.js +66 -0
- package/dist/es5/adapter/helpers/get-bind-group.js.map +1 -0
- package/dist/es5/adapter/helpers/get-vertex-buffer-layout.js +149 -0
- package/dist/es5/adapter/helpers/get-vertex-buffer-layout.js.map +1 -0
- package/dist/es5/adapter/helpers/webgpu-parameters.js +150 -0
- package/dist/es5/adapter/helpers/webgpu-parameters.js.map +1 -0
- package/dist/es5/adapter/resources/webgpu-buffer.js +131 -0
- package/dist/es5/adapter/resources/webgpu-buffer.js.map +1 -0
- package/dist/es5/adapter/resources/webgpu-command-encoder.js +90 -0
- package/dist/es5/adapter/resources/webgpu-command-encoder.js.map +1 -0
- package/dist/es5/adapter/resources/webgpu-compute-pass.js +85 -0
- package/dist/es5/adapter/resources/webgpu-compute-pass.js.map +1 -0
- package/dist/es5/adapter/resources/webgpu-compute-pipeline.js +48 -0
- package/dist/es5/adapter/resources/webgpu-compute-pipeline.js.map +1 -0
- package/dist/es5/adapter/resources/webgpu-external-texture.js +50 -0
- package/dist/es5/adapter/resources/webgpu-external-texture.js.map +1 -0
- package/dist/es5/adapter/resources/webgpu-framebuffer.js +126 -0
- package/dist/es5/adapter/resources/webgpu-framebuffer.js.map +1 -0
- package/dist/es5/adapter/resources/webgpu-query.js +2 -0
- package/dist/es5/adapter/resources/webgpu-query.js.map +1 -0
- package/dist/es5/adapter/resources/webgpu-render-pass.js +124 -0
- package/dist/es5/adapter/resources/webgpu-render-pass.js.map +1 -0
- package/dist/es5/adapter/resources/webgpu-render-pipeline.js +185 -0
- package/dist/es5/adapter/resources/webgpu-render-pipeline.js.map +1 -0
- package/dist/es5/adapter/resources/webgpu-sampler.js +45 -0
- package/dist/es5/adapter/resources/webgpu-sampler.js.map +1 -0
- package/dist/es5/adapter/resources/webgpu-shader.js +125 -0
- package/dist/es5/adapter/resources/webgpu-shader.js.map +1 -0
- package/dist/es5/adapter/resources/webgpu-texture.js +138 -0
- package/dist/es5/adapter/resources/webgpu-texture.js.map +1 -0
- package/dist/es5/adapter/webgpu-canvas-context.js +111 -0
- package/dist/es5/adapter/webgpu-canvas-context.js.map +1 -0
- package/dist/es5/adapter/webgpu-device.js +317 -0
- package/dist/es5/adapter/webgpu-device.js.map +1 -0
- package/dist/es5/adapter/webgpu-types.js +2 -0
- package/dist/es5/adapter/webgpu-types.js.map +1 -0
- package/dist/es5/bundle.js +6 -0
- package/dist/es5/bundle.js.map +1 -0
- package/dist/es5/glsl/glsllang.js +47 -0
- package/dist/es5/glsl/glsllang.js.map +1 -0
- package/dist/es5/index.js +44 -0
- package/dist/es5/index.js.map +1 -0
- package/dist/es5/init.js +7 -0
- package/dist/es5/init.js.map +1 -0
- package/dist/esm/adapter/helpers/accessor-to-format.js +2 -0
- package/dist/esm/adapter/helpers/accessor-to-format.js.map +1 -0
- package/dist/esm/adapter/helpers/convert-texture-format.js +7 -0
- package/dist/esm/adapter/helpers/convert-texture-format.js.map +1 -0
- package/dist/esm/adapter/helpers/generate-mipmaps.js +88 -0
- package/dist/esm/adapter/helpers/generate-mipmaps.js.map +1 -0
- package/dist/esm/adapter/helpers/get-bind-group.js +51 -0
- package/dist/esm/adapter/helpers/get-bind-group.js.map +1 -0
- package/dist/esm/adapter/helpers/get-vertex-buffer-layout.js +83 -0
- package/dist/esm/adapter/helpers/get-vertex-buffer-layout.js.map +1 -0
- package/dist/esm/adapter/helpers/webgpu-parameters.js +137 -0
- package/dist/esm/adapter/helpers/webgpu-parameters.js.map +1 -0
- package/dist/esm/adapter/resources/webgpu-buffer.js +70 -0
- package/dist/esm/adapter/resources/webgpu-buffer.js.map +1 -0
- package/dist/esm/adapter/resources/webgpu-command-encoder.js +49 -0
- package/dist/esm/adapter/resources/webgpu-command-encoder.js.map +1 -0
- package/dist/esm/adapter/resources/webgpu-compute-pass.js +44 -0
- package/dist/esm/adapter/resources/webgpu-compute-pass.js.map +1 -0
- package/dist/esm/adapter/resources/webgpu-compute-pipeline.js +23 -0
- package/dist/esm/adapter/resources/webgpu-compute-pipeline.js.map +1 -0
- package/dist/esm/adapter/resources/webgpu-external-texture.js +23 -0
- package/dist/esm/adapter/resources/webgpu-external-texture.js.map +1 -0
- package/dist/esm/adapter/resources/webgpu-framebuffer.js +93 -0
- package/dist/esm/adapter/resources/webgpu-framebuffer.js.map +1 -0
- package/dist/esm/adapter/resources/webgpu-query.js +2 -0
- package/dist/esm/adapter/resources/webgpu-query.js.map +1 -0
- package/dist/esm/adapter/resources/webgpu-render-pass.js +79 -0
- package/dist/esm/adapter/resources/webgpu-render-pass.js.map +1 -0
- package/dist/esm/adapter/resources/webgpu-render-pipeline.js +130 -0
- package/dist/esm/adapter/resources/webgpu-render-pipeline.js.map +1 -0
- package/dist/esm/adapter/resources/webgpu-sampler.js +20 -0
- package/dist/esm/adapter/resources/webgpu-sampler.js.map +1 -0
- package/dist/esm/adapter/resources/webgpu-shader.js +50 -0
- package/dist/esm/adapter/resources/webgpu-shader.js.map +1 -0
- package/dist/esm/adapter/resources/webgpu-texture.js +95 -0
- package/dist/esm/adapter/resources/webgpu-texture.js.map +1 -0
- package/dist/esm/adapter/webgpu-canvas-context.js +74 -0
- package/dist/esm/adapter/webgpu-canvas-context.js.map +1 -0
- package/dist/esm/adapter/webgpu-device.js +196 -0
- package/dist/esm/adapter/webgpu-device.js.map +1 -0
- package/dist/esm/adapter/webgpu-types.js +2 -0
- package/dist/esm/adapter/webgpu-types.js.map +1 -0
- package/dist/esm/bundle.js +4 -0
- package/dist/esm/bundle.js.map +1 -0
- package/dist/esm/glsl/glsllang.js +9 -0
- package/dist/esm/glsl/glsllang.js.map +1 -0
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/init.js +4 -0
- package/dist/esm/init.js.map +1 -0
- package/dist/glsl/glsllang.js +9 -7
- package/dist/index.js +8 -6
- package/dist/init.js +1 -2
- package/package.json +8 -8
- package/src/adapter/helpers/webgpu-parameters.ts +7 -2
- package/src/adapter/resources/webgpu-command-encoder.ts +2 -1
- package/src/adapter/resources/webgpu-compute-pass.ts +4 -4
- package/src/adapter/resources/webgpu-compute-pipeline.ts +2 -1
- package/src/adapter/resources/webgpu-framebuffer.ts +3 -2
- package/src/adapter/resources/webgpu-render-pass.ts +2 -2
- package/src/adapter/resources/webgpu-render-pipeline.ts +2 -1
- package/src/adapter/resources/webgpu-shader.ts +1 -1
- package/src/adapter/webgpu-canvas-context.ts +3 -2
- package/src/adapter/webgpu-device.ts +2 -2
- package/dist/adapter/helpers/accessor-to-format.js.map +0 -1
- package/dist/adapter/helpers/convert-texture-format.js.map +0 -1
- package/dist/adapter/helpers/generate-mipmaps.js.map +0 -1
- package/dist/adapter/helpers/get-bind-group.js.map +0 -1
- package/dist/adapter/helpers/get-vertex-buffer-layout.js.map +0 -1
- package/dist/adapter/helpers/webgpu-parameters.js.map +0 -1
- package/dist/adapter/resources/webgpu-buffer.js.map +0 -1
- package/dist/adapter/resources/webgpu-command-encoder.js.map +0 -1
- package/dist/adapter/resources/webgpu-compute-pass.js.map +0 -1
- package/dist/adapter/resources/webgpu-compute-pipeline.js.map +0 -1
- package/dist/adapter/resources/webgpu-external-texture.js.map +0 -1
- package/dist/adapter/resources/webgpu-framebuffer.js.map +0 -1
- package/dist/adapter/resources/webgpu-query.js.map +0 -1
- package/dist/adapter/resources/webgpu-render-pass.js.map +0 -1
- package/dist/adapter/resources/webgpu-render-pipeline.js.map +0 -1
- package/dist/adapter/resources/webgpu-sampler.js.map +0 -1
- package/dist/adapter/resources/webgpu-shader.js.map +0 -1
- package/dist/adapter/resources/webgpu-texture.js.map +0 -1
- package/dist/adapter/webgpu-canvas-context.js.map +0 -1
- package/dist/adapter/webgpu-device.js.map +0 -1
- package/dist/adapter/webgpu-types.js.map +0 -1
- package/dist/bundle.js.map +0 -1
- package/dist/glsl/glsllang.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/init.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/helpers/webgpu-parameters.ts"],"names":["addDepthStencil","descriptor","depthStencil","format","stencilFront","stencilBack","PARAMETER_TABLE","cullMode","parameter","value","primitive","frontFace","depthWriteEnabled","depthCompare","depthFormat","depthBias","depthBiasSlopeScale","depthBiasClamp","stencilReadMask","stencilWriteMask","stencilCompare","compare","stencilPassOperation","passOp","stencilFailOperation","failOp","stencilDepthFailOperation","depthFailOp","sampleCount","multisample","count","sampleMask","mask","sampleAlphaToCoverageEnabled","alphaToCoverageEnabled","colorMask","targets","addColorState","writeMask","blendColorOperation","DEFAULT_PIPELINE_DESCRIPTOR","topology","vertex","module","undefined","entryPoint","fragment","applyParametersToRenderPipelineDescriptor","pipelineDescriptor","parameters","Object","assign","setParameters","key","entries","setterFunction","Error","Array","isArray","length","push"],"mappings":"AAEA,SAASA,eAAT,CAAyBC,UAAzB,EAAwF;AACtFA,EAAAA,UAAU,CAACC,YAAX,GAA0BD,UAAU,CAACC,YAAX,IAA2B;AAEnDC,IAAAA,MAAM,EAAE,aAF2C;AAGnDC,IAAAA,YAAY,E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EJ,kBADF,EAEEC,UAFF,EAGQ;AACN,OAAK,MAAM,CAACI,GAAD,EAAM5C,KAAN,CAAX,IAA2ByC,MAAM,CAACI,OAAP,CAAeL,UAAf,CAA3B,EAAuD;AACrD,UAAMM,cAAc,GAAGjD,eAAe,CAAC+C,GAAD,CAAtC;;AACA,QAAI,CAACE,cAAL,EAAqB;AACnB,YAAM,IAAIC,KAAJ,6BAA+BH,GAA/B,EAAN;AACD;;AACDE,IAAAA,cAAc,CAACF,GAAD,EAAM5C,KAAN,EAAauC,kBAAb,CAAd;AACD;AACF;;AAED,SAASX,aAAT,CAAuBpC,UAAvB,EAAuF;AAAA;;AACrFA,EAAAA,UAAU,CAAC6C,QAAX,CAAqBV,OAArB,GAA+B,yBAAAnC,UAAU,CAAC6C,QAAX,8EAAqBV,OAArB,KAAgC,EAA/D;;AACA,MAAI,CAACqB,KAAK,CAACC,OAAN,0BAAczD,UAAU,CAAC6C,QAAzB,0DAAc,sBAAqBV,OAAnC,CAAL,EAAkD;AAChD,UAAM,IAAIoB,KAAJ,CAAU,YAAV,CAAN;AACD;;AACD,MAAI,0BAAAvD,UAAU,CAAC6C,QAAX,yGAAqBV,OAArB,gFAA8BuB,MAA9B,MAAyC,CAA7C,EAAgD;AAAA;;AAC9C,6BAAA1D,UAAU,CAAC6C,QAAX,CAAoBV,OAApB,gFAA6BwB,IAA7B,CAAkC,EAAlC;AACD;;AACD,kCAAO3D,UAAU,CAAC6C,QAAlB,0DAAO,sBAAqBV,OAA5B;AACD","sourcesContent":["import {Parameters} from '@luma.gl/api';\n\nfunction addDepthStencil(descriptor: GPURenderPipelineDescriptor): GPUDepthStencilState {\n descriptor.depthStencil = descriptor.depthStencil || {\n // required, set something\n format: 'depth24plus',\n stencilFront: {},\n stencilBack: {}\n };\n return descriptor.depthStencil;\n}\n\n/**\n * Supports for luma.gl's flat parameter space\n * Populates the corresponding sub-objects in a GPURenderPipelineDescriptor\n */\n// @ts-expect-error\nexport const PARAMETER_TABLE: Record<keyof Parameters, Function> = {\n // RASTERIZATION PARAMETERS\n\n cullMode: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n descriptor.primitive = descriptor.primitive || {};\n descriptor.primitive.cullMode = value;\n },\n\n frontFace: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n descriptor.primitive = descriptor.primitive || {};\n descriptor.primitive.frontFace = value;\n },\n\n // DEPTH\n\n depthWriteEnabled: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.depthWriteEnabled = value;\n },\n\n depthCompare: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.depthCompare = value;\n },\n\n depthFormat: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.format = value;\n },\n\n depthBias: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.depthBias = value;\n },\n\n depthBiasSlopeScale: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.depthBiasSlopeScale = value;\n },\n\n depthBiasClamp: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.depthBiasClamp = value;\n },\n\n // STENCIL\n\n stencilReadMask: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.stencilReadMask = value;\n },\n\n stencilWriteMask: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.stencilWriteMask = value;\n },\n\n stencilCompare: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.stencilFront!.compare = value;\n depthStencil.stencilBack!.compare = value;\n },\n\n stencilPassOperation: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.stencilFront!.passOp = value;\n depthStencil.stencilBack!.passOp = value;\n },\n\n stencilFailOperation: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.stencilFront!.failOp = value;\n depthStencil.stencilBack!.failOp = value;\n },\n\n stencilDepthFailOperation: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const depthStencil = addDepthStencil(descriptor);\n depthStencil.stencilFront!.depthFailOp = value;\n depthStencil.stencilBack!.depthFailOp = value;\n },\n\n // MULTISAMPLE\n\n sampleCount: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n descriptor.multisample = descriptor.multisample || {};\n descriptor.multisample.count = value;\n },\n\n sampleMask: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n descriptor.multisample = descriptor.multisample || {};\n descriptor.multisample.mask = value;\n },\n\n sampleAlphaToCoverageEnabled: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n descriptor.multisample = descriptor.multisample || {};\n descriptor.multisample.alphaToCoverageEnabled = value;\n },\n\n // COLOR\n\n colorMask: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n const targets = addColorState(descriptor);\n targets[0].writeMask = value;\n },\n\n blendColorOperation: (parameter: keyof Parameters, value: any, descriptor: GPURenderPipelineDescriptor) => {\n addColorState(descriptor);\n // const targets = addColorState(descriptor);\n // const target = targets[0];\n // const blend: GPUBlendState = target.blend || {color: {alpha: 0}};\n // blend.color = blend.color || {};\n // target.blend.color.operation = value;\n }\n\n /*\n blendColorSrcTarget: (parameter, value, descriptor: GPURenderPipelineDescriptor) => {\n addColorState(descriptor);\n targets[0].blend = targets[0].blend || {};\n targets[0].blend.color = targets[0].blend.color || {};\n targets[0].blend.color.srcTarget = value;\n },\n\n blendColorDstTarget: (parameter, value, descriptor: GPURenderPipelineDescriptor) => {\n addColorState(descriptor);\n targets[0].blend = targets[0].blend || {};\n targets[0].blend.color = targets[0].blend.color || {};\n targets[0].blend.color.dstTarget = value;\n },\n\n blendAlphaOperation: (parameter, value, descriptor: GPURenderPipelineDescriptor) => {\n addColorState(descriptor);\n targets[0].blend = targets[0].blend || {};\n targets[0].blend.alpha = targets[0].blend.alpha || {};\n targets[0].blend.alpha.operation = value;\n },\n\n blendAlphaSrcTarget: (parameter, value, descriptor: GPURenderPipelineDescriptor) => {\n addColorState(descriptor);\n targets[0].blend = targets[0].blend || {};\n targets[0].blend.alpha = targets[0].blend.alpha || {};\n targets[0].blend.alpha.srcTarget = value;\n },\n\n blendAlphaDstTarget: (parameter, value, descriptor: GPURenderPipelineDescriptor) => {\n addColorState(descriptor);\n targets[0].blend = targets[0].blend || {};\n targets[0].blend.alpha = targets[0].blend.alpha || {};\n targets[0].blend.alpha.dstTarget = value;\n },\n */\n};\n\nconst DEFAULT_PIPELINE_DESCRIPTOR: GPURenderPipelineDescriptor = {\n // depthStencil: {\n // stencilFront: {},\n // stencilBack: {},\n // // depthWriteEnabled: true,\n // // depthCompare: 'less',\n // // format: 'depth24plus-stencil8',\n // },\n\n primitive: {\n cullMode: 'back',\n topology: 'triangle-list'\n },\n\n vertex: {\n module: undefined!,\n entryPoint: 'main'\n },\n\n fragment: {\n module: undefined!,\n entryPoint: 'main',\n targets: [\n // { format: props.color0Format || 'bgra8unorm' }\n ]\n }\n};\n\nexport function applyParametersToRenderPipelineDescriptor(\n pipelineDescriptor: GPURenderPipelineDescriptor,\n parameters: Parameters = {}\n): void {\n // Apply defaults\n Object.assign(pipelineDescriptor, {...DEFAULT_PIPELINE_DESCRIPTOR, ...pipelineDescriptor});\n setParameters(pipelineDescriptor, parameters);\n}\n\n// Apply any supplied parameters\nfunction setParameters(\n pipelineDescriptor: GPURenderPipelineDescriptor,\n parameters: Parameters\n): void {\n for (const [key, value] of Object.entries(parameters)) {\n const setterFunction = PARAMETER_TABLE[key as keyof Parameters];\n if (!setterFunction) {\n throw new Error(`Illegal parameter ${key}`);\n }\n setterFunction(key, value, pipelineDescriptor);\n }\n}\n\nfunction addColorState(descriptor: GPURenderPipelineDescriptor): GPUColorTargetState[] {\n descriptor.fragment!.targets = descriptor.fragment?.targets || [];\n if (!Array.isArray(descriptor.fragment?.targets)) {\n throw new Error('colorstate');\n }\n if (descriptor.fragment?.targets?.length === 0) {\n descriptor.fragment.targets?.push({});\n }\n return descriptor.fragment?.targets as GPUColorTargetState[];\n}\n"],"file":"webgpu-parameters.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/resources/webgpu-buffer.ts"],"names":["Buffer","getByteLength","props","byteLength","data","WebGPUBuffer","constructor","device","mapBuffer","Boolean","handle","createBuffer","size","usage","GPUBufferUsage","VERTEX","COPY_DST","mappedAtCreation","label","id","_writeMapped","unmap","destroy","write","byteOffset","queue","writeBuffer","buffer","readAsync","tempBuffer","MAP_READ","commandEncoder","createCommandEncoder","copyBufferToBuffer","submit","finish","mapAsync","GPUMapMode","READ","arrayBuffer","getMappedRange","slice","typedArray","set","mode","offset"],"mappings":";AACA,SAAQA,MAAR,QAAkC,cAAlC;;AAGA,SAASC,aAAT,CAAuBC,KAAvB,EAAmD;AAAA;;AACjD,SAAOA,KAAK,CAACC,UAAN,oBAAoBD,KAAK,CAACE,IAA1B,gDAAoB,YAAYD,UAAhC,KAA8C,CAArD;AACD;;AAED,eAAe,MAAME,YAAN,SAA2BL,MAA3B,CAAkC;AAK/CM,EAAAA,WAAW,CAACC,MAAD,EAAuBL,KAAvB,EAA2C;AACpD,UAAMK,MAAN,EAAcL,KAAd;;AADoD;;AAAA;;AAAA;;AAEpD,SAAKK,MAAL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AA2BK,MAA3B,EAAmCjC,IAAnC,CAAP;AACD;;AAEDS,EAAAA,KAAK,GAAS;AACZ,SAAKX,MAAL,CAAYW,KAAZ;AACD;;AAlF8C","sourcesContent":["// WEBGPU Buffer implementation\nimport {Buffer, BufferProps} from '@luma.gl/api';\nimport type WebGPUDevice from '../webgpu-device';\n\nfunction getByteLength(props: BufferProps): number {\n return props.byteLength || props.data?.byteLength || 0;\n}\n\nexport default class WebGPUBuffer extends Buffer {\n readonly device: WebGPUDevice;\n readonly handle: GPUBuffer;\n readonly byteLength: number;\n\n constructor(device: WebGPUDevice, props: BufferProps) {\n super(device, props);\n this.device = device;\n\n this.byteLength = getByteLength(props);\n const mapBuffer = Boolean(props.data);\n\n this.handle = this.props.handle || this.device.handle.createBuffer({\n size: this.byteLength,\n // usage defaults to vertex\n usage: this.props.usage || (GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST),\n mappedAtCreation: this.props.mappedAtCreation || mapBuffer,\n label: this.props.id\n });\n\n if (props.data) {\n this._writeMapped(props.data);\n // this.handle.writeAsync({data: props.data, map: false, unmap: false});\n }\n\n if (mapBuffer && !props.mappedAtCreation) {\n this.handle.unmap();\n }\n }\n\n override destroy(): void {\n this.handle.destroy();\n }\n\n // WebGPU provides multiple ways to write a buffer...\n override write(data: ArrayBufferView, byteOffset = 0) {\n this.device.handle.queue.writeBuffer(\n this.handle,\n byteOffset,\n data.buffer,\n data.byteOffset,\n data.byteLength\n );\n }\n\n override async readAsync(byteOffset: number = 0, byteLength: number = this.byteLength): Promise<ArrayBuffer> {\n // We need MAP_READ flag, but only COPY_DST buffers can have MAP_READ flag, so we need to create a temp buffer\n const tempBuffer = new WebGPUBuffer(this.device, {usage: Buffer.MAP_READ | Buffer.COPY_DST, byteLength});\n\n // Now do a GPU-side copy into the temp buffer we can actually read.\n // TODO - we are spinning up an independent command queue here, what does this mean\n const commandEncoder = this.device.handle.createCommandEncoder();\n commandEncoder.copyBufferToBuffer(this.handle, byteOffset, tempBuffer.handle, 0, byteLength);\n this.device.handle.queue.submit([commandEncoder.finish()]);\n\n // Map the temp buffer and read the data.\n await tempBuffer.handle.mapAsync(GPUMapMode.READ, byteOffset, byteLength);\n const arrayBuffer = tempBuffer.handle.getMappedRange().slice(0);\n tempBuffer.handle.unmap();\n tempBuffer.destroy();\n\n return arrayBuffer;\n }\n\n _writeMapped<TypedArray>(typedArray: TypedArray): void {\n const arrayBuffer = this.handle.getMappedRange();\n // @ts-expect-error\n new typedArray.constructor(arrayBuffer).set(typedArray);\n }\n\n // WEBGPU API\n\n mapAsync(mode: number, offset: number = 0, size?: number): Promise<void> {\n return this.handle.mapAsync(mode, offset, size);\n }\n\n getMappedRange(offset: number = 0, size?: number): ArrayBuffer {\n return this.handle.getMappedRange(offset, size);\n }\n\n unmap(): void {\n this.handle.unmap();\n }\n}\n"],"file":"webgpu-buffer.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/resources/webgpu-command-encoder.ts"],"names":["CommandEncoder","cast","WebGPUCommandEncoder","constructor","device","props","handle","createCommandEncoder","measureExecutionTime","label","id","destroy","finish","options","copyBufferToBuffer","source","sourceOffset","destination","destinationOffset","size","copyBufferToTexture","buffer","offset","bytesPerRow","rowsPerImage","texture","mipLevel","origin","width","extent","height","depthOrArrayLayers","copyTextureToBuffer","copyTextureToTexture","pushDebugGroup","groupLabel","popDebugGroup","insertDebugMarker","markerLabel"],"mappings":";AAAA,SAAQA,cAAR,EAA8DC,IAA9D,QAAyE,cAAzE;AAKA,eAAe,MAAMC,oBAAN,SAAmCF,cAAnC,CAAkD;AAI/DG,EAAAA,WAAW,CAACC,MAAD,EAAuBC,KAAvB,EAAmD;AAC5D,UAAMA,KAAN;;AAD4D;;AAAA;;AAE5D,SAAKD,MAAL,GAAcA,MAAd;AACA,SAAKE,MAAL,GAAcD,KAAK,CAACC,MAAN,IAAgB,KAAKF,MAAL,CAAYE,MAAZ,CAAmBC,oBAAnB,CAAwC;AAC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T;AAGEC,MAAAA,MAAM,EAAEjB,OAAO,CAACgB,MAAR,CAAgB,CAAhB,CAHV;AAIEE,MAAAA,kBAAkB,EAAElB,OAAO,CAACgB,MAAR,CAAgB,CAAhB;AAJtB,KAbF;AAoBD;;AAEDG,EAAAA,mBAAmB,CAACnB,OAAD,EAIV,CAAE;;AAEXoB,EAAAA,oBAAoB,CAACpB,OAAD,EAIX,CAAE;;AAEFqB,EAAAA,cAAc,CAACC,UAAD,EAA2B;AAChD,SAAK7B,MAAL,CAAY4B,cAAZ,CAA2BC,UAA3B;AACD;;AAEQC,EAAAA,aAAa,GAAS;AAC7B,SAAK9B,MAAL,CAAY8B,aAAZ;AACD;;AAEQC,EAAAA,iBAAiB,CAACC,WAAD,EAA4B;AACpD,SAAKhC,MAAL,CAAY+B,iBAAZ,CAA8BC,WAA9B;AACD;;AA/F8D","sourcesContent":["import {CommandEncoder, CommandEncoderProps, Buffer, Texture, cast} from '@luma.gl/api';\nimport WebGPUDevice from '../webgpu-device';\nimport WEBGPUBuffer from './webgpu-buffer';\nimport WebGPUTexture from './webgpu-texture';\n\nexport default class WebGPUCommandEncoder extends CommandEncoder {\n readonly device: WebGPUDevice;\n readonly handle: GPUCommandEncoder;\n\n constructor(device: WebGPUDevice, props: CommandEncoderProps) {\n super(props);\n this.device = device;\n this.handle = props.handle || this.device.handle.createCommandEncoder({\n measureExecutionTime: this.props.measureExecutionTime\n });\n this.handle.label = this.props.id;\n }\n\n override destroy(): void {}\n\n finish(options?: {id?: string}): GPUCommandBuffer {\n return this.finish(options);\n }\n\n // beginRenderPass(GPURenderPassDescriptor descriptor): GPURenderPassEncoder;\n // beginComputePass(optional GPUComputePassDescriptor descriptor = {}): GPUComputePassEncoder;\n\n copyBufferToBuffer(options: {\n source: Buffer,\n sourceOffset?: number,\n destination: Buffer,\n destinationOffset?: number,\n size?: number\n }): void {\n this.handle.copyBufferToBuffer(\n cast<WEBGPUBuffer>(options.source).handle,\n options.sourceOffset ?? 0,\n cast<WEBGPUBuffer>(options.destination).handle,\n options.destinationOffset ?? 0,\n options.size ?? 0\n );\n }\n\n copyBufferToTexture(options: {\n source: Buffer,\n offset?: number,\n bytesPerRow: number,\n rowsPerImage: number,\n\n destination: Texture,\n mipLevel?: number;\n aspect?: 'all' | 'stencil-only' | 'depth-only',\n\n origin?: number[] | [number, number, number],\n extent?: number[] | [number, number, number]\n }): void {\n this.handle.copyBufferToTexture(\n {\n buffer: cast<WEBGPUBuffer>(options.source).handle,\n offset: options.offset ?? 0,\n bytesPerRow: options.bytesPerRow,\n rowsPerImage: options.rowsPerImage,\n },\n {\n texture: cast<WebGPUTexture>(options.destination).handle,\n mipLevel: options.mipLevel ?? 0,\n origin: options.origin ?? {},\n // aspect: options.aspect\n },\n {\n // TODO exclamation mark hack\n width: options.extent![0],\n height: options.extent![1],\n depthOrArrayLayers: options.extent![2]\n }\n );\n }\n\n copyTextureToBuffer(options: {\n source: GPUImageCopyTexture,\n destination: GPUImageCopyBuffer,\n copySize: GPUExtent3D\n }): void {}\n\n copyTextureToTexture(options: {\n source: GPUImageCopyTexture ,\n destination: GPUImageCopyTexture,\n copySize: GPUExtent3D\n }): void {}\n\n override pushDebugGroup(groupLabel: string): void {\n this.handle.pushDebugGroup(groupLabel);\n }\n\n override popDebugGroup(): void {\n this.handle.popDebugGroup();\n }\n\n override insertDebugMarker(markerLabel: string): void {\n this.handle.insertDebugMarker(markerLabel);\n }\n\n // writeTimestamp(querySet: Query, queryIndex: number): void {}\n\n // resolveQuerySet(options: {\n // querySet: GPUQuerySet,\n // firstQuery: number,\n // queryCount: number,\n // destination: Buffer,\n // destinationOffset?: number;\n // }): void;\n}"],"file":"webgpu-command-encoder.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/resources/webgpu-compute-pass.ts"],"names":["ComputePass","cast","WebGPUComputePass","constructor","device","props","handle","commandEncoder","beginComputePass","label","id","destroy","endPass","setPipeline","pipeline","wgpuPipeline","_bindGroupLayout","_getBindGroupLayout","setBindings","bindings","Error","dispatch","x","y","z","dispatchIndirect","indirectBuffer","indirectOffset","pushDebugGroup","groupLabel","popDebugGroup","insertDebugMarker","markerLabel"],"mappings":";AAAA,SAAQA,WAAR,EAAyEC,IAAzE,QAAoF,cAApF;AAMA,eAAe,MAAMC,iBAAN,SAAgCF,WAAhC,CAA4C;AAKzDG,EAAAA,WAAW,CAACC,MAAD,EAAuBC,KAAvB,EAAgD;AAAA;;AACzD,UAAMD,MAAN,EAAcC,KAAd;;AADyD;;AAAA;;AAAA,8CAFb,IAEa;;AAEzD,SAAKD,MAAL,GAAcA,MAAd;AAEA,SAAKE,MAAL,GAAc,KAAKD,KAAL,CAAWC,MAAX,8BAAqBF,MAAM,CAACG,cAA5B,0DAAqB,sBAAuBC,gBAAvB,CAAwC;AACzEC,MAAAA,KAAK,EAAE,KAAKJ,KAAL,CAAWK;AADuD,KAAxC,CAArB,CAAd;AAID;;AAGQC,EAAAA,OAAO,GAAS,CAAE;;AAE3BC,EAAAA,OAAO,GAAS;AACd,SAAKN,MAAL,CAAYM,OAAZ;AACD;;AAEDC,EAAAA,WAAW,CAACC,QAAD,EAAkC;AAC3C,UAAMC,YAAY,GAAGd,IAAI,CAAwBa,QAAxB,CAAzB;AACA,SAAKR,MAAL,CAAYO,WAAZ,CAAwBE,YAAY,CAACT,MAArC;AACA,SAAKU,gBAAL,GAAwBD,YAAY,CAACE,mBAAb,EAAxB;AACD;;AAGDC,EAAAA,WAAW,CAACC,QAAD,EAA4B;AACrC,UAAM,IAAIC,KAAJ,CAAU,QAAV,CAAN;AAGD;;AAQDC,EAAAA,QAAQ,CAACC,CAAD,EAAYC,CAAZ,EAAwBC,CAAxB,EAA0C;AAChD,SAAKlB,MAAL,CAAYe,QAAZ,CAAqBC,CAArB,EAAwBC,CAAxB,EAA2BC,CAA3B;AACD;;AAODC,EAAAA,gBAAgB,CAACC,cAAD,EAAyBC,cAAsB,GAAG,CAAlD,EAA2D;AACzE,SAAKrB,MAAL,CAAYmB,gBAAZ,CAA6BxB,IAAI,CAAeyB,cAAf,CAAJ,CAAmCpB,MAAhE,EAAwEqB,cAAxE;AACD;;AAEDC,EAAAA,cAAc,CAACC,UAAD,EAA2B;AACvC,SAAKvB,MAAL,CAAYsB,cAAZ,CAA2BC,UAA3B;AACD;;AACDC,EAAAA,aAAa,GAAS;AACpB,SAAKxB,MAAL,CAAYwB,aAAZ;AACD;;AACDC,EAAAA,iBAAiB,CAACC,WAAD,EAA4B;AAC3C,SAAK1B,MAAL,CAAYyB,iBAAZ,CAA8BC,WAA9B;AACD;;AA9DwD","sourcesContent":["import {ComputePass, ComputePassProps, ComputePipeline, Buffer, Binding, cast} from '@luma.gl/api';\nimport WebGPUDevice from '../webgpu-device';\nimport WebGPUBuffer from './webgpu-buffer';\n// import WebGPUCommandEncoder from './webgpu-command-encoder';\nimport WebGPUComputePipeline from './webgpu-compute-pipeline';\n\nexport default class WebGPUComputePass extends ComputePass {\n readonly device: WebGPUDevice;\n readonly handle: GPUComputePassEncoder;\n _bindGroupLayout: GPUBindGroupLayout | null = null;\n\n constructor(device: WebGPUDevice, props: ComputePassProps) {\n super(device, props);\n this.device = device;\n\n this.handle = this.props.handle || device.commandEncoder?.beginComputePass({\n label: this.props.id,\n // timestampWrites?: GPUComputePassTimestampWrites;\n });\n }\n\n /** @note no WebGPU destroy method, just gc */\n override destroy(): void {}\n\n endPass(): void {\n this.handle.endPass();\n }\n\n setPipeline(pipeline: ComputePipeline): void {\n const wgpuPipeline = cast<WebGPUComputePipeline>(pipeline);\n this.handle.setPipeline(wgpuPipeline.handle);\n this._bindGroupLayout = wgpuPipeline._getBindGroupLayout();\n }\n\n /** Sets an array of bindings (uniform buffers, samplers, textures, ...) */\n setBindings(bindings: Binding[]): void {\n throw new Error('fix me');\n // const bindGroup = getBindGroup(this.device.handle, this._bindGroupLayout, this.props.bindings);\n // this.handle.setBindGroup(0, bindGroup);\n }\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 dispatch(x: number, y?: number, z?: number): void {\n this.handle.dispatch(x, y, z);\n }\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 dispatchIndirect(indirectBuffer: Buffer, indirectOffset: number = 0): void {\n this.handle.dispatchIndirect(cast<WebGPUBuffer>(indirectBuffer).handle, indirectOffset);\n }\n\n pushDebugGroup(groupLabel: string): void {\n this.handle.pushDebugGroup(groupLabel);\n }\n popDebugGroup(): void {\n this.handle.popDebugGroup();\n }\n insertDebugMarker(markerLabel: string): void {\n this.handle.insertDebugMarker(markerLabel);\n }\n\n // writeTimestamp(querySet: GPUQuerySet, queryIndex: number): void;\n // beginPipelineStatisticsQuery(querySet: GPUQuerySet, queryIndex: number): void;\n // endPipelineStatisticsQuery(querySet: GPUQuerySet, queryIndex: number): void;\n}\n"],"file":"webgpu-compute-pass.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/resources/webgpu-compute-pipeline.ts"],"names":["ComputePipeline","cast","WebGPUComputePipeline","constructor","device","props","module","cs","handle","createComputePipeline","label","id","compute","entryPoint","csEntryPoint","_getBindGroupLayout","getBindGroupLayout"],"mappings":";AACA,SAAQA,eAAR,EAA+CC,IAA/C,QAA0D,cAA1D;AAQA,eAAe,MAAMC,qBAAN,SAAoCF,eAApC,CAAoD;AAIjEG,EAAAA,WAAW,CAACC,MAAD,EAAuBC,KAAvB,EAAoD;AAC7D,UAAMD,MAAN,EAAcC,KAAd;;AAD6D;;AAAA;;AAE7D,SAAKD,MAAL,GAAcA,MAAd;AAEA,UAAME,MAAM,GAAGL,IAAI,CAAe,KAAKI,KAAL,CAAWE,EAA1B,CAAJ,CAAkCC,MAAjD;AACA,SAAKA,MAAL,GAAc,KAAKH,KAAL,CAAWG,MAAX,IAAqB,KAAKJ,MAAL,CAAYI,MAAZ,CAAmBC,qBAAnB,CAAyC;AAC1EC,MAAAA,KAAK,EAAE,KAAKL,KAAL,CAAWM,EADwD;AAE1EC,MAAAA,OAAO,EAAE;AACPN,QAAAA,MADO;AAEPO,QAAAA,UAAU,EAAE,KAAKR,KAAL,CAAWS;AAFhB;AAFiE,KAAzC,CAAnC;AAQD;;AAGDC,EAAAA,mBAAmB,GAAG;AAEpB,WAAO,KAAKP,MAAL,CAAYQ,kBAAZ,CAA+B,CAA/B,CAAP;AACD;;AAvBgE","sourcesContent":["// prettier-ignore\nimport {ComputePipeline, ComputePipelineProps, cast} from '@luma.gl/api';\n\nimport WebGPUDevice from '../webgpu-device';\nimport WebGPUShader from './webgpu-shader';\n\n// COMPUTE PIPELINE\n\n/** Creates a new compute pipeline when parameters change */\nexport default class WebGPUComputePipeline extends ComputePipeline {\n device: WebGPUDevice;\n handle: GPUComputePipeline;\n\n constructor(device: WebGPUDevice, props: ComputePipelineProps) {\n super(device, props);\n this.device = device;\n\n const module = cast<WebGPUShader>(this.props.cs).handle;\n this.handle = this.props.handle || this.device.handle.createComputePipeline({\n label: this.props.id,\n compute: {\n module,\n entryPoint: this.props.csEntryPoint,\n // constants: this.props.csConstants\n }\n });\n }\n\n /** For internal use in render passes */\n _getBindGroupLayout() {\n // TODO: Cache?\n return this.handle.getBindGroupLayout(0);\n }\n}\n"],"file":"webgpu-compute-pipeline.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/resources/webgpu-external-texture.ts"],"names":["ExternalTexture","WebGPUSampler","WebGPUExternalTexture","constructor","device","props","handle","importExternalTexture","source","colorSpace","sampler","destroy","setSampler"],"mappings":";AACA,SAAQA,eAAR,QAA2E,cAA3E;AAEA,OAAOC,aAAP,MAA0B,kBAA1B;AAMA,eAAe,MAAMC,qBAAN,SAAoCF,eAApC,CAAoD;AAKjEG,EAAAA,WAAW,CAACC,MAAD,EAAuBC,KAAvB,EAAoD;AAC7D,UAAMD,MAAN,EAAcC,KAAd;;AAD6D;;AAAA;;AAAA;;AAE7D,SAAKD,MAAL,GAAcA,MAAd;AACA,SAAKE,MAAL,GAAc,KAAKD,KAAL,CAAWC,MAAX,IAAqB,KAAKF,MAAL,CAAYE,MAAZ,CAAmBC,qBAAnB,CAAyC;AAC1EC,MAAAA,MAAM,EAAEH,KAAK,CAACG,MAD4D;AAE1EC,MAAAA,UAAU,EAAEJ,KAAK,CAACI;AAFwD,KAAzC,CAAnC;AAIA,SAAKC,OAAL,GAAe,IAAf;AACD;;AAEQC,EAAAA,OAAO,GAAS,CAIxB;;AAGDC,EAAAA,UAAU,CAACF,OAAD,EAAwC;AAEhD,SAAKA,OAAL,GAAeA,OAAO,YAAYT,aAAnB,GAAmCS,OAAnC,GAA6C,IAAIT,aAAJ,CAAkB,KAAKG,MAAvB,EAA+BM,OAA/B,CAA5D;AACA,WAAO,IAAP;AACD;;AA1BgE","sourcesContent":["// luma.gl, MIT license\nimport {ExternalTexture, ExternalTextureProps, Sampler, SamplerProps} from '@luma.gl/api';\nimport type WebGPUDevice from '../webgpu-device';\nimport WebGPUSampler from './webgpu-sampler';\n\n/**\n * Cheap, temporary texture view for videos\n * Only valid within same callback, destroyed automatically as a microtask.\n */\nexport default class WebGPUExternalTexture extends ExternalTexture {\n readonly device: WebGPUDevice;\n readonly handle: GPUExternalTexture;\n sampler: WebGPUSampler;\n\n constructor(device: WebGPUDevice, props: ExternalTextureProps) {\n super(device, props);\n this.device = device;\n this.handle = this.props.handle || this.device.handle.importExternalTexture({\n source: props.source,\n colorSpace: props.colorSpace\n });\n this.sampler = null;\n }\n\n override destroy(): void {\n // External textures are destroyed automatically,\n // as a microtask, instead of manually or upon garbage collection like other resources.\n // this.handle.destroy();\n }\n\n /** Set default sampler */\n setSampler(sampler: Sampler | SamplerProps): this {\n // We can accept a sampler instance or set of props;\n this.sampler = sampler instanceof WebGPUSampler ? sampler : new WebGPUSampler(this.device, sampler);\n return this;\n }\n}\n"],"file":"webgpu-external-texture.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/resources/webgpu-framebuffer.ts"],"names":["Framebuffer","Texture","WEBGPUTexture","WebGPUFramebuffer","constructor","device","props","colorAttachments","depthStencilAttachment","createDepthStencilTexture","map","colorAttachment","createColorTexture","renderPassDescriptor","view","handle","createView","depthLoadValue","depthStoreOp","stencilLoadValue","stencilStoreOp","length","loadValue","storeOp","_createTexture","id","format","width","height","usage","RENDER_ATTACHMENT","Error","texture","_resizeAttachments","i","resizedTexture","destroy"],"mappings":";AACA,SAAQA,WAAR,EAAqBC,OAArB,QAAmC,cAAnC;AAGA,OAAOC,aAAP,MAA0B,kBAA1B;AAWA,eAAe,MAAMC,iBAAN,SAAgCH,WAAhC,CAA4C;AAczDI,EAAAA,WAAW,CAACC,MAAD,EAAuBC,KAAvB,EAAgD;AACzD,UAAMD,MAAN,EAAcC,KAAd;;AADyD;;AAAA,8CAXvB,EAWuB;;AAAA,oDAVZ,IAUY;;AAAA,kDAJvD;AACFC,MAAAA,gBAAgB,EAAE;AADhB,KAIuD;;AAEzD,SAAKF,MAAL,GAAcA,MAAd;;AAEA,QAAIC,KAAK,CAACE,sBAAV,EAAkC;AAChC,WAAKA,sBAAL,GAA8B,KAAKC,yBAAL,CAA+BH,KAA/B,CAA9B;AACD;;AAED,QAAIA,KAAK,CAACC,gBAAV,EAA4B;AAC1B,WAAKA,gBAAL,GAAwBD,KAAK,CAACC,gBAAN,CAAuBG,GAAvB,CAA2BC,eAAe,IAAI,KAAKC,kBAAL,CAAwB,KAAKN,KAA7B,EAAoCK,eAApC,CAA9C,CAAxB;AACD;;AAED,QAAI,KAAKH,sBAAT,EAAiC;AAC/B,WAAKK,oBAAL,CAA0BL,sBAA1B,GAAmD;AACjDM,QAAAA,IAAI,EAAE,KAAKN,sBAAL,CAA4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,QAAAA;AAA9C,OAA3B,CAAvB;;AACA,WAAKpB,sBAAL,CAA4B4B,OAA5B;AACA,WAAK5B,sBAAL,GAA8B2B,cAA9B;AACA,WAAKtB,oBAAL,CAA0BL,sBAA1B,CAAiDM,IAAjD,GAAwDqB,cAAc,CAACpB,MAAf,CAAsBC,UAAtB,EAAxD;AACF;AACF;;AAvGwD","sourcesContent":["import type {FramebufferProps, ColorTextureFormat} from '@luma.gl/api';\nimport {Framebuffer, Texture} from '@luma.gl/api';\nimport WebGPUDevice from '../webgpu-device';\n// import WebGPUCanvasContext from '../webgpu-canvas-context';\nimport WEBGPUTexture from './webgpu-texture';\nimport WebGPUTexture from './webgpu-texture';\n\n// const DEFAULT_DEPTH_STENCIL_FORMAT: DepthStencilTextureFormat = 'depth24plus';\n\n// const MAX_COLOR_ATTACHMENTS = 8;\n\n/**\n * Create new textures with correct size for all attachments. \n * @note resize() destroys existing textures (if size has changed). \n */\nexport default class WebGPUFramebuffer extends Framebuffer {\n readonly device: WebGPUDevice;\n\n colorAttachments: WebGPUTexture[] = [];\n depthStencilAttachment: WebGPUTexture | null = null;\n\n /** Partial render pass descriptor. Used by WebGPURenderPass */\n renderPassDescriptor: {\n colorAttachments: GPURenderPassColorAttachment[];\n depthStencilAttachment?: GPURenderPassDepthStencilAttachment;\n } = {\n colorAttachments: []\n };\n\n constructor(device: WebGPUDevice, props: FramebufferProps) {\n super(device, props);\n this.device = device;\n\n if (props.depthStencilAttachment) {\n this.depthStencilAttachment = this.createDepthStencilTexture(props);\n }\n\n if (props.colorAttachments) {\n this.colorAttachments = props.colorAttachments.map(colorAttachment => this.createColorTexture(this.props, colorAttachment));\n }\n\n if (this.depthStencilAttachment) {\n this.renderPassDescriptor.depthStencilAttachment = {\n view: this.depthStencilAttachment.handle.createView(),\n // Add default clear values\n depthLoadValue: 1.0,\n depthStoreOp: 'store',\n stencilLoadValue: 0,\n stencilStoreOp: 'store',\n }\n }\n\n if (this.colorAttachments.length > 0) {\n this.renderPassDescriptor.colorAttachments = this.colorAttachments.map(colorAttachment => ({\n view: colorAttachment.handle.createView(),\n loadValue: [0.0, 0.0, 0.0, 0.0],\n storeOp: 'store'\n }));\n }\n }\n\n /** Create depth stencil texture */\n private createDepthStencilTexture(props: FramebufferProps): WEBGPUTexture {\n if (props.depthStencilAttachment instanceof WEBGPUTexture) {\n return props.depthStencilAttachment;\n }\n\n if (typeof props.depthStencilAttachment === 'string') {\n return this.device._createTexture({\n id: 'depth-stencil-attachment',\n format: props.depthStencilAttachment,\n width: props.width,\n height: props.height,\n usage: Texture.RENDER_ATTACHMENT\n });\n }\n\n throw new Error('type');\n }\n\n private createColorTexture(props: FramebufferProps, texture: Texture | ColorTextureFormat): WEBGPUTexture {\n if (texture instanceof WEBGPUTexture) {\n return texture;\n }\n\n if (typeof texture === 'string') {\n return this.device._createTexture({\n id: 'color-attachment',\n format: texture,\n width: props.width,\n height: props.height,\n usage: Texture.RENDER_ATTACHMENT\n });\n }\n\n throw new Error('type');\n }\n\n /**\n * Create new textures with correct size for all attachments.\n * @note destroys existing textures.\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.device._createTexture({...this.colorAttachments[i].props, width, height})\n this.colorAttachments[i].destroy();\n this.colorAttachments[i] = resizedTexture;\n this.renderPassDescriptor.colorAttachments[i].view = resizedTexture.handle.createView();\n }\n }\n\n if (this.depthStencilAttachment) {\n const resizedTexture = this.device._createTexture({...this.depthStencilAttachment.props, width, height})\n this.depthStencilAttachment.destroy();\n this.depthStencilAttachment = resizedTexture;\n this.renderPassDescriptor.depthStencilAttachment.view = resizedTexture.handle.createView();\n }\n }\n}\n"],"file":"webgpu-framebuffer.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"webgpu-query.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/resources/webgpu-render-pass.ts"],"names":["RenderPass","cast","WebGPURenderPass","constructor","device","props","framebuffer","canvasContext","getCurrentFramebuffer","renderPassDescriptor","handle","commandEncoder","beginRenderPass","label","id","destroy","endPass","setPipeline","pipeline","setBindings","bindings","bindGroup","_getBindGroup","setBindGroup","setIndexBuffer","buffer","indexFormat","offset","size","setVertexBuffer","slot","draw","options","indexCount","drawIndexed","instanceCount","firstIndex","baseVertex","firstInstance","vertexCount","drawIndirect","setParameters","parameters","blendConstant","stencilReference","scissorRect","viewport","setBlendConstant","setStencilReference","setScissorRect","setViewport","pushDebugGroup","groupLabel","popDebugGroup","insertDebugMarker","markerLabel"],"mappings":";AACA,SAAgBA,UAAhB,EAA4CC,IAA5C,QAAuD,cAAvD;AAMA,eAAe,MAAMC,gBAAN,SAA+BF,UAA/B,CAA0C;AAOvDG,EAAAA,WAAW,CAACC,MAAD,EAAuBC,KAAsB,GAAG,EAAhD,EAAoD;AAC7D,UAAMD,MAAN,EAAcC,KAAd;;AAD6D;;AAAA;;AAAA,sCAFvB,IAEuB;;AAE7D,SAAKD,MAAL,GAAcA,MAAd;AACA,UAAME,WAAW,GAAGD,KAAK,CAACC,WAAN,IAAqBF,MAAM,CAACG,aAAP,CAAqBC,qBAArB,EAAzC;AAEA,UAAMC,oBAAoB,GAAGH,WAAW,CAACG,oBAAzC;AACA,SAAKC,MAAL,GAAc,KAAKL,KAAL,CAAWK,MAAX,IAAqBN,MAAM,CAACO,cAAP,CAAsBC,eAAtB,CAAsCH,oBAAtC,CAAnC;AACA,SAAKC,MAAL,CAAYG,KAAZ,GAAoB,KAAKR,KAAL,CAAWS,EAA/B;AACD;;AAEQC,EAAAA,OAAO,GAAS,CAAE;;AAE3BC,EAAAA,OAAO,GAAS;AACd,SAAKN,MAAL,CAAYM,OAAZ;AACD;;AAEDC,EAAAA,WAAW,CAACC,QAAD,EAAiC;AAC1C,SAAKA,QAAL,GAAgBjB,IAAI,CAAuBiB,QAAvB,CA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,EAAAA,aAAa,CAACC,UAAD,EAAyC;AACpD,UAAM;AAACC,MAAAA,aAAD;AAAgBC,MAAAA,gBAAhB;AAAkCC,MAAAA,WAAlC;AAA+CC,MAAAA;AAA/C,QAA2DJ,UAAjE;;AACA,QAAIC,aAAJ,EAAmB;AACjB,WAAKjC,MAAL,CAAYqC,gBAAZ,CAA6BJ,aAA7B;AACD;;AACD,QAAIC,gBAAJ,EAAsB;AACpB,WAAKlC,MAAL,CAAYsC,mBAAZ,CAAgCJ,gBAAhC;AACD;;AACD,QAAIC,WAAJ,EAAiB;AACf,WAAKnC,MAAL,CAAYuC,cAAZ,CAA2BJ,WAAW,CAAC,CAAD,CAAtC,EAA2CA,WAAW,CAAC,CAAD,CAAtD,EAA2DA,WAAW,CAAC,CAAD,CAAtE,EAA2EA,WAAW,CAAC,CAAD,CAAtF;AACD;;AAED,QAAIC,QAAJ,EAAc;AACZ,WAAKpC,MAAL,CAAYwC,WAAZ,CACEJ,QAAQ,CAAC,CAAD,CADV,EAEEA,QAAQ,CAAC,CAAD,CAFV,EAGEA,QAAQ,CAAC,CAAD,CAHV,EAIEA,QAAQ,CAAC,CAAD,CAJV,EAKEA,QAAQ,CAAC,CAAD,CALV,EAMEA,QAAQ,CAAC,CAAD,CANV;AAQD;AACF;;AAEDK,EAAAA,cAAc,CAACC,UAAD,EAA2B;AACvC,SAAK1C,MAAL,CAAYyC,cAAZ,CAA2BC,UAA3B;AACD;;AACDC,EAAAA,aAAa,GAAS;AACpB,SAAK3C,MAAL,CAAY2C,aAAZ;AACD;;AACDC,EAAAA,iBAAiB,CAACC,WAAD,EAA4B;AAC3C,SAAK7C,MAAL,CAAY4C,iBAAZ,CAA8BC,WAA9B;AACD;;AAlHsD","sourcesContent":["import type {RenderPassProps, RenderPassParameters, Binding} from '@luma.gl/api';\nimport {Buffer, RenderPass, RenderPipeline, cast} from '@luma.gl/api';\nimport WebGPUDevice from '../webgpu-device';\nimport WebGPUBuffer from './webgpu-buffer';\n// import WebGPUCommandEncoder from './webgpu-command-encoder';\nimport WebGPURenderPipeline from './webgpu-render-pipeline';\n\nexport default class WebGPURenderPass extends RenderPass {\n readonly device: WebGPUDevice;\n readonly handle: GPURenderPassEncoder;\n\n /** Active pipeline */\n pipeline: WebGPURenderPipeline | null = null;\n\n constructor(device: WebGPUDevice, props: RenderPassProps = {}) {\n super(device, props);\n this.device = device;\n const framebuffer = props.framebuffer || device.canvasContext.getCurrentFramebuffer();\n // @ts-expect-error\n const renderPassDescriptor = framebuffer.renderPassDescriptor;\n this.handle = this.props.handle || device.commandEncoder.beginRenderPass(renderPassDescriptor);\n this.handle.label = this.props.id;\n }\n\n override destroy(): void {}\n\n endPass(): void {\n this.handle.endPass();\n }\n\n setPipeline(pipeline: RenderPipeline): void {\n this.pipeline = cast<WebGPURenderPipeline>(pipeline);\n this.handle.setPipeline(this.pipeline.handle);\n }\n\n /** Sets an array of bindings (uniform buffers, samplers, textures, ...) */\n setBindings(bindings: Record<string, Binding>): void {\n this.pipeline?.setBindings(bindings);\n const bindGroup = this.pipeline?._getBindGroup();\n if (bindGroup) {\n this.handle.setBindGroup(0, bindGroup);\n }\n }\n\n setIndexBuffer(\n buffer: Buffer,\n indexFormat: GPUIndexFormat,\n offset: number = 0,\n size?: number\n ): void {\n this.handle.setIndexBuffer(cast<WebGPUBuffer>(buffer).handle, indexFormat, offset, size);\n }\n\n setVertexBuffer(slot: number, buffer: Buffer, offset: number = 0): void {\n this.handle.setVertexBuffer(slot, cast<WebGPUBuffer>(buffer).handle, offset);\n }\n\n draw(options: {\n vertexCount?: number;\n indexCount?: number;\n instanceCount?: number;\n firstVertex?: number;\n firstIndex?: number;\n firstInstance?: number;\n baseVertex?: number;\n }): void {\n if (options.indexCount) {\n this.handle.drawIndexed(\n options.indexCount,\n options.instanceCount,\n options.firstIndex,\n options.baseVertex,\n options.firstInstance\n );\n } else {\n this.handle.draw(\n options.vertexCount || 0,\n options.instanceCount,\n options.firstIndex,\n options.firstInstance\n );\n }\n }\n\n drawIndirect(): void {\n // drawIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): void;\n // drawIndexedIndirect(indirectBuffer: GPUBuffer, indirectOffset: number): void;\n }\n\n setParameters(parameters: RenderPassParameters): void {\n const {blendConstant, stencilReference, scissorRect, viewport} = parameters;\n if (blendConstant) {\n this.handle.setBlendConstant(blendConstant);\n }\n if (stencilReference) {\n this.handle.setStencilReference(stencilReference);\n }\n if (scissorRect) {\n this.handle.setScissorRect(scissorRect[0], scissorRect[1], scissorRect[2], scissorRect[3]);\n }\n // TODO - explain how 3 dimensions vs 2 in WebGL works.\n if (viewport) {\n this.handle.setViewport(\n viewport[0],\n viewport[1],\n viewport[2],\n viewport[3],\n viewport[4],\n viewport[5]\n );\n }\n }\n\n pushDebugGroup(groupLabel: string): void {\n this.handle.pushDebugGroup(groupLabel);\n }\n popDebugGroup(): void {\n this.handle.popDebugGroup();\n }\n insertDebugMarker(markerLabel: string): void {\n this.handle.insertDebugMarker(markerLabel);\n }\n\n // writeTimestamp(querySet: GPUQuerySet, queryIndex: number): void;\n // beginOcclusionQuery(queryIndex: number): void;\n // endOcclusionQuery(): void;\n // beginPipelineStatisticsQuery(querySet: GPUQuerySet, queryIndex: number): void;\n // endPipelineStatisticsQuery(querySet: GPUQuerySet, queryIndex: number): void;\n\n // executeBundles(bundles: Iterable<GPURenderBundle>): void;\n}\n"],"file":"webgpu-render-pass.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/resources/webgpu-render-pipeline.ts"],"names":["RenderPipeline","cast","log","isObjectEmpty","applyParametersToRenderPipelineDescriptor","getWebGPUTextureFormat","getBindGroup","getVertexBufferLayout","getBufferSlots","WebGPURenderPipeline","constructor","device","props","handle","createHandle","label","id","vs","fs","_bufferSlots","layout","bufferMap","_buffers","Array","Object","keys","length","fill","_bindGroupLayout","getBindGroupLayout","descriptor","_getRenderPipelineDescriptor","renderPipeline","createRenderPipeline","groupCollapsed","JSON","stringify","groupEnd","destroy","setIndexBuffer","indexBuffer","_indexBuffer","setAttributes","attributes","name","buffer","entries","bufferIndex","Error","setBindings","bindings","assign","_bindGroup","setUniforms","uniforms","_getBuffers","_getBindGroup","vertex","module","entryPoint","vsEntryPoint","buffers","fragment","fsEntryPoint","targets","format","canvasContext","topology","primitive","parameters","draw","options","webgpuRenderPass","renderPass","getDefaultRenderPass","setPipeline","bindGroup","setBindGroup","_setAttributeBuffers","indexCount","drawIndexed","instanceCount","firstIndex","baseVertex","firstInstance","vertexCount","indexType","i","attribute","find","location","setVertexBuffer"],"mappings":";AACA,SAAgBA,cAAhB,EAAqDC,IAArD,EAA2DC,GAA3D,EAAgEC,aAAhE,QAAoF,cAApF;AACA,SAAQC,yCAAR,QAAwD,8BAAxD;AACA,SAAQC,sBAAR,QAAqC,mCAArC;AACA,SAAQC,YAAR,QAA2B,2BAA3B;AACA,SAAQC,qBAAR,EAA+BC,cAA/B,QAAoD,qCAApD;AAaA,eAAe,MAAMC,oBAAN,SAAmCT,cAAnC,CAAkD;AAiB/DU,EAAAA,WAAW,CAACC,MAAD,EAAuBC,KAAvB,EAAmD;AAC5D,UAAMD,MAAN,EAAcC,KAAd;;AAD4D;;AAAA;;AAAA;;AAAA,gCAZpC,IAYoC;;AAAA;;AAAA;;AAAA,0CARlB,IAQkB;;AAAA;;AAAA,wCAFpB,IAEoB;;AAE5D,SAAKD,MAAL,GAAcA,MAAd;AACA,SAAKE,MAAL,GAAe,KAAKD,KAAL,CAAWC,MAAZ,IAA4C,KAAKC,YAAL,EAA1D;AACA,SAAKD,MAAL,CAAYE,KAAZ,GAAoB,KAAKH,KAAL,CAAWI,EAA/B;AAEA,SAAKC,EAAL,GAAUhB,IAAI,CAAeW,KAAK,CAACK,EAArB,CAAd;AACA,SAAKC,EAAL,GAAUjB,IAAI,CAAeW,KAAK,CAACM,EAArB,CAAd;AAEA,SAAKC,YAAL,GAAoBX,cAAc,CAAC,KAAKI,KAAL,CAAWQ,MAAZ,EAAoB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api';\nimport {Buffer, RenderPipeline, RenderPipelineProps, cast, log, isObjectEmpty} from '@luma.gl/api';\nimport {applyParametersToRenderPipelineDescriptor} from '../helpers/webgpu-parameters';\nimport {getWebGPUTextureFormat} from '../helpers/convert-texture-format';\nimport {getBindGroup} from '../helpers/get-bind-group';\nimport {getVertexBufferLayout, getBufferSlots} from '../helpers/get-vertex-buffer-layout';\n// import {convertAttributesVertexBufferToLayout} from '../helpers/get-vertex-buffer-layout';\n// import {mapAccessorToWebGPUFormat} from './helpers/accessor-to-format';\n// import type {BufferAccessors} from './webgpu-pipeline';\n\nimport type WebGPUDevice from '../webgpu-device';\nimport type WebGPUBuffer from './webgpu-buffer';\nimport type WebGPUShader from './webgpu-shader';\nimport type WebGPURenderPass from './webgpu-render-pass';\n\n// RENDER PIPELINE\n\n/** Creates a new render pipeline when parameters change */\nexport default class WebGPURenderPipeline extends RenderPipeline {\n device: WebGPUDevice;\n handle: GPURenderPipeline;\n\n vs: WebGPUShader;\n fs: WebGPUShader | null = null;\n\n private _bufferSlots: Record<string, number>;\n private _buffers: Buffer[];\n private _indexBuffer: WebGPUBuffer | null = null;\n // private _firstIndex: number;\n // private _lastIndex: number;\n\n /** For internal use to create BindGroups */\n private _bindGroupLayout: GPUBindGroupLayout;\n private _bindGroup: GPUBindGroup | null = null;\n\n constructor(device: WebGPUDevice, props: RenderPipelineProps) {\n super(device, props);\n this.device = device;\n this.handle = (this.props.handle as GPURenderPipeline) || this.createHandle();\n this.handle.label = this.props.id;\n\n this.vs = cast<WebGPUShader>(props.vs);\n this.fs = cast<WebGPUShader>(props.fs);\n\n this._bufferSlots = getBufferSlots(this.props.layout, this.props.bufferMap);\n this._buffers = new Array<Buffer>(Object.keys(this._bufferSlots).length).fill(null);\n this._bindGroupLayout = this.handle.getBindGroupLayout(0);\n }\n\n protected createHandle(): GPURenderPipeline {\n const descriptor = this._getRenderPipelineDescriptor();\n const renderPipeline = this.device.handle.createRenderPipeline(descriptor);\n log.groupCollapsed(1, `new WebGPRenderPipeline(${this.id})`)();\n log.log(1, JSON.stringify(descriptor, null, 2))();\n log.groupEnd(1)();\n return renderPipeline;\n }\n\n override destroy(): void {\n // WebGPURenderPipeline has no destroy method.\n }\n\n setIndexBuffer(indexBuffer: Buffer): void {\n this._indexBuffer = cast<WebGPUBuffer>(indexBuffer);\n }\n\n setAttributes(attributes: Record<string, Buffer>): void {\n for (const [name, buffer] of Object.entries(attributes)) {\n const bufferIndex = this._bufferSlots[name];\n if (bufferIndex >= 0) {\n this._buffers[bufferIndex] = buffer;\n } else {\n throw new Error(\n `Setting attribute '${name}' not listed in shader layout for program ${this.id}`\n );\n }\n }\n // for (let i = 0; i < this._bufferSlots.length; ++i) {\n // const bufferName = this._bufferSlots[i];\n // if (attributes[bufferName]) {\n // this.handle\n // }\n // }\n }\n\n /** Set the bindings */\n setBindings(bindings: Record<string, Binding>): void {\n if (!isObjectEmpty(this.props.bindings)) {\n Object.assign(this.props.bindings, bindings);\n // Set up the bindings\n this._bindGroup = getBindGroup(\n this.device.handle,\n this._bindGroupLayout,\n this.props.layout,\n this.props.bindings\n );\n }\n }\n\n setUniforms(uniforms: Record<string, any>): void {\n if (!isObjectEmpty(uniforms)) {\n throw new Error('WebGPU does not support uniforms');\n }\n }\n\n _getBuffers() {\n return this._buffers;\n }\n\n /** Return a bind group created by setBindings */\n _getBindGroup() {\n // assert(this._bindGroup);\n return this._bindGroup;\n }\n\n /** Populate the complex WebGPU GPURenderPipelineDescriptor */\n protected _getRenderPipelineDescriptor() {\n // Set up the vertex stage\n const vertex: GPUVertexState = {\n module: cast<WebGPUShader>(this.props.vs).handle,\n entryPoint: this.props.vsEntryPoint || 'main',\n buffers: getVertexBufferLayout(this.props.layout, this.props.bufferMap)\n };\n\n // Set up the fragment stage\n let fragment: GPUFragmentState | undefined;\n if (this.props.fs) {\n fragment = {\n module: cast<WebGPUShader>(this.props.fs).handle,\n entryPoint: this.props.fsEntryPoint || 'main',\n targets: [\n {\n // TODO exclamation mark hack!\n format: getWebGPUTextureFormat(this.device?.canvasContext?.format!)\n }\n ]\n };\n }\n\n // WebGPU has more restrictive topology support than WebGL\n switch (this.props.topology) {\n case 'triangle-fan':\n case 'line-loop':\n throw new Error(`WebGPU does not support primitive topology ${this.props.topology}`);\n default:\n }\n\n // Create a partially populated descriptor\n let descriptor: GPURenderPipelineDescriptor = {\n vertex,\n fragment,\n primitive: {\n topology: this.props.topology\n }\n };\n\n // Set parameters on the descriptor\n applyParametersToRenderPipelineDescriptor(descriptor, this.props.parameters);\n\n return descriptor;\n }\n\n draw(options: {\n renderPass?: RenderPass;\n vertexCount?: number;\n indexCount?: number;\n instanceCount?: number;\n firstVertex?: number;\n firstIndex?: number;\n firstInstance?: number;\n baseVertex?: number;\n }): void {\n const webgpuRenderPass: WebGPURenderPass =\n cast<WebGPURenderPass>(options.renderPass) || this.device.getDefaultRenderPass();\n\n // Set pipeline\n webgpuRenderPass.handle.setPipeline(this.handle);\n\n // Set bindings (uniform buffers, textures etc)\n const bindGroup = this._getBindGroup();\n if (bindGroup) {\n webgpuRenderPass.handle.setBindGroup(0, bindGroup);\n }\n\n // Set attributes\n this._setAttributeBuffers(webgpuRenderPass);\n\n // Draw\n if (options.indexCount) {\n webgpuRenderPass.handle.drawIndexed(\n options.indexCount,\n options.instanceCount,\n options.firstIndex,\n options.baseVertex,\n options.firstInstance\n );\n } else {\n webgpuRenderPass.handle.draw(\n options.vertexCount || 0,\n options.instanceCount,\n options.firstIndex,\n options.firstInstance\n );\n }\n }\n\n _setAttributeBuffers(webgpuRenderPass: WebGPURenderPass) {\n if (this._indexBuffer) {\n webgpuRenderPass.handle.setIndexBuffer(this._indexBuffer.handle, this._indexBuffer.props.indexType);\n }\n\n const buffers = this._getBuffers();\n for (let i = 0; i < buffers.length; ++i) {\n const buffer = cast<WebGPUBuffer>(buffers[i]);\n if (!buffer) {\n const attribute = this.props.layout.attributes.find(\n (attribute) => attribute.location === i\n );\n throw new Error(\n `No buffer provided for attribute '${attribute?.name || ''}' in Model '${this.props.id}'`\n );\n }\n webgpuRenderPass.handle.setVertexBuffer(i, buffer.handle);\n }\n\n // TODO - HANDLE buffer maps\n /*\n for (const [bufferName, attributeMapping] of Object.entries(this.props.bufferMap)) {\n const buffer = cast<WebGPUBuffer>(this.props.attributes[bufferName]);\n if (!buffer) {\n log.warn(`Missing buffer for buffer map ${bufferName}`)();\n continue;\n }\n\n if ('location' in attributeMapping) {\n // @ts-expect-error TODO model must not depend on webgpu\n renderPass.handle.setVertexBuffer(layout.location, buffer.handle);\n } else {\n for (const [bufferName, mapping] of Object.entries(attributeMapping)) {\n // @ts-expect-error TODO model must not depend on webgpu\n renderPass.handle.setVertexBuffer(field.location, buffer.handle);\n }\n }\n }\n */\n }\n}\n"],"file":"webgpu-render-pipeline.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/resources/webgpu-sampler.ts"],"names":["Sampler","WebGPUSampler","constructor","device","props","samplerProps","type","compare","handle","createSampler","label","id","destroy"],"mappings":";AAAA,SAAQA,OAAR,QAAoC,cAApC;AAUA,eAAe,MAAMC,aAAN,SAA4BD,OAA5B,CAAoC;AAIjDE,EAAAA,WAAW,CAACC,MAAD,EAAuBC,KAAvB,EAAkD;AAC3D,UAAMD,MAAN,EAAcC,KAAd;;AAD2D;;AAAA;;AAE3D,SAAKD,MAAL,GAAcA,MAAd;AAGA,UAAME,YAAyC,GAAG,EAAC,GAAG,KAAKD;AAAT,KAAlD;;AACA,QAAIC,YAAY,CAACC,IAAb,KAAsB,oBAA1B,EAAgD;AAC9C,aAAOD,YAAY,CAACE,OAApB;AACD;;AAED,SAAKC,MAAL,GAAc,KAAKA,MAAL,IAAe,KAAKL,MAAL,CAAYK,MAAZ,CAAmBC,aAAnB,CAAiCJ,YAAjC,CAA7B;AACA,SAAKG,MAAL,CAAYE,KAAZ,GAAoB,KAAKN,KAAL,CAAWO,EAA/B;AACD;;AAEQC,EAAAA,OAAO,GAAS,CAExB;;AApBgD","sourcesContent":["import {Sampler, SamplerProps} from '@luma.gl/api';\nimport type WebGPUDevice from '../webgpu-device';\n\nexport type WebGPUSamplerProps = SamplerProps & {\n handle?: GPUSampler;\n}\n\n/**\n *\n */\nexport default class WebGPUSampler extends Sampler {\n readonly device: WebGPUDevice;\n readonly handle: GPUSampler;\n\n constructor(device: WebGPUDevice, props: WebGPUSamplerProps) {\n super(device, props);\n this.device = device;\n\n // Prepare sampler props\n const samplerProps: Partial<WebGPUSamplerProps> = {...this.props};\n if (samplerProps.type !== 'comparison-sampler') {\n delete samplerProps.compare;\n }\n\n this.handle = this.handle || this.device.handle.createSampler(samplerProps);\n this.handle.label = this.props.id;\n }\n\n override destroy(): void {\n // this.handle.destroy();\n }\n}\n"],"file":"webgpu-sampler.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/resources/webgpu-shader.ts"],"names":["Shader","log","WebGPUShader","constructor","device","props","handle","pushErrorScope","createHandle","label","id","_checkCompilationError","popErrorScope","errorScope","error","shaderLog","compilationInfo","message","Error","destroy","source","language","includes","createShaderModule","code","transform","glsl","glslang","compileGLSL","type","messages"],"mappings":";AACA,SAAQA,MAAR,EAAgBC,GAAhB,QAA0B,cAA1B;AAUA,eAAe,MAAMC,YAAN,SAA2BF,MAA3B,CAAkC;AAI/CG,EAAAA,WAAW,CAACC,MAAD,EAAuBC,KAAvB,EAAiD;AAC1D,UAAMD,MAAN,EAAcC,KAAd;;AAD0D;;AAAA;;AAE1D,SAAKD,MAAL,GAAcA,MAAd;AAEA,SAAKA,MAAL,CAAYE,MAAZ,CAAmBC,cAAnB,CAAkC,YAAlC;AAEA,SAAKD,MAAL,GAAc,KAAKD,KAAL,CAAWC,MAAX,IAAqB,KAAKE,YAAL,EAAnC;AACA,SAAKF,MAAL,CAAYG,KAAZ,GAAoB,KAAKJ,KAAL,CAAWK,EAA/B;;AAEA,SAAKC,sBAAL,CAA4B,KAAKP,MAAL,CAAYE,MAAZ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AACD;;AA3D8C","sourcesContent":["import type {ShaderProps, CompilerMessage} from '@luma.gl/api';\nimport {Shader, log} from '@luma.gl/api';\nimport type WebGPUDevice from '../webgpu-device';\n\nexport type WebGPUShaderProps = ShaderProps & {\n handle?: GPUShaderModule;\n};\n\n/**\n * Immutable shader\n */\nexport default class WebGPUShader extends Shader {\n readonly device: WebGPUDevice;\n readonly handle: GPUShaderModule;\n\n constructor(device: WebGPUDevice, props: WebGPUShaderProps) {\n super(device, props);\n this.device = device;\n\n this.device.handle.pushErrorScope('validation');\n\n this.handle = this.props.handle || this.createHandle();\n this.handle.label = this.props.id;\n\n this._checkCompilationError(this.device.handle.popErrorScope());\n }\n\n async _checkCompilationError(errorScope: Promise<GPUError | null>): Promise<void> {\n const error = await errorScope as GPUValidationError;\n if (error) {\n const shaderLog = await this.compilationInfo();\n log.error(`Shader compilation error: ${error.message}`, shaderLog)();\n // Note: Even though this error is asynchronous and thrown after the constructor completes,\n // it will result in a useful stack trace leading back to the constructor\n throw new Error(`Shader compilation error: ${error.message}`);\n }\n }\n\n override destroy(): void {\n // this.handle.destroy();\n }\n\n protected createHandle(): GPUShaderModule {\n const {source} = this.props;\n\n let language = this.props.language;\n // Compile from src\n if (!language) {\n // wgsl uses C++ \"auto\" style arrow notation\n language = source.includes('->') ? 'wgsl' : 'glsl';\n }\n\n switch(language) {\n case 'wgsl':\n return this.device.handle.createShaderModule({code: source});\n case 'glsl':\n return this.device.handle.createShaderModule({\n code: source,\n // @ts-expect-error\n transform: (glsl) => this.device.glslang.compileGLSL(glsl, type)\n });\n default:\n throw new Error(language);\n }\n }\n\n /** Returns compilation info for this shader */\n async compilationInfo(): Promise<readonly CompilerMessage[]> {\n const compilationInfo = await this.handle.compilationInfo();\n return compilationInfo.messages;\n }\n}\n"],"file":"webgpu-shader.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/adapter/resources/webgpu-texture.ts"],"names":["Texture","getWebGPUTextureFormat","WebGPUSampler","BASE_DIMENSIONS","WebGPUTexture","constructor","device","props","format","Error","handle","createHandle","data","setData","sampler","view","createView","width","height","createTexture","size","depthOrArrayLayers","depth","dimension","usage","mipLevelCount","mipLevels","sampleCount","samples","destroy","setSampler","options","setImage","source","sourceX","sourceY","mipLevel","x","y","z","aspect","colorSpace","premultipliedAlpha","queue","copyExternalImageToTexture","origin","texture"],"mappings":";AACA,SAAQA,OAAR,QAA2D,cAA3D;AACA,SAAQC,sBAAR,QAAqC,mCAArC;AAEA,OAAOC,aAAP,MAA0B,kBAA1B;AAEA,MAAMC,eAAmD,GAAG;AAC1D,QAAM,IADoD;AAE1D,QAAM,IAFoD;AAG1D,cAAY,IAH8C;AAI1D,UAAQ,IAJkD;AAK1D,gBAAc,IAL4C;AAM1D,QAAM;AANoD,CAA5D;AASA,eAAe,MAAMC,aAAN,SAA4BJ,OAA5B,CAAoC;AAajDK,EAAAA,WAAW,CAACC,MAAD,EAAuBC,KAAvB,EAA4C;AACrD,UAAMD,MAAN,EAAcC,KAAd;;AADqD;;AAAA;;AAAA;;AAAA;;AAGrD,QAAI,OAAO,KAAKA,KAAL,CAAWC,MAAlB,KAA6B,QAAjC,EAA2C;AACzC,YAAM,IAAIC,KAAJ,CAAU,eAAV,CAAN;AACD;;AAED,SAAKH,MAAL,GAAcA,MAAd;AACA,SAAKI,MAAL,GAAc,KAAKH,KAAL,CAAWG,MAAX,IAAqB,KAAKC,YAAL,EAAnC;;AAEA,QAAI,KAAKJ,KAAL,CAAWK,IAAf,EAAqB;AACnB,WAAKC,OAAL,CAAa;AAACD,QAAAA,IAAI,EAAE,KAAKL,KAAL,CAAWK;AAAlB,OAAb;AACD;;AAID,SAAKE,OAAL,GAAeP,KAAK,CAACO,OAAN,YAAyBZ,aAAzB,GAAyCK,KAAK,CAACO,OAA/C,GAAyD,IAAIZ,aAAJ,CAAkB,KAAKI,MAAvB,EAA+BC,KAAK,CAACO,OAArC,CAAxE;AAIA,SAAKC,IAAL,GAAY,KAAKL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ACA,WAAO,IAAP;AACD;;AAEDD,EAAAA,OAAO,CAACkB,OAAD,EAEJ;AACD,WAAO,KAAKC,QAAL,CAAc;AAACC,MAAAA,MAAM,EAAEF,OAAO,CAACnB;AAAjB,KAAd,CAAP;AACD;;AAGDoB,EAAAA,QAAQ,CAACD,OAAD,EAcC;AACP,UAAM;AACJE,MAAAA,MADI;AAEJhB,MAAAA,KAAK,GAAGc,OAAO,CAACE,MAAR,CAAehB,KAFnB;AAGJC,MAAAA,MAAM,GAAGa,OAAO,CAACE,MAAR,CAAef,MAHpB;AAIJI,MAAAA,KAAK,GAAG,CAJJ;AAKJY,MAAAA,OAAO,GAAG,CALN;AAMJC,MAAAA,OAAO,GAAG,CANN;AAOJC,MAAAA,QAAQ,GAAG,CAPP;AAQJC,MAAAA,CAAC,GAAG,CARA;AASJC,MAAAA,CAAC,GAAG,CATA;AAUJC,MAAAA,CAAC,GAAG,CAVA;AAWJC,MAAAA,MAAM,GAAG,KAXL;AAYJC,MAAAA,UAAU,GAAG,MAZT;AAaJC,MAAAA,kBAAkB,GAAG;AAbjB,QAcFX,OAdJ;AAkBA,SAAKzB,MAAL,CAAYI,MAAZ,CAAmBiC,KAAnB,CAAyBC,0BAAzB,CAEE;AACEX,MAAAA,MADF;AAEEY,MAAAA,MAAM,EAAE,CAACX,OAAD,EAAUC,OAAV;AAFV,KAFF,EAOE;AACEW,MAAAA,OAAO,EAAE,KAAKpC,MADhB;AAEEmC,MAAAA,MAAM,EAAE,CAACR,CAAD,EAAIC,CAAJ,EAAOC,CAAP,CAFV;AAGEH,MAAAA,QAHF;AAIEI,MAAAA,MAJF;AAKEC,MAAAA,UALF;AAMEC,MAAAA;AANF,KAPF,EAgBE,CACEzB,KADF,EAEEC,MAFF,EAGEI,KAHF,CAhBF;AAsBA,WAAO,IAAP;AACD;;AAjJgD","sourcesContent":["// luma.gl, MIT license\nimport {Texture, TextureProps, Sampler, SamplerProps} from '@luma.gl/api';\nimport {getWebGPUTextureFormat} from '../helpers/convert-texture-format';\nimport type WebGPUDevice from '../webgpu-device';\nimport WebGPUSampler from './webgpu-sampler';\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\nexport default class WebGPUTexture extends Texture {\n readonly device: WebGPUDevice;\n readonly handle: GPUTexture;\n readonly view: GPUTextureView;\n sampler: WebGPUSampler;\n\n // static async createFromImageURL(src, usage = 0) {\n // const img = document.createElement('img');\n // img.src = src;\n // await img.decode();\n // return WebGPUTexture(img, usage);\n // }\n\n constructor(device: WebGPUDevice, props: TextureProps) {\n super(device, props);\n\n if (typeof this.props.format === 'number') {\n throw new Error('number format');\n }\n\n this.device = device;\n this.handle = this.props.handle || this.createHandle();\n\n if (this.props.data) {\n this.setData({data: this.props.data} );\n }\n\n // Create a default sampler. This mimics the WebGL1 API where sampler props are stored on the texture\n // this.setSampler(props.sampler);\n this.sampler = props.sampler instanceof WebGPUSampler ? props.sampler : new WebGPUSampler(this.device, props.sampler);\n\n // TODO - To support texture arrays we need to create custom views...\n // But we are not ready to expose TextureViews to the public API.\n this.view = this.handle.createView({\n // format: this.props.format,\n // dimension: this.props.dimension,\n // aspect = \"all\";\n // baseMipLevel: 0;\n // mipLevelCount;\n // baseArrayLayer = 0;\n // arrayLayerCount;\n });\n }\n\n protected createHandle(): GPUTexture {\n if (typeof this.props.format === 'number') {\n throw new Error('number format');\n }\n\n // Deduce size from data - TODO this is a hack\n // @ts-expect-error\n const width = this.props.width || this.props.data?.width || 1;\n // @ts-expect-error\n const height = this.props.height || this.props.data?.height || 1;\n\n return this.device.handle.createTexture({\n size: {\n width,\n height,\n depthOrArrayLayers: this.props.depth\n },\n dimension: BASE_DIMENSIONS[this.props.dimension],\n format: getWebGPUTextureFormat(this.props.format),\n usage: this.props.usage,\n mipLevelCount: this.props.mipLevels,\n sampleCount: this.props.samples\n });\n }\n\n override destroy(): void {\n this.handle.destroy();\n }\n\n /**\n * Set default sampler\n * Accept a sampler instance or set of props;\n */\n setSampler(sampler: Sampler | SamplerProps): this {\n this.sampler = sampler instanceof WebGPUSampler ? sampler : new WebGPUSampler(this.device, sampler);\n return this;\n }\n\n setData(options: {\n data: any;\n }) {\n return this.setImage({source: options.data});\n }\n\n /** Set image */\n setImage(options: {\n source: ImageBitmap | HTMLCanvasElement | OffscreenCanvas;\n width?: number;\n height?: number;\n depth?: number;\n sourceX?: number;\n sourceY?: number;\n mipLevel?: number;\n x?: number;\n y?: number;\n z?: number;\n aspect?: 'all' | 'stencil-only' | 'depth-only';\n colorSpace?: 'srgb';\n premultipliedAlpha?: boolean;\n }): this {\n const {\n source,\n width = options.source.width,\n height = options.source.height,\n depth = 1,\n sourceX = 0,\n sourceY = 0,\n mipLevel = 0,\n x = 0,\n y = 0,\n z = 0,\n aspect = 'all',\n colorSpace = 'srgb',\n premultipliedAlpha = false\n } = options;\n\n // TODO - max out width\n\n this.device.handle.queue.copyExternalImageToTexture(\n // source: GPUImageCopyExternalImage\n {\n source,\n origin: [sourceX, sourceY]\n },\n // destination: GPUImageCopyTextureTagged\n {\n texture: this.handle,\n origin: [x, y, z],\n mipLevel,\n aspect,\n colorSpace,\n premultipliedAlpha\n },\n // copySize: GPUExtent3D\n [\n width,\n height,\n depth\n ]\n );\n return this;\n }\n\n /*\n async readPixels() {\n const readbackBuffer = device.createBuffer({\n usage: Buffer.COPY_DST | Buffer.MAP_READ,\n size: 4 * textureWidth * textureHeight,\n });\n\n // Copy data from the texture to the buffer.\n const encoder = device.createCommandEncoder();\n encoder.copyTextureToBuffer(\n { texture },\n { buffer, rowPitch: textureWidth * 4 },\n [textureWidth, textureHeight],\n );\n device.submit([encoder.finish()]);\n\n // Get the data on the CPU.\n await buffer.mapAsync(GPUMapMode.READ);\n saveScreenshot(buffer.getMappedRange());\n buffer.unmap();\n }\n\n setImageData(imageData, usage): this {\n let data = null;\n\n const bytesPerRow = Math.ceil((img.width * 4) / 256) * 256;\n if (bytesPerRow == img.width * 4) {\n data = imageData.data;\n } else {\n data = new Uint8Array(bytesPerRow * img.height);\n let imagePixelIndex = 0;\n for (let y = 0; y < img.height; ++y) {\n for (let x = 0; x < img.width; ++x) {\n const i = x * 4 + y * bytesPerRow;\n data[i] = imageData.data[imagePixelIndex];\n data[i + 1] = imageData.data[imagePixelIndex + 1];\n data[i + 2] = imageData.data[imagePixelIndex + 2];\n data[i + 3] = imageData.data[imagePixelIndex + 3];\n imagePixelIndex += 4;\n }\n }\n }\n return this;\n }\n\n setData(data): this {\n const textureDataBuffer = this.device.handle.createBuffer({\n size: data.byteLength,\n usage: Buffer.COPY_DST | Buffer.COPY_SRC,\n mappedAtCreation: true\n });\n new Uint8Array(textureDataBuffer.getMappedRange()).set(data);\n textureDataBuffer.unmap();\n\n this.setBuffer(textureDataBuffer);\n\n textureDataBuffer.destroy();\n return this;\n }\n\n setBuffer(textureDataBuffer, {bytesPerRow}): this {\n const commandEncoder = this.device.handle.createCommandEncoder();\n commandEncoder.copyBufferToTexture(\n {\n buffer: textureDataBuffer,\n bytesPerRow\n },\n {\n texture: this.handle\n },\n {\n width,\n height,\n depth\n }\n );\n\n this.device.handle.defaultQueue.submit([commandEncoder.finish()]);\n return this;\n }\n */\n}\n"],"file":"webgpu-texture.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/adapter/webgpu-canvas-context.ts"],"names":["CanvasContext","log","getWebGPUTextureFormat","WEBGPUFramebuffer","WebGPUCanvasContext","constructor","device","adapter","props","width","height","_setAutoCreatedCanvasId","id","gpuCanvasContext","canvas","getContext","format","getPreferredFormat","destroy","unconfigure","getCurrentFramebuffer","update","currentColorAttachment","createTexture","handle","getCurrentTexture","_createDepthStencilAttachment","colorAttachments","depthStencilAttachment","getPixelSize","sizeChanged","configure","size","colorSpace","compositingAlphaMode","resize","options","depthStencilFormat","usage","GPUTextureUsage","RENDER_ATTACHMENT"],"mappings":";AAC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0C;AAItDC,QAAAA,MAAM,EAAE,KAAKA,MAJyC;AAKtD4B,QAAAA,KAAK,EAAEC,eAAe,CAACC;AAL+B,OAA1B,CAA9B;AAOD;;AACD,WAAO,KAAKZ,sBAAZ;AACD;;AA9F4D","sourcesContent":["import type {Texture, TextureFormat, CanvasContextProps} from '@luma.gl/api';\nimport {CanvasContext, log} from '@luma.gl/api';\nimport {getWebGPUTextureFormat} from './helpers/convert-texture-format';\nimport WebGPUDevice from './webgpu-device';\nimport WEBGPUFramebuffer from './resources/webgpu-framebuffer';\n\n/** \n * Holds a WebGPU Canvas Context which handles resizing etc \n */\nexport default class WebGPUCanvasContext extends CanvasContext {\n readonly device: WebGPUDevice;\n readonly gpuCanvasContext: GPUCanvasContext;\n readonly format: TextureFormat;\n depthStencilFormat: TextureFormat = 'depth24plus';\n sampleCount: number = 1;\n\n private depthStencilAttachment: Texture | null = null;\n\n constructor(device: WebGPUDevice, adapter: GPUAdapter, props: CanvasContextProps) {\n super(props);\n this.device = device;\n // TODO - hack to trigger resize?\n this.width = -1;\n this.height = -1;\n \n this._setAutoCreatedCanvasId(`${this.device.id}-canvas`);\n this.gpuCanvasContext = this.canvas.getContext('webgpu') as GPUCanvasContext;\n this.format = this.gpuCanvasContext.getPreferredFormat(adapter);\n }\n\n destroy(): void {\n this.gpuCanvasContext.unconfigure();\n }\n\n /** Update framebuffer with properly resized \"swap chain\" texture views */\n getCurrentFramebuffer(): WEBGPUFramebuffer {\n // Ensure the canvas context size is updated\n this.update();\n\n // Wrap the current canvas context texture in a luma.gl texture \n const currentColorAttachment = this.device.createTexture({\n id: 'default-render-target',\n handle: this.gpuCanvasContext.getCurrentTexture(),\n format: this.format,\n width: this.width,\n height: this.height\n });\n\n // Resize the depth stencil attachment\n this._createDepthStencilAttachment();\n\n return new WEBGPUFramebuffer(this.device, {\n colorAttachments: [currentColorAttachment],\n depthStencilAttachment: this.depthStencilAttachment\n });\n }\n\n /** Resizes and updates render targets if necessary */\n update() {\n const [width, height] = this.getPixelSize();\n\n const sizeChanged = width !== this.width || height !== this.height;\n\n if (sizeChanged) {\n this.width = width;\n this.height = height;\n\n if (this.depthStencilAttachment) {\n this.depthStencilAttachment.destroy();\n this.depthStencilAttachment = null;\n }\n\n // Reconfigure the canvas size.\n // https://www.w3.org/TR/webgpu/#canvas-configuration\n this.gpuCanvasContext.configure({\n device: this.device.handle,\n format: getWebGPUTextureFormat(this.format),\n size: [this.width, this.height],\n colorSpace: this.props.colorSpace,\n compositingAlphaMode: this.props.compositingAlphaMode\n });\n\n log.log(1, `Resized to ${this.width}x${this.height}px`)();\n }\n\n }\n\n resize(options?: {width?: number; height?: number; useDevicePixels?: boolean | number}): void {\n this.update();\n }\n\n /** We build render targets on demand (i.e. not when size changes but when about to render) */\n _createDepthStencilAttachment() {\n if (!this.depthStencilAttachment) {\n this.depthStencilAttachment = this.device.createTexture({\n id: 'depth-stencil-target',\n format: this.depthStencilFormat,\n width: this.width,\n height: this.height,\n usage: GPUTextureUsage.RENDER_ATTACHMENT\n });\n }\n return this.depthStencilAttachment;\n }\n}\n"],"file":"webgpu-canvas-context.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/adapter/webgpu-device.ts"],"names":["Device","CanvasContext","log","uid","WebGPUBuffer","WebGPUTexture","WebGPUExternalTexture","WebGPUSampler","WebGPUShader","WebGPURenderPipeline","WebGPUComputePipeline","WebGPURenderPass","WebGPUComputePass","WebGPUCanvasContext","WebGPUDevice","isSupported","Boolean","navigator","gpu","create","props","Error","groupCollapsed","adapter","requestAdapter","powerPreference","probe","gpuDevice","requestDevice","requiredFeatures","features","canvas","pageLoaded","device","info","table","groupEnd","constructor","id","handle","_info","type","vendor","name","renderer","version","shadingLanguages","shadingLanguageVersions","glsl","wgsl","vendorMasked","rendererMasked","lost","Promise","resolve","lostInfo","_isLost","reason","message","canvasContext","_getFeatures","destroy","limits","isTextureFormatSupported","format","includes","isTextureFormatFilterable","isTextureFormatRenderable","isLost","_createBuffer","_createTexture","createExternalTexture","createShader","createSampler","createRenderPipeline","createFramebuffer","createComputePipeline","beginRenderPass","commandEncoder","createCommandEncoder","beginComputePass","createCanvasContext","getDefaultRenderPass","renderPass","framebuffer","getCurrentFramebuffer","submit","endPass","commandBuffer","finish","queue","Set","has","delete","add"],"mappings":";AAoBA,SAAQA,MAAR,EAAgBC,aAAhB,EAA+BC,GAA/B,EAAoCC,GAApC,QAA8C,cAA9C;AACA,OAAOC,YAAP,MAAyB,2BAAzB;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,qBAAP,MAAkC,qCAAlC;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,YAAP,MAAyB,2BAAzB;AACA,OAAOC,oBAAP,MAAiC,oCAAjC;AAEA,OAAOC,qBAAP,MAAkC,qCAAlC;AACA,OAAOC,gBAAP,MAA6B,gCAA7B;AACA,OAAOC,iBAAP,MAA8B,iCAA9B;AAEA,OAAOC,mBAAP,MAAgC,yBAAhC;AAIA,eAAe,MAAMC,YAAN,SAA2Bd,MAA3B,CAAkC;AAe7B,SAAXe,WAAW,GAAY;AAC5B,WAAOC,OAAO,CAAC,OAAOC,SAAP,KAAqB,WAArB,IAAoCA,SAAS,CAACC,GAA/C,CAAd;AACD;;AAEkB,eAANC,MAAM,CAACC,KAAD,EAA4C;AAC7D,QAAI,CAACH,SAAS,CAACC,GAAf,EAAoB;AAClB,YAAM,IAAIG,KAAJ,CACJ,8FADI,CAAN;AAGD;;AACDnB,IAAAA,GAAG,CAACoB,cAAJ,CAAmB,CAAnB,EAAsB,sBAAtB;AACA,UAAMC,OAAO,GAAG,MAAMN,SAAS,CAACC,GAAV,CAAcM,cAAd,CAA6B;AACjDC,MAAAA,eAAe,EAAE;AADgC,KAA7B,CAAtB;;AAIA,QAAI,CAACF,OAAL,EAAc;AACZ,YAAM,IAAIF,KAAJ,CAAU,kCAAV,CAAN;AACD;;AAEDnB,IAAAA,GAAG,CAACwB,KAAJ,C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{\n DeviceProps,\n DeviceInfo,\n DeviceLimits,\n DeviceFeature,\n CanvasContextProps,\n BufferProps,\n SamplerProps,\n ShaderProps,\n TextureProps,\n TextureFormat,\n ExternalTextureProps,\n FramebufferProps,\n RenderPipelineProps,\n ComputePipelineProps,\n RenderPassProps,\n ComputePassProps\n} from '@luma.gl/api';\nimport {Device, CanvasContext, log, uid} from '@luma.gl/api';\nimport WebGPUBuffer from './resources/webgpu-buffer';\nimport WebGPUTexture from './resources/webgpu-texture';\nimport WebGPUExternalTexture from './resources/webgpu-external-texture';\nimport WebGPUSampler from './resources/webgpu-sampler';\nimport WebGPUShader from './resources/webgpu-shader';\nimport WebGPURenderPipeline from './resources/webgpu-render-pipeline';\nimport WebGPUFramebuffer from './resources/webgpu-framebuffer';\nimport WebGPUComputePipeline from './resources/webgpu-compute-pipeline';\nimport WebGPURenderPass from './resources/webgpu-render-pass';\nimport WebGPUComputePass from './resources/webgpu-compute-pass';\n\nimport WebGPUCanvasContext from './webgpu-canvas-context';\n// import {loadGlslangModule} from '../glsl/glslang';\n\n/** WebGPU Device implementation */\nexport default class WebGPUDevice extends Device {\n readonly handle: GPUDevice;\n readonly adapter: GPUAdapter;\n readonly lost: Promise<{reason: 'destroyed'; message: string}>;\n canvasContext: WebGPUCanvasContext | null = null;\n\n commandEncoder: GPUCommandEncoder | null = null;\n renderPass: WebGPURenderPass | null = null;\n\n private _info: DeviceInfo;\n private _isLost: boolean = false;\n\n static type: string = 'webgpu';\n\n /** Check if WebGPU is available */\n static isSupported(): boolean {\n return Boolean(typeof navigator !== 'undefined' && navigator.gpu);\n }\n\n static async create(props: DeviceProps): Promise<WebGPUDevice> {\n if (!navigator.gpu) {\n throw new Error(\n 'WebGPU not available. Open in Chrome Canary and turn on chrome://flags/#enable-unsafe-webgpu'\n );\n }\n log.groupCollapsed(1, 'WebGPUDevice created')();\n const adapter = await navigator.gpu.requestAdapter({\n powerPreference: 'high-performance'\n // forceSoftware: false\n });\n if (!adapter) {\n throw new Error('Failed to request WebGPU adapter');\n }\n\n log.probe(1, 'Adapter available')();\n\n const gpuDevice = await adapter.requestDevice({\n requiredFeatures: adapter.features as ReadonlySet<GPUFeatureName>\n // TODO ensure we obtain best limits\n // requiredLimits: adapter.limits\n });\n log.probe(1, 'GPUDevice available')();\n\n if (typeof props.canvas === 'string') {\n await CanvasContext.pageLoaded;\n log.probe(1, 'DOM is loaded')();\n }\n\n const device = new WebGPUDevice(gpuDevice, adapter, props);\n log.probe(1, 'Device created', device.info)();\n log.table(1, device.info)();\n log.groupEnd(1)();\n return device;\n }\n\n constructor(device: GPUDevice, adapter: GPUAdapter, props: DeviceProps) {\n super({...props, id: props.id || uid('webgpu-device')});\n this.handle = device;\n this.adapter = adapter;\n\n this._info = {\n type: 'webgpu',\n vendor: this.adapter.name,\n renderer: '',\n version: '',\n gpu: 'unknown', // 'nvidia' | 'amd' | 'intel' | 'apple' | 'unknown',\n shadingLanguages: ['glsl', 'wgsl'],\n shadingLanguageVersions: {\n glsl: '450',\n wgsl: '100'\n },\n vendorMasked: '',\n rendererMasked: ''\n };\n\n // \"Context\" loss handling\n this.lost = new Promise<{reason: 'destroyed'; message: string}>(async (resolve) => {\n const lostInfo = await this.handle.lost;\n this._isLost = true;\n resolve({reason: 'destroyed', message: lostInfo.message});\n });\n\n // Note: WebGPU devices can be created without a canvas, for compute shader purposes\n if (props.canvas) {\n this.canvasContext = new WebGPUCanvasContext(this, this.adapter, {canvas: props.canvas});\n }\n\n this.features = this._getFeatures();\n }\n\n // TODO\n // Load the glslang module now so that it is available synchronously when compiling shaders\n // const {glsl = true} = props;\n // this.glslang = glsl && await loadGlslangModule();\n\n destroy(): void {\n this.handle.destroy();\n }\n\n get info(): DeviceInfo {\n return this._info;\n }\n\n features: Set<DeviceFeature>;\n\n get limits(): DeviceLimits {\n return this.handle.limits;\n }\n\n isTextureFormatSupported(format: TextureFormat): boolean {\n return !format.includes('webgl');\n }\n\n /** @todo implement proper check? */\n isTextureFormatFilterable(format: TextureFormat): boolean {\n return this.isTextureFormatSupported(format);\n }\n\n /** @todo implement proper check? */\n isTextureFormatRenderable(format: TextureFormat): boolean {\n return this.isTextureFormatSupported(format);\n }\n\n get isLost(): boolean {\n return this._isLost;\n }\n\n _createBuffer(props: BufferProps): WebGPUBuffer {\n return new WebGPUBuffer(this, props);\n }\n\n _createTexture(props: TextureProps): WebGPUTexture {\n return new WebGPUTexture(this, props);\n }\n\n createExternalTexture(props: ExternalTextureProps): WebGPUExternalTexture {\n return new WebGPUExternalTexture(this, props);\n }\n\n createShader(props: ShaderProps): WebGPUShader {\n return new WebGPUShader(this, props);\n }\n\n createSampler(props: SamplerProps): WebGPUSampler {\n return new WebGPUSampler(this, props);\n }\n\n createRenderPipeline(props: RenderPipelineProps): WebGPURenderPipeline {\n return new WebGPURenderPipeline(this, props);\n }\n\n createFramebuffer(props: FramebufferProps): WebGPUFramebuffer {\n throw new Error('Not implemented');\n }\n\n createComputePipeline(props: ComputePipelineProps): WebGPUComputePipeline {\n return new WebGPUComputePipeline(this, props);\n }\n\n // WebGPU specifics\n\n /**\n * Allows a render pass to begin against a canvas context\n * @todo need to support a \"Framebuffer\" equivalent (aka preconfigured RenderPassDescriptors?).\n */\n beginRenderPass(props: RenderPassProps): WebGPURenderPass {\n this.commandEncoder = this.commandEncoder || this.handle.createCommandEncoder();\n return new WebGPURenderPass(this, props);\n }\n\n beginComputePass(props: ComputePassProps): WebGPUComputePass {\n this.commandEncoder = this.commandEncoder || this.handle.createCommandEncoder();\n return new WebGPUComputePass(this, props);\n }\n\n createCanvasContext(props: CanvasContextProps): WebGPUCanvasContext {\n return new WebGPUCanvasContext(this, this.adapter, props);\n }\n\n /**\n * Gets default renderpass encoder.\n * Creates a new encoder against default canvasContext if not already created\n * @note Called internally by Model.\n */\n getDefaultRenderPass(): WebGPURenderPass {\n this.renderPass =\n this.renderPass ||\n this.beginRenderPass({\n framebuffer: this.canvasContext?.getCurrentFramebuffer()\n });\n return this.renderPass;\n }\n\n submit(): void {\n this.renderPass?.endPass();\n const commandBuffer = this.commandEncoder?.finish();\n if (commandBuffer) {\n this.handle.queue.submit([commandBuffer]);\n }\n this.commandEncoder = null;\n this.renderPass = null;\n }\n\n _getFeatures() {\n // WebGPU Features\n const features = new Set<DeviceFeature>(this.handle.features as Set<DeviceFeature>);\n\n // Fixups for pre-standard names: https://github.com/webgpu-native/webgpu-headers/issues/133\n // @ts-expect-error Chrome Canary v99\n if (features.has('depth-clamping')) {\n // @ts-expect-error Chrome Canary v99\n features.delete('depth-clamping');\n features.add('depth-clip-control');\n }\n\n // Add subsets\n if (features.has('texture-compression-bc')) {\n features.add('texture-compression-bc5-webgl');\n }\n\n features.add('webgpu');\n\n features.add('timer-query-webgl');\n\n // WEBGL1 SUPPORT\n features.add('vertex-array-object-webgl1');\n features.add('instanced-rendering-webgl1');\n features.add('multiple-render-targets-webgl1');\n features.add('index-uint32-webgl1');\n features.add('blend-minmax-webgl1');\n features.add('texture-blend-float-webgl1');\n\n // TEXTURES, RENDERBUFFERS\n features.add('texture-formats-srgb-webgl1');\n\n // TEXTURES\n features.add('texture-formats-depth-webgl1');\n features.add('texture-formats-float32-webgl1');\n features.add('texture-formats-float16-webgl1');\n\n features.add('texture-filter-linear-float32-webgl');\n features.add('texture-filter-linear-float16-webgl');\n features.add('texture-filter-anisotropic-webgl');\n\n // FRAMEBUFFERS, TEXTURES AND RENDERBUFFERS\n features.add('texture-renderable-rgba32float-webgl');\n features.add('texture-renderable-float32-webgl');\n features.add('texture-renderable-float16-webgl');\n\n // GLSL extensions\n features.add('glsl-frag-data');\n features.add('glsl-frag-depth');\n features.add('glsl-derivatives');\n features.add('glsl-texture-lod');\n\n return features;\n }\n}\n"],"file":"webgpu-device.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[],"file":"webgpu-types.js"}
|
package/dist/bundle.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/bundle.ts"],"names":["moduleExports","require","globalThis","luma","module","exports","Object","assign"],"mappings":"AACA,MAAMA,aAAa,GAAGC,OAAO,CAAC,SAAD,CAA7B;;AACAC,UAAU,CAACC,IAAX,GAAkBD,UAAU,CAACC,IAAX,IAAmB,EAArC;AACAC,MAAM,CAACC,OAAP,GAAiBC,MAAM,CAACC,MAAP,CAAcL,UAAU,CAACC,IAAzB,EAA+BH,aAA/B,CAAjB","sourcesContent":["// @ts-nocheck\nconst moduleExports = require('./index');\nglobalThis.luma = globalThis.luma || {};\nmodule.exports = Object.assign(globalThis.luma, moduleExports);\n"],"file":"bundle.js"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/glsl/glsllang.ts"],"names":["glslang","loadGlslangModule","glslangModule","default"],"mappings":"AAGA,IAAIA,OAAJ;AAGA,OAAO,eAAeC,iBAAf,GAAmC;AACxC,MAAI,CAACD,OAAL,EAAc;AAEZ,UAAME,aAAa,GAAG,MAAM,OAAiC,oEAAjC,CAA5B;AACAF,IAAAA,OAAO,GAAG,MAAME,aAAa,CAACC,OAAd,EAAhB;AACD;;AACD,SAAOH,OAAP;AACD","sourcesContent":["// Inspired by webgpu samples at https://github.com/austinEng/webgpu-samples/blob/master/src/glslang.ts\n// under BSD 3-clause license\n\nlet glslang: unknown;\n\n/** Dynamically load the GLSL compiler */\nexport async function loadGlslangModule() {\n if (!glslang) {\n // @ts-ignore\n const glslangModule = await import(/* webpackIgnore: true */ 'https://unpkg.com/@webgpu/glslang@0.0.15/dist/web-devel/glslang.js');\n glslang = await glslangModule.default();\n }\n return glslang;\n}\n"],"file":"glsllang.js"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"names":["default","WebGPUDevice","WebGPUBuffer","WebGPUTexture","WebGPUSampler","WebGPUShader"],"mappings":"AAEA,OAAO,cAAP;AACA,OAAO,QAAP;AAGA,SAAQA,OAAO,IAAIC,YAAnB,QAAsC,yBAAtC;AAGA,SAAQD,OAAO,IAAIE,YAAnB,QAAsC,mCAAtC;AACA,SAAQF,OAAO,IAAIG,aAAnB,QAAuC,oCAAvC;AACA,SAAQH,OAAO,IAAII,aAAnB,QAAuC,oCAAvC;AACA,SAAQJ,OAAO,IAAIK,YAAnB,QAAsC,mCAAtC","sourcesContent":["\n// Initialize any global state\nimport '@luma.gl/api';\nimport './init'\n\n// WEBGPU ADAPTER\nexport {default as WebGPUDevice} from './adapter/webgpu-device';\n\n// WEBGPU CLASSES (typically not accessed directly)\nexport {default as WebGPUBuffer} from './adapter/resources/webgpu-buffer';\nexport {default as WebGPUTexture} from './adapter/resources/webgpu-texture';\nexport {default as WebGPUSampler} from './adapter/resources/webgpu-sampler';\nexport {default as WebGPUShader} from './adapter/resources/webgpu-shader';\n"],"file":"index.js"}
|
package/dist/init.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/init.ts"],"names":["luma","WebGPUDevice","registerDevices"],"mappings":"AAAA,SAAQA,IAAR,QAAmB,cAAnB;AACA,OAAOC,YAAP,MAAyB,yBAAzB;AAEAD,IAAI,CAACE,eAAL,CAAqB,CAACD,YAAD,CAArB","sourcesContent":["import {luma} from '@luma.gl/api';\nimport WebGPUDevice from './adapter/webgpu-device';\n\nluma.registerDevices([WebGPUDevice]);\n"],"file":"init.js"}
|