@carbonenginejs/runtime-resource 0.9.2 → 0.11.0
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/NOTICE +3 -2
- package/README.md +47 -6
- package/dist/CjsMotherLode.js +88 -88
- package/dist/CjsMotherLode.js.map +1 -1
- package/dist/CjsResMan.js +717 -228
- package/dist/CjsResMan.js.map +1 -1
- package/dist/CjsResManFetchProvider.js +94 -0
- package/dist/CjsResManFetchProvider.js.map +1 -0
- package/dist/{CjsResManQueue.js → CjsResManWorkQueue.js} +112 -25
- package/dist/CjsResManWorkQueue.js.map +1 -0
- package/dist/format/CjsBlueReader.js +89 -0
- package/dist/format/CjsBlueReader.js.map +1 -1
- package/dist/format/CjsFormat.js +42 -16
- package/dist/format/CjsFormat.js.map +1 -1
- package/dist/format/CjsReader.js +4 -0
- package/dist/format/CjsReader.js.map +1 -1
- package/dist/format/CjsResourceProbe.js +2 -0
- package/dist/format/CjsResourceProbe.js.map +1 -1
- package/dist/format/effect/effectPermutationGraph.js +257 -0
- package/dist/format/effect/effectPermutationGraph.js.map +1 -0
- package/dist/format/effect/effectReflectionPackage.js +636 -0
- package/dist/format/effect/effectReflectionPackage.js.map +1 -0
- package/dist/format/effect/sha256.js +114 -0
- package/dist/format/effect/sha256.js.map +1 -0
- package/dist/format/payloadContract.js +20 -0
- package/dist/format/payloadContract.js.map +1 -1
- package/dist/formats/black/CjsBlackFormat.js +15 -1
- package/dist/formats/black/CjsBlackFormat.js.map +1 -1
- package/dist/formats/black/core/CjsBlackBinaryReader.js +103 -0
- package/dist/formats/black/core/CjsBlackBinaryReader.js.map +1 -1
- package/dist/formats/black/core/CjsBlackPropertyReaders.js +61 -0
- package/dist/formats/black/core/CjsBlackPropertyReaders.js.map +1 -1
- package/dist/formats/black/core/CjsBlackReader.js +125 -0
- package/dist/formats/black/core/CjsBlackReader.js.map +1 -1
- package/dist/formats/black/core/CjsBlackSchemaRegistry.js +103 -0
- package/dist/formats/black/core/CjsBlackSchemaRegistry.js.map +1 -1
- package/dist/formats/black/core/helpers.js +17 -0
- package/dist/formats/black/core/helpers.js.map +1 -1
- package/dist/formats/bnk/CjsBnkFormat.js +8 -0
- package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
- package/dist/formats/bnk/core/helpers.js +20 -0
- package/dist/formats/bnk/core/helpers.js.map +1 -1
- package/dist/formats/bnk/core/musicNodes.js +40 -3
- package/dist/formats/bnk/core/musicNodes.js.map +1 -1
- package/dist/formats/bnk/core/soundbanksInfo.js +2 -0
- package/dist/formats/bnk/core/soundbanksInfo.js.map +1 -1
- package/dist/formats/cmf/core/binary.js +71 -0
- package/dist/formats/cmf/core/binary.js.map +1 -1
- package/dist/formats/cmf/core/buffers.js +4 -0
- package/dist/formats/cmf/core/buffers.js.map +1 -1
- package/dist/formats/cmf/core/helpers.js +31 -0
- package/dist/formats/cmf/core/helpers.js.map +1 -1
- package/dist/formats/cmf/core/schema.js +10 -0
- package/dist/formats/cmf/core/schema.js.map +1 -1
- package/dist/formats/cmf/core/shared.js +9 -0
- package/dist/formats/cmf/core/shared.js.map +1 -1
- package/dist/formats/cmf/core/writer.js +54 -0
- package/dist/formats/cmf/core/writer.js.map +1 -1
- package/dist/formats/dds/core/bc6h.js +10 -0
- package/dist/formats/dds/core/bc6h.js.map +1 -1
- package/dist/formats/dds/core/bc7.js +16 -0
- package/dist/formats/dds/core/bc7.js.map +1 -1
- package/dist/formats/dds/core/helpers.js +47 -0
- package/dist/formats/dds/core/helpers.js.map +1 -1
- package/dist/formats/dxbc/CjsDxbcFormat.js +142 -0
- package/dist/formats/dxbc/CjsDxbcFormat.js.map +1 -0
- package/dist/formats/dxbc/core/DxbcReader.js +266 -0
- package/dist/formats/dxbc/core/DxbcReader.js.map +1 -0
- package/dist/formats/dxbc/core/container.js +169 -0
- package/dist/formats/dxbc/core/container.js.map +1 -0
- package/dist/formats/dxbc/core/decoder.js +789 -0
- package/dist/formats/dxbc/core/decoder.js.map +1 -0
- package/dist/formats/dxbc/core/errors.js +19 -0
- package/dist/formats/dxbc/core/errors.js.map +1 -0
- package/dist/formats/dxbc/core/helpers.js +220 -0
- package/dist/formats/dxbc/core/helpers.js.map +1 -0
- package/dist/formats/dxbc/core/opcodes.js +45 -0
- package/dist/formats/dxbc/core/opcodes.js.map +1 -0
- package/dist/formats/dxbc/core/program.js +91 -0
- package/dist/formats/dxbc/core/program.js.map +1 -0
- package/dist/formats/dxbc/core/signature.js +172 -0
- package/dist/formats/dxbc/core/signature.js.map +1 -0
- package/dist/formats/dxbc/index.js +2 -0
- package/dist/formats/dxbc/index.js.map +1 -0
- package/dist/formats/fbx/core/helpers.js +21 -0
- package/dist/formats/fbx/core/helpers.js.map +1 -1
- package/dist/formats/flac/CjsFlacFormat.js +49 -0
- package/dist/formats/flac/CjsFlacFormat.js.map +1 -1
- package/dist/formats/flac/core/helpers.js +20 -0
- package/dist/formats/flac/core/helpers.js.map +1 -1
- package/dist/formats/gif/CjsGifFormat.js +49 -0
- package/dist/formats/gif/CjsGifFormat.js.map +1 -1
- package/dist/formats/gif/core/helpers.js +20 -0
- package/dist/formats/gif/core/helpers.js.map +1 -1
- package/dist/formats/gltf/core/helpers.js +15 -0
- package/dist/formats/gltf/core/helpers.js.map +1 -1
- package/dist/formats/gltf/core/parser.js +13 -0
- package/dist/formats/gltf/core/parser.js.map +1 -1
- package/dist/formats/gltf/core/targets.js +10 -0
- package/dist/formats/gltf/core/targets.js.map +1 -1
- package/dist/formats/gr2/core/bitknit2.js +2 -0
- package/dist/formats/gr2/core/bitknit2.js.map +1 -1
- package/dist/formats/gr2/core/helpers.js +20 -0
- package/dist/formats/gr2/core/helpers.js.map +1 -1
- package/dist/formats/gr2/core/targets.js +10 -0
- package/dist/formats/gr2/core/targets.js.map +1 -1
- package/dist/formats/hlsl/CjsHlslFormat.js +254 -0
- package/dist/formats/hlsl/CjsHlslFormat.js.map +1 -0
- package/dist/formats/hlsl/core/HlslBinaryUtils.js +15 -0
- package/dist/formats/hlsl/core/HlslBinaryUtils.js.map +1 -0
- package/dist/formats/hlsl/core/HlslEffectReadError.js +19 -0
- package/dist/formats/hlsl/core/HlslEffectReadError.js.map +1 -0
- package/dist/formats/hlsl/core/HlslEffectStateManager.js +130 -0
- package/dist/formats/hlsl/core/HlslEffectStateManager.js.map +1 -0
- package/dist/formats/hlsl/core/HlslReader.js +266 -0
- package/dist/formats/hlsl/core/HlslReader.js.map +1 -0
- package/dist/formats/hlsl/core/HlslRenderStateSetup.js +37 -0
- package/dist/formats/hlsl/core/HlslRenderStateSetup.js.map +1 -0
- package/dist/formats/hlsl/core/HlslResourceSetDescription.js +94 -0
- package/dist/formats/hlsl/core/HlslResourceSetDescription.js.map +1 -0
- package/dist/formats/hlsl/core/HlslShaderBytecode.js +44 -0
- package/dist/formats/hlsl/core/HlslShaderBytecode.js.map +1 -0
- package/dist/formats/hlsl/core/analysis.js +51 -0
- package/dist/formats/hlsl/core/analysis.js.map +1 -0
- package/dist/formats/hlsl/core/helpers.js +270 -0
- package/dist/formats/hlsl/core/helpers.js.map +1 -0
- package/dist/formats/hlsl/core/json.js +284 -0
- package/dist/formats/hlsl/core/json.js.map +1 -0
- package/dist/formats/hlsl/core/metadata.js +327 -0
- package/dist/formats/hlsl/core/metadata.js.map +1 -0
- package/dist/formats/hlsl/core/portableReflection.js +848 -0
- package/dist/formats/hlsl/core/portableReflection.js.map +1 -0
- package/dist/formats/hlsl/core/render-states.js +280 -0
- package/dist/formats/hlsl/core/render-states.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/HlslRenderContextEnum.js +43 -0
- package/dist/formats/hlsl/core/tr2/HlslRenderContextEnum.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js +294 -0
- package/dist/formats/hlsl/core/tr2/resources/HlslEffectRes.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/resources/HlslShaderPermutation.js +33 -0
- package/dist/formats/hlsl/core/tr2/resources/HlslShaderPermutation.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js +416 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectBindingManifest.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectConstant.js +40 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectConstant.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js +742 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectDescription.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectLibrary.js +52 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectLibrary.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectParameterAnnotation.js +38 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectParameterAnnotation.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectResource.js +50 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectResource.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js +86 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectTechnique.js +31 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslEffectTechnique.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslPass.js +42 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslPass.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslSamplerDescription.js +55 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslSamplerDescription.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslSamplerSetup.js +29 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslSamplerSetup.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslShader.js +220 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslShader.js.map +1 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslShaderOption.js +30 -0
- package/dist/formats/hlsl/core/tr2/shader/HlslShaderOption.js.map +1 -0
- package/dist/formats/hlsl/index.js +2 -0
- package/dist/formats/hlsl/index.js.map +1 -0
- package/dist/formats/hlsl/portable.js +2 -0
- package/dist/formats/hlsl/portable.js.map +1 -0
- package/dist/formats/index.js +4 -0
- package/dist/formats/index.js.map +1 -1
- package/dist/formats/jpeg/core/helpers.js +52 -0
- package/dist/formats/jpeg/core/helpers.js.map +1 -1
- package/dist/formats/jpeg/core/jpeg.js +93 -0
- package/dist/formats/jpeg/core/jpeg.js.map +1 -1
- package/dist/formats/mp3/core/helpers.js +37 -0
- package/dist/formats/mp3/core/helpers.js.map +1 -1
- package/dist/formats/mp4/core/helpers.js +35 -0
- package/dist/formats/mp4/core/helpers.js.map +1 -1
- package/dist/formats/ogg/CjsOggFormat.js +49 -0
- package/dist/formats/ogg/CjsOggFormat.js.map +1 -1
- package/dist/formats/ogg/core/helpers.js +23 -0
- package/dist/formats/ogg/core/helpers.js.map +1 -1
- package/dist/formats/ogg/core/vorbis.js +13 -0
- package/dist/formats/ogg/core/vorbis.js.map +1 -1
- package/dist/formats/png/core/helpers.js +52 -0
- package/dist/formats/png/core/helpers.js.map +1 -1
- package/dist/formats/red/CjsRedFormat.js +2 -0
- package/dist/formats/red/CjsRedFormat.js.map +1 -1
- package/dist/formats/red/core/CjsRedReader.js +52 -0
- package/dist/formats/red/core/CjsRedReader.js.map +1 -1
- package/dist/formats/red/core/helpers.js +19 -0
- package/dist/formats/red/core/helpers.js.map +1 -1
- package/dist/formats/stl/core/stl.js +8 -0
- package/dist/formats/stl/core/stl.js.map +1 -1
- package/dist/formats/stl/core/targets.js +10 -0
- package/dist/formats/stl/core/targets.js.map +1 -1
- package/dist/formats/tga/core/helpers.js +47 -0
- package/dist/formats/tga/core/helpers.js.map +1 -1
- package/dist/formats/wav/core/helpers.js +37 -0
- package/dist/formats/wav/core/helpers.js.map +1 -1
- package/dist/formats/webgl/CjsWebglFormat.js +221 -0
- package/dist/formats/webgl/CjsWebglFormat.js.map +1 -0
- package/dist/formats/webgl/core/cewg/CewgPackage.js +339 -0
- package/dist/formats/webgl/core/cewg/CewgPackage.js.map +1 -0
- package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js +104 -0
- package/dist/formats/webgl/core/cewg/CewgPackageBuilder.js.map +1 -0
- package/dist/formats/webgl/core/cewg/binary.js +101 -0
- package/dist/formats/webgl/core/cewg/binary.js.map +1 -0
- package/dist/formats/webgl/core/cewgCompleteness.js +81 -0
- package/dist/formats/webgl/core/cewgCompleteness.js.map +1 -0
- package/dist/formats/webgl/core/effectPackage.js +789 -0
- package/dist/formats/webgl/core/effectPackage.js.map +1 -0
- package/dist/formats/webgl/core/effectPackageValidation.js +331 -0
- package/dist/formats/webgl/core/effectPackageValidation.js.map +1 -0
- package/dist/formats/webgl/core/errors.js +27 -0
- package/dist/formats/webgl/core/errors.js.map +1 -0
- package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js +2678 -0
- package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -0
- package/dist/formats/webgl/core/glsl/DxbcGlslHelpers.js +89 -0
- package/dist/formats/webgl/core/glsl/DxbcGlslHelpers.js.map +1 -0
- package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js +428 -0
- package/dist/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js.map +1 -0
- package/dist/formats/webgl/core/helpers.js +306 -0
- package/dist/formats/webgl/core/helpers.js.map +1 -0
- package/dist/formats/webgl/index.js +2 -0
- package/dist/formats/webgl/index.js.map +1 -0
- package/dist/formats/webgpu/CjsWebgpuFormat.js +376 -0
- package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js +415 -0
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackage.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js +100 -0
- package/dist/formats/webgpu/core/cewgpu/CewgpuPackageBuilder.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/binary.js +93 -0
- package/dist/formats/webgpu/core/cewgpu/binary.js.map +1 -0
- package/dist/formats/webgpu/core/cewgpu/tags.js +17 -0
- package/dist/formats/webgpu/core/cewgpu/tags.js.map +1 -0
- package/dist/formats/webgpu/core/effectAnalysis.js +82 -0
- package/dist/formats/webgpu/core/effectAnalysis.js.map +1 -0
- package/dist/formats/webgpu/core/effectBackendBodySet.js +305 -0
- package/dist/formats/webgpu/core/effectBackendBodySet.js.map +1 -0
- package/dist/formats/webgpu/core/effectPackageValidation.js +1078 -0
- package/dist/formats/webgpu/core/effectPackageValidation.js.map +1 -0
- package/dist/formats/webgpu/core/errors.js +20 -0
- package/dist/formats/webgpu/core/errors.js.map +1 -0
- package/dist/formats/webgpu/core/helpers.js +448 -0
- package/dist/formats/webgpu/core/helpers.js.map +1 -0
- package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js +223 -0
- package/dist/formats/webgpu/core/ir/analyzeRegisterValues.js.map +1 -0
- package/dist/formats/webgpu/core/ir/buildControlFlow.js +220 -0
- package/dist/formats/webgpu/core/ir/buildControlFlow.js.map +1 -0
- package/dist/formats/webgpu/core/ir/indexableTemps.js +137 -0
- package/dist/formats/webgpu/core/ir/indexableTemps.js.map +1 -0
- package/dist/formats/webgpu/core/ir/inferValueTypes.js +454 -0
- package/dist/formats/webgpu/core/ir/inferValueTypes.js.map +1 -0
- package/dist/formats/webgpu/core/ir/lowerDxbcToIr.js +494 -0
- package/dist/formats/webgpu/core/ir/lowerDxbcToIr.js.map +1 -0
- package/dist/formats/webgpu/core/ir/resolveRegisterFlow.js +177 -0
- package/dist/formats/webgpu/core/ir/resolveRegisterFlow.js.map +1 -0
- package/dist/formats/webgpu/core/ir/sourceLanes.js +61 -0
- package/dist/formats/webgpu/core/ir/sourceLanes.js.map +1 -0
- package/dist/formats/webgpu/core/packageEffect.js +300 -0
- package/dist/formats/webgpu/core/packageEffect.js.map +1 -0
- package/dist/formats/webgpu/core/packageEffectSelection.js +164 -0
- package/dist/formats/webgpu/core/packageEffectSelection.js.map +1 -0
- package/dist/formats/webgpu/core/packageMetadata.js +8 -0
- package/dist/formats/webgpu/core/packageMetadata.js.map +1 -0
- package/dist/formats/webgpu/core/schema.js +4 -0
- package/dist/formats/webgpu/core/schema.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js +275 -0
- package/dist/formats/webgpu/core/wgsl/buildResourceTransformPlan.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js +182 -0
- package/dist/formats/webgpu/core/wgsl/buildWgslBindingPlan.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/buildWgslSet.js +324 -0
- package/dist/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/emitWgsl.js +356 -0
- package/dist/formats/webgpu/core/wgsl/emitWgsl.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/hoistEscapingValues.js +77 -0
- package/dist/formats/webgpu/core/wgsl/hoistEscapingValues.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerBindingLayout.js +451 -0
- package/dist/formats/webgpu/core/wgsl/lowerBindingLayout.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js +754 -0
- package/dist/formats/webgpu/core/wgsl/lowerComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js +457 -0
- package/dist/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerFragmentProgram.js +1572 -0
- package/dist/formats/webgpu/core/wgsl/lowerFragmentProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerMergeHistogramsComputeProgram.js +659 -0
- package/dist/formats/webgpu/core/wgsl/lowerMergeHistogramsComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerParticleClearComputePrograms.js +734 -0
- package/dist/formats/webgpu/core/wgsl/lowerParticleClearComputePrograms.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerParticleEmitComputeProgram.js +583 -0
- package/dist/formats/webgpu/core/wgsl/lowerParticleEmitComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerSkinVerticesComputeProgram.js +621 -0
- package/dist/formats/webgpu/core/wgsl/lowerSkinVerticesComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerSortComputeProgram.js +824 -0
- package/dist/formats/webgpu/core/wgsl/lowerSortComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerSortInnerComputeProgram.js +697 -0
- package/dist/formats/webgpu/core/wgsl/lowerSortInnerComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerSortStepComputeProgram.js +559 -0
- package/dist/formats/webgpu/core/wgsl/lowerSortStepComputeProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/lowerVertexProgram.js +1328 -0
- package/dist/formats/webgpu/core/wgsl/lowerVertexProgram.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/particleEmitSemanticDigest.js +110 -0
- package/dist/formats/webgpu/core/wgsl/particleEmitSemanticDigest.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/precisionControls.js +55 -0
- package/dist/formats/webgpu/core/wgsl/precisionControls.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/selectionPlans.js +758 -0
- package/dist/formats/webgpu/core/wgsl/selectionPlans.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/uniformity.js +78 -0
- package/dist/formats/webgpu/core/wgsl/uniformity.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/validateExactComputeIr.js +196 -0
- package/dist/formats/webgpu/core/wgsl/validateExactComputeIr.js.map +1 -0
- package/dist/formats/webgpu/core/wgsl/validateHandleOperand.js +37 -0
- package/dist/formats/webgpu/core/wgsl/validateHandleOperand.js.map +1 -0
- package/dist/formats/webgpu/index.js +2 -0
- package/dist/formats/webgpu/index.js.map +1 -0
- package/dist/formats/webm/core/helpers.js +35 -0
- package/dist/formats/webm/core/helpers.js.map +1 -1
- package/dist/formats/webp/CjsWebpFormat.js +49 -0
- package/dist/formats/webp/CjsWebpFormat.js.map +1 -1
- package/dist/formats/webp/core/helpers.js +23 -0
- package/dist/formats/webp/core/helpers.js.map +1 -1
- package/dist/formats/wem/CjsWemFormat.js +8 -0
- package/dist/formats/wem/CjsWemFormat.js.map +1 -1
- package/dist/formats/wem/core/bitStream.js +2 -0
- package/dist/formats/wem/core/bitStream.js.map +1 -1
- package/dist/formats/wem/core/helpers.js +20 -0
- package/dist/formats/wem/core/helpers.js.map +1 -1
- package/dist/formats/yaml/CjsYamlFormat.js +45 -0
- package/dist/formats/yaml/CjsYamlFormat.js.map +1 -1
- package/dist/formats/yaml/core/CjsYamlReader.js +91 -0
- package/dist/formats/yaml/core/CjsYamlReader.js.map +1 -1
- package/dist/formats/yaml/core/helpers.js +10 -0
- package/dist/formats/yaml/core/helpers.js.map +1 -1
- package/dist/index.js +56 -43
- package/dist/index.js.map +1 -1
- package/dist/{CjsResource.js → resource/CjsResource.js} +232 -17
- package/dist/resource/CjsResource.js.map +1 -0
- package/dist/{resources → resource}/Tr2LightProfileRes.js +4 -3
- package/dist/resource/Tr2LightProfileRes.js.map +1 -0
- package/dist/{resources → resource/audio}/AudioGeometryResData.js +1 -1
- package/dist/resource/audio/AudioGeometryResData.js.map +1 -0
- package/dist/resource/audio/CjsAudioBufferRes.js +86 -0
- package/dist/resource/audio/CjsAudioBufferRes.js.map +1 -0
- package/dist/resource/audio/CjsAudioRes.js +213 -0
- package/dist/resource/audio/CjsAudioRes.js.map +1 -0
- package/dist/resource/audio/index.js +4 -0
- package/dist/resource/audio/index.js.map +1 -0
- package/dist/{resources → resource/geometry}/MeshDecalData.js +1 -1
- package/dist/resource/geometry/MeshDecalData.js.map +1 -0
- package/dist/{resources → resource/geometry}/MeshDecalLodData.js +1 -1
- package/dist/resource/geometry/MeshDecalLodData.js.map +1 -0
- package/dist/resource/geometry/TriGeometryRes.js +656 -0
- package/dist/resource/geometry/TriGeometryRes.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResAreaData.js +1 -1
- package/dist/resource/geometry/TriGeometryResAreaData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResJointData.js +1 -1
- package/dist/resource/geometry/TriGeometryResJointData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResLodData.js +1 -1
- package/dist/resource/geometry/TriGeometryResLodData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResMeshData.js +1 -1
- package/dist/resource/geometry/TriGeometryResMeshData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriGeometryResSkeletonData.js +1 -1
- package/dist/resource/geometry/TriGeometryResSkeletonData.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriJointBinding.js +1 -1
- package/dist/resource/geometry/TriJointBinding.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriMorphTargetGeometryConstants.js +1 -1
- package/dist/resource/geometry/TriMorphTargetGeometryConstants.js.map +1 -0
- package/dist/{resources → resource/geometry}/TriRtGeometryConstants.js +1 -1
- package/dist/resource/geometry/TriRtGeometryConstants.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/GStateBindingCallbackData.js +1 -1
- package/dist/resource/geometry/granny/GStateBindingCallbackData.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/Tr2GrannyIntersectionResult.js +1 -1
- package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/Tr2GrannyStateRes.js +6 -5
- package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/TriGrannyRes.js +6 -5
- package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -0
- package/dist/{resources → resource/geometry/granny}/enums.js +1 -9
- package/dist/resource/geometry/granny/enums.js.map +1 -0
- package/dist/resource/geometry/granny/index.js +6 -0
- package/dist/resource/geometry/granny/index.js.map +1 -0
- package/dist/resource/geometry/index.js +17 -0
- package/dist/resource/geometry/index.js.map +1 -0
- package/dist/resource/index.js +52 -0
- package/dist/resource/index.js.map +1 -0
- package/dist/resource/resourceBoundary.js +64 -0
- package/dist/resource/resourceBoundary.js.map +1 -0
- package/dist/resource/shader/Tr2EffectRes.js +429 -0
- package/dist/resource/shader/Tr2EffectRes.js.map +1 -0
- package/dist/resource/shader/Tr2MaterialArea.js +34 -0
- package/dist/resource/shader/Tr2MaterialArea.js.map +1 -0
- package/dist/resource/shader/Tr2MaterialMesh.js +30 -0
- package/dist/resource/shader/Tr2MaterialMesh.js.map +1 -0
- package/dist/resource/shader/Tr2MaterialRes.js +35 -0
- package/dist/resource/shader/Tr2MaterialRes.js.map +1 -0
- package/dist/resource/shader/Tr2Shader.js +256 -0
- package/dist/resource/shader/Tr2Shader.js.map +1 -0
- package/dist/resource/shader/Tr2ShaderPermutation.js +47 -0
- package/dist/resource/shader/Tr2ShaderPermutation.js.map +1 -0
- package/dist/resource/shader/index.js +17 -0
- package/dist/resource/shader/index.js.map +1 -0
- package/dist/resource/shader/portable.js +33 -0
- package/dist/resource/shader/portable.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectConstant.js +135 -0
- package/dist/resource/shader/reflection/Tr2EffectConstant.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectDefine.js +28 -0
- package/dist/resource/shader/reflection/Tr2EffectDefine.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectDescription.js +107 -0
- package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js +145 -0
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +103 -0
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectResource.js +84 -0
- package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js +239 -0
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js +66 -0
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -0
- package/dist/resource/shader/reflection/Tr2Pass.js +109 -0
- package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -0
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js +75 -0
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -0
- package/dist/{texture → resource/texture}/CjsTextureArrayRes.js +83 -6
- package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -0
- package/dist/{texture/CjsTextureParameterProxy.js → resource/texture/CjsTextureArrayResParameterProxy.js} +56 -10
- package/dist/resource/texture/CjsTextureArrayResParameterProxy.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2ImageRes.js +6 -4
- package/dist/resource/texture/Tr2ImageRes.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TextureLodManager.js +3 -1
- package/dist/resource/texture/Tr2TextureLodManager.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TextureLodUpdateRequest.js +1 -1
- package/dist/resource/texture/Tr2TextureLodUpdateRequest.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePackChannel.js +1 -1
- package/dist/resource/texture/Tr2TexturePackChannel.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipeline.js +6 -4
- package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineParams.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineParams.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepCompress.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepGenerateMips.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepLimitSize.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepLoad.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -0
- package/dist/{resources → resource/texture}/Tr2TexturePipelineStepPack.js +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -0
- package/dist/{resources → resource/texture}/TriTextureRes.js +42 -26
- package/dist/resource/texture/TriTextureRes.js.map +1 -0
- package/dist/resource/texture/index.js +15 -0
- package/dist/resource/texture/index.js.map +1 -0
- package/dist/{resources → resource/texture}/texturePipelineBehavior.js +59 -59
- package/dist/resource/texture/texturePipelineBehavior.js.map +1 -0
- package/dist/worker/CjsResManMainThreadLoader.js +87 -0
- package/dist/worker/CjsResManMainThreadLoader.js.map +1 -0
- package/dist/worker/CjsResManWorker.js +217 -0
- package/dist/worker/CjsResManWorker.js.map +1 -0
- package/dist/worker/CjsResManWorkerLoader.js +434 -0
- package/dist/worker/CjsResManWorkerLoader.js.map +1 -0
- package/dist/worker/protocol.js +12 -0
- package/dist/worker/protocol.js.map +1 -0
- package/docs/README.md +16 -3
- package/docs/architecture.md +39 -16
- package/docs/concepts/resource-lifecycle.md +2 -1
- package/docs/formats/README.md +8 -0
- package/docs/formats/provenance.md +11 -3
- package/docs/reference/classes/README.md +6 -4
- package/docs/reference/classes/audio.md +30 -0
- package/docs/reference/classes/core.md +31 -11
- package/docs/reference/classes/formats.md +440 -0
- package/docs/reference/classes/resources.md +151 -41
- package/docs/reference/classes/texture.md +7 -7
- package/docs/reference/motherlode-cache.md +17 -0
- package/docs/reference/queues.md +9 -1
- package/docs/reference/workers.md +135 -0
- package/docs/roadmap.md +27 -1
- package/format-notices/dxbc/LICENSE +21 -0
- package/format-notices/dxbc/NOTICE +20 -0
- package/format-notices/hlsl/LICENSE +21 -0
- package/format-notices/hlsl/NOTICE +25 -0
- package/format-notices/webgl/LICENSE +21 -0
- package/format-notices/webgl/NOTICE +35 -0
- package/format-notices/webgpu/LICENSE +21 -0
- package/format-notices/webgpu/NOTICE +31 -0
- package/package.json +13 -1
- package/dist/CjsResManQueue.js.map +0 -1
- package/dist/CjsResource.js.map +0 -1
- package/dist/CjsResourceSource.js +0 -68
- package/dist/CjsResourceSource.js.map +0 -1
- package/dist/resourcePath.js +0 -18
- package/dist/resourcePath.js.map +0 -1
- package/dist/resourceStates.js +0 -9
- package/dist/resourceStates.js.map +0 -1
- package/dist/resources/AudioGeometryResData.js.map +0 -1
- package/dist/resources/GStateBindingCallbackData.js.map +0 -1
- package/dist/resources/MeshDecalData.js.map +0 -1
- package/dist/resources/MeshDecalLodData.js.map +0 -1
- package/dist/resources/Tr2EffectRes.js +0 -71
- package/dist/resources/Tr2EffectRes.js.map +0 -1
- package/dist/resources/Tr2GrannyIntersectionResult.js.map +0 -1
- package/dist/resources/Tr2GrannyStateRes.js.map +0 -1
- package/dist/resources/Tr2ImageRes.js.map +0 -1
- package/dist/resources/Tr2LightProfileRes.js.map +0 -1
- package/dist/resources/Tr2MaterialArea.js +0 -34
- package/dist/resources/Tr2MaterialArea.js.map +0 -1
- package/dist/resources/Tr2MaterialMesh.js +0 -31
- package/dist/resources/Tr2MaterialMesh.js.map +0 -1
- package/dist/resources/Tr2MaterialRes.js +0 -34
- package/dist/resources/Tr2MaterialRes.js.map +0 -1
- package/dist/resources/Tr2ShaderPermutation.js +0 -43
- package/dist/resources/Tr2ShaderPermutation.js.map +0 -1
- package/dist/resources/Tr2TextureLodManager.js.map +0 -1
- package/dist/resources/Tr2TextureLodUpdateRequest.js.map +0 -1
- package/dist/resources/Tr2TexturePackChannel.js.map +0 -1
- package/dist/resources/Tr2TexturePipeline.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineParams.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepCompress.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepGenerateMips.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepLimitSize.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepLoad.js.map +0 -1
- package/dist/resources/Tr2TexturePipelineStepPack.js.map +0 -1
- package/dist/resources/TriGeometryRes.js +0 -239
- package/dist/resources/TriGeometryRes.js.map +0 -1
- package/dist/resources/TriGeometryResAreaData.js.map +0 -1
- package/dist/resources/TriGeometryResJointData.js.map +0 -1
- package/dist/resources/TriGeometryResLodData.js.map +0 -1
- package/dist/resources/TriGeometryResMeshData.js.map +0 -1
- package/dist/resources/TriGeometryResSkeletonData.js.map +0 -1
- package/dist/resources/TriGrannyRes.js.map +0 -1
- package/dist/resources/TriJointBinding.js.map +0 -1
- package/dist/resources/TriMorphTargetGeometryConstants.js.map +0 -1
- package/dist/resources/TriRtGeometryConstants.js.map +0 -1
- package/dist/resources/TriTextureRes.js.map +0 -1
- package/dist/resources/enums.js.map +0 -1
- package/dist/resources/resourceBoundary.js +0 -47
- package/dist/resources/resourceBoundary.js.map +0 -1
- package/dist/resources/texturePipelineBehavior.js.map +0 -1
- package/dist/texture/CjsTextureArrayRes.js.map +0 -1
- package/dist/texture/CjsTextureParameterProxy.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lowerDxbcToIr.js","sources":["../../../../../../src/formats/webgpu/core/ir/lowerDxbcToIr.js"],"sourcesContent":["import CjsDxbcFormat from \"../../../dxbc/index.js\";\nimport { analyzeRegisterValues, operandRoles } from \"./analyzeRegisterValues.js\";\nimport { buildControlFlow } from \"./buildControlFlow.js\";\nimport { resolveRegisterFlow } from \"./resolveRegisterFlow.js\";\nimport { inferValueTypes, SCALAR_TYPES } from \"./inferValueTypes.js\";\n\nexport const SHADER_IR_FORMAT = \"CJS_SHADER_IR\";\nexport const SHADER_IR_VERSION = 1;\nconst PRECISE_MASK = /^x?y?z?w?$/u;\n\nconst BINDING_KINDS = Object.freeze({\n dcl_constant_buffer: \"uniform-buffer\",\n dcl_sampler: \"sampler\",\n dcl_resource: \"sampled-resource\",\n dcl_resource_raw: \"sampled-resource\",\n dcl_resource_structured: \"sampled-resource\",\n dcl_unordered_access_view_typed: \"storage-resource\",\n dcl_unordered_access_view_raw: \"storage-resource\",\n dcl_unordered_access_view_structured: \"storage-resource\"\n});\n\nconst BLOCK_BEFORE = new Set([ \"loop\", \"else\", \"endif\", \"endloop\", \"case\", \"default\", \"endswitch\" ]);\nconst BLOCK_AFTER = new Set([\n \"if\", \"loop\", \"switch\", \"break\", \"breakc\", \"continue\", \"continuec\",\n \"ret\", \"retc\", \"discard\", \"else\", \"endif\", \"endloop\", \"case\", \"default\", \"endswitch\"\n]);\n\nfunction clonePlain(value)\n{\n if (value === null || value === undefined) return value ?? null;\n if (ArrayBuffer.isView(value)) return Array.from(value);\n if (Array.isArray(value)) return value.map(clonePlain);\n if (typeof value === \"object\")\n {\n const out = {};\n for (const [ key, entry ] of Object.entries(value)) out[key] = clonePlain(entry);\n return out;\n }\n return value;\n}\n\nfunction readDecoded(input, options)\n{\n if (input instanceof Uint8Array || input instanceof ArrayBuffer || ArrayBuffer.isView(input))\n {\n const raw = CjsDxbcFormat.read(input, {\n emit: CjsDxbcFormat.OUTPUT_RAW,\n source: options.source || \"memory\",\n decodeInstructions: true\n });\n return {\n program: raw.program,\n instructions: raw.decoder?.instructions || [],\n signatures: {\n input: raw.inputSignature?.elements || [],\n output: raw.outputSignature?.elements || [],\n patch: raw.patchSignature?.elements || []\n }\n };\n }\n if (input?.program && input?.decoder)\n {\n return {\n program: input.program,\n instructions: input.decoder.instructions || [],\n signatures: {\n input: input.inputSignature?.elements || input.signatures?.input || [],\n output: input.outputSignature?.elements || input.signatures?.output || [],\n patch: input.patchSignature?.elements || input.signatures?.patch || []\n }\n };\n }\n if (input?.program && Array.isArray(input.instructions))\n {\n return { program: input.program, instructions: input.instructions, signatures: input.signatures || {} };\n }\n throw new TypeError(\"CjsWebgpuFormat.BuildShaderIr: expected DXBC bytes or decoded program/instructions\");\n}\n\nfunction normalizedRange(declaration)\n{\n if (declaration.bindingRange) return clonePlain(declaration.bindingRange);\n const registerIndex = declaration.registerIndex ?? null;\n return {\n bindingModel: \"sm5.0-register\",\n rangeId: null,\n lowerBound: registerIndex,\n upperBound: registerIndex,\n unbounded: false,\n registerCount: registerIndex === null ? 0 : 1,\n registerSpace: 0\n };\n}\n\nfunction buildBinding(instruction)\n{\n const resourceKind = BINDING_KINDS[instruction.opcodeName];\n if (!resourceKind) return null;\n const declaration = instruction.declaration || {};\n const range = normalizedRange(declaration);\n return {\n kind: \"binding\",\n id: `${resourceKind}:space${range.registerSpace}:range${range.rangeId ?? range.lowerBound}`,\n resourceKind,\n operandType: instruction.operands?.[0]?.typeName || null,\n declarationOffset: instruction.offset,\n registerIndex: declaration.registerIndex ?? range.lowerBound,\n range,\n accessPattern: declaration.accessPattern || null,\n resourceDimension: declaration.resourceDimensionName || null,\n structureStride: declaration.structureStride ?? null,\n returnType: clonePlain(declaration.returnType || null)\n };\n}\n\nfunction controlKind(opcodeName)\n{\n if ([ \"if\", \"else\", \"endif\" ].includes(opcodeName)) return \"selection\";\n if ([ \"loop\", \"endloop\", \"break\", \"breakc\", \"continue\", \"continuec\" ].includes(opcodeName)) return \"loop\";\n if ([ \"switch\", \"case\", \"default\", \"endswitch\" ].includes(opcodeName)) return \"switch\";\n if ([ \"ret\", \"retc\", \"discard\", \"abort\" ].includes(opcodeName)) return \"termination\";\n return null;\n}\n\nconst COMPONENT_ORDER = [ \"x\", \"y\", \"z\", \"w\" ];\nconst FLOAT_VIEW = new DataView(new ArrayBuffer(4));\n\nfunction immediateRecord(value)\n{\n const bits = (value?.uint32 ?? 0) >>> 0;\n FLOAT_VIEW.setUint32(0, bits);\n return { uint32: bits, float32: FLOAT_VIEW.getFloat32(0) };\n}\n\n/**\n * Recognizes indexable temps that are immutable constant tables: every write\n * is a straight-line pre-control-flow `mov x#[slot].mask, l(...)` immediate,\n * and at least one access uses relative addressing. Such registers lower to a\n * module-scope WGSL `const` array (the same shape as the DXBC icb), so their\n * dynamic reads never need mutable-register SSA. Any relative indexable-temp\n * usage that does not fit this shape fails closed here with a diagnostic.\n *\n * @param {object[]} declarationInstructions Decoded declaration instructions.\n * @param {object[]} executable Decoded executable instructions.\n * @returns {{tables: object[]|null, removed: Set<number>|null}} Tables and initializer indices.\n */\nfunction extractConstTables(declarationInstructions, executable)\n{\n const declared = new Map();\n const duplicateDeclarations = new Set();\n for (const declaration of declarationInstructions)\n {\n if (declaration.opcodeName !== \"dcl_indexable_temp\") continue;\n const data = declaration.declaration || {};\n if (declared.has(data.registerIndex)) duplicateDeclarations.add(data.registerIndex);\n declared.set(data.registerIndex, {\n slotCount: data.registerCount,\n componentCount: data.componentCount\n });\n }\n\n const touched = new Map();\n const entryFor = (registerIndex) =>\n {\n let entry = touched.get(registerIndex);\n if (!entry)\n {\n entry = { writes: [], hasRelative: false, invalid: null };\n touched.set(registerIndex, entry);\n }\n return entry;\n };\n const invalidate = (entry, reason) =>\n {\n if (!entry.invalid) entry.invalid = reason;\n };\n let firstControl = executable.findIndex((instruction) => controlKind(instruction.opcodeName) !== null);\n if (firstControl < 0) firstControl = executable.length;\n\n executable.forEach((instruction, instructionIndex) =>\n {\n operandRoles(instruction).forEach(({ operand, role }, operandIndex) =>\n {\n if (operand.typeName !== \"indexable_temp\") return;\n const indices = operand.indices || [];\n const registerIndex = indices[0]?.values?.[0];\n const entry = entryFor(registerIndex);\n if (indices.length !== 2 || indices[0]?.relative\n || indices[0]?.values?.length !== 1\n || !Number.isInteger(registerIndex) || registerIndex < 0\n || operand.registerIndex !== registerIndex)\n {\n return invalidate(entry, \"requires one consistent fixed register identity and [register][slot] addressing\");\n }\n if (indices[1]?.relative) entry.hasRelative = true;\n\n if (role === \"source\")\n {\n const lanes = operand.selected\n ? [ operand.selected ]\n : operand.swizzle\n ? Array.from(new Set(operand.swizzle))\n : COMPONENT_ORDER.slice();\n entry.reads = entry.reads || [];\n entry.reads.push({ instructionIndex, lanes });\n return;\n }\n\n // Destination use: only straight-line immediate table initializers\n // are representable; anything else is a mutable indexable temp.\n const source = instruction.operands?.[1];\n const slot = indices[1]?.values?.[0];\n if (instruction.opcodeName !== \"mov\" || instruction.saturate)\n {\n return invalidate(entry, \"is only writable by non-saturating mov initializers\");\n }\n if (instructionIndex >= firstControl)\n {\n return invalidate(entry, \"initializers must precede all control flow\");\n }\n if (indices[1]?.relative || indices[1]?.values?.length !== 1\n || !Number.isInteger(slot) || slot < 0)\n {\n return invalidate(entry, \"initializers require an immediate slot index\");\n }\n if (source?.typeName !== \"immediate32\" || (source.modifierName || \"none\") !== \"none\"\n || ![ 1, 4 ].includes(source.immediateValues?.length ?? 0))\n {\n return invalidate(entry, \"initializers require immediate32 sources\");\n }\n if ((operand.modifierName || \"none\") !== \"none\"\n || (operand.minPrecisionName || \"default\") !== \"default\"\n || (source.minPrecisionName || \"default\") !== \"default\"\n || instruction.extensions?.length)\n {\n return invalidate(entry, \"initializers require canonical default-precision mov operands\");\n }\n if (!operand.mask || operand.swizzle || operand.selected || source.mask\n || (source.swizzle && source.selected)\n || (source.selected && !COMPONENT_ORDER.includes(source.selected))\n || (source.swizzle && (source.swizzle.length !== 4\n || Array.from(source.swizzle).some((lane) => !COMPONENT_ORDER.includes(lane)))))\n {\n return invalidate(entry, \"initializers require canonical destination and source component selection\");\n }\n const valuesByLane = {};\n for (const lane of operand.mask)\n {\n const destinationLane = COMPONENT_ORDER.indexOf(lane);\n const sourceLane = source.selected || source.swizzle?.[destinationLane] || lane;\n const sourceLaneIndex = COMPONENT_ORDER.indexOf(sourceLane);\n const value = source.immediateValues.length === 1\n ? source.immediateValues[0]\n : source.immediateValues[sourceLaneIndex];\n if (!value)\n {\n return invalidate(entry, \"an initializer selects an unavailable immediate lane\");\n }\n valuesByLane[lane] = value;\n }\n entry.writes.push({ instructionIndex, slot, mask: operand.mask, valuesByLane });\n });\n });\n\n const tables = [];\n const removed = new Set();\n\n for (const [ registerIndex, entry ] of touched)\n {\n if (!entry.hasRelative) continue;\n const declaration = declared.get(registerIndex);\n const describe = (reason) => new Error(\n `Shader IR indexable temp x${registerIndex} relative addressing is not supported: ${reason}`);\n if (entry.invalid) throw describe(entry.invalid);\n if (duplicateDeclarations.has(registerIndex)) throw describe(\"it has duplicate declarations\");\n if (!declaration || !Number.isInteger(declaration.slotCount) || declaration.slotCount < 1)\n {\n throw describe(\"it has no usable declaration\");\n }\n if (!Number.isInteger(declaration.componentCount)\n || declaration.componentCount < 1 || declaration.componentCount > 4)\n {\n throw describe(\"it has an invalid component count\");\n }\n const lastWrite = Math.max(...entry.writes.map((write) => write.instructionIndex));\n const firstRead = Math.min(...(entry.reads || []).map((read) => read.instructionIndex));\n if (lastWrite >= firstRead)\n {\n throw describe(\"all initializers must precede every read\");\n }\n\n const laneMask = entry.writes[0]?.mask;\n if (Array.from(laneMask || \"\").some((lane) =>\n COMPONENT_ORDER.indexOf(lane) >= declaration.componentCount))\n {\n throw describe(\"an initializer writes outside the declared component range\");\n }\n const rows = Array.from({ length: declaration.slotCount }, () =>\n COMPONENT_ORDER.map(() => null));\n for (const write of entry.writes)\n {\n if (write.mask !== laneMask) throw describe(\"initializers must share one write mask\");\n if (write.slot < 0 || write.slot >= declaration.slotCount)\n {\n throw describe(\"an initializer writes outside the declared range\");\n }\n for (const lane of write.mask)\n {\n const laneIndex = COMPONENT_ORDER.indexOf(lane);\n if (rows[write.slot][laneIndex] !== null) throw describe(\"a slot lane is written twice\");\n rows[write.slot][laneIndex] = immediateRecord(write.valuesByLane[lane]);\n }\n removed.add(write.instructionIndex);\n }\n for (const [ slot, row ] of rows.entries())\n {\n for (const lane of laneMask || \"\")\n {\n if (row[COMPONENT_ORDER.indexOf(lane)] === null)\n {\n throw describe(`slot ${slot} is never fully written`);\n }\n }\n }\n for (const read of entry.reads || [])\n {\n if (read.lanes.some((lane) => !(laneMask || \"\").includes(lane)))\n {\n throw describe(\"a read selects lanes the table never writes\");\n }\n }\n\n tables.push(Object.freeze({\n kind: \"const-table\",\n registerIndex,\n symbol: `xt${registerIndex}`,\n slotCount: declaration.slotCount,\n laneMask: laneMask || \"\",\n rows: rows.map((row) => row.map((value) => value ?? { uint32: 0, float32: 0 }))\n }));\n }\n\n return tables.length ? { tables, removed } : { tables: null, removed: null };\n}\n\nfunction buildInstruction(instruction, index)\n{\n return {\n kind: \"instruction\",\n index,\n dxbcOffset: instruction.offset,\n opcode: instruction.opcode,\n opcodeName: instruction.opcodeName,\n controlKind: controlKind(instruction.opcodeName),\n testBoolean: instruction.testBoolean || null,\n saturate: !!instruction.saturate,\n preciseMask: instruction.preciseMask || \"\",\n ...(instruction.opcodeName === \"resinfo\"\n ? { resinfoReturnTypeName: instruction.resinfoReturnTypeName || \"float\" }\n : {}),\n ...(instruction.opcodeName === \"sync\"\n ? {\n syncFlags: Number.isInteger(instruction.syncFlags)\n ? instruction.syncFlags\n : null,\n syncFlagNames: Array.isArray(instruction.syncFlagNames)\n ? clonePlain(instruction.syncFlagNames)\n : null\n }\n : {}),\n ...(instruction.extensions?.length\n ? { extensions: clonePlain(instruction.extensions) }\n : {}),\n ...(instruction.tailTokens?.length\n ? { tailTokens: clonePlain(instruction.tailTokens) }\n : {}),\n operands: clonePlain(instruction.operands || [])\n };\n}\n\nfunction buildBlocks(instructions)\n{\n if (instructions.length === 0) return [];\n const leaders = new Set([ 0 ]);\n for (let index = 0; index < instructions.length; index += 1)\n {\n if (BLOCK_BEFORE.has(instructions[index].opcodeName)) leaders.add(index);\n if (BLOCK_AFTER.has(instructions[index].opcodeName) && index + 1 < instructions.length) leaders.add(index + 1);\n }\n\n const starts = Array.from(leaders).sort((a, b) => a - b);\n return starts.map((start, blockIndex) =>\n {\n const end = (starts[blockIndex + 1] ?? instructions.length) - 1;\n const last = instructions[end];\n return {\n kind: \"basic-block\",\n id: `block${blockIndex}`,\n index: blockIndex,\n startInstruction: start,\n endInstruction: end,\n startDxbcOffset: instructions[start].dxbcOffset,\n endDxbcOffset: last.dxbcOffset,\n instructionIndices: Array.from({ length: end - start + 1 }, (_, offset) => start + offset),\n terminator: last.controlKind ? last.opcodeName : null\n };\n });\n}\n\nfunction validateProgram(program)\n{\n if (!program.stage || !Number.isInteger(program.shaderModel.major))\n {\n throw new Error(\"Invalid shader IR program identity\");\n }\n for (let index = 1; index < program.instructions.length; index += 1)\n {\n if (program.instructions[index].dxbcOffset <= program.instructions[index - 1].dxbcOffset)\n {\n throw new Error(\"Shader IR instruction offsets must be strictly increasing\");\n }\n }\n const covered = program.blocks.flatMap((block) => block.instructionIndices);\n if (covered.length !== program.instructions.length || covered.some((value, index) => value !== index))\n {\n throw new Error(\"Shader IR basic blocks must cover every executable instruction exactly once\");\n }\n const blockIds = new Set(program.blocks.map((block) => block.id));\n for (const block of program.blocks)\n {\n if (block.successors.some((edge) => !blockIds.has(edge.blockId)))\n {\n throw new Error(\"Shader IR control-flow edge references an unknown block\");\n }\n for (const edge of block.successors)\n {\n const successor = program.blocks.find((entry) => entry.id === edge.blockId);\n if (!successor.predecessors.some((entry) => entry.blockId === block.id && entry.kind === edge.kind))\n {\n throw new Error(\"Shader IR control-flow successor/predecessor edges must be symmetric\");\n }\n }\n }\n const bindingIds = new Set();\n for (const binding of program.bindings)\n {\n if (bindingIds.has(binding.id)) throw new Error(`Duplicate shader IR binding ${binding.id}`);\n bindingIds.add(binding.id);\n }\n const valueIds = new Set(program.values.map((value) => value.id));\n const valuesById = new Map(program.values.map((value) => [ value.id, value ]));\n if (valueIds.size !== program.values.length) throw new Error(\"Shader IR register value ids must be unique\");\n for (const block of program.blocks)\n {\n if (block.inputValueIds.some((id) => !valueIds.has(id)))\n {\n throw new Error(\"Shader IR block input references an unknown value\");\n }\n if (block.outputValues.some((output) => !valueIds.has(output.ref.valueId)))\n {\n throw new Error(\"Shader IR block output references an unknown value\");\n }\n if (block.mergeSite?.valueIds?.some((id) =>\n !valueIds.has(id)\n || valuesById.get(id).origin !== \"control-flow-merge\"\n || valuesById.get(id).blockId !== block.id))\n {\n throw new Error(\"Shader IR merge site references an invalid merge value\");\n }\n }\n for (const instruction of program.instructions)\n {\n if (!instruction.dataflow) throw new Error(\"Shader IR instruction is missing register dataflow\");\n const refs = [\n ...instruction.dataflow.reads.flatMap((read) => read.refs),\n ...instruction.dataflow.writes.flatMap((write) => [\n { valueId: write.valueId },\n ...Object.values(write.previous || {}),\n ...Object.values(write.result || {})\n ])\n ];\n if (refs.some((ref) => !valueIds.has(ref.valueId)))\n {\n throw new Error(\"Shader IR register dataflow references an unknown value\");\n }\n }\n for (const value of program.values)\n {\n if (value.origin === \"block-input\") throw new Error(\"Shader IR contains an unresolved block input\");\n if (value.origin === \"control-flow-merge\")\n {\n if (value.incoming.length < 2) throw new Error(\"Shader IR merge value must have at least two incoming values\");\n if (value.incoming.some((incoming) => !valueIds.has(incoming.valueId)))\n {\n throw new Error(\"Shader IR merge value references an unknown incoming value\");\n }\n if (value.incoming.some((incoming) =>\n incoming.component !== value.writeMask\n || valuesById.get(incoming.valueId).register !== value.register))\n {\n throw new Error(\"Shader IR merge value has an incompatible incoming register component\");\n }\n }\n if (!value.componentTypes || Object.values(value.componentTypes).some((type) => !SCALAR_TYPES.includes(type)))\n {\n throw new Error(\"Shader IR register value has an invalid component type\");\n }\n }\n for (const instruction of program.instructions)\n {\n if (!instruction.typeInfo) throw new Error(\"Shader IR instruction is missing type information\");\n if (typeof instruction.preciseMask !== \"string\" || !PRECISE_MASK.test(instruction.preciseMask))\n {\n throw new Error(`Shader IR instruction ${instruction.index} has an invalid precise component mask`);\n }\n if (instruction.typeInfo.bitcasts.some((bitcast) =>\n !SCALAR_TYPES.includes(bitcast.from) || !SCALAR_TYPES.includes(bitcast.to)))\n {\n throw new Error(\"Shader IR instruction has an invalid bitcast type\");\n }\n }\n}\n\nfunction deepFreeze(value)\n{\n if (!value || typeof value !== \"object\" || Object.isFrozen(value)) return value;\n for (const entry of Object.values(value)) deepFreeze(entry);\n return Object.freeze(value);\n}\n\n/**\n * Lowers decoded DXBC framing into the stable front-end shader IR.\n * Type inference and SSA value reconstruction are later passes.\n *\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView|object} input DXBC bytes or decoded result.\n * @param {object} [options] IR provenance options.\n * @returns {object} Frozen, validated shader IR program.\n */\nexport function lowerDxbcToIr(input, options = {})\n{\n const decoded = readDecoded(input, options);\n if (!decoded.program) throw new Error(\"DXBC input has no shader program\");\n\n const declarationInstructions = decoded.instructions.filter((instruction) => instruction.isDeclaration);\n let executable = decoded.instructions.filter((instruction) => !instruction.isDeclaration);\n const constTableExtraction = extractConstTables(declarationInstructions, executable);\n if (constTableExtraction.removed)\n {\n executable = executable.filter((_, index) => !constTableExtraction.removed.has(index));\n }\n const instructions = executable.map(buildInstruction);\n const icbInstruction = declarationInstructions.find((instruction) => instruction.customData?.immediateConstantBuffer);\n const immediateConstantBuffer = icbInstruction\n ? clonePlain(icbInstruction.customData.immediateConstantBuffer)\n : null;\n const program = {\n kind: \"shader-program\",\n format: SHADER_IR_FORMAT,\n formatVersion: SHADER_IR_VERSION,\n source: options.source || decoded.program.source || \"memory\",\n stage: decoded.program.programTypeName,\n programType: decoded.program.programType,\n shaderModel: {\n major: decoded.program.majorVersion,\n minor: decoded.program.minorVersion\n },\n signatures: {\n input: clonePlain(decoded.signatures?.input || []),\n output: clonePlain(decoded.signatures?.output || []),\n patch: clonePlain(decoded.signatures?.patch || [])\n },\n declarations: declarationInstructions.map((instruction) => ({\n kind: \"declaration\",\n dxbcOffset: instruction.offset,\n opcodeName: instruction.opcodeName,\n data: clonePlain(instruction.declaration),\n operands: clonePlain(instruction.operands || []),\n ...(instruction.tailTokens?.length\n ? { tailTokens: clonePlain(instruction.tailTokens) }\n : {})\n })),\n bindings: declarationInstructions.map(buildBinding).filter(Boolean),\n immediateConstantBuffer,\n constTables: constTableExtraction.tables,\n instructions,\n blocks: buildBlocks(instructions)\n };\n buildControlFlow(program);\n analyzeRegisterValues(program);\n resolveRegisterFlow(program);\n inferValueTypes(program);\n validateProgram(program);\n return deepFreeze(program);\n}\n"],"names":["SHADER_IR_FORMAT","SHADER_IR_VERSION","PRECISE_MASK","BINDING_KINDS","Object","freeze","dcl_constant_buffer","dcl_sampler","dcl_resource","dcl_resource_raw","dcl_resource_structured","dcl_unordered_access_view_typed","dcl_unordered_access_view_raw","dcl_unordered_access_view_structured","BLOCK_BEFORE","Set","BLOCK_AFTER","clonePlain","value","undefined","ArrayBuffer","isView","Array","from","isArray","map","out","key","entry","entries","readDecoded","input","options","Uint8Array","raw","CjsDxbcFormat","read","emit","OUTPUT_RAW","source","decodeInstructions","program","instructions","decoder","signatures","inputSignature","elements","output","outputSignature","patch","patchSignature","TypeError","normalizedRange","declaration","bindingRange","registerIndex","bindingModel","rangeId","lowerBound","upperBound","unbounded","registerCount","registerSpace","buildBinding","instruction","resourceKind","opcodeName","range","kind","id","operandType","operands","typeName","declarationOffset","offset","accessPattern","resourceDimension","resourceDimensionName","structureStride","returnType","controlKind","includes","COMPONENT_ORDER","FLOAT_VIEW","DataView","immediateRecord","bits","uint32","setUint32","float32","getFloat32","extractConstTables","declarationInstructions","executable","declared","Map","duplicateDeclarations","data","has","add","set","slotCount","componentCount","touched","entryFor","get","writes","hasRelative","invalid","invalidate","reason","firstControl","findIndex","length","forEach","instructionIndex","operandRoles","operand","role","operandIndex","indices","values","relative","Number","isInteger","lanes","selected","swizzle","slice","reads","push","slot","saturate","modifierName","immediateValues","minPrecisionName","extensions","mask","some","lane","valuesByLane","destinationLane","indexOf","sourceLane","sourceLaneIndex","tables","removed","describe","Error","lastWrite","Math","max","write","firstRead","min","laneMask","rows","laneIndex","row","symbol","buildInstruction","index","dxbcOffset","opcode","testBoolean","preciseMask","resinfoReturnTypeName","syncFlags","syncFlagNames","tailTokens","buildBlocks","leaders","starts","sort","a","b","start","blockIndex","end","last","startInstruction","endInstruction","startDxbcOffset","endDxbcOffset","instructionIndices","_","terminator","validateProgram","stage","shaderModel","major","covered","blocks","flatMap","block","blockIds","successors","edge","blockId","successor","find","predecessors","bindingIds","binding","bindings","valueIds","valuesById","size","inputValueIds","outputValues","ref","valueId","mergeSite","origin","dataflow","refs","previous","result","incoming","component","writeMask","register","componentTypes","type","SCALAR_TYPES","typeInfo","test","bitcasts","bitcast","to","deepFreeze","isFrozen","lowerDxbcToIr","decoded","filter","isDeclaration","constTableExtraction","icbInstruction","customData","immediateConstantBuffer","format","formatVersion","programTypeName","programType","majorVersion","minor","minorVersion","declarations","Boolean","constTables","buildControlFlow","analyzeRegisterValues","resolveRegisterFlow","inferValueTypes"],"mappings":";;;;;;AAMO,MAAMA,gBAAgB,GAAG;AACzB,MAAMC,iBAAiB,GAAG;AACjC,MAAMC,YAAY,GAAG,aAAa;AAElC,MAAMC,aAAa,GAAGC,MAAM,CAACC,MAAM,CAAC;AAChCC,EAAAA,mBAAmB,EAAE,gBAAgB;AACrCC,EAAAA,WAAW,EAAE,SAAS;AACtBC,EAAAA,YAAY,EAAE,kBAAkB;AAChCC,EAAAA,gBAAgB,EAAE,kBAAkB;AACpCC,EAAAA,uBAAuB,EAAE,kBAAkB;AAC3CC,EAAAA,+BAA+B,EAAE,kBAAkB;AACnDC,EAAAA,6BAA6B,EAAE,kBAAkB;AACjDC,EAAAA,oCAAoC,EAAE;AAC1C,CAAC,CAAC;AAEF,MAAMC,YAAY,GAAG,IAAIC,GAAG,CAAC,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,CAAE,CAAC;AACpG,MAAMC,WAAW,GAAG,IAAID,GAAG,CAAC,CACxB,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAClE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAA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AAK,IAAI,EAAE;KACpD;AACDsM,IAAAA,YAAY,EAAE3J,uBAAuB,CAACnE,GAAG,CAAEuC,WAAW,KAAM;AACxDI,MAAAA,IAAI,EAAE,aAAa;MACnB8F,UAAU,EAAElG,WAAW,CAACU,MAAM;MAC9BR,UAAU,EAAEF,WAAW,CAACE,UAAU;AAClC+B,MAAAA,IAAI,EAAEhF,UAAU,CAAC+C,WAAW,CAACX,WAAW,CAAC;MACzCkB,QAAQ,EAAEtD,UAAU,CAAC+C,WAAW,CAACO,QAAQ,IAAI,EAAE,CAAC;AAChD,MAAA,IAAIP,WAAW,CAACyG,UAAU,EAAExD,MAAM,GAC5B;AAAEwD,QAAAA,UAAU,EAAExJ,UAAU,CAAC+C,WAAW,CAACyG,UAAU;OAAG,GAClD,EAAE;AACZ,KAAC,CAAC,CAAC;IACHmC,QAAQ,EAAEhH,uBAAuB,CAACnE,GAAG,CAACsC,YAAY,CAAC,CAAC2K,MAAM,CAACc,OAAO,CAAC;IACnET,uBAAuB;IACvBU,WAAW,EAAEb,oBAAoB,CAAC3F,MAAM;IACxCvG,YAAY;IACZsJ,MAAM,EAAEtB,WAAW,CAAChI,YAAY;GACnC;EACDgN,gBAAgB,CAACjN,OAAO,CAAC;EACzBkN,qBAAqB,CAAClN,OAAO,CAAC;EAC9BmN,mBAAmB,CAACnN,OAAO,CAAC;EAC5BoN,eAAe,CAACpN,OAAO,CAAC;EACxBkJ,eAAe,CAAClJ,OAAO,CAAC;EACxB,OAAO6L,UAAU,CAAC7L,OAAO,CAAC;AAC9B;;;;"}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
const MUTABLE_REGISTER_FILES = new Set(["temp", "output", "indexable_temp", "output_depth", "output_coverage", "output_control_point", "output_depth_greater_equal", "output_depth_less_equal"]);
|
|
2
|
+
function refKey(register, component) {
|
|
3
|
+
return `${register}.${component}`;
|
|
4
|
+
}
|
|
5
|
+
function valueRef(value, component) {
|
|
6
|
+
return {
|
|
7
|
+
valueId: value.id,
|
|
8
|
+
component
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function isMutableRegister(register) {
|
|
12
|
+
return MUTABLE_REGISTER_FILES.has(register.slice(0, register.indexOf("[")));
|
|
13
|
+
}
|
|
14
|
+
function replaceObjectRefs(object, replacements) {
|
|
15
|
+
if (!object) return object;
|
|
16
|
+
for (const [key, ref] of Object.entries(object)) object[key] = replacements.get(ref.valueId) || ref;
|
|
17
|
+
return object;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Resolves conservative block inputs through CFG predecessors and materializes
|
|
22
|
+
* live cross-block merge values. Values are component-granular so masked DXBC
|
|
23
|
+
* writes retain the correct incoming lanes.
|
|
24
|
+
*
|
|
25
|
+
* @param {object} program Mutable shader IR under construction.
|
|
26
|
+
* @returns {object} The same program.
|
|
27
|
+
*/
|
|
28
|
+
function resolveRegisterFlow(program) {
|
|
29
|
+
const values = program.values;
|
|
30
|
+
const blocksById = new Map(program.blocks.map(block => [block.id, block]));
|
|
31
|
+
const placeholders = new Map(values.filter(value => value.origin === "block-input").map(value => [value.id, value]));
|
|
32
|
+
const replacements = new Map();
|
|
33
|
+
const externalValues = new Map();
|
|
34
|
+
const mergeValues = new Map();
|
|
35
|
+
const entryBlockId = program.controlFlow.entryBlockId;
|
|
36
|
+
const outputMaps = new Map(program.blocks.map(block => [block.id, new Map(block.outputValues.map(entry => [refKey(entry.register, entry.component), entry.ref]))]));
|
|
37
|
+
const createValue = data => {
|
|
38
|
+
const value = {
|
|
39
|
+
kind: "register-value",
|
|
40
|
+
id: `value${values.length}`,
|
|
41
|
+
...data
|
|
42
|
+
};
|
|
43
|
+
values.push(value);
|
|
44
|
+
return value;
|
|
45
|
+
};
|
|
46
|
+
const externalRef = (register, component) => {
|
|
47
|
+
const key = refKey(register, component);
|
|
48
|
+
if (!externalValues.has(key)) {
|
|
49
|
+
externalValues.set(key, createValue({
|
|
50
|
+
origin: isMutableRegister(register) ? "undefined-register" : "program-input",
|
|
51
|
+
blockId: null,
|
|
52
|
+
instructionIndex: null,
|
|
53
|
+
register,
|
|
54
|
+
writeMask: component,
|
|
55
|
+
previous: null
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
return valueRef(externalValues.get(key), component);
|
|
59
|
+
};
|
|
60
|
+
let resolveEntry;
|
|
61
|
+
let resolveExit;
|
|
62
|
+
const resolveRef = ref => {
|
|
63
|
+
const placeholder = placeholders.get(ref.valueId);
|
|
64
|
+
if (!placeholder) return replacements.get(ref.valueId) || ref;
|
|
65
|
+
if (!replacements.has(ref.valueId)) {
|
|
66
|
+
replacements.set(ref.valueId, resolveEntry(blocksById.get(placeholder.blockId), placeholder.register, placeholder.writeMask));
|
|
67
|
+
}
|
|
68
|
+
return replacements.get(ref.valueId);
|
|
69
|
+
};
|
|
70
|
+
resolveExit = (block, register, component) => {
|
|
71
|
+
const local = outputMaps.get(block.id).get(refKey(register, component));
|
|
72
|
+
return local ? resolveRef(local) : resolveEntry(block, register, component);
|
|
73
|
+
};
|
|
74
|
+
resolveEntry = (block, register, component) => {
|
|
75
|
+
if (!isMutableRegister(register)) return externalRef(register, component);
|
|
76
|
+
const key = refKey(register, component);
|
|
77
|
+
const mergeKey = `${block.id}:${key}`;
|
|
78
|
+
if (mergeValues.has(mergeKey)) return valueRef(mergeValues.get(mergeKey), component);
|
|
79
|
+
const predecessorIds = Array.from(new Set(block.predecessors.map(edge => edge.blockId))).filter(id => block.reachable && blocksById.get(id).reachable).sort((a, b) => blocksById.get(a).index - blocksById.get(b).index);
|
|
80
|
+
const includesProgramEntry = block.id === entryBlockId || !block.reachable || predecessorIds.length === 0;
|
|
81
|
+
const incomingCount = predecessorIds.length + (includesProgramEntry ? 1 : 0);
|
|
82
|
+
if (incomingCount === 1) {
|
|
83
|
+
if (includesProgramEntry) return externalRef(register, component);
|
|
84
|
+
return resolveExit(blocksById.get(predecessorIds[0]), register, component);
|
|
85
|
+
}
|
|
86
|
+
const merge = createValue({
|
|
87
|
+
origin: "control-flow-merge",
|
|
88
|
+
blockId: block.id,
|
|
89
|
+
instructionIndex: null,
|
|
90
|
+
register,
|
|
91
|
+
writeMask: component,
|
|
92
|
+
previous: null,
|
|
93
|
+
incoming: []
|
|
94
|
+
});
|
|
95
|
+
mergeValues.set(mergeKey, merge);
|
|
96
|
+
if (includesProgramEntry) {
|
|
97
|
+
const ref = externalRef(register, component);
|
|
98
|
+
merge.incoming.push({
|
|
99
|
+
kind: "program-entry",
|
|
100
|
+
blockId: null,
|
|
101
|
+
...ref
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
for (const predecessorId of predecessorIds) {
|
|
105
|
+
const ref = resolveExit(blocksById.get(predecessorId), register, component);
|
|
106
|
+
merge.incoming.push({
|
|
107
|
+
kind: "predecessor",
|
|
108
|
+
blockId: predecessorId,
|
|
109
|
+
...ref
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return valueRef(merge, component);
|
|
113
|
+
};
|
|
114
|
+
for (const placeholder of placeholders.values()) {
|
|
115
|
+
if (!replacements.has(placeholder.id)) {
|
|
116
|
+
replacements.set(placeholder.id, resolveEntry(blocksById.get(placeholder.blockId), placeholder.register, placeholder.writeMask));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const aliases = new Map();
|
|
120
|
+
const canonicalRef = ref => {
|
|
121
|
+
let current = ref;
|
|
122
|
+
const seen = new Set();
|
|
123
|
+
while (aliases.has(current.valueId) && !seen.has(current.valueId)) {
|
|
124
|
+
seen.add(current.valueId);
|
|
125
|
+
current = aliases.get(current.valueId);
|
|
126
|
+
}
|
|
127
|
+
return current;
|
|
128
|
+
};
|
|
129
|
+
let changed = true;
|
|
130
|
+
while (changed) {
|
|
131
|
+
changed = false;
|
|
132
|
+
for (const merge of mergeValues.values()) {
|
|
133
|
+
if (aliases.has(merge.id)) continue;
|
|
134
|
+
const refs = merge.incoming.map(incoming => canonicalRef(incoming)).filter(ref => ref.valueId !== merge.id);
|
|
135
|
+
const unique = Array.from(new Map(refs.map(ref => [`${ref.valueId}.${ref.component}`, ref])).values());
|
|
136
|
+
if (unique.length === 1) {
|
|
137
|
+
aliases.set(merge.id, unique[0]);
|
|
138
|
+
changed = true;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
for (const [id, ref] of replacements) replacements.set(id, canonicalRef(ref));
|
|
143
|
+
for (const [id, ref] of aliases) replacements.set(id, canonicalRef(ref));
|
|
144
|
+
for (const merge of mergeValues.values()) {
|
|
145
|
+
if (aliases.has(merge.id)) continue;
|
|
146
|
+
merge.incoming = merge.incoming.map(incoming => ({
|
|
147
|
+
...incoming,
|
|
148
|
+
...canonicalRef(incoming)
|
|
149
|
+
}));
|
|
150
|
+
}
|
|
151
|
+
for (const instruction of program.instructions) {
|
|
152
|
+
for (const read of instruction.dataflow.reads) {
|
|
153
|
+
read.refs = read.refs.map(resolveRef);
|
|
154
|
+
}
|
|
155
|
+
for (const write of instruction.dataflow.writes) {
|
|
156
|
+
replaceObjectRefs(write.previous, replacements);
|
|
157
|
+
replaceObjectRefs(write.result, replacements);
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
for (const value of values) {
|
|
161
|
+
replaceObjectRefs(value.previous, replacements);
|
|
162
|
+
}
|
|
163
|
+
for (const block of program.blocks) {
|
|
164
|
+
block.inputValueIds = Array.from(new Set(block.inputValueIds.map(id => replacements.get(id)?.valueId).filter(Boolean)));
|
|
165
|
+
for (const output of block.outputValues) output.ref = resolveRef(output.ref);
|
|
166
|
+
const concreteMerges = Array.from(mergeValues.values()).filter(value => value.blockId === block.id && !aliases.has(value.id)).map(value => value.id);
|
|
167
|
+
if (block.mergeSite) {
|
|
168
|
+
block.mergeSite.valueIds = concreteMerges;
|
|
169
|
+
block.mergeSite.requiresRegisterMerge = concreteMerges.length > 0;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
program.values = values.filter(value => value.origin !== "block-input" && !aliases.has(value.id));
|
|
173
|
+
return program;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export { resolveRegisterFlow };
|
|
177
|
+
//# sourceMappingURL=resolveRegisterFlow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRegisterFlow.js","sources":["../../../../../../src/formats/webgpu/core/ir/resolveRegisterFlow.js"],"sourcesContent":["const MUTABLE_REGISTER_FILES = new Set([\n \"temp\", \"output\", \"indexable_temp\", \"output_depth\", \"output_coverage\",\n \"output_control_point\", \"output_depth_greater_equal\", \"output_depth_less_equal\"\n]);\n\nfunction refKey(register, component)\n{\n return `${register}.${component}`;\n}\n\nfunction valueRef(value, component)\n{\n return { valueId: value.id, component };\n}\n\nfunction isMutableRegister(register)\n{\n return MUTABLE_REGISTER_FILES.has(register.slice(0, register.indexOf(\"[\")));\n}\n\nfunction replaceObjectRefs(object, replacements)\n{\n if (!object) return object;\n for (const [ key, ref ] of Object.entries(object)) object[key] = replacements.get(ref.valueId) || ref;\n return object;\n}\n\n/**\n * Resolves conservative block inputs through CFG predecessors and materializes\n * live cross-block merge values. Values are component-granular so masked DXBC\n * writes retain the correct incoming lanes.\n *\n * @param {object} program Mutable shader IR under construction.\n * @returns {object} The same program.\n */\nexport function resolveRegisterFlow(program)\n{\n const values = program.values;\n const blocksById = new Map(program.blocks.map((block) => [ block.id, block ]));\n const placeholders = new Map(values\n .filter((value) => value.origin === \"block-input\")\n .map((value) => [ value.id, value ]));\n const replacements = new Map();\n const externalValues = new Map();\n const mergeValues = new Map();\n const entryBlockId = program.controlFlow.entryBlockId;\n const outputMaps = new Map(program.blocks.map((block) => [\n block.id,\n new Map(block.outputValues.map((entry) => [ refKey(entry.register, entry.component), entry.ref ]))\n ]));\n\n const createValue = (data) =>\n {\n const value = { kind: \"register-value\", id: `value${values.length}`, ...data };\n values.push(value);\n return value;\n };\n\n const externalRef = (register, component) =>\n {\n const key = refKey(register, component);\n if (!externalValues.has(key))\n {\n externalValues.set(key, createValue({\n origin: isMutableRegister(register) ? \"undefined-register\" : \"program-input\",\n blockId: null,\n instructionIndex: null,\n register,\n writeMask: component,\n previous: null\n }));\n }\n return valueRef(externalValues.get(key), component);\n };\n\n let resolveEntry;\n let resolveExit;\n const resolveRef = (ref) =>\n {\n const placeholder = placeholders.get(ref.valueId);\n if (!placeholder) return replacements.get(ref.valueId) || ref;\n if (!replacements.has(ref.valueId))\n {\n replacements.set(ref.valueId, resolveEntry(\n blocksById.get(placeholder.blockId),\n placeholder.register,\n placeholder.writeMask\n ));\n }\n return replacements.get(ref.valueId);\n };\n\n resolveExit = (block, register, component) =>\n {\n const local = outputMaps.get(block.id).get(refKey(register, component));\n return local ? resolveRef(local) : resolveEntry(block, register, component);\n };\n\n resolveEntry = (block, register, component) =>\n {\n if (!isMutableRegister(register)) return externalRef(register, component);\n const key = refKey(register, component);\n const mergeKey = `${block.id}:${key}`;\n if (mergeValues.has(mergeKey)) return valueRef(mergeValues.get(mergeKey), component);\n\n const predecessorIds = Array.from(new Set(block.predecessors.map((edge) => edge.blockId)))\n .filter((id) => block.reachable && blocksById.get(id).reachable)\n .sort((a, b) => blocksById.get(a).index - blocksById.get(b).index);\n const includesProgramEntry = block.id === entryBlockId || !block.reachable || predecessorIds.length === 0;\n const incomingCount = predecessorIds.length + (includesProgramEntry ? 1 : 0);\n\n if (incomingCount === 1)\n {\n if (includesProgramEntry) return externalRef(register, component);\n return resolveExit(blocksById.get(predecessorIds[0]), register, component);\n }\n\n const merge = createValue({\n origin: \"control-flow-merge\",\n blockId: block.id,\n instructionIndex: null,\n register,\n writeMask: component,\n previous: null,\n incoming: []\n });\n mergeValues.set(mergeKey, merge);\n if (includesProgramEntry)\n {\n const ref = externalRef(register, component);\n merge.incoming.push({ kind: \"program-entry\", blockId: null, ...ref });\n }\n for (const predecessorId of predecessorIds)\n {\n const ref = resolveExit(blocksById.get(predecessorId), register, component);\n merge.incoming.push({ kind: \"predecessor\", blockId: predecessorId, ...ref });\n }\n return valueRef(merge, component);\n };\n\n for (const placeholder of placeholders.values())\n {\n if (!replacements.has(placeholder.id))\n {\n replacements.set(placeholder.id, resolveEntry(\n blocksById.get(placeholder.blockId),\n placeholder.register,\n placeholder.writeMask\n ));\n }\n }\n\n const aliases = new Map();\n const canonicalRef = (ref) =>\n {\n let current = ref;\n const seen = new Set();\n while (aliases.has(current.valueId) && !seen.has(current.valueId))\n {\n seen.add(current.valueId);\n current = aliases.get(current.valueId);\n }\n return current;\n };\n let changed = true;\n while (changed)\n {\n changed = false;\n for (const merge of mergeValues.values())\n {\n if (aliases.has(merge.id)) continue;\n const refs = merge.incoming\n .map((incoming) => canonicalRef(incoming))\n .filter((ref) => ref.valueId !== merge.id);\n const unique = Array.from(new Map(refs.map((ref) => [ `${ref.valueId}.${ref.component}`, ref ])).values());\n if (unique.length === 1)\n {\n aliases.set(merge.id, unique[0]);\n changed = true;\n }\n }\n }\n for (const [ id, ref ] of replacements) replacements.set(id, canonicalRef(ref));\n for (const [ id, ref ] of aliases) replacements.set(id, canonicalRef(ref));\n for (const merge of mergeValues.values())\n {\n if (aliases.has(merge.id)) continue;\n merge.incoming = merge.incoming.map((incoming) => ({ ...incoming, ...canonicalRef(incoming) }));\n }\n\n for (const instruction of program.instructions)\n {\n for (const read of instruction.dataflow.reads)\n {\n read.refs = read.refs.map(resolveRef);\n }\n for (const write of instruction.dataflow.writes)\n {\n replaceObjectRefs(write.previous, replacements);\n replaceObjectRefs(write.result, replacements);\n }\n }\n for (const value of values)\n {\n replaceObjectRefs(value.previous, replacements);\n }\n for (const block of program.blocks)\n {\n block.inputValueIds = Array.from(new Set(block.inputValueIds\n .map((id) => replacements.get(id)?.valueId)\n .filter(Boolean)));\n for (const output of block.outputValues) output.ref = resolveRef(output.ref);\n const concreteMerges = Array.from(mergeValues.values())\n .filter((value) => value.blockId === block.id && !aliases.has(value.id))\n .map((value) => value.id);\n if (block.mergeSite)\n {\n block.mergeSite.valueIds = concreteMerges;\n block.mergeSite.requiresRegisterMerge = concreteMerges.length > 0;\n }\n }\n\n program.values = values.filter((value) => value.origin !== \"block-input\" && !aliases.has(value.id));\n return program;\n}\n"],"names":["MUTABLE_REGISTER_FILES","Set","refKey","register","component","valueRef","value","valueId","id","isMutableRegister","has","slice","indexOf","replaceObjectRefs","object","replacements","key","ref","Object","entries","get","resolveRegisterFlow","program","values","blocksById","Map","blocks","map","block","placeholders","filter","origin","externalValues","mergeValues","entryBlockId","controlFlow","outputMaps","outputValues","entry","createValue","data","kind","length","push","externalRef","set","blockId","instructionIndex","writeMask","previous","resolveEntry","resolveExit","resolveRef","placeholder","local","mergeKey","predecessorIds","Array","from","predecessors","edge","reachable","sort","a","b","index","includesProgramEntry","incomingCount","merge","incoming","predecessorId","aliases","canonicalRef","current","seen","add","changed","refs","unique","instruction","instructions","read","dataflow","reads","write","writes","result","inputValueIds","Boolean","output","concreteMerges","mergeSite","valueIds","requiresRegisterMerge"],"mappings":"AAAA,MAAMA,sBAAsB,GAAG,IAAIC,GAAG,CAAC,CACnC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,EAAE,cAAc,EAAE,iBAAiB,EACrE,sBAAsB,EAAE,4BAA4B,EAAE,yBAAyB,CAClF,CAAC;AAEF,SAASC,MAAMA,CAACC,QAAQ,EAAEC,SAAS,EACnC;AACI,EAAA,OAAO,CAAA,EAAGD,QAAQ,CAAA,CAAA,EAAIC,SAAS,CAAA,CAAE;AACrC;AAEA,SAASC,QAAQA,CAACC,KAAK,EAAEF,SAAS,EAClC;EACI,OAAO;IAAEG,OAAO,EAAED,KAAK,CAACE,EAAE;AAAEJ,IAAAA;GAAW;AAC3C;AAEA,SAASK,iBAAiBA,CAACN,QAAQ,EACnC;AACI,EAAA,OAAOH,sBAAsB,CAACU,GAAG,CAACP,QAAQ,CAACQ,KAAK,CAAC,CAAC,EAAER,QAAQ,CAACS,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/E;AAEA,SAASC,iBAAiBA,CAACC,MAAM,EAAEC,YAAY,EAC/C;AACI,EAAA,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AE,CAAC,CAAC;AACnG,EAAA,OAAOc,OAAO;AAClB;;;;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
const DOT_LANES = Object.freeze({
|
|
2
|
+
dp2: Object.freeze(["x", "y"]),
|
|
3
|
+
dp3: Object.freeze(["x", "y", "z"]),
|
|
4
|
+
dp4: Object.freeze(["x", "y", "z", "w"])
|
|
5
|
+
});
|
|
6
|
+
const XY = Object.freeze(["x", "y"]);
|
|
7
|
+
const XYZ = Object.freeze(["x", "y", "z"]);
|
|
8
|
+
function sampledResourceDimension(instruction, program) {
|
|
9
|
+
const resource = instruction.operands?.[2];
|
|
10
|
+
if (!program || !resource) return null;
|
|
11
|
+
const reference = resource.resourceReference;
|
|
12
|
+
const binding = (program.bindings || []).find(entry => entry.resourceKind === "sampled-resource" && (reference?.rangeId !== null && reference?.rangeId !== undefined ? entry.range?.rangeId === reference.rangeId : entry.registerIndex === resource.registerIndex));
|
|
13
|
+
return binding?.resourceDimension || null;
|
|
14
|
+
}
|
|
15
|
+
function sampleCoordinateLanes(instruction, program) {
|
|
16
|
+
return ["texturecube", "texture3d", "texture2darray"].includes(sampledResourceDimension(instruction, program)) ? XYZ : XY;
|
|
17
|
+
}
|
|
18
|
+
function sampleGradientLanes(instruction, program) {
|
|
19
|
+
return ["texturecube", "texture3d"].includes(sampledResourceDimension(instruction, program)) ? XYZ : XY;
|
|
20
|
+
}
|
|
21
|
+
function loadAddressLanes(instruction, program) {
|
|
22
|
+
const dimension = sampledResourceDimension(instruction, program);
|
|
23
|
+
if (dimension === "buffer") return ["x"];
|
|
24
|
+
if (dimension === "texture2d") return ["x", "y", "w"];
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Returns intrinsic source-lane positions for instructions whose inputs are
|
|
30
|
+
* independent of the destination write mask.
|
|
31
|
+
*
|
|
32
|
+
* @param {object} instruction Decoded/IR instruction.
|
|
33
|
+
* @param {number} operandIndex Operand index within the instruction.
|
|
34
|
+
* @param {object} [program] Shader IR, used to resolve sampled-resource dimension.
|
|
35
|
+
* @returns {Array<string>|null} Fixed x/y/z/w positions, when applicable.
|
|
36
|
+
*/
|
|
37
|
+
function fixedSourceLanes(instruction, operandIndex, program = null) {
|
|
38
|
+
const dot = DOT_LANES[instruction.opcodeName];
|
|
39
|
+
if (dot && operandIndex > 0) return dot;
|
|
40
|
+
if (instruction.opcodeName === "ld" && operandIndex === 1) return loadAddressLanes(instruction, program);
|
|
41
|
+
if (instruction.opcodeName === "store_uav_typed" && operandIndex === 1) return ["x"];
|
|
42
|
+
if (instruction.opcodeName === "ld_structured" && operandIndex === 1) return ["x"];
|
|
43
|
+
if (instruction.opcodeName === "store_structured") {
|
|
44
|
+
if ([1, 2].includes(operandIndex)) return ["x"];
|
|
45
|
+
if (operandIndex === 3) {
|
|
46
|
+
const mask = Array.from(instruction.operands?.[0]?.mask || "");
|
|
47
|
+
return mask.length ? mask : null;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (["sample", "sample_b", "sample_c", "sample_c_lz", "sample_d", "sample_l", "gather4"].includes(instruction.opcodeName)) {
|
|
51
|
+
if (operandIndex === 1) return sampleCoordinateLanes(instruction, program);
|
|
52
|
+
if (instruction.opcodeName === "sample_d" && [4, 5].includes(operandIndex)) {
|
|
53
|
+
return sampleGradientLanes(instruction, program);
|
|
54
|
+
}
|
|
55
|
+
if (["sample_b", "sample_c", "sample_l"].includes(instruction.opcodeName) && operandIndex === 4) return ["x"];
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { fixedSourceLanes };
|
|
61
|
+
//# sourceMappingURL=sourceLanes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourceLanes.js","sources":["../../../../../../src/formats/webgpu/core/ir/sourceLanes.js"],"sourcesContent":["const DOT_LANES = Object.freeze({\n dp2: Object.freeze([ \"x\", \"y\" ]),\n dp3: Object.freeze([ \"x\", \"y\", \"z\" ]),\n dp4: Object.freeze([ \"x\", \"y\", \"z\", \"w\" ])\n});\n\nconst XY = Object.freeze([ \"x\", \"y\" ]);\nconst XYZ = Object.freeze([ \"x\", \"y\", \"z\" ]);\n\nfunction sampledResourceDimension(instruction, program)\n{\n const resource = instruction.operands?.[2];\n if (!program || !resource) return null;\n const reference = resource.resourceReference;\n const binding = (program.bindings || []).find((entry) => entry.resourceKind === \"sampled-resource\"\n && (reference?.rangeId !== null && reference?.rangeId !== undefined\n ? entry.range?.rangeId === reference.rangeId\n : entry.registerIndex === resource.registerIndex));\n return binding?.resourceDimension || null;\n}\n\nfunction sampleCoordinateLanes(instruction, program)\n{\n return [ \"texturecube\", \"texture3d\", \"texture2darray\" ]\n .includes(sampledResourceDimension(instruction, program))\n ? XYZ\n : XY;\n}\n\nfunction sampleGradientLanes(instruction, program)\n{\n return [ \"texturecube\", \"texture3d\" ].includes(sampledResourceDimension(instruction, program))\n ? XYZ\n : XY;\n}\n\nfunction loadAddressLanes(instruction, program)\n{\n const dimension = sampledResourceDimension(instruction, program);\n if (dimension === \"buffer\") return [ \"x\" ];\n if (dimension === \"texture2d\") return [ \"x\", \"y\", \"w\" ];\n return null;\n}\n\n/**\n * Returns intrinsic source-lane positions for instructions whose inputs are\n * independent of the destination write mask.\n *\n * @param {object} instruction Decoded/IR instruction.\n * @param {number} operandIndex Operand index within the instruction.\n * @param {object} [program] Shader IR, used to resolve sampled-resource dimension.\n * @returns {Array<string>|null} Fixed x/y/z/w positions, when applicable.\n */\nexport function fixedSourceLanes(instruction, operandIndex, program = null)\n{\n const dot = DOT_LANES[instruction.opcodeName];\n if (dot && operandIndex > 0) return dot;\n if (instruction.opcodeName === \"ld\" && operandIndex === 1) return loadAddressLanes(instruction, program);\n if (instruction.opcodeName === \"store_uav_typed\" && operandIndex === 1) return [ \"x\" ];\n if (instruction.opcodeName === \"ld_structured\" && operandIndex === 1) return [ \"x\" ];\n if (instruction.opcodeName === \"store_structured\")\n {\n if ([ 1, 2 ].includes(operandIndex)) return [ \"x\" ];\n if (operandIndex === 3)\n {\n const mask = Array.from(instruction.operands?.[0]?.mask || \"\");\n return mask.length ? mask : null;\n }\n }\n if ([ \"sample\", \"sample_b\", \"sample_c\", \"sample_c_lz\", \"sample_d\", \"sample_l\", \"gather4\" ]\n .includes(instruction.opcodeName))\n {\n if (operandIndex === 1) return sampleCoordinateLanes(instruction, program);\n if (instruction.opcodeName === \"sample_d\" && [ 4, 5 ].includes(operandIndex))\n {\n return sampleGradientLanes(instruction, program);\n }\n if ([ \"sample_b\", \"sample_c\", \"sample_l\" ].includes(instruction.opcodeName) && operandIndex === 4) return [ \"x\" ];\n }\n return null;\n}\n"],"names":["DOT_LANES","Object","freeze","dp2","dp3","dp4","XY","XYZ","sampledResourceDimension","instruction","program","resource","operands","reference","resourceReference","binding","bindings","find","entry","resourceKind","rangeId","undefined","range","registerIndex","resourceDimension","sampleCoordinateLanes","includes","sampleGradientLanes","loadAddressLanes","dimension","fixedSourceLanes","operandIndex","dot","opcodeName","mask","Array","from","length"],"mappings":"AAAA,MAAMA,SAAS,GAAGC,MAAM,CAACC,MAAM,CAAC;EAC5BC,GAAG,EAAEF,MAAM,CAACC,MAAM,CAAC,CAAE,GAAG,EAAE,GAAG,CAAE,CAAC;AAChCE,EAAAA,GAAG,EAAEH,MAAM,CAACC,MAAM,CAAC,CAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAE,CAAC;AACrCG,EAAAA,GAAG,EAAEJ,MAAM,CAACC,MAAM,CAAC,CAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAE;AAC7C,CAAC,CAAC;AAEF,MAAMI,EAAE,GAAGL,MAAM,CAACC,MAAM,CAAC,CAAE,GAAG,EAAE,GAAG,CAAE,CAAC;AACtC,MAAMK,GAAG,GAAGN,MAAM,CAACC,MAAM,CAAC,CAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAE,CAAC;AAE5C,SA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