@carbonenginejs/runtime 0.1.0-alpha.4 → 0.1.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/global/blue/BlueClasses.js +200 -0
- package/dist/global/blue/BlueClasses.js.map +1 -0
- package/dist/global/blue/IBlueClasses.js +79 -0
- package/dist/global/blue/IBlueClasses.js.map +1 -0
- package/dist/global/blue/IBlueDynamicResourceConstructor.js +16 -0
- package/dist/global/blue/IBlueDynamicResourceConstructor.js.map +1 -1
- package/dist/global/blue/blue.js +8 -2
- package/dist/global/blue/blue.js.map +1 -1
- package/dist/global/blue/index.js +2 -0
- package/dist/global/blue/index.js.map +1 -1
- package/dist/global/consts/index.js +0 -1
- package/dist/global/consts/index.js.map +1 -1
- package/dist/global/consts/renderContext/formats.js +26 -25
- package/dist/global/consts/renderContext/formats.js.map +1 -1
- package/dist/{trinityal/Tr2BitmapDimensions.js → global/imageio/BitmapDimensions.js} +19 -15
- package/dist/global/imageio/BitmapDimensions.js.map +1 -0
- package/dist/global/imageio/Cutout.js +28 -0
- package/dist/global/imageio/Cutout.js.map +1 -0
- package/dist/global/imageio/HostBitmap.js +1106 -0
- package/dist/global/imageio/HostBitmap.js.map +1 -0
- package/dist/global/imageio/ImageIOResult.js +99 -0
- package/dist/global/imageio/ImageIOResult.js.map +1 -0
- package/dist/global/imageio/ImageUtility.js +205 -0
- package/dist/global/imageio/ImageUtility.js.map +1 -0
- package/dist/global/imageio/LoadParameters.js +86 -0
- package/dist/global/imageio/LoadParameters.js.map +1 -0
- package/dist/global/imageio/Metadata.js +22 -0
- package/dist/global/imageio/Metadata.js.map +1 -0
- package/dist/global/imageio/index.js +8 -0
- package/dist/global/{consts/webgpu → imageio}/index.js.map +1 -1
- package/dist/global/index.js +2 -1
- package/dist/global/index.js.map +1 -1
- package/dist/global/math/color.js +1 -1
- package/dist/global/math/color.js.map +1 -1
- package/dist/global/schema/CjsSchema.js +8 -0
- package/dist/global/schema/CjsSchema.js.map +1 -1
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/resource/CjsResMan.js +47 -7
- package/dist/resource/CjsResMan.js.map +1 -1
- package/dist/resource/Tr2LightProfileRes.js +37 -0
- package/dist/resource/Tr2LightProfileRes.js.map +1 -1
- package/dist/resource/format/CjsByteWriter.js +46 -46
- package/dist/resource/format/CjsByteWriter.js.map +1 -1
- package/dist/resource/format/CjsFormat.js +7 -8
- package/dist/resource/format/CjsFormat.js.map +1 -1
- package/dist/resource/format/CjsFormatStore.js +8 -8
- package/dist/resource/format/CjsFormatStore.js.map +1 -1
- package/dist/resource/format/CjsGeometryFormat.js +114 -0
- package/dist/resource/format/CjsGeometryFormat.js.map +1 -0
- package/dist/resource/format/CjsImageFormat.js +282 -0
- package/dist/resource/format/CjsImageFormat.js.map +1 -0
- package/dist/resource/format/CjsResourceProbe.js +12 -48
- package/dist/resource/format/CjsResourceProbe.js.map +1 -1
- package/dist/resource/format/CjsStringTable.js +37 -37
- package/dist/resource/format/CjsStringTable.js.map +1 -1
- package/dist/resource/format/carbonEffect/CjsCarbonEffectReader.js +10 -10
- package/dist/resource/format/carbonEffect/CjsCarbonEffectReader.js.map +1 -1
- package/dist/resource/format/carbonEffect/CjsCarbonEffectWriter.js +37 -37
- package/dist/resource/format/carbonEffect/CjsCarbonEffectWriter.js.map +1 -1
- package/dist/resource/format/carbonEffect/carbonEffectBackendBlock.js +35 -7
- package/dist/resource/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -1
- package/dist/resource/format/index.js +3 -1
- package/dist/resource/format/index.js.map +1 -1
- package/dist/resource/formats/black/CjsBlackFormat.js +130 -137
- package/dist/resource/formats/black/CjsBlackFormat.js.map +1 -1
- package/dist/resource/formats/bnk/CjsBnkFormat.js +12 -19
- package/dist/resource/formats/bnk/CjsBnkFormat.js.map +1 -1
- package/dist/resource/formats/bnk/core/helpers.js +1 -3
- package/dist/resource/formats/bnk/core/helpers.js.map +1 -1
- package/dist/resource/formats/cmf/CjsCmfFormat.js +19 -82
- package/dist/resource/formats/cmf/CjsCmfFormat.js.map +1 -1
- package/dist/resource/formats/cmf/core/constants.js +1 -2
- package/dist/resource/formats/cmf/core/constants.js.map +1 -1
- package/dist/resource/formats/{stl/core/targets.js → cmf/core/flatShared.js} +9 -8
- package/dist/resource/formats/cmf/core/flatShared.js.map +1 -0
- package/dist/resource/formats/cmf/core/helpers.js +13 -13
- package/dist/resource/formats/cmf/core/helpers.js.map +1 -1
- package/dist/resource/formats/cmf/core/writer.js +24 -24
- package/dist/resource/formats/cmf/core/writer.js.map +1 -1
- package/dist/resource/formats/dds/CjsDdsFormat.js +134 -17
- package/dist/resource/formats/dds/CjsDdsFormat.js.map +1 -1
- package/dist/resource/formats/dds/core/helpers.js +125 -40
- package/dist/resource/formats/dds/core/helpers.js.map +1 -1
- package/dist/resource/formats/dxbc/CjsDxbcFormat.js +14 -16
- package/dist/resource/formats/dxbc/CjsDxbcFormat.js.map +1 -1
- package/dist/resource/formats/dxbc/core/{container.js → DxbcContainer.js} +2 -2
- package/dist/resource/formats/dxbc/core/DxbcContainer.js.map +1 -0
- package/dist/resource/formats/dxbc/core/{errors.js → DxbcReadError.js} +1 -1
- package/dist/resource/formats/dxbc/core/DxbcReadError.js.map +1 -0
- package/dist/resource/formats/dxbc/core/DxbcReader.js +1 -1
- package/dist/resource/formats/dxbc/core/DxbcReader.js.map +1 -1
- package/dist/resource/formats/dxbc/core/{program.js → DxbcShaderProgram.js} +2 -2
- package/dist/resource/formats/dxbc/core/DxbcShaderProgram.js.map +1 -0
- package/dist/resource/formats/dxbc/core/{signature.js → DxbcSignatureChunk.js} +2 -2
- package/dist/resource/formats/dxbc/core/DxbcSignatureChunk.js.map +1 -0
- package/dist/resource/formats/dxbc/core/decoder.js +2 -2
- package/dist/resource/formats/dxbc/core/decoder.js.map +1 -1
- package/dist/resource/formats/dxbc/core/helpers.js +3 -3
- package/dist/resource/formats/dxbc/core/helpers.js.map +1 -1
- package/dist/resource/formats/fbx/CjsFbxFormat.js +18 -20
- package/dist/resource/formats/fbx/CjsFbxFormat.js.map +1 -1
- package/dist/resource/formats/flac/CjsFlacFormat.js +7 -13
- package/dist/resource/formats/flac/CjsFlacFormat.js.map +1 -1
- package/dist/resource/formats/fsd/32/CjsFsd32Format.js +29 -29
- package/dist/resource/formats/fsd/32/CjsFsd32Format.js.map +1 -1
- package/dist/resource/formats/fsd/64/CjsFsd64Format.js +3 -3
- package/dist/resource/formats/fsd/64/CjsFsd64Format.js.map +1 -1
- package/dist/resource/formats/fsd/64/core/CjsFsd64Binary.js +23 -23
- package/dist/resource/formats/fsd/64/core/CjsFsd64Binary.js.map +1 -1
- package/dist/resource/formats/fsd/64/core/CjsFsd64Reader.js +8 -8
- package/dist/resource/formats/fsd/64/core/CjsFsd64Reader.js.map +1 -1
- package/dist/resource/formats/fsd/CjsFsdFormat.js +23 -23
- package/dist/resource/formats/fsd/CjsFsdFormat.js.map +1 -1
- package/dist/resource/formats/gif/CjsGifFormat.js +24 -15
- package/dist/resource/formats/gif/CjsGifFormat.js.map +1 -1
- package/dist/resource/formats/gltf/CjsGltfFormat.js +33 -98
- package/dist/resource/formats/gltf/CjsGltfFormat.js.map +1 -1
- package/dist/resource/formats/gltf/core/helpers.js +3 -12
- package/dist/resource/formats/gltf/core/helpers.js.map +1 -1
- package/dist/resource/formats/gr2/CjsGr2Format.js +27 -91
- package/dist/resource/formats/gr2/CjsGr2Format.js.map +1 -1
- package/dist/resource/formats/hlsl/CjsHlslFormat.js +22 -25
- package/dist/resource/formats/hlsl/CjsHlslFormat.js.map +1 -1
- package/dist/resource/formats/hlsl/core/carbonDescriptionToRuntime.js +1 -1
- package/dist/resource/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -1
- package/dist/resource/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js +3 -3
- package/dist/resource/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js.map +1 -1
- package/dist/resource/formats/ies/CjsIESFormat.js +29 -29
- package/dist/resource/formats/ies/CjsIESFormat.js.map +1 -1
- package/dist/resource/formats/jpeg/CjsJpegFormat.js +24 -15
- package/dist/resource/formats/jpeg/CjsJpegFormat.js.map +1 -1
- package/dist/resource/formats/jpeg/core/helpers.js +3 -5
- package/dist/resource/formats/jpeg/core/helpers.js.map +1 -1
- package/dist/resource/formats/jpeg/core/jpeg.js +58 -58
- package/dist/resource/formats/jpeg/core/jpeg.js.map +1 -1
- package/dist/resource/formats/jsonl/CjsJsonlFormat.js +3 -3
- package/dist/resource/formats/jsonl/CjsJsonlFormat.js.map +1 -1
- package/dist/resource/formats/mp3/CjsMp3Format.js +7 -14
- package/dist/resource/formats/mp3/CjsMp3Format.js.map +1 -1
- package/dist/resource/formats/mp3/core/helpers.js +3 -5
- package/dist/resource/formats/mp3/core/helpers.js.map +1 -1
- package/dist/resource/formats/mp4/CjsMp4Format.js +7 -13
- package/dist/resource/formats/mp4/CjsMp4Format.js.map +1 -1
- package/dist/resource/formats/mp4/core/helpers.js +3 -5
- package/dist/resource/formats/mp4/core/helpers.js.map +1 -1
- package/dist/resource/formats/obj/CjsObjFormat.js +92 -157
- package/dist/resource/formats/obj/CjsObjFormat.js.map +1 -1
- package/dist/resource/formats/obj/core/helpers.js +5 -113
- package/dist/resource/formats/obj/core/helpers.js.map +1 -1
- package/dist/resource/formats/ogg/CjsOggFormat.js +7 -14
- package/dist/resource/formats/ogg/CjsOggFormat.js.map +1 -1
- package/dist/resource/formats/pickle/CjsPickleFormat.js +7 -12
- package/dist/resource/formats/pickle/CjsPickleFormat.js.map +1 -1
- package/dist/resource/formats/pickle/core/CjsPickleProtocol0Reader.js +7 -7
- package/dist/resource/formats/pickle/core/CjsPickleProtocol0Reader.js.map +1 -1
- package/dist/resource/formats/pickle/core/CjsPickleProtocol4Reader.js +7 -7
- package/dist/resource/formats/pickle/core/CjsPickleProtocol4Reader.js.map +1 -1
- package/dist/resource/formats/png/CjsPngFormat.js +40 -15
- package/dist/resource/formats/png/CjsPngFormat.js.map +1 -1
- package/dist/resource/formats/png/core/helpers.js +4 -6
- package/dist/resource/formats/png/core/helpers.js.map +1 -1
- package/dist/resource/formats/red/CjsRedFormat.js +22 -28
- package/dist/resource/formats/red/CjsRedFormat.js.map +1 -1
- package/dist/resource/formats/schemabound/CjsSchemaBoundFormat.js +3 -7
- package/dist/resource/formats/schemabound/CjsSchemaBoundFormat.js.map +1 -1
- package/dist/resource/formats/schemabound/core/schemaBoundValues.js +5 -0
- package/dist/resource/formats/schemabound/core/schemaBoundValues.js.map +1 -1
- package/dist/resource/formats/sqlite/CjsSqliteFormat.js +4 -9
- package/dist/resource/formats/sqlite/CjsSqliteFormat.js.map +1 -1
- package/dist/resource/formats/static/CjsStaticFormat.js +4 -4
- package/dist/resource/formats/static/CjsStaticFormat.js.map +1 -1
- package/dist/resource/formats/stl/CjsStlFormat.js +39 -104
- package/dist/resource/formats/stl/CjsStlFormat.js.map +1 -1
- package/dist/resource/formats/stl/core/helpers.js +5 -19
- package/dist/resource/formats/stl/core/helpers.js.map +1 -1
- package/dist/resource/formats/tga/CjsTgaFormat.js +26 -15
- package/dist/resource/formats/tga/CjsTgaFormat.js.map +1 -1
- package/dist/resource/formats/tga/core/helpers.js +3 -5
- package/dist/resource/formats/tga/core/helpers.js.map +1 -1
- package/dist/resource/formats/vta/CjsVtaFormat.js +8 -15
- package/dist/resource/formats/vta/CjsVtaFormat.js.map +1 -1
- package/dist/resource/formats/wav/CjsWavFormat.js +7 -14
- package/dist/resource/formats/wav/CjsWavFormat.js.map +1 -1
- package/dist/resource/formats/wav/core/helpers.js +3 -5
- package/dist/resource/formats/wav/core/helpers.js.map +1 -1
- package/dist/resource/formats/webgl/CjsWebglFormat.js +103 -105
- package/dist/resource/formats/webgl/CjsWebglFormat.js.map +1 -1
- package/dist/resource/formats/webgl/core/{errors.js → WebglReadError.js} +1 -1
- package/dist/resource/formats/webgl/core/WebglReadError.js.map +1 -0
- package/dist/resource/formats/webgl/core/effectPackage.js +1 -1
- package/dist/resource/formats/webgl/core/effectPackage.js.map +1 -1
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js +3 -3
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
- package/dist/resource/formats/webgl/core/glsl/{DxbcGlslHelpers.js → DxbcGlslHelperRegistry.js} +2 -2
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslHelperRegistry.js.map +1 -0
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js +1 -1
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js.map +1 -1
- package/dist/resource/formats/webgl/core/glslBackendBlock.js +1 -1
- package/dist/resource/formats/webgl/core/glslBackendBlock.js.map +1 -1
- package/dist/resource/formats/webgl/core/helpers.js.map +1 -1
- package/dist/resource/formats/webgpu/CjsWebgpuFormat.js +28 -29
- package/dist/resource/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
- package/dist/resource/formats/webgpu/core/{errors.js → WebgpuReadError.js} +1 -1
- package/dist/resource/formats/webgpu/core/WebgpuReadError.js.map +1 -0
- package/dist/resource/formats/webgpu/core/carbonWebgpu/validateContainer.js +1 -1
- package/dist/resource/formats/webgpu/core/carbonWebgpu/validateContainer.js.map +1 -1
- package/dist/resource/formats/webgpu/core/helpers.js +1 -1
- package/dist/resource/formats/webgpu/core/helpers.js.map +1 -1
- package/dist/resource/formats/webgpu/core/ir/lowerDxbcToIr.js +1 -1
- package/dist/resource/formats/webgpu/core/ir/lowerDxbcToIr.js.map +1 -1
- package/dist/resource/formats/webgpu/core/wgsl/buildWgslSet.js +18 -6
- package/dist/resource/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -1
- package/dist/resource/formats/webgpu/core/wgsl/lowerBindingLayout.js +39 -13
- package/dist/resource/formats/webgpu/core/wgsl/lowerBindingLayout.js.map +1 -1
- package/dist/resource/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js +16 -14
- package/dist/resource/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js.map +1 -1
- package/dist/resource/formats/webm/CjsWebmFormat.js +8 -13
- package/dist/resource/formats/webm/CjsWebmFormat.js.map +1 -1
- package/dist/resource/formats/webm/core/helpers.js +3 -5
- package/dist/resource/formats/webm/core/helpers.js.map +1 -1
- package/dist/resource/formats/webp/CjsWebpFormat.js +8 -12
- package/dist/resource/formats/webp/CjsWebpFormat.js.map +1 -1
- package/dist/resource/formats/wem/CjsWemFormat.js +9 -17
- package/dist/resource/formats/wem/CjsWemFormat.js.map +1 -1
- package/dist/resource/formats/wem/core/bitStream.js +35 -35
- package/dist/resource/formats/wem/core/bitStream.js.map +1 -1
- package/dist/resource/formats/wem/core/helpers.js +1 -3
- package/dist/resource/formats/wem/core/helpers.js.map +1 -1
- package/dist/resource/formats/yaml/CjsYamlFormat.js +28 -37
- package/dist/resource/formats/yaml/CjsYamlFormat.js.map +1 -1
- package/dist/resource/imageio/ImageIO.js +142 -0
- package/dist/resource/imageio/ImageIO.js.map +1 -0
- package/dist/resource/imageio/index.js +17 -0
- package/dist/resource/imageio/index.js.map +1 -0
- package/dist/resource/index.js +7 -0
- package/dist/resource/index.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectResource.js +24 -2
- package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2Pass.js +76 -5
- package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
- package/dist/resource/texture/CjsTextureArrayConstructor.js +97 -0
- package/dist/resource/texture/CjsTextureArrayConstructor.js.map +1 -0
- package/dist/resource/texture/CjsTexturePackConstructor.js +160 -0
- package/dist/resource/texture/CjsTexturePackConstructor.js.map +1 -0
- package/dist/resource/texture/CjsTexturePipelineStepArray.js +72 -0
- package/dist/resource/texture/CjsTexturePipelineStepArray.js.map +1 -0
- package/dist/resource/texture/CjsTexturePipelineStepConvert.js +73 -0
- package/dist/resource/texture/CjsTexturePipelineStepConvert.js.map +1 -0
- package/dist/resource/texture/CjsTexturePipelineStepPack.js +71 -0
- package/dist/resource/texture/CjsTexturePipelineStepPack.js.map +1 -0
- package/dist/resource/texture/CjsTexturePipelineStepResize.js +123 -0
- package/dist/resource/texture/CjsTexturePipelineStepResize.js.map +1 -0
- package/dist/resource/texture/SolidColorTextureConstructor.js +11 -1
- package/dist/resource/texture/SolidColorTextureConstructor.js.map +1 -1
- package/dist/resource/texture/Tr2ImageRes.js +100 -68
- package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipeline.js +45 -25
- package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js +34 -1
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js +30 -3
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js +81 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js +36 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js +146 -24
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -1
- package/dist/resource/texture/TriTextureRes.js +151 -29
- package/dist/resource/texture/TriTextureRes.js.map +1 -1
- package/dist/resource/texture/index.js +7 -0
- package/dist/resource/texture/index.js.map +1 -1
- package/dist/resource/texture/registerTextureResources.js +83 -0
- package/dist/resource/texture/registerTextureResources.js.map +1 -0
- package/dist/resource/texture/solidColorTexture.js +10 -19
- package/dist/resource/texture/solidColorTexture.js.map +1 -1
- package/dist/sof/EveSOF.js +39 -7
- package/dist/sof/EveSOF.js.map +1 -1
- package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js +2 -2
- package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js.map +1 -1
- package/dist/trinity/core/Tr2ImageIOHelpers.js +80 -17
- package/dist/trinity/core/Tr2ImageIOHelpers.js.map +1 -1
- package/dist/trinity/core/Tr2RenderUtils.js +1 -1
- package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js +49 -62
- package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js.map +1 -1
- package/dist/trinity/core/Tr2TextureReference.js +114 -0
- package/dist/trinity/core/Tr2TextureReference.js.map +1 -0
- package/dist/trinity/core/device/Tr2DepthStencil.js +2 -2
- package/dist/trinity/core/device/Tr2DepthStencil.js.map +1 -1
- package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBuffer.js +1 -1
- package/dist/trinity/core/index.js +1 -0
- package/dist/trinity/core/index.js.map +1 -1
- package/dist/trinity/core/lighting/Tr2LightManager.js +5 -4
- package/dist/trinity/core/lighting/Tr2LightManager.js.map +1 -1
- package/dist/trinity/core/procedural/GradientTextureConstructor.js +5 -4
- package/dist/trinity/core/procedural/GradientTextureConstructor.js.map +1 -1
- package/dist/trinity/core/procedural/gradientTexture.js +10 -13
- package/dist/trinity/core/procedural/gradientTexture.js.map +1 -1
- package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js +1 -1
- package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js.map +1 -1
- package/dist/trinity/eve/EveImpactOverlay.js +102 -50
- package/dist/trinity/eve/EveImpactOverlay.js.map +1 -1
- package/dist/trinity/eve/EveModularObjectModifier.js +9 -18
- package/dist/trinity/eve/EveModularObjectModifier.js.map +1 -1
- package/dist/trinity/eve/attachment/turrets/EveTurretSet.js +175 -157
- package/dist/trinity/eve/attachment/turrets/EveTurretSet.js.map +1 -1
- package/dist/trinity/eve/attachment/turrets/EveTurretTarget.js +100 -83
- package/dist/trinity/eve/attachment/turrets/EveTurretTarget.js.map +1 -1
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js +26 -20
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js.map +1 -1
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js +368 -179
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js.map +1 -1
- package/dist/trinity/eve/child/EveChildMesh.js +242 -234
- package/dist/trinity/eve/child/EveChildMesh.js.map +1 -1
- package/dist/trinity/eve/child/EveChildTurret.js +57 -16
- package/dist/trinity/eve/child/EveChildTurret.js.map +1 -1
- package/dist/trinity/eve/child/EveSpaceObjectChild.js +28 -1
- package/dist/trinity/eve/child/EveSpaceObjectChild.js.map +1 -1
- package/dist/trinity/eve/index.js +2 -2
- package/dist/trinity/eve/overlays/EveDamageOverlay.js +5 -1
- package/dist/trinity/eve/overlays/EveDamageOverlay.js.map +1 -1
- package/dist/trinity/eve/scene/EveSpaceScene.js +234 -233
- package/dist/trinity/eve/scene/EveSpaceScene.js.map +1 -1
- package/dist/trinity/eve/scene/EveSpaceSceneRenderDriver.js +2 -0
- package/dist/trinity/eve/scene/EveSpaceSceneRenderDriver.js.map +1 -1
- package/dist/trinity/eve/spaceObject/EveSpaceObject2.js +492 -437
- package/dist/trinity/eve/spaceObject/EveSpaceObject2.js.map +1 -1
- package/dist/trinity/generated/index.js +0 -1
- package/dist/trinity/generated/index.js.map +1 -1
- package/dist/trinity/generated/trinityCore/index.js +0 -1
- package/dist/trinity/generated/trinityCore/index.js.map +1 -1
- package/dist/trinity/index.js +3 -3
- package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js +10 -1
- package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js.map +1 -1
- package/dist/trinity/shader/Tr2DataTextureManager.js +152 -66
- package/dist/trinity/shader/Tr2DataTextureManager.js.map +1 -1
- package/dist/trinity/shader/Tr2Material.js +1 -1
- package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js +5 -5
- package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js.map +1 -1
- package/dist/trinityal/index.js +1 -1
- package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js +2 -2
- package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2SwapChainALStub.js +45 -45
- package/dist/trinityal/stub/Tr2SwapChainALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2TextureALStub.js +170 -170
- package/dist/trinityal/stub/Tr2TextureALStub.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuDevice.js +234 -164
- package/dist/trinityal/webgpu/CjsWebgpuDevice.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js +7 -0
- package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js +78 -14
- package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js.map +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuUtils.js +94 -0
- package/dist/trinityal/webgpu/core/CjsWebgpuUtils.js.map +1 -0
- package/dist/trinityal/webgpu/internal.js +1 -0
- package/dist/trinityal/webgpu/internal.js.map +1 -1
- package/docs/global/reference/classes/README.md +90 -0
- package/docs/resource/concepts/format-capabilities.md +3 -3
- package/docs/resource/formats/README.md +1 -1
- package/docs/resource/reference/classes/core.md +31 -1
- package/docs/resource/reference/classes/formats.md +7 -7
- package/docs/resource/reference/classes/resources.md +76 -16
- package/docs/trinity/reference/classes/generated.md +0 -10
- package/docs/trinity/reference/classes/trinity-core.md +1692 -1682
- package/docs/trinityal/reference/classes/README.md +0 -10
- package/docs/trinityal/webgpu/reference/classes/README.md +276 -266
- package/package.json +4 -3
- package/dist/global/consts/webgpu/index.js +0 -2
- package/dist/global/consts/webgpu/textureFormats.js +0 -180
- package/dist/global/consts/webgpu/textureFormats.js.map +0 -1
- package/dist/resource/formats/dxbc/core/container.js.map +0 -1
- package/dist/resource/formats/dxbc/core/errors.js.map +0 -1
- package/dist/resource/formats/dxbc/core/program.js.map +0 -1
- package/dist/resource/formats/dxbc/core/signature.js.map +0 -1
- package/dist/resource/formats/stl/core/targets.js.map +0 -1
- package/dist/resource/formats/webgl/core/errors.js.map +0 -1
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslHelpers.js.map +0 -1
- package/dist/resource/formats/webgpu/core/errors.js.map +0 -1
- package/dist/resource/texture/texturePipelineBehavior.js +0 -332
- package/dist/resource/texture/texturePipelineBehavior.js.map +0 -1
- package/dist/trinity/generated/trinityCore/Tr2TextureReference.js +0 -40
- package/dist/trinity/generated/trinityCore/Tr2TextureReference.js.map +0 -1
- package/dist/trinityal/Tr2BitmapDimensions.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tr2SwapChainALStub.js","sources":["../../../../src/trinityal/stub/Tr2SwapChainALStub.js"],"sourcesContent":["// Source: trinity/trinityal/stub/Tr2SwapChainALStub.cpp\
|
|
1
|
+
{"version":3,"file":"Tr2SwapChainALStub.js","sources":["../../../../src/trinityal/stub/Tr2SwapChainALStub.js"],"sourcesContent":["// Source: trinity/trinityal/stub/Tr2SwapChainALStub.cpp\n// Source: trinity/trinityal/stub/Tr2SwapChainALStub.h\n//\n// A swap chain with no window behind it.\n//\n// It owns one back buffer, and `IsValid` is that back buffer's validity - so a\n// swap chain that failed to allocate reports itself unusable rather than\n// presenting into nothing.\n//\n// CARBON'S BACK BUFFER HERE IS 4x4, and that is not a placeholder someone\n// forgot: the stub has no window to ask for a size, and a caller that needs a\n// real size uses the render context's default back buffer, which is created\n// from the present parameters. Transcribed as it stands, because inventing a\n// size would make a headless test agree with a number nothing chose.\n\nimport { CjsSchema } from \"#schema\";\nimport { Tr2ALMemoryType, Tr2DeviceResourceAL } from \"../Tr2DeviceResourceAL/index.js\";\nimport { ALResult } from \"../ALResult.js\";\nimport { BitmapDimensions as Tr2BitmapDimensions } from \"#imageio\";\nimport { Tr2TextureALStub } from \"./Tr2TextureALStub.js\";\nimport { PixelFormat, Tr2GpuUsage } from \"../../global/consts/renderContext/index.js\";\n\n\n/** Carbon's stub back-buffer size (`Tr2SwapChainALStub.cpp:27`). */\nconst STUB_BACK_BUFFER_SIZE = 4;\n\n\n/**\n * A swap chain whose presents complete immediately.\n */\nexport class Tr2SwapChainALStub extends Tr2DeviceResourceAL\n{\n /** m_backBuffer */\n _backBuffer = new Tr2TextureALStub();\n\n /**\n * Creates the swap chain and its back buffer.\n *\n * @param {object} windowHandle The window to present into; ignored here.\n * @param {object} renderContext The context to create against.\n * @returns {number} An `ALResult` value.\n */\n Create(windowHandle, renderContext)\n {\n if (!renderContext.IsValid()) return ALResult.E_INVALIDARG;\n\n this._backBuffer.Destroy();\n this._backBuffer = new Tr2TextureALStub();\n\n return this._backBuffer.Create(\n Tr2BitmapDimensions.texture2D(\n STUB_BACK_BUFFER_SIZE,\n STUB_BACK_BUFFER_SIZE,\n 1,\n PixelFormat.PIXEL_FORMAT_B8G8R8X8_UNORM\n ),\n { gpuUsage: Tr2GpuUsage.RENDER_TARGET },\n renderContext\n );\n }\n\n /** Releases the back buffer and leaves the device-resource registry. */\n Destroy()\n {\n this._backBuffer.Destroy();\n this._backBuffer = new Tr2TextureALStub();\n super.Destroy();\n }\n\n /**\n * Whether the chain can be presented.\n *\n * @returns {boolean} The back buffer's validity.\n */\n IsValid()\n {\n return this._backBuffer.IsValid();\n }\n\n /**\n * The back buffer.\n *\n * @returns {Tr2TextureALStub} The texture.\n */\n GetBackBuffer()\n {\n return this._backBuffer;\n }\n\n /**\n * Presents the back buffer. There is nothing to show, but the frame ended.\n *\n * @param {object} _renderContext The context presenting the frame; Carbon\n * takes it (`Tr2SwapChainALStub.cpp:41`) and names no parameter, because\n * the stub has nothing to present into.\n * @returns {number} An `ALResult` value.\n */\n Present(_renderContext)\n {\n return ALResult.S_OK;\n }\n\n /**\n * Back buffer width.\n *\n * @returns {number} Width in pixels.\n */\n GetWidth()\n {\n return this._backBuffer.GetWidth();\n }\n\n /**\n * Back buffer height.\n *\n * @returns {number} Height in pixels.\n */\n GetHeight()\n {\n return this._backBuffer.GetHeight();\n }\n\n /**\n * Which memory class this chain occupies.\n *\n * VIDEO, not managed - the one AL resource that says so, because a swap\n * chain's surfaces belong to the display rather than to the device heap.\n *\n * @returns {number} A `Tr2ALMemoryType` value.\n */\n GetMemoryClass()\n {\n return Tr2ALMemoryType.AL_MEMORY_VIDEO;\n }\n\n /**\n * Names the chain for a debugger.\n *\n * @param {string} _name The name Carbon would attach; the stub discards it.\n * @returns {number} An `ALResult` value; the stub keeps no name.\n */\n SetName(_name)\n {\n return ALResult.S_OK;\n }\n}\n\n// DECLARED AS A CALL, NOT A DECORATOR, for the reason recorded in\n// Tr2BitmapDimensions.js: the layer is imported straight from source by its\n// tests and raw Node cannot parse decorator syntax.\n//\n// The donor is NAMED rather than left to be derived from this class's name.\n// Carbon calls every backend's class the same thing and carries the backend in\n// the FILE name, because only one backend compiles at a time; we ship them\n// together, so the backend moves onto the class name. That divergence is the\n// author's to declare, never a checker's to guess.\nCjsSchema.define(Tr2SwapChainALStub, { className: \"Tr2SwapChainALStub\", carbon: \"Tr2SwapChainAL\" });\n"],"names":["STUB_BACK_BUFFER_SIZE","Tr2SwapChainALStub","Tr2DeviceResourceAL","_backBuffer","Tr2TextureALStub","Create","windowHandle","renderContext","IsValid","ALResult","E_INVALIDARG","Destroy","Tr2BitmapDimensions","texture2D","PixelFormat","PIXEL_FORMAT_B8G8R8X8_UNORM","gpuUsage","Tr2GpuUsage","RENDER_TARGET","GetBackBuffer","Present","_renderContext","S_OK","GetWidth","GetHeight","GetMemoryClass","Tr2ALMemoryType","AL_MEMORY_VIDEO","SetName","_name","CjsSchema","define","className","carbon"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAUA;AACA,MAAMA,qBAAqB,GAAG,CAAC;;AAG/B;AACA;AACA;AACO,MAAMC,kBAAkB,SAASC,mBAAmB,CAC3D;AACE;AACAC,EAAAA,WAAW,GAAG,IAAIC,gBAAgB,EAAE;;AAEpC;AACF;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,MAAMA,CAACC,YAAY,EAAEC,aAAa,EAClC;IACE,IAAI,CAACA,aAAa,CAACC,OAAO,EAAE,EAAE,OAAOC,QAAQ,CAACC,YAAY;AAE1D,IAAA,IAAI,CAACP,WAAW,CAACQ,OAAO,EAAE;AAC1B,IAAA,IAAI,CAACR,WAAW,GAAG,IAAIC,gBAAgB,EAAE;IAEzC,OAAO,IAAI,CAACD,WAAW,CAACE,MAAM,CAC5BO,gBAAmB,CAACC,SAAS,CAC3Bb,qBAAqB,EACrBA,qBAAqB,EACrB,CAAC,EACDc,WAAW,CAACC,2BACd,CAAC,EACD;MAAEC,QAAQ,EAAEC,WAAW,CAACC;KAAe,EACvCX,aACF,CAAC;AACH,EAAA;;AAEA;AACAI,EAAAA,OAAOA,GACP;AACE,IAAA,IAAI,CAACR,WAAW,CAACQ,OAAO,EAAE;AAC1B,IAAA,IAAI,CAACR,WAAW,GAAG,IAAIC,gBAAgB,EAAE;IACzC,KAAK,CAACO,OAAO,EAAE;AACjB,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACEH,EAAAA,OAAOA,GACP;AACE,IAAA,OAAO,IAAI,CAACL,WAAW,CAACK,OAAO,EAAE;AACnC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACEW,EAAAA,aAAaA,GACb;IACE,OAAO,IAAI,CAAChB,WAAW;AACzB,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEiB,OAAOA,CAACC,cAAc,EACtB;IACE,OAAOZ,QAAQ,CAACa,IAAI;AACtB,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACEC,EAAAA,QAAQA,GACR;AACE,IAAA,OAAO,IAAI,CAACpB,WAAW,CAACoB,QAAQ,EAAE;AACpC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACEC,EAAAA,SAASA,GACT;AACE,IAAA,OAAO,IAAI,CAACrB,WAAW,CAACqB,SAAS,EAAE;AACrC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACEC,EAAAA,cAAcA,GACd;IACE,OAAOC,eAAe,CAACC,eAAe;AACxC,EAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;EACEC,OAAOA,CAACC,KAAK,EACb;IACE,OAAOpB,QAAQ,CAACa,IAAI;AACtB,EAAA;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACAQ,SAAS,CAACC,MAAM,CAAC9B,kBAAkB,EAAE;AAAE+B,EAAAA,SAAS,EAAE,oBAAoB;AAAEC,EAAAA,MAAM,EAAE;AAAiB,CAAC,CAAC;;;;"}
|
|
@@ -2,7 +2,7 @@ import { CjsSchema } from '#schema';
|
|
|
2
2
|
import { Tr2ALMemoryType } from '../Tr2DeviceResourceAL/Tr2BaseDeviceResourceAL.js';
|
|
3
3
|
import { Tr2DeviceResourceAL } from '../Tr2DeviceResourceAL/Tr2DeviceResourceAL.js';
|
|
4
4
|
import { ALResult } from '../ALResult.js';
|
|
5
|
-
import {
|
|
5
|
+
import { BitmapDimensions } from '#imageio';
|
|
6
6
|
import { Crop, Tr2TextureSubresource } from '../Tr2HalHelperStructures/Tr2TextureSubresource.js';
|
|
7
7
|
import { TextureType, IsCompressedFormat } from '../../global/consts/renderContext/formats.js';
|
|
8
8
|
import '../../global/consts/renderContext/pipeline.js';
|
|
@@ -49,12 +49,12 @@ import { Tr2MsaaDesc } from '../Tr2HalHelperStructures/Tr2MsaaDesc.js';
|
|
|
49
49
|
/** Carbon's "no descriptor heap index", returned by both heap accessors. */
|
|
50
50
|
const NO_HEAP_INDEX = 0xffffffff;
|
|
51
51
|
|
|
52
|
-
/**
|
|
53
|
-
* A texture that validates like a real one and holds its pixels on the CPU.
|
|
52
|
+
/**
|
|
53
|
+
* A texture that validates like a real one and holds its pixels on the CPU.
|
|
54
54
|
*/
|
|
55
55
|
class Tr2TextureALStub extends Tr2DeviceResourceAL {
|
|
56
56
|
/** m_desc */
|
|
57
|
-
_desc = new
|
|
57
|
+
_desc = new BitmapDimensions();
|
|
58
58
|
|
|
59
59
|
/** m_msaa */
|
|
60
60
|
_msaa = new Tr2MsaaDesc();
|
|
@@ -68,20 +68,20 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
|
|
|
68
68
|
/** m_data - allocated on first map, released on unmap unless kept "often". */
|
|
69
69
|
_data = null;
|
|
70
70
|
|
|
71
|
-
/**
|
|
72
|
-
* Creates the texture.
|
|
73
|
-
*
|
|
74
|
-
* Every refusal below is Carbon's, in Carbon's order
|
|
75
|
-
* (`Tr2TextureALStub.cpp:18-95`).
|
|
76
|
-
*
|
|
77
|
-
* @param {Tr2BitmapDimensions} desc The texture description.
|
|
78
|
-
* @param {object} options Creation options.
|
|
79
|
-
* @param {number} [options.gpuUsage] A `Tr2GpuUsage` bit set.
|
|
80
|
-
* @param {number} [options.cpuUsage] A `Tr2CpuUsage` bit set.
|
|
81
|
-
* @param {Tr2MsaaDesc} [options.msaa] Multisample description.
|
|
82
|
-
* @param {object[]} [options.initialData] Initial subresource data, if any.
|
|
83
|
-
* @param {object} renderContext The context to create against.
|
|
84
|
-
* @returns {number} An `ALResult` value.
|
|
71
|
+
/**
|
|
72
|
+
* Creates the texture.
|
|
73
|
+
*
|
|
74
|
+
* Every refusal below is Carbon's, in Carbon's order
|
|
75
|
+
* (`Tr2TextureALStub.cpp:18-95`).
|
|
76
|
+
*
|
|
77
|
+
* @param {Tr2BitmapDimensions} desc The texture description.
|
|
78
|
+
* @param {object} options Creation options.
|
|
79
|
+
* @param {number} [options.gpuUsage] A `Tr2GpuUsage` bit set.
|
|
80
|
+
* @param {number} [options.cpuUsage] A `Tr2CpuUsage` bit set.
|
|
81
|
+
* @param {Tr2MsaaDesc} [options.msaa] Multisample description.
|
|
82
|
+
* @param {object[]} [options.initialData] Initial subresource data, if any.
|
|
83
|
+
* @param {object} renderContext The context to create against.
|
|
84
|
+
* @returns {number} An `ALResult` value.
|
|
85
85
|
*/
|
|
86
86
|
Create(desc, options, renderContext) {
|
|
87
87
|
this._Reset();
|
|
@@ -142,12 +142,12 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
|
|
|
142
142
|
return ALResult.S_OK;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
/**
|
|
146
|
-
* Adopts a texture shared by another device.
|
|
147
|
-
*
|
|
148
|
-
* Carbon's stub refuses: sharing needs a real device on both sides.
|
|
149
|
-
*
|
|
150
|
-
* @returns {number} An `ALResult` value.
|
|
145
|
+
/**
|
|
146
|
+
* Adopts a texture shared by another device.
|
|
147
|
+
*
|
|
148
|
+
* Carbon's stub refuses: sharing needs a real device on both sides.
|
|
149
|
+
*
|
|
150
|
+
* @returns {number} An `ALResult` value.
|
|
151
151
|
*/
|
|
152
152
|
OpenShared() {
|
|
153
153
|
return ALResult.E_FAIL;
|
|
@@ -155,7 +155,7 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
|
|
|
155
155
|
|
|
156
156
|
/** Carbon's impl `Destroy`: clears the description without unregistering. */
|
|
157
157
|
_Reset() {
|
|
158
|
-
this._desc = new
|
|
158
|
+
this._desc = new BitmapDimensions();
|
|
159
159
|
this._msaa = new Tr2MsaaDesc();
|
|
160
160
|
this._gpuUsage = Tr2GpuUsage.NONE;
|
|
161
161
|
this._cpuUsage = Tr2CpuUsage.NONE;
|
|
@@ -168,155 +168,155 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
|
|
|
168
168
|
super.Destroy();
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
/**
|
|
172
|
-
* Whether the texture holds anything.
|
|
173
|
-
*
|
|
174
|
-
* Carbon's test is the width, because a created texture always has one.
|
|
175
|
-
*
|
|
176
|
-
* @returns {boolean} True when created.
|
|
171
|
+
/**
|
|
172
|
+
* Whether the texture holds anything.
|
|
173
|
+
*
|
|
174
|
+
* Carbon's test is the width, because a created texture always has one.
|
|
175
|
+
*
|
|
176
|
+
* @returns {boolean} True when created.
|
|
177
177
|
*/
|
|
178
178
|
IsValid() {
|
|
179
179
|
return this._desc.GetWidth() !== 0;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
/**
|
|
183
|
-
* Which memory class this texture occupies.
|
|
184
|
-
*
|
|
185
|
-
* @returns {number} A `Tr2ALMemoryType` value.
|
|
182
|
+
/**
|
|
183
|
+
* Which memory class this texture occupies.
|
|
184
|
+
*
|
|
185
|
+
* @returns {number} A `Tr2ALMemoryType` value.
|
|
186
186
|
*/
|
|
187
187
|
GetMemoryClass() {
|
|
188
188
|
return Tr2ALMemoryType.AL_MEMORY_MANAGED;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
/**
|
|
192
|
-
* The texture description.
|
|
193
|
-
*
|
|
194
|
-
* @returns {Tr2BitmapDimensions} The description.
|
|
191
|
+
/**
|
|
192
|
+
* The texture description.
|
|
193
|
+
*
|
|
194
|
+
* @returns {Tr2BitmapDimensions} The description.
|
|
195
195
|
*/
|
|
196
196
|
GetDesc() {
|
|
197
197
|
return this._desc;
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
/**
|
|
201
|
-
* The multisample description.
|
|
202
|
-
*
|
|
203
|
-
* @returns {Tr2MsaaDesc} The description.
|
|
200
|
+
/**
|
|
201
|
+
* The multisample description.
|
|
202
|
+
*
|
|
203
|
+
* @returns {Tr2MsaaDesc} The description.
|
|
204
204
|
*/
|
|
205
205
|
GetMsaaDesc() {
|
|
206
206
|
return this._msaa;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
/**
|
|
210
|
-
* The GPU usage this texture was created with.
|
|
211
|
-
*
|
|
212
|
-
* @returns {number} A `Tr2GpuUsage` bit set.
|
|
209
|
+
/**
|
|
210
|
+
* The GPU usage this texture was created with.
|
|
211
|
+
*
|
|
212
|
+
* @returns {number} A `Tr2GpuUsage` bit set.
|
|
213
213
|
*/
|
|
214
214
|
GetGpuUsage() {
|
|
215
215
|
return this._gpuUsage;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
/**
|
|
219
|
-
* The CPU usage this texture was created with.
|
|
220
|
-
*
|
|
221
|
-
* @returns {number} A `Tr2CpuUsage` bit set.
|
|
218
|
+
/**
|
|
219
|
+
* The CPU usage this texture was created with.
|
|
220
|
+
*
|
|
221
|
+
* @returns {number} A `Tr2CpuUsage` bit set.
|
|
222
222
|
*/
|
|
223
223
|
GetCpuUsage() {
|
|
224
224
|
return this._cpuUsage;
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
/**
|
|
228
|
-
* Width of mip zero.
|
|
229
|
-
*
|
|
230
|
-
* @returns {number} Width in pixels.
|
|
227
|
+
/**
|
|
228
|
+
* Width of mip zero.
|
|
229
|
+
*
|
|
230
|
+
* @returns {number} Width in pixels.
|
|
231
231
|
*/
|
|
232
232
|
GetWidth() {
|
|
233
233
|
return this._desc.GetWidth();
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
/**
|
|
237
|
-
* Height of mip zero.
|
|
238
|
-
*
|
|
239
|
-
* @returns {number} Height in pixels.
|
|
236
|
+
/**
|
|
237
|
+
* Height of mip zero.
|
|
238
|
+
*
|
|
239
|
+
* @returns {number} Height in pixels.
|
|
240
240
|
*/
|
|
241
241
|
GetHeight() {
|
|
242
242
|
return this._desc.GetHeight();
|
|
243
243
|
}
|
|
244
244
|
|
|
245
|
-
/**
|
|
246
|
-
* Volume depth.
|
|
247
|
-
*
|
|
248
|
-
* @returns {number} Depth in slices.
|
|
245
|
+
/**
|
|
246
|
+
* Volume depth.
|
|
247
|
+
*
|
|
248
|
+
* @returns {number} Depth in slices.
|
|
249
249
|
*/
|
|
250
250
|
GetDepth() {
|
|
251
251
|
return this._desc.GetDepth();
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
/**
|
|
255
|
-
* The declared mip count.
|
|
256
|
-
*
|
|
257
|
-
* @returns {number} Mip levels as declared.
|
|
254
|
+
/**
|
|
255
|
+
* The declared mip count.
|
|
256
|
+
*
|
|
257
|
+
* @returns {number} Mip levels as declared.
|
|
258
258
|
*/
|
|
259
259
|
GetMipCount() {
|
|
260
260
|
return this._desc.GetMipCount();
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
/**
|
|
264
|
-
* The mip count in effect.
|
|
265
|
-
*
|
|
266
|
-
* @returns {number} Mip levels.
|
|
263
|
+
/**
|
|
264
|
+
* The mip count in effect.
|
|
265
|
+
*
|
|
266
|
+
* @returns {number} Mip levels.
|
|
267
267
|
*/
|
|
268
268
|
GetTrueMipCount() {
|
|
269
269
|
return this._desc.GetTrueMipCount();
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
/**
|
|
273
|
-
* The pixel format.
|
|
274
|
-
*
|
|
275
|
-
* @returns {number} A `PixelFormat` value.
|
|
272
|
+
/**
|
|
273
|
+
* The pixel format.
|
|
274
|
+
*
|
|
275
|
+
* @returns {number} A `PixelFormat` value.
|
|
276
276
|
*/
|
|
277
277
|
GetFormat() {
|
|
278
278
|
return this._desc.GetFormat();
|
|
279
279
|
}
|
|
280
280
|
|
|
281
|
-
/**
|
|
282
|
-
* The texture type.
|
|
283
|
-
*
|
|
284
|
-
* @returns {number} A `TextureType` value.
|
|
281
|
+
/**
|
|
282
|
+
* The texture type.
|
|
283
|
+
*
|
|
284
|
+
* @returns {number} A `TextureType` value.
|
|
285
285
|
*/
|
|
286
286
|
GetType() {
|
|
287
287
|
return this._desc.GetType();
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
/**
|
|
291
|
-
* Slices in the array.
|
|
292
|
-
*
|
|
293
|
-
* @returns {number} Array size.
|
|
290
|
+
/**
|
|
291
|
+
* Slices in the array.
|
|
292
|
+
*
|
|
293
|
+
* @returns {number} Array size.
|
|
294
294
|
*/
|
|
295
295
|
GetArraySize() {
|
|
296
296
|
return this._desc.GetArraySize();
|
|
297
297
|
}
|
|
298
298
|
|
|
299
|
-
/**
|
|
300
|
-
* Bytes in one mip.
|
|
301
|
-
*
|
|
302
|
-
* @param {number} mip Mip level.
|
|
303
|
-
* @returns {number} Size in bytes.
|
|
299
|
+
/**
|
|
300
|
+
* Bytes in one mip.
|
|
301
|
+
*
|
|
302
|
+
* @param {number} mip Mip level.
|
|
303
|
+
* @returns {number} Size in bytes.
|
|
304
304
|
*/
|
|
305
305
|
GetMipSize(mip) {
|
|
306
306
|
return this._desc.GetMipSize(mip);
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
-
/**
|
|
310
|
-
* Allocates and returns the storage for one subresource, for reading.
|
|
311
|
-
*
|
|
312
|
-
* The CPU-read check comes FIRST, before validity, because a texture that
|
|
313
|
-
* was never created for reading is a caller mistake rather than a state
|
|
314
|
-
* problem - which is why it answers `E_INVALIDCALL` and not `E_FAIL`.
|
|
315
|
-
*
|
|
316
|
-
* @param {Tr2TextureSubresource} region The subresource to map.
|
|
317
|
-
* @param {boolean} synchronize Whether to wait for outstanding GPU work.
|
|
318
|
-
* @param {object} renderContext The context to map against.
|
|
319
|
-
* @returns {{result: number, data: Uint8Array|null, pitch: number}} The mapping.
|
|
309
|
+
/**
|
|
310
|
+
* Allocates and returns the storage for one subresource, for reading.
|
|
311
|
+
*
|
|
312
|
+
* The CPU-read check comes FIRST, before validity, because a texture that
|
|
313
|
+
* was never created for reading is a caller mistake rather than a state
|
|
314
|
+
* problem - which is why it answers `E_INVALIDCALL` and not `E_FAIL`.
|
|
315
|
+
*
|
|
316
|
+
* @param {Tr2TextureSubresource} region The subresource to map.
|
|
317
|
+
* @param {boolean} synchronize Whether to wait for outstanding GPU work.
|
|
318
|
+
* @param {object} renderContext The context to map against.
|
|
319
|
+
* @returns {{result: number, data: Uint8Array|null, pitch: number}} The mapping.
|
|
320
320
|
*/
|
|
321
321
|
MapForReading(region, synchronize, renderContext) {
|
|
322
322
|
if (!HasFlag(this._cpuUsage, Tr2CpuUsage.READ)) return {
|
|
@@ -347,12 +347,12 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
|
|
|
347
347
|
this._ReleaseUnlessKept();
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
/**
|
|
351
|
-
* Allocates and returns the storage for one subresource, for writing.
|
|
352
|
-
*
|
|
353
|
-
* @param {Tr2TextureSubresource} region The subresource to map.
|
|
354
|
-
* @param {object} renderContext The context to map against.
|
|
355
|
-
* @returns {{result: number, data: Uint8Array|null, pitch: number}} The mapping.
|
|
350
|
+
/**
|
|
351
|
+
* Allocates and returns the storage for one subresource, for writing.
|
|
352
|
+
*
|
|
353
|
+
* @param {Tr2TextureSubresource} region The subresource to map.
|
|
354
|
+
* @param {object} renderContext The context to map against.
|
|
355
|
+
* @returns {{result: number, data: Uint8Array|null, pitch: number}} The mapping.
|
|
356
356
|
*/
|
|
357
357
|
MapForWriting(region, renderContext) {
|
|
358
358
|
if (!HasFlag(this._cpuUsage, Tr2CpuUsage.WRITE)) return {
|
|
@@ -420,18 +420,18 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
|
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
|
|
423
|
-
/**
|
|
424
|
-
* Writes pixels into one subresource.
|
|
425
|
-
*
|
|
426
|
-
* A texture mapped often is written through a map, not through this, so
|
|
427
|
-
* Carbon refuses `WRITE_OFTEN` here outright.
|
|
428
|
-
*
|
|
429
|
-
* @param {Tr2TextureSubresource} region The subresource to write.
|
|
430
|
-
* @param {ArrayBufferView} source The pixels.
|
|
431
|
-
* @param {number} pitch Bytes per row in the source.
|
|
432
|
-
* @param {number} slicePitch Bytes per slice in the source.
|
|
433
|
-
* @param {object} renderContext The context to write against.
|
|
434
|
-
* @returns {number} An `ALResult` value.
|
|
423
|
+
/**
|
|
424
|
+
* Writes pixels into one subresource.
|
|
425
|
+
*
|
|
426
|
+
* A texture mapped often is written through a map, not through this, so
|
|
427
|
+
* Carbon refuses `WRITE_OFTEN` here outright.
|
|
428
|
+
*
|
|
429
|
+
* @param {Tr2TextureSubresource} region The subresource to write.
|
|
430
|
+
* @param {ArrayBufferView} source The pixels.
|
|
431
|
+
* @param {number} pitch Bytes per row in the source.
|
|
432
|
+
* @param {number} slicePitch Bytes per slice in the source.
|
|
433
|
+
* @param {object} renderContext The context to write against.
|
|
434
|
+
* @returns {number} An `ALResult` value.
|
|
435
435
|
*/
|
|
436
436
|
UpdateSubresource(region, source, pitch, slicePitch, renderContext) {
|
|
437
437
|
if (HasFlag(this._cpuUsage, Tr2CpuUsage.WRITE_OFTEN)) return ALResult.E_INVALIDCALL;
|
|
@@ -442,17 +442,17 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
|
|
|
442
442
|
return ALResult.S_OK;
|
|
443
443
|
}
|
|
444
444
|
|
|
445
|
-
/**
|
|
446
|
-
* Copies a region from another texture.
|
|
447
|
-
*
|
|
448
|
-
* A whole-to-whole copy short-circuits; anything else must survive `Crop`,
|
|
449
|
-
* which is where a mismatched face count or an empty overlap is caught.
|
|
450
|
-
*
|
|
451
|
-
* @param {Tr2TextureSubresource} destSubresource The region to write.
|
|
452
|
-
* @param {Tr2TextureALStub} source The texture to read.
|
|
453
|
-
* @param {Tr2TextureSubresource} sourceSubresource The region to read.
|
|
454
|
-
* @param {object} renderContext The context to copy against.
|
|
455
|
-
* @returns {number} An `ALResult` value.
|
|
445
|
+
/**
|
|
446
|
+
* Copies a region from another texture.
|
|
447
|
+
*
|
|
448
|
+
* A whole-to-whole copy short-circuits; anything else must survive `Crop`,
|
|
449
|
+
* which is where a mismatched face count or an empty overlap is caught.
|
|
450
|
+
*
|
|
451
|
+
* @param {Tr2TextureSubresource} destSubresource The region to write.
|
|
452
|
+
* @param {Tr2TextureALStub} source The texture to read.
|
|
453
|
+
* @param {Tr2TextureSubresource} sourceSubresource The region to read.
|
|
454
|
+
* @param {object} renderContext The context to copy against.
|
|
455
|
+
* @returns {number} An `ALResult` value.
|
|
456
456
|
*/
|
|
457
457
|
CopySubresourceRegion(destSubresource, source, sourceSubresource, renderContext) {
|
|
458
458
|
if (!this.IsValid() || !renderContext.IsValid()) return ALResult.E_INVALIDCALL;
|
|
@@ -470,13 +470,13 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
|
|
|
470
470
|
return ALResult.S_OK;
|
|
471
471
|
}
|
|
472
472
|
|
|
473
|
-
/**
|
|
474
|
-
* Regenerates the mip chain.
|
|
475
|
-
*
|
|
476
|
-
* Only a texture that is both a render target and a shader resource can be
|
|
477
|
-
* generated into, because that is how the hardware does it.
|
|
478
|
-
*
|
|
479
|
-
* @returns {number} An `ALResult` value.
|
|
473
|
+
/**
|
|
474
|
+
* Regenerates the mip chain.
|
|
475
|
+
*
|
|
476
|
+
* Only a texture that is both a render target and a shader resource can be
|
|
477
|
+
* generated into, because that is how the hardware does it.
|
|
478
|
+
*
|
|
479
|
+
* @returns {number} An `ALResult` value.
|
|
480
480
|
*/
|
|
481
481
|
GenerateMipMaps() {
|
|
482
482
|
if (!HasFlag(this._gpuUsage, Tr2GpuUsage.RENDER_TARGET) || !HasFlag(this._gpuUsage, Tr2GpuUsage.SHADER_RESOURCE)) {
|
|
@@ -485,15 +485,15 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
|
|
|
485
485
|
return ALResult.S_OK;
|
|
486
486
|
}
|
|
487
487
|
|
|
488
|
-
/**
|
|
489
|
-
* Resolves a multisampled texture into a single-sampled one.
|
|
490
|
-
*
|
|
491
|
-
* With one sample there is nothing to resolve, so Carbon falls back to a
|
|
492
|
-
* plain copy - and inherits that copy's validation with it.
|
|
493
|
-
*
|
|
494
|
-
* @param {Tr2TextureALStub} destination The texture to resolve into.
|
|
495
|
-
* @param {object} renderContext The context to resolve against.
|
|
496
|
-
* @returns {number} An `ALResult` value.
|
|
488
|
+
/**
|
|
489
|
+
* Resolves a multisampled texture into a single-sampled one.
|
|
490
|
+
*
|
|
491
|
+
* With one sample there is nothing to resolve, so Carbon falls back to a
|
|
492
|
+
* plain copy - and inherits that copy's validation with it.
|
|
493
|
+
*
|
|
494
|
+
* @param {Tr2TextureALStub} destination The texture to resolve into.
|
|
495
|
+
* @param {object} renderContext The context to resolve against.
|
|
496
|
+
* @returns {number} An `ALResult` value.
|
|
497
497
|
*/
|
|
498
498
|
Resolve(destination, renderContext) {
|
|
499
499
|
if (this._msaa.samples <= 1) {
|
|
@@ -512,58 +512,58 @@ class Tr2TextureALStub extends Tr2DeviceResourceAL {
|
|
|
512
512
|
return ALResult.S_OK;
|
|
513
513
|
}
|
|
514
514
|
|
|
515
|
-
/**
|
|
516
|
-
* The handle another device could open this texture by.
|
|
517
|
-
*
|
|
518
|
-
* @returns {number} Always zero; the stub shares nothing.
|
|
515
|
+
/**
|
|
516
|
+
* The handle another device could open this texture by.
|
|
517
|
+
*
|
|
518
|
+
* @returns {number} Always zero; the stub shares nothing.
|
|
519
519
|
*/
|
|
520
520
|
GetSharedHandle() {
|
|
521
521
|
return 0;
|
|
522
522
|
}
|
|
523
523
|
|
|
524
|
-
/**
|
|
525
|
-
* Where the shader-resource view sits in the descriptor heap.
|
|
526
|
-
*
|
|
527
|
-
* @returns {number} Carbon's "no index".
|
|
524
|
+
/**
|
|
525
|
+
* Where the shader-resource view sits in the descriptor heap.
|
|
526
|
+
*
|
|
527
|
+
* @returns {number} Carbon's "no index".
|
|
528
528
|
*/
|
|
529
529
|
GetSrvIndexInHeap() {
|
|
530
530
|
return NO_HEAP_INDEX;
|
|
531
531
|
}
|
|
532
532
|
|
|
533
|
-
/**
|
|
534
|
-
* Where the unordered-access view sits in the descriptor heap.
|
|
535
|
-
*
|
|
536
|
-
* @returns {number} Carbon's "no index".
|
|
533
|
+
/**
|
|
534
|
+
* Where the unordered-access view sits in the descriptor heap.
|
|
535
|
+
*
|
|
536
|
+
* @returns {number} Carbon's "no index".
|
|
537
537
|
*/
|
|
538
538
|
GetUavIndexInHeap() {
|
|
539
539
|
return NO_HEAP_INDEX;
|
|
540
540
|
}
|
|
541
541
|
|
|
542
|
-
/**
|
|
543
|
-
* Names the texture for a debugger.
|
|
544
|
-
*
|
|
545
|
-
* @param {string} _name The name Carbon would attach; the stub discards it.
|
|
546
|
-
* @returns {number} An `ALResult` value; the stub keeps no name.
|
|
542
|
+
/**
|
|
543
|
+
* Names the texture for a debugger.
|
|
544
|
+
*
|
|
545
|
+
* @param {string} _name The name Carbon would attach; the stub discards it.
|
|
546
|
+
* @returns {number} An `ALResult` value; the stub keeps no name.
|
|
547
547
|
*/
|
|
548
548
|
SetName(_name) {
|
|
549
549
|
return ALResult.S_OK;
|
|
550
550
|
}
|
|
551
551
|
|
|
552
|
-
/**
|
|
553
|
-
* The debug name.
|
|
554
|
-
*
|
|
555
|
-
* @returns {null} Always null, as Carbon's stub returns.
|
|
552
|
+
/**
|
|
553
|
+
* The debug name.
|
|
554
|
+
*
|
|
555
|
+
* @returns {null} Always null, as Carbon's stub returns.
|
|
556
556
|
*/
|
|
557
557
|
GetName() {
|
|
558
558
|
return null;
|
|
559
559
|
}
|
|
560
560
|
}
|
|
561
561
|
|
|
562
|
-
/**
|
|
563
|
-
* Copies a subresource region, so a call that crops does not alter its caller.
|
|
564
|
-
*
|
|
565
|
-
* @param {Tr2TextureSubresource} region The region to copy.
|
|
566
|
-
* @returns {Tr2TextureSubresource} An independent copy.
|
|
562
|
+
/**
|
|
563
|
+
* Copies a subresource region, so a call that crops does not alter its caller.
|
|
564
|
+
*
|
|
565
|
+
* @param {Tr2TextureSubresource} region The region to copy.
|
|
566
|
+
* @returns {Tr2TextureSubresource} An independent copy.
|
|
567
567
|
*/
|
|
568
568
|
function CopyRegion(region) {
|
|
569
569
|
const copy = new Tr2TextureSubresource();
|