@carbonenginejs/runtime-resource 0.19.2 → 0.22.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 +6 -0
- package/dist/CjsResMan.js +1374 -1318
- package/dist/CjsResMan.js.map +1 -1
- package/dist/format/CjsFormat.js +393 -164
- package/dist/format/CjsFormat.js.map +1 -1
- package/dist/format/CjsFormatStore.js +315 -0
- package/dist/format/CjsFormatStore.js.map +1 -0
- package/dist/format/CjsResourceProbe.js +66 -234
- package/dist/format/CjsResourceProbe.js.map +1 -1
- package/dist/format/payloadContract.js +47 -6
- package/dist/format/payloadContract.js.map +1 -1
- package/dist/formats/black/CjsBlackFormat.js +23 -6
- package/dist/formats/black/CjsBlackFormat.js.map +1 -1
- package/dist/formats/bnk/CjsBnkFormat.js +122 -120
- package/dist/formats/bnk/CjsBnkFormat.js.map +1 -1
- package/dist/formats/bnk/core/helpers.js +5 -15
- package/dist/formats/bnk/core/helpers.js.map +1 -1
- package/dist/formats/cmf/CjsCmfFormat.js +31 -14
- package/dist/formats/cmf/CjsCmfFormat.js.map +1 -1
- package/dist/formats/dds/CjsDdsFormat.js +29 -19
- package/dist/formats/dds/CjsDdsFormat.js.map +1 -1
- package/dist/formats/dds/core/helpers.js +4 -5
- package/dist/formats/dds/core/helpers.js.map +1 -1
- package/dist/formats/dxbc/CjsDxbcFormat.js +15 -13
- package/dist/formats/dxbc/CjsDxbcFormat.js.map +1 -1
- package/dist/formats/fbx/CjsFbxFormat.js +27 -19
- package/dist/formats/fbx/CjsFbxFormat.js.map +1 -1
- package/dist/formats/fbx/core/helpers.js +4 -4
- package/dist/formats/fbx/core/helpers.js.map +1 -1
- package/dist/formats/flac/CjsFlacFormat.js +19 -17
- package/dist/formats/flac/CjsFlacFormat.js.map +1 -1
- package/dist/formats/flac/core/helpers.js +5 -11
- package/dist/formats/flac/core/helpers.js.map +1 -1
- package/dist/formats/fsd/32/CjsFsd32Format.js +55 -0
- package/dist/formats/fsd/32/CjsFsd32Format.js.map +1 -0
- package/dist/formats/fsd/32/index.js +2 -0
- package/dist/formats/fsd/32/index.js.map +1 -0
- package/dist/formats/fsd/64/CjsFsd64Format.js +119 -0
- package/dist/formats/fsd/64/CjsFsd64Format.js.map +1 -0
- package/dist/formats/fsd/64/core/CjsFsd64Binary.js +393 -0
- package/dist/formats/fsd/64/core/CjsFsd64Binary.js.map +1 -0
- package/dist/formats/fsd/64/core/CjsFsd64Reader.js +138 -0
- package/dist/formats/fsd/64/core/CjsFsd64Reader.js.map +1 -0
- package/dist/formats/fsd/64/core/CjsFsd64SchemaDecoder.js +389 -0
- package/dist/formats/fsd/64/core/CjsFsd64SchemaDecoder.js.map +1 -0
- package/dist/formats/fsd/64/core/CjsFsd64SchemaReader.js +43 -0
- package/dist/formats/fsd/64/core/CjsFsd64SchemaReader.js.map +1 -0
- package/dist/formats/fsd/64/core/fsd64Records.js +60 -0
- package/dist/formats/fsd/64/core/fsd64Records.js.map +1 -0
- package/dist/formats/fsd/64/index.js +7 -0
- package/dist/formats/fsd/64/index.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64ReaderSetCharacterStaticData.js +33 -0
- package/dist/formats/fsd/64/readers/CjsFsd64ReaderSetCharacterStaticData.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaAgentTypes.js +35 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaAgentTypes.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaAgentsInSpace.js +50 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaAgentsInSpace.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaAncestries.js +75 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaAncestries.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaArchetypes.js +57 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaArchetypes.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaAudioMetadata.js +201 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaAudioMetadata.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaBloodlines.js +73 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaBloodlines.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCategories.js +53 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCategories.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterAvatarBehaviors.js +44 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterAvatarBehaviors.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterColorLocations.js +38 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterColorLocations.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterColorNames.js +34 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterColorNames.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterModifierLocations.js +34 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterModifierLocations.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterPortraitResources.js +44 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterPortraitResources.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterResources.js +81 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterResources.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterSculptingLocations.js +34 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCharacterSculptingLocations.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCompressibleTypes.js +41 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCompressibleTypes.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaContrabandTypes.js +63 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaContrabandTypes.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaControlTowerResources.js +76 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaControlTowerResources.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationActivities.js +38 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationActivities.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationRoleGroups.js +74 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationRoleGroups.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationRoles.js +59 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaCorporationRoles.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaAttributeCategories.js +46 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaAttributeCategories.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaAttributes.js +133 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaAttributes.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaEffects.js +236 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaEffects.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaUnits.js +60 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaDogmaUnits.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaDynamicItemAttributes.js +95 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaDynamicItemAttributes.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaEpicArcs.js +106 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaEpicArcs.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaExpertSystems.js +86 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaExpertSystems.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaFactions.js +117 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaFactions.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaGraphicIds.js +70 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaGraphicIds.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaGraphicMaterialSets.js +173 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaGraphicMaterialSets.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaGroups.js +77 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaGroups.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaIcons.js +62 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaIcons.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaMarketGroups.js +63 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaMarketGroups.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaMetaGroups.js +86 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaMetaGroups.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaNpcCorporationDivisions.js +72 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaNpcCorporationDivisions.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaNpcCorporations.js +326 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaNpcCorporations.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaPaperdolls.js +279 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaPaperdolls.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaRaces.js +64 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaRaces.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSchoolMap.js +40 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSchoolMap.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSchools.js +113 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSchools.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkillPlans.js +130 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkillPlans.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentCategories.js +38 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentCategories.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentPointValues.js +45 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentPointValues.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentRarities.js +44 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponentRarities.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponents.js +163 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrComponents.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotCategories.js +37 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotCategories.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotConfigurations.js +77 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotConfigurations.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotNames.js +37 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlotNames.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlots.js +74 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrSlots.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrTierThresholds.js +44 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaSkinrTierThresholds.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaStationOperations.js +120 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaStationOperations.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaStationServices.js +49 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaStationServices.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeDogma.js +73 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeDogma.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeLists.js +122 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeLists.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeMaterials.js +83 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypeMaterials.js.map +1 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypes.js +194 -0
- package/dist/formats/fsd/64/readers/CjsFsd64SchemaTypes.js.map +1 -0
- package/dist/formats/fsd/64/readers/index.js +58 -0
- package/dist/formats/fsd/64/readers/index.js.map +1 -0
- package/dist/formats/fsd/CjsFsdFormat.js +62 -0
- package/dist/formats/fsd/CjsFsdFormat.js.map +1 -0
- package/dist/formats/fsd/index.js +9 -0
- package/dist/formats/fsd/index.js.map +1 -0
- package/dist/formats/gif/CjsGifFormat.js +26 -16
- package/dist/formats/gif/CjsGifFormat.js.map +1 -1
- package/dist/formats/gif/core/helpers.js +6 -18
- package/dist/formats/gif/core/helpers.js.map +1 -1
- package/dist/formats/gltf/CjsGltfFormat.js +25 -13
- package/dist/formats/gltf/CjsGltfFormat.js.map +1 -1
- package/dist/formats/gr2/CjsGr2Format.js +27 -6
- package/dist/formats/gr2/CjsGr2Format.js.map +1 -1
- package/dist/formats/hlsl/CjsHlslFormat.js +20 -16
- package/dist/formats/hlsl/CjsHlslFormat.js.map +1 -1
- package/dist/formats/hlsl/core/analysis.js +1 -1
- package/dist/formats/index.js +5 -0
- package/dist/formats/index.js.map +1 -1
- package/dist/formats/jpeg/CjsJpegFormat.js +26 -19
- package/dist/formats/jpeg/CjsJpegFormat.js.map +1 -1
- package/dist/formats/jpeg/core/helpers.js +6 -15
- package/dist/formats/jpeg/core/helpers.js.map +1 -1
- package/dist/formats/jpeg/core/jpeg.js +0 -3
- package/dist/formats/jpeg/core/jpeg.js.map +1 -1
- package/dist/formats/mp3/CjsMp3Format.js +19 -19
- package/dist/formats/mp3/CjsMp3Format.js.map +1 -1
- package/dist/formats/mp3/core/helpers.js +5 -11
- package/dist/formats/mp3/core/helpers.js.map +1 -1
- package/dist/formats/mp4/CjsMp4Format.js +20 -19
- package/dist/formats/mp4/CjsMp4Format.js.map +1 -1
- package/dist/formats/mp4/core/helpers.js +6 -15
- package/dist/formats/mp4/core/helpers.js.map +1 -1
- package/dist/formats/obj/CjsObjFormat.js +25 -12
- package/dist/formats/obj/CjsObjFormat.js.map +1 -1
- package/dist/formats/ogg/CjsOggFormat.js +26 -17
- package/dist/formats/ogg/CjsOggFormat.js.map +1 -1
- package/dist/formats/ogg/core/helpers.js +5 -16
- package/dist/formats/ogg/core/helpers.js.map +1 -1
- package/dist/formats/pickle/CjsPickleFormat.js +64 -5
- package/dist/formats/pickle/CjsPickleFormat.js.map +1 -1
- package/dist/formats/png/CjsPngFormat.js +28 -19
- package/dist/formats/png/CjsPngFormat.js.map +1 -1
- package/dist/formats/png/core/helpers.js +5 -14
- package/dist/formats/png/core/helpers.js.map +1 -1
- package/dist/formats/red/CjsRedFormat.js +19 -5
- package/dist/formats/red/CjsRedFormat.js.map +1 -1
- package/dist/formats/schemabound/CjsSchemaBoundFormat.js +48 -38
- package/dist/formats/schemabound/CjsSchemaBoundFormat.js.map +1 -1
- package/dist/formats/sqlite/CjsSqliteFormat.js +49 -41
- package/dist/formats/sqlite/CjsSqliteFormat.js.map +1 -1
- package/dist/formats/static/CjsStaticFormat.js +15 -57
- package/dist/formats/static/CjsStaticFormat.js.map +1 -1
- package/dist/formats/static/staticContainers.js +6 -6
- package/dist/formats/static/staticContainers.js.map +1 -1
- package/dist/formats/stl/CjsStlFormat.js +25 -12
- package/dist/formats/stl/CjsStlFormat.js.map +1 -1
- package/dist/formats/tga/CjsTgaFormat.js +26 -19
- package/dist/formats/tga/CjsTgaFormat.js.map +1 -1
- package/dist/formats/tga/core/helpers.js +7 -22
- package/dist/formats/tga/core/helpers.js.map +1 -1
- package/dist/formats/wav/CjsWavFormat.js +26 -19
- package/dist/formats/wav/CjsWavFormat.js.map +1 -1
- package/dist/formats/wav/core/helpers.js +7 -16
- package/dist/formats/wav/core/helpers.js.map +1 -1
- package/dist/formats/webgl/CjsWebglFormat.js +11 -13
- package/dist/formats/webgl/CjsWebglFormat.js.map +1 -1
- package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js +90 -12
- package/dist/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
- package/dist/formats/webgl/core/helpers.js +2 -2
- package/dist/formats/webgl/core/helpers.js.map +1 -1
- package/dist/formats/webgl/core/readGlslEffectContainer.js +8 -8
- package/dist/formats/webgl/core/readGlslEffectContainer.js.map +1 -1
- package/dist/formats/webgpu/CjsWebgpuFormat.js +11 -5
- package/dist/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
- package/dist/formats/webm/CjsWebmFormat.js +20 -19
- package/dist/formats/webm/CjsWebmFormat.js.map +1 -1
- package/dist/formats/webm/core/helpers.js +6 -15
- package/dist/formats/webm/core/helpers.js.map +1 -1
- package/dist/formats/webp/CjsWebpFormat.js +19 -17
- package/dist/formats/webp/CjsWebpFormat.js.map +1 -1
- package/dist/formats/webp/core/helpers.js +5 -11
- package/dist/formats/webp/core/helpers.js.map +1 -1
- package/dist/formats/wem/CjsWemFormat.js +128 -141
- package/dist/formats/wem/CjsWemFormat.js.map +1 -1
- package/dist/formats/wem/core/helpers.js +1 -114
- package/dist/formats/wem/core/helpers.js.map +1 -1
- package/dist/formats/wem/core/{resolve.js → probeCodecSupport.js} +11 -18
- package/dist/formats/wem/core/probeCodecSupport.js.map +1 -0
- package/dist/formats/yaml/CjsYamlFormat.js +20 -5
- package/dist/formats/yaml/CjsYamlFormat.js.map +1 -1
- package/dist/generated/index.js +2 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/generated/resources/Tr2RaycastGeometryRes.js +34 -0
- package/dist/generated/resources/Tr2RaycastGeometryRes.js.map +1 -0
- package/dist/generated/resources/index.js +2 -0
- package/dist/generated/resources/index.js.map +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/resource/CjsResource.js +134 -0
- package/dist/resource/CjsResource.js.map +1 -1
- package/dist/resource/ResourceRequirement.js +42 -0
- package/dist/resource/ResourceRequirement.js.map +1 -0
- package/dist/resource/Tr2LightProfileRes.js +2 -1
- package/dist/resource/Tr2LightProfileRes.js.map +1 -1
- package/dist/resource/geometry/TriGeometryRes.js +34 -7
- package/dist/resource/geometry/TriGeometryRes.js.map +1 -1
- package/dist/resource/geometry/granny/Tr2GrannyStateRes.js +184 -7
- package/dist/resource/geometry/granny/Tr2GrannyStateRes.js.map +1 -1
- package/dist/resource/geometry/granny/TriGrannyRes.js +20 -8
- package/dist/resource/geometry/granny/TriGrannyRes.js.map +1 -1
- package/dist/resource/index.js +1 -0
- package/dist/resource/index.js.map +1 -1
- package/dist/resource/resourceBoundary.js +24 -1
- package/dist/resource/resourceBoundary.js.map +1 -1
- package/dist/resource/shader/Tr2EffectRes.js +2 -1
- package/dist/resource/shader/Tr2EffectRes.js.map +1 -1
- package/dist/resource/texture/CjsTextureArrayRes.js +2 -1
- package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -1
- package/dist/resource/texture/Tr2ImageRes.js +2 -1
- package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
- package/dist/resource/texture/TriTextureRes.js +40 -2
- package/dist/resource/texture/TriTextureRes.js.map +1 -1
- package/docs/architecture.md +121 -116
- package/docs/concepts/format-capabilities.md +90 -0
- package/docs/formats/README.md +14 -6
- package/docs/formats/fsd.md +104 -0
- package/docs/formats/gr2.md +1 -1
- package/docs/formats/hlsl/reference/api.md +6 -4
- package/docs/formats/provenance.md +18 -0
- package/docs/formats/schemabound.md +10 -4
- package/docs/formats/static.md +26 -26
- package/docs/formats/webgpu/reference/api.md +4 -3
- package/docs/reference/classes/core.md +22 -2
- package/docs/reference/classes/formats.md +643 -1
- package/docs/reference/classes/resources.md +463 -453
- package/docs/reference/queues.md +205 -194
- package/docs/roadmap.md +14 -18
- package/format-notices/fsd/LICENSE +21 -0
- package/format-notices/fsd/NOTICE +11 -0
- package/package.json +70 -64
- package/dist/formats/wem/core/resolve.js.map +0 -1
- package/docs/concepts/format-type-resolution.md +0 -79
|
@@ -1,17 +1,9 @@
|
|
|
1
|
+
import { CjsFormat } from '../../format/CjsFormat.js';
|
|
1
2
|
import { DEFAULT_VALUES, normalizeValues, emitGlslWithOptions, toJsonValue, isWebglEffectContainer, OUTPUT_JSON } from './core/helpers.js';
|
|
2
3
|
import { buildEffectPackage } from './core/effectPackage.js';
|
|
3
4
|
import { readGlslEffectContainer } from './core/readGlslEffectContainer.js';
|
|
4
5
|
import { inspectGlslEffectContainer } from './core/inspectGlslEffectContainer.js';
|
|
5
6
|
|
|
6
|
-
/**
|
|
7
|
-
* Exposed CarbonEngineJS-facing WebGL format class.
|
|
8
|
-
*
|
|
9
|
-
* Keep this file small and reviewable: container decoding lives in
|
|
10
|
-
* core/readGlslEffectContainer.js, summarising in
|
|
11
|
-
* core/inspectGlslEffectContainer.js, the DXBC-to-GLSL ES 3.00 emitter under
|
|
12
|
-
* core/glsl, and option normalization in core/helpers.js.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
7
|
const FORMAT_NAME = "CjsWebglFormat";
|
|
16
8
|
|
|
17
9
|
/**
|
|
@@ -26,7 +18,7 @@ const FORMAT_NAME = "CjsWebglFormat";
|
|
|
26
18
|
* records; `Inspect` is a cheap structural summary; `BuildEffect` translates a
|
|
27
19
|
* compiled Tr2 effect into one; `EmitGlsl` translates a single DXBC stage.
|
|
28
20
|
*/
|
|
29
|
-
class CjsWebglFormat {
|
|
21
|
+
class CjsWebglFormat extends CjsFormat {
|
|
30
22
|
#emit = DEFAULT_VALUES.emit;
|
|
31
23
|
#source = DEFAULT_VALUES.source;
|
|
32
24
|
|
|
@@ -36,6 +28,7 @@ class CjsWebglFormat {
|
|
|
36
28
|
* @param {object} [options] Default format values.
|
|
37
29
|
*/
|
|
38
30
|
constructor(options = {}) {
|
|
31
|
+
super();
|
|
39
32
|
this.SetValues(options);
|
|
40
33
|
}
|
|
41
34
|
|
|
@@ -188,10 +181,15 @@ class CjsWebglFormat {
|
|
|
188
181
|
return toJsonValue(value);
|
|
189
182
|
}
|
|
190
183
|
static OUTPUT_JSON = OUTPUT_JSON;
|
|
191
|
-
static
|
|
184
|
+
static id = "webgl";
|
|
192
185
|
static mediaTypes = Object.freeze(["shader"]);
|
|
193
|
-
static
|
|
194
|
-
|
|
186
|
+
static outputs = CjsFormat.defineOutputs({
|
|
187
|
+
json: {
|
|
188
|
+
default: true,
|
|
189
|
+
decoded: true
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
static extensions = Object.freeze([]);
|
|
195
193
|
static packageVersion = "0.2.0";
|
|
196
194
|
}
|
|
197
195
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CjsWebglFormat.js","sources":["../../../../src/formats/webgl/CjsWebglFormat.js"],"sourcesContent":["/**\n * Exposed CarbonEngineJS-facing WebGL format class.\n *\n * Keep this file small and reviewable: container decoding lives in\n * core/readGlslEffectContainer.js, summarising in\n * core/inspectGlslEffectContainer.js, the DXBC-to-GLSL ES 3.00 emitter under\n * core/glsl, and option normalization in core/helpers.js.\n */\n\nimport {\n DEFAULT_VALUES,\n OUTPUT_JSON,\n emitGlslWithOptions,\n isWebglEffectContainer,\n normalizeValues,\n toJsonValue\n} from \"./core/helpers.js\";\nimport { buildEffectPackage } from \"./core/effectPackage.js\";\nimport { readGlslEffectContainer } from \"./core/readGlslEffectContainer.js\";\nimport { inspectGlslEffectContainer } from \"./core/inspectGlslEffectContainer.js\";\n\nconst FORMAT_NAME = \"CjsWebglFormat\";\n\n/**\n * CarbonEngineJS-facing format surface for `.carbonwebgl` WebGL shader packages, and\n * a DXBC -> GLSL ES 3.00 emitter for the WebGL2 vertex/pixel/map-style-compute\n * stages ccpwgl targets.\n *\n * The Cjs prefix marks this as a JavaScript format/construction boundary. A\n * WebGL effect is a stock Carbon effect container whose stored programs are\n * GLSL ES 3.00 - the same file shape Carbon ships for its own backends, and the\n * same one WebGPU emits with WGSL. `Read` decodes one into stage and shader\n * records; `Inspect` is a cheap structural summary; `BuildEffect` translates a\n * compiled Tr2 effect into one; `EmitGlsl` translates a single DXBC stage.\n */\nexport class CjsWebglFormat\n{\n\n #emit = DEFAULT_VALUES.emit;\n #source = DEFAULT_VALUES.source;\n\n /**\n * Create a reusable format profile.\n *\n * @param {object} [options] Default format values.\n */\n constructor(options = {})\n {\n this.SetValues(options);\n }\n\n /**\n * Set format values for this reusable profile.\n *\n * @param {object} [options] Values to merge into the profile.\n * @returns {CjsWebglFormat} This format profile.\n */\n SetValues(options = {})\n {\n const values = normalizeValues(this.GetValues(), options, FORMAT_NAME);\n\n this.#emit = values.emit;\n this.#source = values.source;\n\n return this;\n }\n\n /**\n * Get this profile's current values, optionally with per-call overrides.\n *\n * @param {object} [options] Optional values to merge into a copy.\n * @returns {object} A copy of the effective values.\n */\n GetValues(options = {})\n {\n return normalizeValues({\n emit: this.#emit,\n source: this.#source\n }, options, FORMAT_NAME);\n }\n\n /**\n * Decode an effect container into stage and shader records.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Per-call value overrides.\n * @returns {object} Stage graph in the completeness rules' vocabulary.\n */\n Read(input, options = {})\n {\n return readGlslEffectContainer(input, this.GetValues(options));\n }\n\n /**\n * Summarise an effect container without decoding every body's records.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Per-call value overrides.\n * @returns {object} Plain summary data.\n */\n Inspect(input, options = {})\n {\n return inspectGlslEffectContainer(input, this.GetValues(options));\n }\n\n /**\n * Translates one DXBC vertex/pixel/map-style-compute stage into GLSL ES 3.00.\n *\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.\n * @param {object} [options] Combined ccpwgl-profile/emit options. See {@link CjsWebglFormat.emitGlsl}.\n * @returns {object} GLSL text plus the IO contract the packaging layer records.\n */\n EmitGlsl(dxbcBytes, options = {})\n {\n return emitGlslWithOptions(dxbcBytes, options);\n }\n\n /**\n * Builds a complete effect container from compiled Tr2 effect bytes.\n *\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\n * @param {object} [options] Selection, provenance, and emitter policy.\n * @returns {object} Package bytes plus inspection and qualification records.\n */\n BuildEffect(input, options = {})\n {\n return buildEffectPackage(input, options);\n }\n\n /**\n * Instance JSON-compatible conversion.\n *\n * @param {any} value Format output to convert.\n * @returns {any} Plain JSON-compatible data.\n */\n ToJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * Static payload sniff. Static methods use camelCase by convention.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate bytes.\n * @returns {boolean} True when the payload has the container shape.\n */\n static isWebglEffectContainer(input)\n {\n return isWebglEffectContainer(input);\n }\n\n /**\n * Static one-shot container decode.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Format values.\n * @returns {object} Stage graph in the completeness rules' vocabulary.\n */\n static read(input, options = {})\n {\n return readGlslEffectContainer(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Static one-shot inspection.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Format values.\n * @returns {object} Plain summary data.\n */\n static inspect(input, options = {})\n {\n return inspectGlslEffectContainer(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Static one-shot DXBC-to-GLSL emission.\n *\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.\n * @param {object} [options] Combined ccpwgl-profile/emit options: `constantBufferStyle`\n * (`\"array\"` (default) uniform `vec4[]` for ccpwgl's uniform4fv path, or `\"std140\"`),\n * `pixelConstantBufferRemap` (default `{ 0: 7 }`, pixel-stage cb slot renames),\n * `samplerName(register, stageName)` (naming function), `vertexStructuredCapacity`\n * (default 69, bone-array element capacity), `dataTextureWidth` (default 2048),\n * `pairVaryings` (per-call varying zero-fill list), `source` (per-call error-detail name).\n * @returns {object} GLSL text plus the IO contract the packaging layer records.\n */\n static emitGlsl(dxbcBytes, options = {})\n {\n return emitGlslWithOptions(dxbcBytes, options);\n }\n\n /**\n * Static whole-effect container builder.\n *\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\n * @param {object} [options] Selection, provenance, and emitter policy.\n * @returns {object} Package bytes plus inspection and qualification records.\n */\n static buildEffect(input, options = {})\n {\n return buildEffectPackage(input, options);\n }\n\n /**\n * Static JSON-compatible conversion.\n *\n * @param {any} value Format output to convert.\n * @returns {any} Plain JSON-compatible data.\n */\n static toJSON(value)\n {\n return toJsonValue(value);\n }\n\n static OUTPUT_JSON = OUTPUT_JSON;\n static type = Object.freeze([ \"shader\" ]);\n static mediaTypes = Object.freeze([ \"shader\" ]);\n static inputTypes = Object.freeze([ \"carbonwebgl\" ]);\n static outputTypes = Object.freeze([ OUTPUT_JSON ]);\n static packageVersion = \"0.2.0\";\n\n}\n\nexport default CjsWebglFormat;\n"],"names":["FORMAT_NAME","CjsWebglFormat","DEFAULT_VALUES","emit","source","constructor","options","SetValues","values","normalizeValues","GetValues","Read","input","readGlslEffectContainer","Inspect","inspectGlslEffectContainer","EmitGlsl","dxbcBytes","emitGlslWithOptions","BuildEffect","buildEffectPackage","ToJSON","value","toJsonValue","isWebglEffectContainer","read","inspect","emitGlsl","buildEffect","toJSON","OUTPUT_JSON","type","Object","freeze","mediaTypes","inputTypes","outputTypes","packageVersion"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"CjsWebglFormat.js","sources":["../../../../src/formats/webgl/CjsWebglFormat.js"],"sourcesContent":["import { CjsFormat } from \"../../format/CjsFormat.js\";\n/**\n * Exposed CarbonEngineJS-facing WebGL format class.\n *\n * Keep this file small and reviewable: container decoding lives in\n * core/readGlslEffectContainer.js, summarising in\n * core/inspectGlslEffectContainer.js, the DXBC-to-GLSL ES 3.00 emitter under\n * core/glsl, and option normalization in core/helpers.js.\n */\n\nimport {\n DEFAULT_VALUES,\n OUTPUT_JSON,\n emitGlslWithOptions,\n isWebglEffectContainer,\n normalizeValues,\n toJsonValue\n} from \"./core/helpers.js\";\nimport { buildEffectPackage } from \"./core/effectPackage.js\";\nimport { readGlslEffectContainer } from \"./core/readGlslEffectContainer.js\";\nimport { inspectGlslEffectContainer } from \"./core/inspectGlslEffectContainer.js\";\n\nconst FORMAT_NAME = \"CjsWebglFormat\";\n\n/**\n * CarbonEngineJS-facing format surface for `.carbonwebgl` WebGL shader packages, and\n * a DXBC -> GLSL ES 3.00 emitter for the WebGL2 vertex/pixel/map-style-compute\n * stages ccpwgl targets.\n *\n * The Cjs prefix marks this as a JavaScript format/construction boundary. A\n * WebGL effect is a stock Carbon effect container whose stored programs are\n * GLSL ES 3.00 - the same file shape Carbon ships for its own backends, and the\n * same one WebGPU emits with WGSL. `Read` decodes one into stage and shader\n * records; `Inspect` is a cheap structural summary; `BuildEffect` translates a\n * compiled Tr2 effect into one; `EmitGlsl` translates a single DXBC stage.\n */\nexport class CjsWebglFormat extends CjsFormat\n{\n\n #emit = DEFAULT_VALUES.emit;\n #source = DEFAULT_VALUES.source;\n\n /**\n * Create a reusable format profile.\n *\n * @param {object} [options] Default format values.\n */\n constructor(options = {})\n {\n super();\n this.SetValues(options);\n }\n\n /**\n * Set format values for this reusable profile.\n *\n * @param {object} [options] Values to merge into the profile.\n * @returns {CjsWebglFormat} This format profile.\n */\n SetValues(options = {})\n {\n const values = normalizeValues(this.GetValues(), options, FORMAT_NAME);\n\n this.#emit = values.emit;\n this.#source = values.source;\n\n return this;\n }\n\n /**\n * Get this profile's current values, optionally with per-call overrides.\n *\n * @param {object} [options] Optional values to merge into a copy.\n * @returns {object} A copy of the effective values.\n */\n GetValues(options = {})\n {\n return normalizeValues({\n emit: this.#emit,\n source: this.#source\n }, options, FORMAT_NAME);\n }\n\n /**\n * Decode an effect container into stage and shader records.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Per-call value overrides.\n * @returns {object} Stage graph in the completeness rules' vocabulary.\n */\n Read(input, options = {})\n {\n return readGlslEffectContainer(input, this.GetValues(options));\n }\n\n /**\n * Summarise an effect container without decoding every body's records.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Per-call value overrides.\n * @returns {object} Plain summary data.\n */\n Inspect(input, options = {})\n {\n return inspectGlslEffectContainer(input, this.GetValues(options));\n }\n\n /**\n * Translates one DXBC vertex/pixel/map-style-compute stage into GLSL ES 3.00.\n *\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.\n * @param {object} [options] Combined ccpwgl-profile/emit options. See {@link CjsWebglFormat.emitGlsl}.\n * @returns {object} GLSL text plus the IO contract the packaging layer records.\n */\n EmitGlsl(dxbcBytes, options = {})\n {\n return emitGlslWithOptions(dxbcBytes, options);\n }\n\n /**\n * Builds a complete effect container from compiled Tr2 effect bytes.\n *\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\n * @param {object} [options] Selection, provenance, and emitter policy.\n * @returns {object} Package bytes plus inspection and qualification records.\n */\n BuildEffect(input, options = {})\n {\n return buildEffectPackage(input, options);\n }\n\n /**\n * Instance JSON-compatible conversion.\n *\n * @param {any} value Format output to convert.\n * @returns {any} Plain JSON-compatible data.\n */\n ToJSON(value)\n {\n return toJsonValue(value);\n }\n\n /**\n * Static payload sniff. Static methods use camelCase by convention.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Candidate bytes.\n * @returns {boolean} True when the payload has the container shape.\n */\n static isWebglEffectContainer(input)\n {\n return isWebglEffectContainer(input);\n }\n\n /**\n * Static one-shot container decode.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Format values.\n * @returns {object} Stage graph in the completeness rules' vocabulary.\n */\n static read(input, options = {})\n {\n return readGlslEffectContainer(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Static one-shot inspection.\n *\n * @param {Uint8Array|ArrayBuffer|Buffer|DataView} input Container bytes.\n * @param {object} [options] Format values.\n * @returns {object} Plain summary data.\n */\n static inspect(input, options = {})\n {\n return inspectGlslEffectContainer(input, normalizeValues(DEFAULT_VALUES, options, FORMAT_NAME));\n }\n\n /**\n * Static one-shot DXBC-to-GLSL emission.\n *\n * @param {ArrayBuffer|ArrayBufferView|Uint8Array} dxbcBytes DXBC container bytes.\n * @param {object} [options] Combined ccpwgl-profile/emit options: `constantBufferStyle`\n * (`\"array\"` (default) uniform `vec4[]` for ccpwgl's uniform4fv path, or `\"std140\"`),\n * `pixelConstantBufferRemap` (default `{ 0: 7 }`, pixel-stage cb slot renames),\n * `samplerName(register, stageName)` (naming function), `vertexStructuredCapacity`\n * (default 69, bone-array element capacity), `dataTextureWidth` (default 2048),\n * `pairVaryings` (per-call varying zero-fill list), `source` (per-call error-detail name).\n * @returns {object} GLSL text plus the IO contract the packaging layer records.\n */\n static emitGlsl(dxbcBytes, options = {})\n {\n return emitGlslWithOptions(dxbcBytes, options);\n }\n\n /**\n * Static whole-effect container builder.\n *\n * @param {Uint8Array|ArrayBuffer|ArrayBufferView} input Compiled effect bytes.\n * @param {object} [options] Selection, provenance, and emitter policy.\n * @returns {object} Package bytes plus inspection and qualification records.\n */\n static buildEffect(input, options = {})\n {\n return buildEffectPackage(input, options);\n }\n\n /**\n * Static JSON-compatible conversion.\n *\n * @param {any} value Format output to convert.\n * @returns {any} Plain JSON-compatible data.\n */\n static toJSON(value)\n {\n return toJsonValue(value);\n }\n\n static OUTPUT_JSON = OUTPUT_JSON;\n static id = \"webgl\";\n static mediaTypes = Object.freeze([ \"shader\" ]);\n static outputs = CjsFormat.defineOutputs({\n json: { default: true, decoded: true }\n });\n static extensions = Object.freeze([]);\n static packageVersion = \"0.2.0\";\n\n}\n\nexport default CjsWebglFormat;\n"],"names":["FORMAT_NAME","CjsWebglFormat","CjsFormat","DEFAULT_VALUES","emit","source","constructor","options","SetValues","values","normalizeValues","GetValues","Read","input","readGlslEffectContainer","Inspect","inspectGlslEffectContainer","EmitGlsl","dxbcBytes","emitGlslWithOptions","BuildEffect","buildEffectPackage","ToJSON","value","toJsonValue","isWebglEffectContainer","read","inspect","emitGlsl","buildEffect","toJSON","OUTPUT_JSON","id","mediaTypes","Object","freeze","outputs","defineOutputs","json","default","decoded","extensions","packageVersion"],"mappings":";;;;;;AAsBA,MAAMA,WAAW,GAAG,gBAAgB;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,cAAc,SAASC,SAAS,CAC7C;AAEI,EAAA,KAAK,GAAGC,cAAc,CAACC,IAAI;AAC3B,EAAA,OAAO,GAAGD,cAAc,CAACE,MAAM;;AAE/B;AACJ;AACA;AACA;AACA;AACIC,EAAAA,WAAWA,CAACC,OAAO,GAAG,EAAE,EACxB;AACI,IAAA,KAAK,EAAE;AACP,IAAA,IAAI,CAACC,SAAS,CAACD,OAAO,CAAC;AAC3B,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACIC,EAAAA,SAASA,CAACD,OAAO,GAAG,EAAE,EACtB;AACI,IAAA,MAAME,MAAM,GAAGC,eAAe,CAAC,IAAI,CAACC,SAAS,EAAE,EAAEJ,OAAO,EAAEP,WAAW,CAAC;AAEtE,IAAA,IAAI,CAAC,KAAK,GAAGS,MAAM,CAACL,IAAI;AACxB,IAAA,IAAI,CAAC,OAAO,GAAGK,MAAM,CAACJ,MAAM;AAE5B,IAAA,OAAO,IAAI;AACf,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACIM,EAAAA,SAASA,CAACJ,OAAO,GAAG,EAAE,EACtB;AACI,IAAA,OAAOG,eAAe,CAAC;AACnBN,MAAAA,IAAI,EAAE,IAAI,CAAC,KAAK;MAChBC,MAAM,EAAE,IAAI,CAAC;AACjB,KAAC,EAAEE,OAAO,EAAEP,WAAW,CAAC;AAC5B,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACIY,EAAAA,IAAIA,CAACC,KAAK,EAAEN,OAAO,GAAG,EAAE,EACxB;IACI,OAAOO,uBAAuB,CAACD,KAAK,EAAE,IAAI,CAACF,SAAS,CAACJ,OAAO,CAAC,CAAC;AAClE,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACIQ,EAAAA,OAAOA,CAACF,KAAK,EAAEN,OAAO,GAAG,EAAE,EAC3B;IACI,OAAOS,0BAA0B,CAACH,KAAK,EAAE,IAAI,CAACF,SAAS,CAACJ,OAAO,CAAC,CAAC;AACrE,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACIU,EAAAA,QAAQA,CAACC,SAAS,EAAEX,OAAO,GAAG,EAAE,EAChC;AACI,IAAA,OAAOY,mBAAmB,CAACD,SAAS,EAAEX,OAAO,CAAC;AAClD,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACIa,EAAAA,WAAWA,CAACP,KAAK,EAAEN,OAAO,GAAG,EAAE,EAC/B;AACI,IAAA,OAAOc,kBAAkB,CAACR,KAAK,EAAEN,OAAO,CAAC;AAC7C,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;EACIe,MAAMA,CAACC,KAAK,EACZ;IACI,OAAOC,WAAW,CAACD,KAAK,CAAC;AAC7B,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;EACI,OAAOE,sBAAsBA,CAACZ,KAAK,EACnC;IACI,OAAOY,sBAAsB,CAACZ,KAAK,CAAC;AACxC,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACA;EACI,OAAOa,IAAIA,CAACb,KAAK,EAAEN,OAAO,GAAG,EAAE,EAC/B;AACI,IAAA,OAAOO,uBAAuB,CAACD,KAAK,EAAEH,eAAe,CAACP,cAAc,EAAEI,OAAO,EAAEP,WAAW,CAAC,CAAC;AAChG,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACA;EACI,OAAO2B,OAAOA,CAACd,KAAK,EAAEN,OAAO,GAAG,EAAE,EAClC;AACI,IAAA,OAAOS,0BAA0B,CAACH,KAAK,EAAEH,eAAe,CAACP,cAAc,EAAEI,OAAO,EAAEP,WAAW,CAAC,CAAC;AACnG,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACI,OAAO4B,QAAQA,CAACV,SAAS,EAAEX,OAAO,GAAG,EAAE,EACvC;AACI,IAAA,OAAOY,mBAAmB,CAACD,SAAS,EAAEX,OAAO,CAAC;AAClD,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;AACA;EACI,OAAOsB,WAAWA,CAAChB,KAAK,EAAEN,OAAO,GAAG,EAAE,EACtC;AACI,IAAA,OAAOc,kBAAkB,CAACR,KAAK,EAAEN,OAAO,CAAC;AAC7C,EAAA;;AAEA;AACJ;AACA;AACA;AACA;AACA;EACI,OAAOuB,MAAMA,CAACP,KAAK,EACnB;IACI,OAAOC,WAAW,CAACD,KAAK,CAAC;AAC7B,EAAA;EAEA,OAAOQ,WAAW,GAAGA,WAAW;EAChC,OAAOC,EAAE,GAAG,OAAO;EACnB,OAAOC,UAAU,GAAGC,MAAM,CAACC,MAAM,CAAC,CAAE,QAAQ,CAAE,CAAC;AAC/C,EAAA,OAAOC,OAAO,GAAGlC,SAAS,CAACmC,aAAa,CAAC;AACrCC,IAAAA,IAAI,EAAE;AAAEC,MAAAA,OAAO,EAAE,IAAI;AAAEC,MAAAA,OAAO,EAAE;AAAK;AACzC,GAAC,CAAC;AACF,EAAA,OAAOC,UAAU,GAAGP,MAAM,CAACC,MAAM,CAAC,EAAE,CAAC;EACrC,OAAOO,cAAc,GAAG,OAAO;AAEnC;;;;"}
|
|
@@ -133,8 +133,33 @@ class DxbcGlslEmitter {
|
|
|
133
133
|
// into one array binding frees two texture units on shaders that
|
|
134
134
|
// sit exactly on WebGL2's 16-unit limit.
|
|
135
135
|
detailMapArrayRegisters: [],
|
|
136
|
+
// Which end of the source clip range is NEAR, and therefore which
|
|
137
|
+
// form the depth-range fixup takes.
|
|
138
|
+
//
|
|
139
|
+
// "reversed" (default) z_clip [w, 0] -> gl_Position.z = w - 2z
|
|
140
|
+
// "forward" z_clip [0, w] -> gl_Position.z = 2z - w
|
|
141
|
+
//
|
|
142
|
+
// The default is "reversed" because that is what the shaders this
|
|
143
|
+
// emitter translates were compiled against, and it is a property of
|
|
144
|
+
// the INPUT, not a preference of any one consumer. It is stated as
|
|
145
|
+
// an option rather than hard-coded for two reasons: the assumption
|
|
146
|
+
// is otherwise invisible in the output, and a future source may not
|
|
147
|
+
// share it. Deciding it here also means a consumer supplies a
|
|
148
|
+
// matching projection or gets inverted depth, which is a real
|
|
149
|
+
// coupling and better declared than implied.
|
|
150
|
+
//
|
|
151
|
+
// Switch to "forward" to A/B the convention against a forward-range
|
|
152
|
+
// projection. Expect an unbiased vertex to look identical either
|
|
153
|
+
// way - the fixup and the projection compose to the identity - and
|
|
154
|
+
// only shader-authored depth offsets to change sign. That is the
|
|
155
|
+
// whole observable difference, and it is what makes the wrong
|
|
156
|
+
// choice so hard to see.
|
|
157
|
+
depthRange: "reversed",
|
|
136
158
|
...options.profile
|
|
137
159
|
};
|
|
160
|
+
if (this.profile.depthRange !== "reversed" && this.profile.depthRange !== "forward") {
|
|
161
|
+
throw new TypeError(`DxbcGlslEmitter: depthRange must be "reversed" or "forward", got ${JSON.stringify(this.profile.depthRange)}`);
|
|
162
|
+
}
|
|
138
163
|
}
|
|
139
164
|
|
|
140
165
|
/**
|
|
@@ -2957,11 +2982,37 @@ DxbcGlslEmitter.prototype._ldStructured = function _ldStructured(state, instruct
|
|
|
2957
2982
|
});
|
|
2958
2983
|
}
|
|
2959
2984
|
const offsetDwords = offsetOperand.immediateValues[0].uint32 >> 2;
|
|
2960
|
-
|
|
2985
|
+
let element = state.formatter.sourceExpression(instruction.operands[1], {
|
|
2961
2986
|
destMask: "x",
|
|
2962
2987
|
as: "int"
|
|
2963
2988
|
});
|
|
2964
2989
|
const swizzle = resourceOperand.swizzle || "xyzw";
|
|
2990
|
+
|
|
2991
|
+
// `ld_structured` reads its address ONCE and writes every masked component
|
|
2992
|
+
// from that one read. This emitter scalarises the write into one assignment
|
|
2993
|
+
// per component and re-substitutes the address expression in each, so when
|
|
2994
|
+
// the destination register is also the address register, the second
|
|
2995
|
+
// component onwards reads the value the first assignment just stored.
|
|
2996
|
+
//
|
|
2997
|
+
// That is not hypothetical: it corrupts the bone-matrix fetch in every
|
|
2998
|
+
// skinned EVE hull shader. The address is `blendIndex + boneArrayBase`, the
|
|
2999
|
+
// destination is the same register, and the third matrix row overwrites it
|
|
3000
|
+
// mid-fetch - so rows 2 and 3 index the bone buffer with a matrix float
|
|
3001
|
+
// (~1e9) instead of a bone index. Verified across skinned_quadv5,
|
|
3002
|
+
// skinned_quaddetailv5 and skinned_quadheatv5: every vertex body of every
|
|
3003
|
+
// technique. Unskinned shaders never alias and are unaffected.
|
|
3004
|
+
//
|
|
3005
|
+
// Same hazard `movc` above already guards, handled the same way, and only
|
|
3006
|
+
// when it actually aliases so non-aliasing shaders emit byte-identical GLSL.
|
|
3007
|
+
const addressOperand = instruction.operands[1];
|
|
3008
|
+
const destOperand = instruction.operands[0];
|
|
3009
|
+
const aliasesAddress = addressOperand && destOperand && addressOperand.type === destOperand.type && addressOperand.registerIndex === destOperand.registerIndex;
|
|
3010
|
+
if (aliasesAddress) {
|
|
3011
|
+
this._line(state, "{");
|
|
3012
|
+
state.indent += 1;
|
|
3013
|
+
this._line(state, `int cjsSbAddr = ${element};`);
|
|
3014
|
+
element = "cjsSbAddr";
|
|
3015
|
+
}
|
|
2965
3016
|
const widthMask = this.profile.dataTextureWidth - 1;
|
|
2966
3017
|
const widthShift = Math.log2(this.profile.dataTextureWidth);
|
|
2967
3018
|
const aligned = info.strideDwords % 4 === 0 && offsetDwords % 4 === 0;
|
|
@@ -3003,6 +3054,10 @@ DxbcGlslEmitter.prototype._ldStructured = function _ldStructured(state, instruct
|
|
|
3003
3054
|
}
|
|
3004
3055
|
this._line(state, `${this._destComponentRef(state, instruction.operands[0], target, component)} = ${value};`);
|
|
3005
3056
|
}
|
|
3057
|
+
if (aliasesAddress) {
|
|
3058
|
+
state.indent -= 1;
|
|
3059
|
+
this._line(state, "}");
|
|
3060
|
+
}
|
|
3006
3061
|
};
|
|
3007
3062
|
|
|
3008
3063
|
/**
|
|
@@ -3129,6 +3184,18 @@ DxbcGlslEmitter.prototype._gather4Channel = function _gather4Channel(operand) {
|
|
|
3129
3184
|
/**
|
|
3130
3185
|
* Assembles the final GLSL text.
|
|
3131
3186
|
*/
|
|
3187
|
+
/**
|
|
3188
|
+
* The depth-range fixup emitted at the end of a vertex stage, by source range.
|
|
3189
|
+
*
|
|
3190
|
+
* Both entries map their range onto GL NDC [-1, 1] and both compose to the
|
|
3191
|
+
* identity with a projection of the matching form, so an unbiased vertex is
|
|
3192
|
+
* unchanged either way. See `profile.depthRange`.
|
|
3193
|
+
* @type {Object.<string,string>}
|
|
3194
|
+
*/
|
|
3195
|
+
const DEPTH_RANGE_FIXUP = Object.freeze({
|
|
3196
|
+
reversed: "gl_Position.z = gl_Position.w - 2.0 * gl_Position.z;",
|
|
3197
|
+
forward: "gl_Position.z = 2.0 * gl_Position.z - gl_Position.w;"
|
|
3198
|
+
});
|
|
3132
3199
|
DxbcGlslEmitter.prototype._assemble = function _assemble(state) {
|
|
3133
3200
|
const lines = ["#version 300 es"];
|
|
3134
3201
|
if (state.isPixel || state.isCompute) {
|
|
@@ -3139,16 +3206,27 @@ DxbcGlslEmitter.prototype._assemble = function _assemble(state) {
|
|
|
3139
3206
|
if (helperSource) {
|
|
3140
3207
|
lines.push("", helperSource);
|
|
3141
3208
|
}
|
|
3142
|
-
// Vertex stages get the
|
|
3143
|
-
//
|
|
3144
|
-
//
|
|
3145
|
-
//
|
|
3146
|
-
//
|
|
3147
|
-
//
|
|
3148
|
-
//
|
|
3149
|
-
//
|
|
3150
|
-
//
|
|
3151
|
-
//
|
|
3209
|
+
// Vertex stages get the depth-range fixup that turns a compiled shader's
|
|
3210
|
+
// clip z into GL's. These shaders are compiled against a REVERSED depth
|
|
3211
|
+
// range: z_clip runs [w, 0], near at w and far at 0, and `w - 2z` maps that
|
|
3212
|
+
// onto GL NDC [-1, 1].
|
|
3213
|
+
//
|
|
3214
|
+
// The reversal is observable in the shipped bodies themselves. Surface
|
|
3215
|
+
// decals add a small positive constant to clip z to lift themselves off the
|
|
3216
|
+
// hull they sit on, and a lift is only toward the camera on a reversed
|
|
3217
|
+
// axis.
|
|
3218
|
+
//
|
|
3219
|
+
// The caller MUST supply a reversed-D3D projection. Composed with one, this
|
|
3220
|
+
// is exactly the identity for an unbiased vertex, so the depth buffer keeps
|
|
3221
|
+
// conventional GL values and legacy shaders sharing it are unaffected. What
|
|
3222
|
+
// changes is the direction of any offset the shader authors ITSELF: the
|
|
3223
|
+
// decal family adds `+1e-5` to lift itself off the hull, which is toward
|
|
3224
|
+
// the camera only on a reversed axis. Hand it a forward-D3D projection and
|
|
3225
|
+
// every such offset inverts - decals sink INTO the hull by `2e-5/w`, an
|
|
3226
|
+
// error that grows as the camera closes in.
|
|
3227
|
+
//
|
|
3228
|
+
// The body is wrapped in a helper so early `ret` (return) statements cannot
|
|
3229
|
+
// skip the fixup.
|
|
3152
3230
|
const writesPosition = [...state.outputNames.values()].includes("gl_Position");
|
|
3153
3231
|
if (!state.isPixel && !state.isCompute && writesPosition) {
|
|
3154
3232
|
lines.push("", "void dxbc_main() {");
|
|
@@ -3156,7 +3234,7 @@ DxbcGlslEmitter.prototype._assemble = function _assemble(state) {
|
|
|
3156
3234
|
lines.push(` ${early}`);
|
|
3157
3235
|
}
|
|
3158
3236
|
lines.push(...state.bodyLines, "}");
|
|
3159
|
-
lines.push("", "void main() {", " dxbc_main();",
|
|
3237
|
+
lines.push("", "void main() {", " dxbc_main();", ` ${DEPTH_RANGE_FIXUP[this.profile.depthRange]}`, "}");
|
|
3160
3238
|
return `${lines.join("\n")}\n`;
|
|
3161
3239
|
}
|
|
3162
3240
|
lines.push("", "void main() {");
|