@arcgis/core 5.0.0-next.73 → 5.0.0-next.75
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/Color.d.ts +8 -0
- package/WebDocument2D.d.ts +5 -30
- package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0b666327e8090a6e6f6a.js +1 -0
- package/assets/esri/core/workers/chunks/16a7edb381621085a631.js +1 -0
- package/assets/esri/core/workers/chunks/{e246b256347a281c13fd.js → 22288b62da20a7a78a4f.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e37a3005f2ad2c0a918.js → 23cf4cbc389d2b50e968.js} +1 -1
- package/assets/esri/core/workers/chunks/4750f55a289bc0cf3d77.js +1 -0
- package/assets/esri/core/workers/chunks/{935a6dccb88557f98189.js → 76b516b8c110ad983bf6.js} +8 -6
- package/assets/esri/core/workers/chunks/a5181292b309b8249bd8.js +1 -0
- package/assets/esri/core/workers/chunks/ae733ee050f27f7d8924.js +1 -0
- package/assets/esri/core/workers/chunks/{64985e9b6e2edb3ceb37.js → b498db9715a722c52995.js} +45 -58
- package/assets/esri/core/workers/chunks/befeca51530bba5e8073.js +1 -0
- package/assets/esri/core/workers/chunks/cd788ed111e1e35cf9c8.js +1 -0
- package/assets/esri/core/workers/chunks/f35021214e534d5e0446.js +1 -0
- package/assets/esri/themes/base/widgets/_FeatureTable.scss +99 -22
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_en.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_no.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
- package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
- package/chunks/ComponentShader.glsl.js +1 -1
- package/chunks/GlowBlur.glsl.js +2 -3
- package/chunks/HUDMaterial.glsl.js +43 -56
- package/config.d.ts +6 -8
- package/config.js +1 -1
- package/core/Collection.d.ts +27 -1
- package/core/types.d.ts +0 -23
- package/core/urlUtils.d.ts +10 -0
- package/geometry/support/MeshTexture.d.ts +0 -2
- package/geometry/support/MeshVertexAttributes.d.ts +0 -2
- package/identity/IdentityManagerBase.d.ts +3 -6
- package/interfaces.d.ts +3 -3
- package/kernel.js +1 -1
- package/layers/BaseDynamicLayer.d.ts +1 -4
- package/layers/BaseElevationLayer.d.ts +3 -6
- package/layers/BuildingSceneLayer.d.ts +1 -4
- package/layers/CSVLayer.d.ts +1 -4
- package/layers/CatalogLayer.d.ts +1 -4
- package/layers/DimensionLayer.d.ts +1 -4
- package/layers/ElevationLayer.d.ts +3 -6
- package/layers/FeatureLayer.d.ts +1 -4
- package/layers/GaussianSplatLayer.d.ts +0 -1
- package/layers/GeoJSONLayer.d.ts +1 -4
- package/layers/GeoRSSLayer.d.ts +1 -4
- package/layers/GraphicsLayer.d.ts +1 -4
- package/layers/GroupLayer.d.ts +1 -4
- package/layers/ImageryLayer.d.ts +1 -4
- package/layers/ImageryTileLayer.d.ts +1 -4
- package/layers/IntegratedMesh3DTilesLayer.d.ts +1 -4
- package/layers/IntegratedMeshLayer.d.ts +1 -4
- package/layers/KMLLayer.d.ts +1 -4
- package/layers/Layer.d.ts +2 -6
- package/layers/LineOfSightLayer.d.ts +1 -4
- package/layers/MapImageLayer.d.ts +1 -4
- package/layers/MapNotesLayer.d.ts +1 -4
- package/layers/MediaLayer.d.ts +1 -4
- package/layers/OGCFeatureLayer.d.ts +1 -4
- package/layers/OrientedImageryLayer.d.ts +1 -4
- package/layers/ParquetLayer.d.ts +1 -4
- package/layers/PointCloudLayer.d.ts +1 -4
- package/layers/RouteLayer.d.ts +2 -5
- package/layers/SceneLayer.d.ts +1 -4
- package/layers/SubtypeGroupLayer.d.ts +1 -12
- package/layers/TileLayer.d.ts +1 -4
- package/layers/UnknownLayer.d.ts +1 -4
- package/layers/UnsupportedLayer.d.ts +1 -4
- package/layers/VectorTileLayer.d.ts +1 -4
- package/layers/VideoLayer.d.ts +1 -4
- package/layers/ViewshedLayer.d.ts +1 -4
- package/layers/VoxelLayer.d.ts +1 -4
- package/layers/WCSLayer.d.ts +1 -4
- package/layers/WFSLayer.d.ts +1 -4
- package/layers/WMSLayer.d.ts +1 -4
- package/layers/WMTSLayer.d.ts +1 -4
- package/layers/catalog/CatalogDynamicGroupLayer.d.ts +1 -4
- package/layers/catalog/CatalogFootprintLayer.d.ts +1 -4
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +1 -6
- package/layers/mixins/EditBusLayer.d.ts +0 -1
- package/layers/mixins/PublishableLayer.d.ts +15 -0
- package/layers/support/FeatureFilter.d.ts +0 -1
- package/layers/support/MosaicRule.d.ts +0 -4
- package/layers/support/PublishingInfo.d.ts +1 -1
- package/layers/support/types.d.ts +2 -2
- package/layers/types.d.ts +19 -6
- package/package.json +1 -1
- package/portal/PortalUser.d.ts +1 -1
- package/renderers/support/RendererLegendOptions.d.ts +0 -1
- package/request/types.d.ts +0 -1
- package/rest/support/NormalizationBinParametersMixin.d.ts +18 -20
- package/rest/support/PrintTemplate.d.ts +0 -1
- package/rest/support/RelationshipQuery.d.ts +1 -10
- package/rest/support/types.d.ts +29 -3
- package/smartMapping/heuristics/binLevel.d.ts +1 -1
- package/smartMapping/heuristics/scaleRange.d.ts +1 -1
- package/smartMapping/heuristics/sizeRange.d.ts +1 -1
- package/smartMapping/heuristics/types.d.ts +0 -2
- package/smartMapping/labels/bins.d.ts +1 -1
- package/smartMapping/labels/clusters.d.ts +1 -1
- package/smartMapping/popup/clusters.d.ts +1 -1
- package/smartMapping/popup/templates.d.ts +1 -1
- package/smartMapping/raster/renderers/classBreaks.d.ts +1 -1
- package/smartMapping/raster/renderers/colormap.d.ts +1 -1
- package/smartMapping/raster/renderers/flow.d.ts +0 -1
- package/smartMapping/raster/renderers/rgb.d.ts +1 -1
- package/smartMapping/raster/renderers/shadedRelief.d.ts +0 -1
- package/smartMapping/raster/renderers/stretch.d.ts +1 -1
- package/smartMapping/raster/renderers/uniqueValue.d.ts +0 -1
- package/smartMapping/raster/renderers/vectorField.d.ts +0 -1
- package/smartMapping/raster/support/utils.d.ts +0 -2
- package/smartMapping/renderers/color.d.ts +6 -6
- package/smartMapping/renderers/dotDensity.d.ts +0 -1
- package/smartMapping/renderers/heatmap.d.ts +1 -1
- package/smartMapping/renderers/location.d.ts +0 -1
- package/smartMapping/renderers/opacity.d.ts +1 -1
- package/smartMapping/renderers/pieChart.d.ts +0 -2
- package/smartMapping/renderers/predominance.d.ts +0 -1
- package/smartMapping/renderers/relationship.d.ts +0 -1
- package/smartMapping/renderers/size.d.ts +4 -6
- package/smartMapping/renderers/type.d.ts +9 -5
- package/smartMapping/renderers/univariateColorSize.d.ts +2 -2
- package/smartMapping/statistics/classBreaks.d.ts +1 -1
- package/smartMapping/statistics/heatmapStatistics.d.ts +1 -1
- package/smartMapping/statistics/histogram.d.ts +1 -1
- package/smartMapping/statistics/predominantCategories.d.ts +1 -1
- package/smartMapping/statistics/summaryStatistics.d.ts +1 -1
- package/smartMapping/statistics/summaryStatisticsForAge.d.ts +1 -1
- package/smartMapping/statistics/support/ageUtils.d.ts +1 -1
- package/smartMapping/statistics/types.d.ts +26 -8
- package/smartMapping/statistics/uniqueValues.d.ts +1 -1
- package/smartMapping/symbology/color.d.ts +4 -4
- package/smartMapping/symbology/dotDensity.d.ts +3 -3
- package/smartMapping/symbology/flow.d.ts +3 -3
- package/smartMapping/symbology/heatmap.d.ts +3 -3
- package/smartMapping/symbology/location.d.ts +1 -1
- package/smartMapping/symbology/pieChart.d.ts +3 -3
- package/smartMapping/symbology/predominance.d.ts +3 -3
- package/smartMapping/symbology/relationship.d.ts +3 -3
- package/smartMapping/symbology/size.d.ts +1 -1
- package/smartMapping/symbology/support/colorRamps.d.ts +1 -1
- package/smartMapping/symbology/type.d.ts +3 -3
- package/support/revision.js +1 -1
- package/symbols/cim/types.d.ts +0 -12
- package/symbols/support/symbolUtils.d.ts +1 -1
- package/views/2d/MapViewConstraints.d.ts +2 -10
- package/views/2d/engine/brushes.js +1 -1
- package/views/2d/engine/vectorTiles/GlyphMosaic.js +1 -1
- package/views/2d/engine/vectorTiles/MemoryBuffer.js +1 -1
- package/views/2d/engine/vectorTiles/RenderBucket.js +1 -1
- package/views/2d/engine/vectorTiles/SpriteMosaic.js +1 -1
- package/views/2d/engine/vectorTiles/VTLPainter3D.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/VertexMemoryBuffer.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLCircleMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLFillMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLLineMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLSymbolMaterial.js +1 -1
- package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/RenderingDevice.js +5 -0
- package/views/2d/engine/webgl/WGLContainer.js +1 -1
- package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
- package/views/2d/engine/webgl/number.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderBackground.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderCircle.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderFill.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderIcon.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderLine.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderOutline.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderText.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +5 -0
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniques.js +5 -0
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
- package/views/3d/layers/i3s/meshUtils.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +6 -4
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +18 -14
- package/views/3d/webgl-engine/effects/glow/GlowBlur.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +23 -20
- package/views/BreakpointsOwner.d.ts +2 -2
- package/views/LinkChartView.d.ts +0 -2
- package/views/View2D.d.ts +3 -15
- package/views/input/types.d.ts +2 -13
- package/views/layers/BuildingComponentSublayerView.d.ts +0 -1
- package/views/types.d.ts +2 -9
- package/views/webgl/RenderingContext.js +1 -1
- package/views/webgl/VertexArrayObject.js +1 -1
- package/views/webgl/renderState.js +1 -1
- package/webdoc/ips/SmoothingProperties.d.ts +1 -1
- package/webdoc/ips/SmoothingProperties.js +1 -1
- package/widgets/BasemapLayerList/BasemapLayerListVisibleElements.d.ts +10 -10
- package/widgets/BasemapLayerList/types.d.ts +6 -1
- package/widgets/Bookmarks/BookmarksVisibleElements.d.ts +0 -9
- package/widgets/Bookmarks/types.d.ts +0 -4
- package/widgets/CatalogLayerList/CatalogLayerListVisibleElements.d.ts +2 -2
- package/widgets/CatalogLayerList/types.d.ts +5 -1
- package/widgets/Editor/VisibleElements.d.ts +0 -11
- package/widgets/ElevationProfile/types.d.ts +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/FieldColumn.d.ts +0 -1
- package/widgets/FeatureTable/VisibleElements.d.ts +2 -16
- package/widgets/FeatureTable/support/AttachmentsViewOptions.d.ts +5 -3
- package/widgets/FeatureTable/support/AttachmentsViewOptions.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Features/FeaturesViewModel.d.ts +3 -27
- package/widgets/Features/FeaturesVisibleElements.d.ts +4 -4
- package/widgets/LayerList/LayerListViewModel.d.ts +20 -5
- package/widgets/LayerList/LayerListVisibleElements.d.ts +10 -12
- package/widgets/LayerList/ListItem.d.ts +33 -0
- package/widgets/LayerList/ListItemPanel.d.ts +8 -2
- package/widgets/LayerList/types.d.ts +58 -15
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Popup/PopupVisibleElements.d.ts +6 -6
- package/widgets/Popup/types.d.ts +1 -1
- package/widgets/ScaleRangeSlider/ScaleRanges.d.ts +1 -1
- package/widgets/Sketch/CreateToolVisibilityMap.d.ts +0 -4
- package/widgets/Sketch/VisibleElements.d.ts +0 -2
- package/widgets/Sketch/types.d.ts +1 -1
- package/widgets/TableList/ListItemPanel.d.ts +8 -0
- package/widgets/TableList/TableListViewModel.d.ts +9 -14
- package/widgets/TableList/TableListVisibleElements.d.ts +9 -11
- package/widgets/TableList/types.d.ts +13 -7
- package/widgets/support/SnappingControls/VisibleElements.d.ts +0 -4
- package/widgets/types.d.ts +1 -9
- package/assets/esri/core/workers/chunks/1d8fc0239c907ff5d1e8.js +0 -1
- package/assets/esri/core/workers/chunks/562cddaf63985e53ee6e.js +0 -1
- package/assets/esri/core/workers/chunks/b899b4e7979c13b99526.js +0 -1
- package/assets/esri/core/workers/chunks/d0ae8752419d5b761190.js +0 -1
- package/assets/esri/core/workers/chunks/df2ba5f9d57080fca183.js +0 -1
- package/assets/esri/core/workers/chunks/ee175fd4ec706f7878c0.js +0 -1
- package/assets/esri/core/workers/chunks/fc00d7278b43df813c54.js +0 -1
- package/layers/mixins/ScaleRange.d.ts +0 -16
- package/views/2d/engine/vectorTiles/shaders/Programs.js +0 -5
- package/views/2d/engine/vectorTiles/shaders/VTLMaterialManager.js +0 -5
- package/views/2d/engine/vectorTiles/shaders/sources/resolver.js +0 -5
- package/views/2d/engine/vectorTiles/shaders/sources/shaderRepository.js +0 -5
- package/views/2d/engine/vtlBrushes.js +0 -5
- package/views/2d/engine/webgl/brushes/WGLBrushVTLBackground.js +0 -5
- package/views/2d/engine/webgl/brushes/WGLBrushVTLCircle.js +0 -5
- package/views/2d/engine/webgl/brushes/WGLBrushVTLFill.js +0 -5
- package/views/2d/engine/webgl/brushes/WGLBrushVTLLine.js +0 -5
- package/views/2d/engine/webgl/brushes/WGLBrushVTLSymbol.js +0 -5
- package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +0 -5
- package/widgets/FeatureTable/support/FeatureStore.d.ts +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"
|
|
5
|
+
import"../../../../core/libs/gl-matrix-2/math/vec2.js";import"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import"../core/shaderLibrary/Slice.glsl.js";import"../core/shaderLibrary/attributes/ObjectAndLayerIdColor.glsl.js";import"../core/shaderLibrary/hud/AlignPixel.glsl.js";import"../core/shaderLibrary/hud/HUD.glsl.js";import"../core/shaderLibrary/hud/HUDOcclusionPass.glsl.js";import"../core/shaderLibrary/hud/HUDVisibility.glsl.js";import"../core/shaderLibrary/output/OutputHighlight.glsl.js";import"../core/shaderLibrary/shading/PositionOutsideClipSpace.js";import"../core/shaderLibrary/shading/VisualVariables.glsl.js";import"../core/shaderLibrary/util/ColorConversion.glsl.js";import"../core/shaderLibrary/util/ScreenSizePerspective.glsl.js";import"../core/shaderLibrary/util/View.glsl.js";import"../core/shaderModules/Float2PassUniform.js";import"../core/shaderModules/Float4BindUniform.js";import"../core/shaderModules/Float4PassUniform.js";import"../core/shaderModules/FloatBindUniform.js";import"../core/shaderModules/FloatPassUniform.js";import"../core/shaderModules/glsl.js";import"../core/shaderModules/Texture2DBindUniform.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/ShaderBuilder.js";import"../../../../webscene/support/AlphaCutoff.js";export{b as build,c as calculateAnchorPosition,f as fullUV}from"../../../../chunks/HUDMaterial.glsl.js";
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as i}from"../materials/DefaultTechniqueConfiguration.js";class o extends i{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.visibilityPixelEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.
|
|
5
|
+
import{__decorate as e}from"tslib";import{parameter as t}from"../core/shaderTechnique/ShaderTechniqueConfiguration.js";import{DefaultTechniqueConfiguration as i}from"../materials/DefaultTechniqueConfiguration.js";class o extends i{constructor(e){super(),this.spherical=e,this.screenCenterOffsetUnitsEnabled=!1,this.visibilityPixelEnabled=!0,this.signedDistanceFieldEnabled=!1,this.sampleSignedDistanceFieldTexelCenter=!1,this.hasVVSize=!1,this.hasVVColor=!1,this.hasVerticalOffset=!1,this.hasScreenSizePerspective=!1,this.hasRotation=!1,this.debugDrawLabelBorder=!1,this.hasPolygonOffset=!1,this.depthTestEnabled=!0,this.pixelSnappingEnabled=!0,this.draped=!1,this.terrainDepthTest=!1,this.cullAboveTerrain=!1,this.occlusionPass=!1,this.occludedFragmentFade=!1,this.isFocused=!0,this.olidColorInstanced=!1,this.textureCoordinateType=0,this.emissionSource=0,this.discardInvisibleFragments=!0,this.hasVVInstancing=!1,this.snowCover=!1}}e([t()],o.prototype,"screenCenterOffsetUnitsEnabled",void 0),e([t()],o.prototype,"visibilityPixelEnabled",void 0),e([t()],o.prototype,"signedDistanceFieldEnabled",void 0),e([t()],o.prototype,"sampleSignedDistanceFieldTexelCenter",void 0),e([t()],o.prototype,"hasVVSize",void 0),e([t()],o.prototype,"hasVVColor",void 0),e([t()],o.prototype,"hasVerticalOffset",void 0),e([t()],o.prototype,"hasScreenSizePerspective",void 0),e([t()],o.prototype,"hasRotation",void 0),e([t()],o.prototype,"debugDrawLabelBorder",void 0),e([t()],o.prototype,"hasPolygonOffset",void 0),e([t()],o.prototype,"depthTestEnabled",void 0),e([t()],o.prototype,"pixelSnappingEnabled",void 0),e([t()],o.prototype,"draped",void 0),e([t()],o.prototype,"terrainDepthTest",void 0),e([t()],o.prototype,"cullAboveTerrain",void 0),e([t()],o.prototype,"occlusionPass",void 0),e([t()],o.prototype,"occludedFragmentFade",void 0),e([t()],o.prototype,"isFocused",void 0);export{o as HUDMaterialTechniqueConfiguration};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{TextureBackedBufferModule as o}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{NormalAttribute as e}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{DoublePrecision as r}from"../../../core/shaderLibrary/util/DoublePrecision.glsl.js";import{Float3DrawUniform as t}from"../../../core/shaderModules/Float3DrawUniform.js";import{Float3PassUniform as a}from"../../../core/shaderModules/Float3PassUniform.js";import{glsl as l}from"../../../core/shaderModules/glsl.js";import{Matrix3DrawUniform as
|
|
5
|
+
import{TextureBackedBufferModule as o}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{NormalAttribute as e}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{DoublePrecision as r}from"../../../core/shaderLibrary/util/DoublePrecision.glsl.js";import{Float3DrawUniform as t}from"../../../core/shaderModules/Float3DrawUniform.js";import{Float3PassUniform as a}from"../../../core/shaderModules/Float3PassUniform.js";import{glsl as l,If as n}from"../../../core/shaderModules/glsl.js";import{Matrix3DrawUniform as d}from"../../../core/shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as m}from"../../../core/shaderModules/Matrix3PassUniform.js";import{Matrix4BindUniform as i}from"../../../core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintDrawUniform as s}from"../../../core/shaderModules/Texture2DUintDrawUniform.js";import{edgeViewTextureLayout as c}from"../../../lib/edgeRendering/bufferLayouts.js";const f=new o(c,"componentIndex",new s("componentTextureBuffer",o=>o.componentDataTextureBuffer?.texture));function u(o,s){const{vertex:c}=o;o.include(e,s);const{silhouette:u,legacy:v,spherical:w,hasModelRotationScale:p}=s;o.attributes.add("componentIndex","uint");const{getTextureAttribute:F,TextureBackedBufferModule:M}=f;o.include(M);const h=8,x=128;c.constants.add("lineWidthFractionFactor","float",h),c.constants.add("extensionLengthOffset","float",x),c.code.add(l`
|
|
6
6
|
struct ComponentData {
|
|
7
7
|
vec4 color;
|
|
8
8
|
vec3 normal;
|
|
@@ -15,16 +15,16 @@ import{TextureBackedBufferModule as o}from"../../../core/shaderLibrary/TextureBa
|
|
|
15
15
|
|
|
16
16
|
ComponentData readComponentData() {
|
|
17
17
|
vec3 normal = normalModel();
|
|
18
|
-
vec3 normal2 = ${
|
|
18
|
+
vec3 normal2 = ${u?l`decompressNormal(normal2Compressed)`:l`normal`};
|
|
19
19
|
|
|
20
|
-
vec4 colorValue = ${
|
|
21
|
-
float lineWidth = float(${
|
|
22
|
-
float extensionLength = float(${
|
|
20
|
+
vec4 colorValue = ${F("color")};
|
|
21
|
+
float lineWidth = float(${F("lineWidth")}) / lineWidthFractionFactor;
|
|
22
|
+
float extensionLength = float(${F("extensionLength")}) - extensionLengthOffset;
|
|
23
23
|
// SOLID (=0/255) needs to be > 0.0, SKETCHY (=1/255) needs to be <= 0;
|
|
24
|
-
float type = -(float(${
|
|
25
|
-
float opacity = ${
|
|
24
|
+
float type = -(float(${F("materialType")})) + 0.5;
|
|
25
|
+
float opacity = ${F("opacity")};
|
|
26
26
|
|
|
27
|
-
float verticalOffset = ${
|
|
27
|
+
float verticalOffset = ${F("elevationOffset")};
|
|
28
28
|
|
|
29
29
|
return ComponentData(
|
|
30
30
|
vec4(colorValue.rgb, colorValue.a * opacity),
|
|
@@ -35,23 +35,26 @@ import{TextureBackedBufferModule as o}from"../../../core/shaderLibrary/TextureBa
|
|
|
35
35
|
verticalOffset
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
|
-
`),
|
|
38
|
+
`),v?c.code.add(l`vec3 _modelToWorldNormal(vec3 normal) {
|
|
39
39
|
return (model * vec4(normal, 0.0)).xyz;
|
|
40
40
|
}
|
|
41
41
|
vec3 _modelToViewNormal(vec3 normal) {
|
|
42
42
|
return (localView * model * vec4(normal, 0.0)).xyz;
|
|
43
|
-
}`):(
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
}`):(p&&c.uniforms.add(new d("transformNormalGlobalFromModel",o=>o.transformNormalGlobalFromModel)),c.code.add(l`
|
|
44
|
+
vec3 _modelToWorldNormal(vec3 normal) {
|
|
45
|
+
return ${n(p,l`transformNormalGlobalFromModel * `)}normal;
|
|
46
|
+
}
|
|
47
|
+
`)),u?(o.attributes.add("normal2Compressed","vec2"),c.code.add(l`vec3 worldNormal(ComponentData data) {
|
|
46
48
|
return _modelToWorldNormal(normalize(data.normal + data.normal2));
|
|
47
|
-
}`)):
|
|
49
|
+
}`)):c.code.add(l`vec3 worldNormal(ComponentData data) {
|
|
48
50
|
return _modelToWorldNormal(data.normal);
|
|
49
|
-
}`),
|
|
51
|
+
}`),v?c.code.add(l`void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) {
|
|
50
52
|
worldPos = (model * vec4(modelPos, 1.0)).xyz;
|
|
51
53
|
viewPos = (localView * vec4(worldPos, 1.0)).xyz;
|
|
52
|
-
}`):(
|
|
54
|
+
}`):(c.include(r,s),c.uniforms.add(new m("transformViewFromCameraRelativeRS",o=>o.transformViewFromCameraRelativeRS),new t("transformWorldFromModelTL",o=>o.transformWorldFromModelTL),new t("transformWorldFromModelTH",o=>o.transformWorldFromModelTH),new a("transformWorldFromViewTL",o=>o.transformWorldFromViewTL),new a("transformWorldFromViewTH",o=>o.transformWorldFromViewTH)),p&&c.uniforms.add(new d("transformWorldFromModelRS",o=>o.transformWorldFromModelRS)),c.code.add(l`
|
|
53
55
|
void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) {
|
|
54
|
-
|
|
56
|
+
|
|
57
|
+
vec3 rotatedModelPosition = ${n(p,l`transformWorldFromModelRS * `)}modelPos;
|
|
55
58
|
|
|
56
59
|
vec3 transformCameraRelativeFromModel = dpAdd(
|
|
57
60
|
transformWorldFromModelTL,
|
|
@@ -63,14 +66,14 @@ viewPos = (localView * vec4(worldPos, 1.0)).xyz;
|
|
|
63
66
|
worldPos = transformCameraRelativeFromModel + rotatedModelPosition;
|
|
64
67
|
|
|
65
68
|
if (verticalOffset != 0.0) {
|
|
66
|
-
vec3 vUp = ${
|
|
69
|
+
vec3 vUp = ${w?"normalize(transformWorldFromModelTL + rotatedModelPosition);":"vec3(0.0, 0.0, 1.0);"}
|
|
67
70
|
worldPos += verticalOffset * vUp;
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
viewPos = transformViewFromCameraRelativeRS * worldPos;
|
|
71
74
|
}
|
|
72
|
-
`)),
|
|
75
|
+
`)),c.uniforms.add(new i("transformProjFromView",o=>o.camera.projectionMatrix)).code.add(l`vec4 projFromViewPosition(vec3 position) {
|
|
73
76
|
return transformProjFromView * vec4(position, 1.0);
|
|
74
|
-
}`),
|
|
77
|
+
}`),c.code.add(l`float calculateExtensionLength(float extensionLength, float lineLength) {
|
|
75
78
|
return extensionLength / (log2(max(1.0, 256.0 / lineLength)) * 0.2 + 1.0);
|
|
76
|
-
}`)}function
|
|
79
|
+
}`)}function v(o){return 1===o||2===o}export{u as EdgeUtil,v as usesSketchLogic};
|
|
@@ -11,7 +11,6 @@ export interface BreakpointsOwnerProperties extends Partial<Pick<BreakpointsOwne
|
|
|
11
11
|
export abstract class BreakpointsOwner {
|
|
12
12
|
constructor(...args: any[]);
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
14
|
* A convenience property used for defining the breakpoints on the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View2D.html#height)
|
|
16
15
|
* and [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View2D.html#width) of the view. The sizes specified here determine the values of
|
|
17
16
|
* the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint)
|
|
@@ -90,12 +89,13 @@ export abstract class BreakpointsOwner {
|
|
|
90
89
|
*/
|
|
91
90
|
accessor heightBreakpoint: BreakpointSize;
|
|
92
91
|
/**
|
|
93
|
-
*
|
|
94
92
|
* A convenience property indicating the view's orientation. See the table below for a list of possible values.
|
|
93
|
+
*
|
|
95
94
|
* > [!WARNING]
|
|
96
95
|
* >
|
|
97
96
|
* > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/styling/#view-size-css-classes) for additional
|
|
98
97
|
* > information on working with this.
|
|
98
|
+
*
|
|
99
99
|
* Possible Value | Description
|
|
100
100
|
* ---------------|------------
|
|
101
101
|
* landscape | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View2D.html#width) of the view is greater than its [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View2D.html#height).
|
package/views/LinkChartView.d.ts
CHANGED
|
@@ -21,7 +21,6 @@ export interface LinkChartViewProperties extends View2DProperties {
|
|
|
21
21
|
* color: "magenta" // autocasts as new Color()
|
|
22
22
|
* }
|
|
23
23
|
* });
|
|
24
|
-
* @since 4.16
|
|
25
24
|
* @example
|
|
26
25
|
* let view = new MapView({
|
|
27
26
|
* container: "viewDiv",
|
|
@@ -71,7 +70,6 @@ export default class LinkChartView extends View2D {
|
|
|
71
70
|
* color: "magenta" // autocasts as new Color()
|
|
72
71
|
* }
|
|
73
72
|
* });
|
|
74
|
-
* @since 4.16
|
|
75
73
|
* @example
|
|
76
74
|
* let view = new MapView({
|
|
77
75
|
* container: "viewDiv",
|
package/views/View2D.d.ts
CHANGED
|
@@ -70,7 +70,6 @@ export interface View2DProperties extends ViewProperties, DOMContainerProperties
|
|
|
70
70
|
* The background color of the view. If the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View2D.html#map) changes, the view's `background` is reset to the map's background,
|
|
71
71
|
* even if the user set it previously.
|
|
72
72
|
*
|
|
73
|
-
* @since 4.16
|
|
74
73
|
* @example
|
|
75
74
|
* let view = new MapView({
|
|
76
75
|
* container: "viewDiv",
|
|
@@ -221,11 +220,7 @@ export interface View2DProperties extends ViewProperties, DOMContainerProperties
|
|
|
221
220
|
* view.extent = extent; // Updates the view without animation
|
|
222
221
|
*/
|
|
223
222
|
extent?: ExtentProperties;
|
|
224
|
-
/**
|
|
225
|
-
* Applies a display filter on the view for a specific set of floor levels. It can filter the map display on floor-aware layers by zero or more level IDs.
|
|
226
|
-
*
|
|
227
|
-
* @since 4.19
|
|
228
|
-
*/
|
|
223
|
+
/** Applies a display filter on the view for a specific set of floor levels. It can filter the map display on floor-aware layers by zero or more level IDs. */
|
|
229
224
|
floors?: ReadonlyArrayOrCollection<string>;
|
|
230
225
|
/**
|
|
231
226
|
* Options for configuring the highlight. Use the highlight method on the
|
|
@@ -409,7 +404,6 @@ export default abstract class View2D extends View2DSuperclass {
|
|
|
409
404
|
* The background color of the view. If the view's [map](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View2D.html#map) changes, the view's `background` is reset to the map's background,
|
|
410
405
|
* even if the user set it previously.
|
|
411
406
|
*
|
|
412
|
-
* @since 4.16
|
|
413
407
|
* @example
|
|
414
408
|
* let view = new MapView({
|
|
415
409
|
* container: "viewDiv",
|
|
@@ -564,11 +558,7 @@ export default abstract class View2D extends View2DSuperclass {
|
|
|
564
558
|
*/
|
|
565
559
|
get extent(): Extent;
|
|
566
560
|
set extent(value: ExtentProperties);
|
|
567
|
-
/**
|
|
568
|
-
* Applies a display filter on the view for a specific set of floor levels. It can filter the map display on floor-aware layers by zero or more level IDs.
|
|
569
|
-
*
|
|
570
|
-
* @since 4.19
|
|
571
|
-
*/
|
|
561
|
+
/** Applies a display filter on the view for a specific set of floor levels. It can filter the map display on floor-aware layers by zero or more level IDs. */
|
|
572
562
|
get floors(): Collection<string>;
|
|
573
563
|
set floors(value: ReadonlyArrayOrCollection<string>);
|
|
574
564
|
/**
|
|
@@ -740,7 +730,6 @@ export default abstract class View2D extends View2DSuperclass {
|
|
|
740
730
|
* and [BasemapToggle](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-BasemapToggle.html) widgets and the view spatialReference cannot be changed at runtime.
|
|
741
731
|
*
|
|
742
732
|
* @default false
|
|
743
|
-
* @since 4.23
|
|
744
733
|
* @see [spatialReference](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View2D.html#spatialReference)
|
|
745
734
|
*/
|
|
746
735
|
accessor spatialReferenceLocked: boolean;
|
|
@@ -776,7 +765,6 @@ export default abstract class View2D extends View2DSuperclass {
|
|
|
776
765
|
* > If the `timeZone` is set to `unknown` and a layer’s date/time field includes time information, set the [DateTimeFieldFormat#timeStyle](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DateTimeFieldFormat.html#timeStyle) property to either long or full on the corresponding [date/time field](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-DateTimeFieldFormat.html).
|
|
777
766
|
*
|
|
778
767
|
* @default "system"
|
|
779
|
-
* @since 4.28
|
|
780
768
|
* @see [wikipedia - List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
|
|
781
769
|
* @example
|
|
782
770
|
* // Date and time will be displayed in Pacific/Auckland (NZ) time zone
|
|
@@ -887,7 +875,7 @@ export default abstract class View2D extends View2DSuperclass {
|
|
|
887
875
|
*
|
|
888
876
|
* > [!WARNING]
|
|
889
877
|
* >
|
|
890
|
-
* >
|
|
878
|
+
* > The `goTo` method now respects the user's preference for [reduced motion](https://developers.arcgis.com/javascript/latest/accessibility/#reduced-motion).
|
|
891
879
|
* > By default, `goTo()` will animate, but when the user expresses a preference for reduced motion, `goTo()` will navigate to the specified target without animation.
|
|
892
880
|
* > It is possible to override the user's preference for reduced motion by configuring [esriConfig.respectPrefersReducedMotion](https://developers.arcgis.com/javascript/latest/api-reference/esri-config.html#ConfigWithRespectPrefersReducedMotion)
|
|
893
881
|
* > or on a per-call basis by specifying the `animate` property.
|
package/views/input/types.d.ts
CHANGED
|
@@ -709,11 +709,7 @@ export interface ViewBaseEventTypes {
|
|
|
709
709
|
|
|
710
710
|
/** @since 5.0 */
|
|
711
711
|
export interface ViewEventTypes extends ViewBaseEventTypes {
|
|
712
|
-
/**
|
|
713
|
-
* Fires when browser focus is moved away from the view.
|
|
714
|
-
*
|
|
715
|
-
* @since 4.7
|
|
716
|
-
*/
|
|
712
|
+
/** Fires when browser focus is moved away from the view. */
|
|
717
713
|
blur: ViewBlurEvent;
|
|
718
714
|
/**
|
|
719
715
|
* Fires after a user clicks on the view. This event emits slightly slower than an
|
|
@@ -782,11 +778,7 @@ export interface ViewEventTypes extends ViewBaseEventTypes {
|
|
|
782
778
|
* });
|
|
783
779
|
*/
|
|
784
780
|
drag: DragEvent;
|
|
785
|
-
/**
|
|
786
|
-
* Fires when browser focus is on the view.
|
|
787
|
-
*
|
|
788
|
-
* @since 4.7
|
|
789
|
-
*/
|
|
781
|
+
/** Fires when browser focus is on the view. */
|
|
790
782
|
focus: ViewFocusEvent;
|
|
791
783
|
/**
|
|
792
784
|
* Fires after holding either a mouse button or a single finger on the view for a short amount of time.
|
|
@@ -807,7 +799,6 @@ export interface ViewEventTypes extends ViewBaseEventTypes {
|
|
|
807
799
|
* the view, and is not inhibited by a [View#@double-click](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#event-double-click) event. This event
|
|
808
800
|
* is useful for interactive experiences that require feedback without delay.
|
|
809
801
|
*
|
|
810
|
-
* @since 4.7
|
|
811
802
|
* @example
|
|
812
803
|
* // Set up an immediate-click event handler and retrieve the screen point
|
|
813
804
|
* view.on("immediate-click", function(event) {
|
|
@@ -824,8 +815,6 @@ export interface ViewEventTypes extends ViewBaseEventTypes {
|
|
|
824
815
|
* be prevented by use of `stopPropagation` on the [View#@immediate-click](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#event-immediate-click)
|
|
825
816
|
* event and can therefore be used to react to double-clicking independently of usage of the
|
|
826
817
|
* [View#@immediate-click](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#event-immediate-click) event.
|
|
827
|
-
*
|
|
828
|
-
* @since 4.15
|
|
829
818
|
*/
|
|
830
819
|
"immediate-double-click": ImmediateDoubleClickEvent;
|
|
831
820
|
/**
|
|
@@ -83,7 +83,6 @@ export default class BuildingComponentSublayerView extends Accessor {
|
|
|
83
83
|
* The availableFields is populated when the layer view is finished [updating](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-BuildingComponentSublayerView.html#updating). Use this list when
|
|
84
84
|
* querying features on the [client-side](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-BuildingComponentSublayerView.html#queryFeatures).
|
|
85
85
|
*
|
|
86
|
-
* @since 4.12
|
|
87
86
|
* @see [BuildingComponentSublayer#outFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-buildingSublayers-BuildingComponentSublayer.html#outFields)
|
|
88
87
|
*/
|
|
89
88
|
get availableFields(): string[];
|
package/views/types.d.ts
CHANGED
|
@@ -301,7 +301,6 @@ export type ViewHit = GraphicHit | MediaHit | RouteHit;
|
|
|
301
301
|
|
|
302
302
|
/**
|
|
303
303
|
* Object specification for the graphic hit result returned in [ViewHitTestResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-types.html#ViewHitTestResult) of the [MapView#hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) method.
|
|
304
|
-
* See the table below for the specification of each property in this object.
|
|
305
304
|
*
|
|
306
305
|
* @since 4.24
|
|
307
306
|
*/
|
|
@@ -336,7 +335,6 @@ export interface GraphicHit {
|
|
|
336
335
|
|
|
337
336
|
/**
|
|
338
337
|
* Object specification for the media hit results returned from [MediaLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MediaLayer.html) in [ViewHitTestResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-types.html#ViewHitTestResult) of the [MapView#hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) method.
|
|
339
|
-
* See the table below for the specification of each property in this object.
|
|
340
338
|
*
|
|
341
339
|
* @since 4.24
|
|
342
340
|
*/
|
|
@@ -363,7 +361,6 @@ export interface MediaHit {
|
|
|
363
361
|
/**
|
|
364
362
|
* An object representing a point on the element. The origin (0, 0) corresponds to the top-left corner of the element.
|
|
365
363
|
*
|
|
366
|
-
* @since 4.28
|
|
367
364
|
* @since 5.0
|
|
368
365
|
*/
|
|
369
366
|
sourcePoint?: ScreenPoint | null;
|
|
@@ -373,7 +370,6 @@ export interface MediaHit {
|
|
|
373
370
|
|
|
374
371
|
/**
|
|
375
372
|
* Object specification for the route hit results returned from [RouteLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-RouteLayer.html) in [ViewHitTestResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-types.html#ViewHitTestResult) of the [MapView#hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest) method.
|
|
376
|
-
* See the table below for the specification of each property in this object.
|
|
377
373
|
*
|
|
378
374
|
* @since 4.24
|
|
379
375
|
*/
|
|
@@ -570,7 +566,6 @@ export type SceneViewHit = SceneViewGraphicHit | SceneViewMediaHit | SceneViewRo
|
|
|
570
566
|
|
|
571
567
|
/**
|
|
572
568
|
* Object specification for the graphic hit result returned in [SceneViewHitTestResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-types.html#SceneViewHitTestResult) of the [SceneView#hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) method.
|
|
573
|
-
* See the table below for the specification of each property in this object.
|
|
574
569
|
*
|
|
575
570
|
* @since 4.24
|
|
576
571
|
*/
|
|
@@ -578,7 +573,6 @@ export type SceneViewGraphicHit = HitExtension<GraphicHit>;
|
|
|
578
573
|
|
|
579
574
|
/**
|
|
580
575
|
* Object specification for the media hit results returned from [MediaLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-MediaLayer.html) in [SceneViewHitTestResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-types.html#SceneViewHitTestResult) of the [SceneView#hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) method.
|
|
581
|
-
* See the table below for the specification of each property in this object.
|
|
582
576
|
*
|
|
583
577
|
* @since 4.24
|
|
584
578
|
*/
|
|
@@ -586,7 +580,6 @@ export type SceneViewMediaHit = HitExtension<MediaHit>;
|
|
|
586
580
|
|
|
587
581
|
/**
|
|
588
582
|
* Object specification for the route hit results returned from [RouteLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-RouteLayer.html) in [SceneViewHitTestResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-types.html#SceneViewHitTestResult) of the [SceneView#hitTest()](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#hitTest) method.
|
|
589
|
-
* See the table below for the specification of each property in this object.
|
|
590
583
|
*
|
|
591
584
|
* @since 4.24
|
|
592
585
|
*/
|
|
@@ -704,7 +697,6 @@ export interface HitTestOptions3D {
|
|
|
704
697
|
}
|
|
705
698
|
|
|
706
699
|
/**
|
|
707
|
-
*
|
|
708
700
|
* A convenience property used for defining the breakpoints on the [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View2D.html#height)
|
|
709
701
|
* and [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View2D.html#width) of the view. The sizes specified here determine the values of
|
|
710
702
|
* the [widthBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#widthBreakpoint) and [heightBreakpoint](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-BreakpointsOwner.html#heightBreakpoint)
|
|
@@ -781,12 +773,13 @@ export interface Breakpoints {
|
|
|
781
773
|
}
|
|
782
774
|
|
|
783
775
|
/**
|
|
784
|
-
*
|
|
785
776
|
* A convenience property indicating the view's orientation. See the table below for a list of possible values.
|
|
777
|
+
*
|
|
786
778
|
* > [!WARNING]
|
|
787
779
|
* >
|
|
788
780
|
* > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/styling/#view-size-css-classes) for additional
|
|
789
781
|
* > information on working with this.
|
|
782
|
+
*
|
|
790
783
|
* Possible Value | Description
|
|
791
784
|
* ---------------|------------
|
|
792
785
|
* landscape | The [width](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View2D.html#width) of the view is greater than its [height](https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View2D.html#height).
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"../../core/has.js";import{disposeMaybe as t}from"../../core/maybe.js";import{after as e}from"../../core/promiseUtils.js";import{Milliseconds as s}from"../../core/time.js";import{webglDebugEnabled as i,checkWebGLError as a,getErrorMessage as r}from"./checkWebGLError.js";import{ContextState as n}from"./ContextState.js";import{DrawBufferBack as l,DrawBufferNone as h,ColorAttachment0 as f,baseTextureUnit as o,ResourceType as u,PrimitiveType as c}from"./enums.js";import{InstanceCounter as d}from"./InstanceCounter.js";import{Parameters as _}from"./Parameters.js";import{ProgramCache as b}from"./ProgramCache.js";import{StateTracker as g}from"./renderState.js";import p from"./Texture.js";import{WebGLDriverTest as m}from"./WebGLDriverTest.js";import{Capabilities as B}from"./capabilities/Capabilities.js";let F=class{constructor(t,e){this.gl=t,this.instanceCounter=new d,this._programCache=new b(this),this._transformFeedbackRequestInfo=null,this._state=new n,this._numOfDrawCalls=0,this._numOfTriangles=0,this._options=e,this.configure(e)}configure(e){this._options=e,this._capabilities=new B(this.gl,e),this._parameters=new _(this.gl,this._capabilities,e),p.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const s=this.gl.getParameter(this.gl.VIEWPORT);this._state=new n,this._state.viewport={x:s[0],y:s[1],width:s[2],height:s[3]},this._stateTracker=new g({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const e=t.color;this.setBlendColor(e.r,e.g,e.b,e.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const e=t.function;this.setStencilFunction(e.func,e.ref,e.mask);const s=t.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)},setDrawBuffers:t=>{if(t)this.setDrawBuffers(t.buffers);else{const{drawFramebuffer:t}=this._state;null===t?this.setDrawBuffers([l]):0===t.colorAttachments.length?this.setDrawBuffers([h]):this.setDrawBuffers([f])}}}),this.enforceState(),t(this._driverTest),this._driverTest=new m(this)}updateOptions(t){this._options={...this._options,...t},this._parameters=new _(this.gl,this._capabilities,this._options)}dispose(){this._driverTest=t(this._driverTest),this._programCache=t(this._programCache),this.bindVAO(null),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663),this._state.textureUnitMap.length=0,this._state=null,this._capabilities=null,this._stateTracker=null,i()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}get programCache(){return this._programCache}setPipelineState(t){this._stateTracker.setPipeline(t)}setBlendingEnabled(t){this._state.blend!==t&&(!0===t?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=t,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(t,e){for(let s=0;s<t.length;++s)this._state.textureUnitMap[t[s]]=null;e>=0&&(this._state.activeTexture=e)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(t,e,s,i){t===this._state.blendColor.r&&e===this._state.blendColor.g&&s===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(t,e,s,i),this._state.blendColor.r=t,this._state.blendColor.g=e,this._state.blendColor.b=s,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(t,e){t===this._state.blendFunction.srcRGB&&e===this._state.blendFunction.dstRGB||(this.gl.blendFunc(t,e),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=e,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(t,e,s,i){this._state.blendFunction.srcRGB===t&&this._state.blendFunction.srcAlpha===s&&this._state.blendFunction.dstRGB===e&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(t,e,s,i),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=s,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(t){this._state.blendEquation.mode!==t&&(this.gl.blendEquation(t),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(t,e){this._state.blendEquation.mode===t&&this._state.blendEquation.modeAlpha===e||(this.gl.blendEquationSeparate(t,e),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setColorMask(t,e,s,i){this._state.colorMask.r===t&&this._state.colorMask.g===e&&this._state.colorMask.b===s&&this._state.colorMask.a===i||(this.gl.colorMask(t,e,s,i),this._state.colorMask.r=t,this._state.colorMask.g=e,this._state.colorMask.b=s,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(t,e,s,i){this._state.clearColor.r===t&&this._state.clearColor.g===e&&this._state.clearColor.b===s&&this._state.clearColor.a===i||(this.gl.clearColor(t,e,s,i),this._state.clearColor.r=t,this._state.clearColor.g=e,this._state.clearColor.b=s,this._state.clearColor.a=i)}setFaceCullingEnabled(t){this._state.faceCulling!==t&&(!0===t?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=t,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(t){this._state.polygonOffsetFill!==t&&(!0===t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=t,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(t,e){this._state.polygonOffset[0]===t&&this._state.polygonOffset[1]===e||(this._state.polygonOffset[0]=t,this._state.polygonOffset[1]=e,this.gl.polygonOffset(t,e),this._stateTracker.invalidatePolygonOffset())}setCullFace(t){this._state.cullFace!==t&&(this.gl.cullFace(t),this._state.cullFace=t,this._stateTracker.invalidateCulling())}setFrontFace(t){this._state.frontFace!==t&&(this.gl.frontFace(t),this._state.frontFace=t,this._stateTracker.invalidateCulling())}setScissorTestEnabled(t){this._state.scissorTest!==t&&(!0===t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=t)}setScissorRect(t,e,s,i){this._state.scissorRect.x===t&&this._state.scissorRect.y===e&&this._state.scissorRect.width===s&&this._state.scissorRect.height===i||(this.gl.scissor(t,e,s,i),this._state.scissorRect.x=t,this._state.scissorRect.y=e,this._state.scissorRect.width=s,this._state.scissorRect.height=i)}setDepthTestEnabled(t){this._state.depthTest!==t&&(!0===t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=t,this._stateTracker.invalidateDepthTest())}setClearDepth(t){this._state.clearDepth!==t&&(this.gl.clearDepth(t),this._state.clearDepth=t)}setDepthFunction(t){this._state.depthFunction!==t&&(this.gl.depthFunc(t),this._state.depthFunction=t,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(t){this._state.depthWrite!==t&&(this.gl.depthMask(t),this._state.depthWrite=t,this._stateTracker.invalidateDepthWrite())}setDepthRange(t,e){this._state.depthRange.zNear===t&&this._state.depthRange.zFar===e||(this.gl.depthRange(t,e),this._state.depthRange.zNear=t,this._state.depthRange.zFar=e,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(t){this._state.stencilTest!==t&&(!0===t?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=t,this._stateTracker.invalidateStencilTest())}setClearStencil(t){t!==this._state.clearStencil&&(this.gl.clearStencil(t),this._state.clearStencil=t)}setStencilFunction(t,e,s){this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===e&&this._state.stencilFunction.mask===s||(this.gl.stencilFunc(t,e,s),this._state.stencilFunction.face=1032,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=e,this._state.stencilFunction.mask=s,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(t,e,s,i){this._state.stencilFunction.face===t&&this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(t,e,s,i),this._state.stencilFunction.face=t,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(t){this._state.stencilWriteMask!==t&&(this.gl.stencilMask(t),this._state.stencilWriteMask=t,this._stateTracker.invalidateStencilWrite())}setStencilOp(t,e,s){1032===this._state.stencilOperation.face&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===e&&this._state.stencilOperation.zPass===s||(this.gl.stencilOp(t,e,s),this._state.stencilOperation.face=1032,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=e,this._state.stencilOperation.zPass=s,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(t,e,s,i){this._state.stencilOperation.face===t&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(t,e,s,i),this._state.stencilOperation.face=t,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(t,e=!1){const s=this._state.activeTexture;return t>=0&&(e||t!==this._state.activeTexture)&&(this.gl.activeTexture(o+t),this._state.activeTexture=t),s}setDrawBuffers(t){const{drawFramebuffer:e}=this._state,s=null===e,i=s?this._state.drawBuffers.defaultFramebuffer:this._state.drawBuffers.fbos.get(e);if(i?.length!==t.length||!i.every((e,s)=>e===t[s]))if(t.length>this.parameters.maxDrawBuffers)console.error("Setting more active draw buffers than GL.MAX_DRAW_BUFFERS allows.");else{if(s){if(t.length>1)return void console.error("The default framebuffer can only have one active draw buffer.");if(t[0]!==l&&t[0]!==h)return void console.error("The default framebuffer can only use the constants GL.BACK or GL.NONE as draw buffers.")}s||!t.includes(l)?(this.gl.drawBuffers(t),s?this._state.drawBuffers.defaultFramebuffer=t:this._state.drawBuffers.fbos.set(e,t),this._stateTracker.invalidateDrawBuffers()):console.error("A framebuffer object can only use the constants GL.COLOR_ATTACHMENTi or GL.NONE as draw buffers.")}}clear(t,e=255){if(t){if(16384&t){const t=this._state.drawFramebuffer?.colorAttachments;t&&this.setDrawBuffers(t),this.setColorMask(!0,!0,!0,!0)}256&t&&this.setDepthWriteEnabled(!0),1024&t&&this.setStencilWriteMask(e),this.gl.clear(t)}}clearFramebuffer(t,e=!1,s=!1){let i=0;if(t){const e=1e-13,s=Math.max(e,t[3]);this.setClearColor(t[0],t[1],t[2],s),i|=16384}e&&(i|=256),!1===s?s=0:(!0===s&&(s=255),i|=1024),i&&this.clear(i,s)}clearBuffer(t,e,s=6144,i=void 0){this.gl.clearBufferfv(s,t,e,i)}clearBufferInteger(t,e,s=6144,i=void 0){this.gl.clearBufferiv(s,t,e,i)}clearBufferUnsignedInteger(t,e,s=6144,i=void 0){this.gl.clearBufferuiv(s,t,e,i)}drawArrays(t,e,s){if(this._transformFeedbackRequestInfo){if(t!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(null==this._state.program?.hasTransformFeedbackVaryings)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(i()&&(this._numOfDrawCalls++,this._numOfTriangles+=x(t,s),has("enable-feature:webgl-debug:textureReadWrite"))){const t=this._state.textureUnitMap;for(let e=0;e<t.length;e++){const s=t[e];if(null!=s&&s===this._state.drawFramebuffer?.colorTexture)throw new Error(`Detected readWrite. Texture already bound at index ${e}`)}}this.gl.drawArrays(t,e,s),a(this.gl)}drawArraysInstanced(t,e,s,i){this.gl.drawArraysInstanced(t,e,s,i),a(this.gl)}drawElements(t,e,s,a){if(this._transformFeedbackRequestInfo)throw new Error("Cannot called drawElements during a transform feedback request");if(i()&&(this._numOfDrawCalls++,this._numOfTriangles+=x(t,e)),this.gl.drawElements(t,e,s,a),i()){const i=r(this.gl);if(i){const r=this.getBoundVAO(),n=r?.indexBuffer,l=r?.buffers,h={indexBuffer:n,vertexBuffers:l},f={mode:t,count:e,type:s,offset:a},o=n?.size??0,u=a+e,c=o<u?`. Buffer is too small. Attempted to draw index ${u} of ${o}`:"";console.error(`drawElements: ${i}${c}`,{args:f,vao:h})}}}drawElementsInstanced(t,e,s,i,r){this.gl.drawElementsInstanced(t,e,s,i,r),a(this.gl)}logInfo(){i()&&console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`)}resetInfo(){i()&&(this._numOfDrawCalls=0,this._numOfTriangles=0)}get capabilities(){return this._capabilities}setViewport(t,e,s,i){s=Math.max(Math.round(s),1),i=Math.max(Math.round(i),1);const a=this._state.viewport;a.x===t&&a.y===e&&a.width===s&&a.height===i||(a.x=t,a.y=e,a.width=s,a.height=i,this.gl.viewport(t,e,s,i))}setViewport4fv(t){this.setViewport(t[0],t[1],t[2],t[3])}restoreViewport({x:t,y:e,width:s,height:i}){this.setViewport(t,e,s,i)}getViewport(){const t=this._state.viewport;return{x:t.x,y:t.y,width:t.width,height:t.height}}useProgram(t){this._state.program!==t&&(this._state.program?.stop(),this._state.program=t,this.gl.useProgram(t?.glName??null))}bindTexture(t,e,s=!1){(e>=this.parameters.maxTextureImageUnits||e<0)&&console.error("Input texture unit is out of range of available units!");const i=this._state.textureUnitMap[e];return null==t?.glName?(null!=i&&(this.setActiveTexture(e,s),this.gl.bindTexture(i.descriptor.target,null)),this._state.textureUnitMap[e]=null,i):s||i!==t?(this.setActiveTexture(e,s),this.gl.bindTexture(t.descriptor.target,t.glName),t.applyChanges(),this._state.textureUnitMap[e]=t,i):(t.isDirty&&(this.setActiveTexture(e,s),t.applyChanges()),i)}unbindTexture(t){if(null!=t)for(let e=0;e<this.parameters.maxTextureImageUnits;e++)this._state.textureUnitMap[e]===t&&(this.bindTexture(null,e),this._state.textureUnitMap[e]=null)}bindFramebuffer(t,e=!1){if(e||this._state.readFramebuffer!==t||this._state.drawFramebuffer!==t){if(this._stateTracker.invalidateDrawBuffers(),null==t)return this.gl.bindFramebuffer(36160,null),void(this._state.readFramebuffer=this._state.drawFramebuffer=null);t.initializeAndBind(36160),this._state.readFramebuffer=t,this._state.drawFramebuffer=t}}bindFramebufferSeparate(t,e,s=!1){const i=36008===e,a=i?this._state.readFramebuffer:this._state.drawFramebuffer;(s||a!==t)&&(null==t?this.gl.bindFramebuffer(e,null):t.initializeAndBind(e),i?this._state.readFramebuffer=t??null:(this._stateTracker.invalidateDrawBuffers(),this._state.drawFramebuffer=t??null))}blitFramebuffer(t,e,s=16384,i=9728,a=0,r=0,n=t.width,l=t.height,h=0,f=0,o=e.width,u=e.height){this.bindFramebufferSeparate(t,36008,!0),this.bindFramebufferSeparate(e,36009,!0),this.gl.blitFramebuffer(a,r,n,l,h,f,o,u,s,i)}bindBuffer(t,e){if(t)switch(e??=t.bufferType,e){case 34962:this._state.vertexBuffer=T(this.gl,t,e,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=T(this.gl,t,e,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=T(this.gl,t,e,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=T(this.gl,t,e,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=T(this.gl,t,e,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=T(this.gl,t,e,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=T(this.gl,t,e,this._state.copyWriteBuffer);break;case 35982:this._state.transformFeedbackBuffer=T(this.gl,t,e,this._state.transformFeedbackBuffer)}}bindRenderbuffer(t){const e=this.gl;t||(e.bindRenderbuffer(e.RENDERBUFFER,null),this._state.renderbuffer=null),this._state.renderbuffer!==t&&(e.bindRenderbuffer(e.RENDERBUFFER,t.glName),this._state.renderbuffer=t)}_getBufferBinding(t,e){if(e>=this.parameters.maxUniformBufferBindings||e<0)return console.error("Uniform buffer binding point is out of range!"),null;const s=35345===t?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let i=s[e];return null==i&&(i={buffer:null,offset:0,size:0},s[e]=i),i}bindBufferBase(t,e,s){const i=this._getBufferBinding(t,e);null!=i&&(i.buffer===s&&0===i.offset&&0===i.size||(this.gl.bindBufferBase(t,e,s?s.glName:null),i.buffer=s,i.offset=0,i.size=0))}bindBufferRange(t,e,s,i,a){const r=this._getBufferBinding(t,e);null!=r&&(r.buffer===s&&r.offset===i&&r.size===a||(i%this._parameters.uniformBufferOffsetAlignment===0?(this.gl.bindBufferRange(t,e,s.glName,i,a),r.buffer=s,r.offset=i,r.size=a):console.error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUBO(t,e,s,a){null!=e?(i()&&(a??e.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),e.initialize(),void 0!==s&&void 0!==a?this.bindBufferRange(35345,t,e.buffer,s,a):this.bindBufferBase(35345,t,e.buffer)):this.bindBufferBase(35345,t,null)}unbindUBO(t){for(let e=0,s=this._state.uniformBufferBindingPoints.length;e<s;e++){const s=this._state.uniformBufferBindingPoints[e];null!=s&&s.buffer===t.buffer&&this.bindBufferBase(35345,e,null)}}unbindBuffer(t){switch(t){case 34962:this._state.vertexBuffer=T(this.gl,null,t,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=T(this.gl,null,t,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=T(this.gl,null,t,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=T(this.gl,null,t,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=T(this.gl,null,t,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=T(this.gl,null,t,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=T(this.gl,null,t,this._state.copyWriteBuffer)}}bindVAO(t,e){if(null==t)return this._state.vertexArrayObject?.unbind(),void(this._state.vertexArrayObject=null);this._state.vertexArrayObject!==t&&(t.bind(e),this._state.vertexArrayObject=t)}bindTransformFeedback(t){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,t.glName)}beginTransformFeedback(t,e){if(this._transformFeedbackRequestInfo)throw new Error("Already in a transform feedback request");const{gl:s}=this;s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,t.glName),s.beginTransformFeedback(e),this._transformFeedbackRequestInfo={primitiveType:e}}endTransformFeedback(){if(!this._transformFeedbackRequestInfo)throw new Error("Not in a transform feedback request");const{gl:t}=this;t.endTransformFeedback(),t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null),this._transformFeedbackRequestInfo=null}async clientWaitAsync(t=s(10)){const{gl:i}=this,a=i.fenceSync(37143,0);if(!a)throw new Error("Client wait failed, could not create sync object");let r;this.instanceCounter.increment(u.Sync,a),i.flush();do{await e(t),r=i.clientWaitSync(a,0,0)}while(37147===r);if(this.instanceCounter.decrement(u.Sync,a),i.deleteSync(a),37149===r)throw new Error("Client wait failed")}getBoundFramebufferObject(t=36160){return 36008===t?this._state.readFramebuffer:this._state.drawFramebuffer}temporaryBindFramebufferObject(t,e,s=!1){const i=this.getBoundFramebufferObject();try{this.bindFramebuffer(t,s),e()}finally{this.bindFramebuffer(i,s)}}getBoundVAO(){return this._state.vertexArrayObject}resetState(){this.useProgram(null),this.bindVAO(null),this.bindFramebuffer(null,!0),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663);for(let t=0;t<this.parameters.maxTextureImageUnits;++t)this.bindTexture(null,t);this.setBlendingEnabled(!1),this.setBlendFunction(1,0),this.setBlendEquation(32774),this.setBlendColor(0,0,0,0),this.setFaceCullingEnabled(!1),this.setCullFace(1029),this.setFrontFace(2305),this.setPolygonOffsetFillEnabled(!1),this.setPolygonOffset(0,0),this.setScissorTestEnabled(!1),this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height),this.setDepthTestEnabled(!1),this.setDepthFunction(513),this.setDepthRange(0,1),this.setStencilTestEnabled(!1),this.setStencilFunction(519,0,0),this.setStencilOp(7680,7680,7680),this.setClearColor(0,0,0,0),this.setClearDepth(1),this.setClearStencil(0),this.setColorMask(!0,!0,!0,!0),this.setStencilWriteMask(4294967295),this.setDepthWriteEnabled(!0),this.setDrawBuffers([l]),this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)}enforceState(){const{gl:t}=this;t.bindVertexArray(null);for(let s=0;s<this.parameters.maxVertexAttributes;s++)t.disableVertexAttribArray(s);this._state.vertexBuffer?t.bindBuffer(this._state.vertexBuffer.bufferType,this._state.vertexBuffer.glName):t.bindBuffer(34962,null),this._state.indexBuffer?t.bindBuffer(this._state.indexBuffer.bufferType,this._state.indexBuffer.glName):t.bindBuffer(34963,null),this._state.uniformBuffer?t.bindBuffer(this._state.uniformBuffer.bufferType,this._state.uniformBuffer.glName):t.bindBuffer(35345,null);for(let s=0;s<this._parameters.maxUniformBufferBindings;s++){const e=this._state.uniformBufferBindingPoints[s];if(null!=e){const{buffer:i,offset:a,size:r}=e;null!==i?0===a&&0===r?t.bindBufferBase(35345,s,i.glName):t.bindBufferRange(35345,s,i.glName,a,r):t.bindBufferBase(35345,s,null)}}if(this._state.pixelPackBuffer?t.bindBuffer(this._state.pixelPackBuffer.bufferType,this._state.pixelPackBuffer.glName):t.bindBuffer(35051,null),this._state.pixelUnpackBuffer?t.bindBuffer(this._state.pixelUnpackBuffer.bufferType,this._state.pixelUnpackBuffer.glName):t.bindBuffer(35052,null),this._state.copyReadBuffer?t.bindBuffer(this._state.copyReadBuffer.bufferType,this._state.copyReadBuffer.glName):t.bindBuffer(36662,null),this._state.copyWriteBuffer?t.bindBuffer(this._state.copyWriteBuffer.bufferType,this._state.copyWriteBuffer.glName):t.bindBuffer(36663,null),t.bindFramebuffer(36008,null),t.readBuffer(t.BACK),this._state.readFramebuffer&&(t.bindFramebuffer(36008,this._state.readFramebuffer.glName),t.readBuffer(f)),t.bindFramebuffer(36009,this._state.drawFramebuffer?.glName??null),null===this._state.drawFramebuffer){const e=this._state.drawBuffers.defaultFramebuffer;t.drawBuffers(e??[l])}else{const e=this._state.drawBuffers.fbos.get(this._state.drawFramebuffer);t.drawBuffers(e??[f])}if(this._state.vertexArrayObject){const t=this._state.vertexArrayObject;this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null),this.bindVAO(t)}t.useProgram(this._state.program?.glName??null),t.blendColor(this._state.blendColor.r,this._state.blendColor.g,this._state.blendColor.b,this._state.blendColor.a),t.bindRenderbuffer(t.RENDERBUFFER,this._state.renderbuffer?.glName??null),!0===this._state.blend?t.enable(this.gl.BLEND):t.disable(this.gl.BLEND),t.blendEquationSeparate(this._state.blendEquation.mode,this._state.blendEquation.modeAlpha),t.blendFuncSeparate(this._state.blendFunction.srcRGB,this._state.blendFunction.dstRGB,this._state.blendFunction.srcAlpha,this._state.blendFunction.dstAlpha),t.clearColor(this._state.clearColor.r,this._state.clearColor.g,this._state.clearColor.b,this._state.clearColor.a),t.clearDepth(this._state.clearDepth),t.clearStencil(this._state.clearStencil),t.colorMask(this._state.colorMask.r,this._state.colorMask.g,this._state.colorMask.b,this._state.colorMask.a),t.cullFace(this._state.cullFace),t.depthFunc(this._state.depthFunction),t.depthRange(this._state.depthRange.zNear,this._state.depthRange.zFar),!0===this._state.depthTest?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),t.depthMask(this._state.depthWrite),t.frontFace(this._state.frontFace),t.lineWidth(1),!0===this._state.faceCulling?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),t.polygonOffset(this._state.polygonOffset[0],this._state.polygonOffset[1]),!0===this._state.polygonOffsetFill?t.enable(t.POLYGON_OFFSET_FILL):t.disable(t.POLYGON_OFFSET_FILL),t.scissor(this._state.scissorRect.x,this._state.scissorRect.y,this._state.scissorRect.width,this._state.scissorRect.height),!0===this._state.scissorTest?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST),t.stencilFunc(this._state.stencilFunction.func,this._state.stencilFunction.ref,this._state.stencilFunction.mask),t.stencilOpSeparate(this._state.stencilOperation.face,this._state.stencilOperation.fail,this._state.stencilOperation.zFail,this._state.stencilOperation.zPass),!0===this._state.stencilTest?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),t.stencilMask(this._state.stencilWriteMask);for(let s=0;s<this.parameters.maxTextureImageUnits;s++){t.activeTexture(o+s),t.bindTexture(3553,null),t.bindTexture(34067,null),t.bindTexture(32879,null),t.bindTexture(35866,null);const e=this._state.textureUnitMap[s];null!=e&&t.bindTexture(e.descriptor.target,e.glName)}t.activeTexture(o+this._state.activeTexture);const e=this._state.viewport;t.viewport(e.x,e.y,e.width,e.height),this.resetInfo()}};function T(t,e,s,i){return e?i!==e&&t.bindBuffer(s,e.glName):t.bindBuffer(s,null),e}function x(t,e){switch(t){case c.POINTS:return 2*e;case c.TRIANGLES:return e/3;case c.TRIANGLE_STRIP:case c.TRIANGLE_FAN:return e-2;default:return 0}}export{F as RenderingContext};
|
|
5
|
+
import has from"../../core/has.js";import{disposeMaybe as t}from"../../core/maybe.js";import{after as e}from"../../core/promiseUtils.js";import{Milliseconds as s}from"../../core/time.js";import{webglDebugEnabled as i,checkWebGLError as a,getErrorMessage as r}from"./checkWebGLError.js";import{ContextState as n}from"./ContextState.js";import{DrawBufferBack as l,DrawBufferNone as h,ColorAttachment0 as f,baseTextureUnit as o,ResourceType as u,PrimitiveType as c}from"./enums.js";import{InstanceCounter as d}from"./InstanceCounter.js";import{Parameters as _}from"./Parameters.js";import{ProgramCache as b}from"./ProgramCache.js";import{StateTracker as g}from"./renderState.js";import p from"./Texture.js";import{WebGLDriverTest as m}from"./WebGLDriverTest.js";import{Capabilities as B}from"./capabilities/Capabilities.js";let F=class{constructor(t,e){this.gl=t,this.instanceCounter=new d,this._programCache=new b(this),this._transformFeedbackRequestInfo=null,this._state=new n,this._numOfDrawCalls=0,this._numOfTriangles=0,this._options=e,this.configure(e)}configure(e){this._options=e,this._capabilities=new B(this.gl,e),this._parameters=new _(this.gl,this._capabilities,e),p.TEXTURE_UNIT_FOR_UPDATES=this._parameters.maxTextureImageUnits-1;const s=this.gl.getParameter(this.gl.VIEWPORT);this._state=new n,this._state.viewport={x:s[0],y:s[1],width:s[2],height:s[3]},this._stateTracker=new g({setBlending:t=>{if(t){this.setBlendingEnabled(!0),this.setBlendEquationSeparate(t.opRgb,t.opAlpha),this.setBlendFunctionSeparate(t.srcRgb,t.dstRgb,t.srcAlpha,t.dstAlpha);const e=t.color;this.setBlendColor(e.r,e.g,e.b,e.a)}else this.setBlendingEnabled(!1)},setCulling:t=>{t?(this.setFaceCullingEnabled(!0),this.setCullFace(t.face),this.setFrontFace(t.mode)):this.setFaceCullingEnabled(!1)},setPolygonOffset:t=>{t?(this.setPolygonOffsetFillEnabled(!0),this.setPolygonOffset(t.factor,t.units)):this.setPolygonOffsetFillEnabled(!1)},setDepthTest:t=>{t?(this.setDepthTestEnabled(!0),this.setDepthFunction(t.func)):this.setDepthTestEnabled(!1)},setStencilTest:t=>{if(t){this.setStencilTestEnabled(!0);const e=t.function;this.setStencilFunction(e.func,e.ref,e.mask);const s=t.operation;this.setStencilOp(s.fail,s.zFail,s.zPass)}else this.setStencilTestEnabled(!1)},setDepthWrite:t=>{t?(this.setDepthWriteEnabled(!0),this.setDepthRange(t.zNear,t.zFar)):this.setDepthWriteEnabled(!1)},setColorWrite:t=>{t?this.setColorMask(t.r,t.g,t.b,t.a):this.setColorMask(!1,!1,!1,!1)},setStencilWrite:t=>{t?this.setStencilWriteMask(t.mask):this.setStencilWriteMask(0)},setDrawBuffers:t=>{if(t)this.setDrawBuffers(t.buffers);else{const{drawFramebuffer:t}=this._state;null===t?this.setDrawBuffers([l]):0===t.colorAttachments.length?this.setDrawBuffers([h]):this.setDrawBuffers([f])}}}),this.enforceState(),t(this._driverTest),this._driverTest=new m(this)}updateOptions(t){this._options={...this._options,...t},this._parameters=new _(this.gl,this._capabilities,this._options)}dispose(){this._driverTest=t(this._driverTest),this._programCache=t(this._programCache),this.bindVAO(null),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663),this._state.textureUnitMap.length=0,this._state=null,this._capabilities=null,this._stateTracker=null,i()&&console.log(this.instanceCounter.resourceInformation)}get driverTest(){return this._driverTest}get contextAttributes(){return this.gl.getContextAttributes()}get parameters(){return this._parameters}get programCache(){return this._programCache}setPipelineState(t){this._stateTracker.setPipeline(t)}getPipelineState(){return this._stateTracker.getPipelineState()}setBlendingEnabled(t){this._state.blend!==t&&(!0===t?this.gl.enable(this.gl.BLEND):this.gl.disable(this.gl.BLEND),this._state.blend=t,this._stateTracker.invalidateBlending())}externalProgramUpdate(){this._state.program?.stop(),this._state.program=null}externalTextureUnitUpdate(t,e){for(let s=0;s<t.length;++s)this._state.textureUnitMap[t[s]]=null;e>=0&&(this._state.activeTexture=e)}externalVertexArrayObjectUpdate(){this.gl.bindVertexArray(null),this._state.vertexArrayObject=null,this._state.vertexBuffer=null,this._state.indexBuffer=null}externalVertexBufferUpdate(){this._state.vertexBuffer=null}externalIndexBufferUpdate(){this._state.indexBuffer=null}setBlendColor(t,e,s,i){t===this._state.blendColor.r&&e===this._state.blendColor.g&&s===this._state.blendColor.b&&i===this._state.blendColor.a||(this.gl.blendColor(t,e,s,i),this._state.blendColor.r=t,this._state.blendColor.g=e,this._state.blendColor.b=s,this._state.blendColor.a=i,this._stateTracker.invalidateBlending())}setBlendFunction(t,e){t===this._state.blendFunction.srcRGB&&e===this._state.blendFunction.dstRGB||(this.gl.blendFunc(t,e),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=t,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=e,this._stateTracker.invalidateBlending())}setBlendFunctionSeparate(t,e,s,i){this._state.blendFunction.srcRGB===t&&this._state.blendFunction.srcAlpha===s&&this._state.blendFunction.dstRGB===e&&this._state.blendFunction.dstAlpha===i||(this.gl.blendFuncSeparate(t,e,s,i),this._state.blendFunction.srcRGB=t,this._state.blendFunction.srcAlpha=s,this._state.blendFunction.dstRGB=e,this._state.blendFunction.dstAlpha=i,this._stateTracker.invalidateBlending())}setBlendEquation(t){this._state.blendEquation.mode!==t&&(this.gl.blendEquation(t),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=t,this._stateTracker.invalidateBlending())}setBlendEquationSeparate(t,e){this._state.blendEquation.mode===t&&this._state.blendEquation.modeAlpha===e||(this.gl.blendEquationSeparate(t,e),this._state.blendEquation.mode=t,this._state.blendEquation.modeAlpha=e,this._stateTracker.invalidateBlending())}setColorMask(t,e,s,i){this._state.colorMask.r===t&&this._state.colorMask.g===e&&this._state.colorMask.b===s&&this._state.colorMask.a===i||(this.gl.colorMask(t,e,s,i),this._state.colorMask.r=t,this._state.colorMask.g=e,this._state.colorMask.b=s,this._state.colorMask.a=i,this._stateTracker.invalidateColorWrite())}setClearColor(t,e,s,i){this._state.clearColor.r===t&&this._state.clearColor.g===e&&this._state.clearColor.b===s&&this._state.clearColor.a===i||(this.gl.clearColor(t,e,s,i),this._state.clearColor.r=t,this._state.clearColor.g=e,this._state.clearColor.b=s,this._state.clearColor.a=i)}setFaceCullingEnabled(t){this._state.faceCulling!==t&&(!0===t?this.gl.enable(this.gl.CULL_FACE):this.gl.disable(this.gl.CULL_FACE),this._state.faceCulling=t,this._stateTracker.invalidateCulling())}setPolygonOffsetFillEnabled(t){this._state.polygonOffsetFill!==t&&(!0===t?this.gl.enable(this.gl.POLYGON_OFFSET_FILL):this.gl.disable(this.gl.POLYGON_OFFSET_FILL),this._state.polygonOffsetFill=t,this._stateTracker.invalidatePolygonOffset())}setPolygonOffset(t,e){this._state.polygonOffset[0]===t&&this._state.polygonOffset[1]===e||(this._state.polygonOffset[0]=t,this._state.polygonOffset[1]=e,this.gl.polygonOffset(t,e),this._stateTracker.invalidatePolygonOffset())}setCullFace(t){this._state.cullFace!==t&&(this.gl.cullFace(t),this._state.cullFace=t,this._stateTracker.invalidateCulling())}setFrontFace(t){this._state.frontFace!==t&&(this.gl.frontFace(t),this._state.frontFace=t,this._stateTracker.invalidateCulling())}setScissorTestEnabled(t){this._state.scissorTest!==t&&(!0===t?this.gl.enable(this.gl.SCISSOR_TEST):this.gl.disable(this.gl.SCISSOR_TEST),this._state.scissorTest=t)}setScissorRect(t,e,s,i){this._state.scissorRect.x===t&&this._state.scissorRect.y===e&&this._state.scissorRect.width===s&&this._state.scissorRect.height===i||(this.gl.scissor(t,e,s,i),this._state.scissorRect.x=t,this._state.scissorRect.y=e,this._state.scissorRect.width=s,this._state.scissorRect.height=i)}setDepthTestEnabled(t){this._state.depthTest!==t&&(!0===t?this.gl.enable(this.gl.DEPTH_TEST):this.gl.disable(this.gl.DEPTH_TEST),this._state.depthTest=t,this._stateTracker.invalidateDepthTest())}setClearDepth(t){this._state.clearDepth!==t&&(this.gl.clearDepth(t),this._state.clearDepth=t)}setDepthFunction(t){this._state.depthFunction!==t&&(this.gl.depthFunc(t),this._state.depthFunction=t,this._stateTracker.invalidateDepthTest())}setDepthWriteEnabled(t){this._state.depthWrite!==t&&(this.gl.depthMask(t),this._state.depthWrite=t,this._stateTracker.invalidateDepthWrite())}setDepthRange(t,e){this._state.depthRange.zNear===t&&this._state.depthRange.zFar===e||(this.gl.depthRange(t,e),this._state.depthRange.zNear=t,this._state.depthRange.zFar=e,this._stateTracker.invalidateDepthWrite())}setStencilTestEnabled(t){this._state.stencilTest!==t&&(!0===t?this.gl.enable(this.gl.STENCIL_TEST):this.gl.disable(this.gl.STENCIL_TEST),this._state.stencilTest=t,this._stateTracker.invalidateStencilTest())}setClearStencil(t){t!==this._state.clearStencil&&(this.gl.clearStencil(t),this._state.clearStencil=t)}setStencilFunction(t,e,s){this._state.stencilFunction.func===t&&this._state.stencilFunction.ref===e&&this._state.stencilFunction.mask===s||(this.gl.stencilFunc(t,e,s),this._state.stencilFunction.face=1032,this._state.stencilFunction.func=t,this._state.stencilFunction.ref=e,this._state.stencilFunction.mask=s,this._stateTracker.invalidateStencilTest())}setStencilFunctionSeparate(t,e,s,i){this._state.stencilFunction.face===t&&this._state.stencilFunction.func===e&&this._state.stencilFunction.ref===s&&this._state.stencilFunction.mask===i||(this.gl.stencilFuncSeparate(t,e,s,i),this._state.stencilFunction.face=t,this._state.stencilFunction.func=e,this._state.stencilFunction.ref=s,this._state.stencilFunction.mask=i,this._stateTracker.invalidateStencilTest())}setStencilWriteMask(t){this._state.stencilWriteMask!==t&&(this.gl.stencilMask(t),this._state.stencilWriteMask=t,this._stateTracker.invalidateStencilWrite())}setStencilOp(t,e,s){1032===this._state.stencilOperation.face&&this._state.stencilOperation.fail===t&&this._state.stencilOperation.zFail===e&&this._state.stencilOperation.zPass===s||(this.gl.stencilOp(t,e,s),this._state.stencilOperation.face=1032,this._state.stencilOperation.fail=t,this._state.stencilOperation.zFail=e,this._state.stencilOperation.zPass=s,this._stateTracker.invalidateStencilTest())}setStencilOpSeparate(t,e,s,i){this._state.stencilOperation.face===t&&this._state.stencilOperation.fail===e&&this._state.stencilOperation.zFail===s&&this._state.stencilOperation.zPass===i||(this.gl.stencilOpSeparate(t,e,s,i),this._state.stencilOperation.face=t,this._state.stencilOperation.fail=e,this._state.stencilOperation.zFail=s,this._state.stencilOperation.zPass=i,this._stateTracker.invalidateStencilTest())}setActiveTexture(t,e=!1){const s=this._state.activeTexture;return t>=0&&(e||t!==this._state.activeTexture)&&(this.gl.activeTexture(o+t),this._state.activeTexture=t),s}setDrawBuffers(t){const{drawFramebuffer:e}=this._state,s=null===e,i=s?this._state.drawBuffers.defaultFramebuffer:this._state.drawBuffers.fbos.get(e);if(i?.length!==t.length||!i.every((e,s)=>e===t[s]))if(t.length>this.parameters.maxDrawBuffers)console.error("Setting more active draw buffers than GL.MAX_DRAW_BUFFERS allows.");else{if(s){if(t.length>1)return void console.error("The default framebuffer can only have one active draw buffer.");if(t[0]!==l&&t[0]!==h)return void console.error("The default framebuffer can only use the constants GL.BACK or GL.NONE as draw buffers.")}s||!t.includes(l)?(this.gl.drawBuffers(t),s?this._state.drawBuffers.defaultFramebuffer=t:this._state.drawBuffers.fbos.set(e,t),this._stateTracker.invalidateDrawBuffers()):console.error("A framebuffer object can only use the constants GL.COLOR_ATTACHMENTi or GL.NONE as draw buffers.")}}clear(t,e=255){if(t){if(16384&t){const t=this._state.drawFramebuffer?.colorAttachments;t&&this.setDrawBuffers(t),this.setColorMask(!0,!0,!0,!0)}256&t&&this.setDepthWriteEnabled(!0),1024&t&&this.setStencilWriteMask(e),this.gl.clear(t)}}clearFramebuffer(t,e=!1,s=!1){let i=0;if(t){const e=1e-13,s=Math.max(e,t[3]);this.setClearColor(t[0],t[1],t[2],s),i|=16384}e&&(i|=256),!1===s?s=0:(!0===s&&(s=255),i|=1024),i&&this.clear(i,s)}clearBuffer(t,e,s=6144,i=void 0){this.gl.clearBufferfv(s,t,e,i)}clearBufferInteger(t,e,s=6144,i=void 0){this.gl.clearBufferiv(s,t,e,i)}clearBufferUnsignedInteger(t,e,s=6144,i=void 0){this.gl.clearBufferuiv(s,t,e,i)}drawArrays(t,e,s){if(this._transformFeedbackRequestInfo){if(t!==this._transformFeedbackRequestInfo.primitiveType)throw new Error("DrawArrays called during transform feedback, but primitiveType does not match that of the current transform feedback request");if(null==this._state.program?.hasTransformFeedbackVaryings)throw new Error("DrawArrays called during transform feedback, but the shader program was not linked with a transform feedback varying")}if(i()&&(this._numOfDrawCalls++,this._numOfTriangles+=x(t,s),has("enable-feature:webgl-debug:textureReadWrite"))){const t=this._state.textureUnitMap;for(let e=0;e<t.length;e++){const s=t[e];if(null!=s&&s===this._state.drawFramebuffer?.colorTexture)throw new Error(`Detected readWrite. Texture already bound at index ${e}`)}}this.gl.drawArrays(t,e,s),a(this.gl)}drawArraysInstanced(t,e,s,i){this.gl.drawArraysInstanced(t,e,s,i),a(this.gl)}drawElements(t,e,s,a){if(this._transformFeedbackRequestInfo)throw new Error("Cannot called drawElements during a transform feedback request");if(i()&&(this._numOfDrawCalls++,this._numOfTriangles+=x(t,e)),this.gl.drawElements(t,e,s,a),i()){const i=r(this.gl);if(i){const r=this.getBoundVAO(),n=r?.indexBuffer,l=r?.buffers,h={indexBuffer:n,vertexBuffers:l},f={mode:t,count:e,type:s,offset:a},o=n?.size??0,u=a+e,c=o<u?`. Buffer is too small. Attempted to draw index ${u} of ${o}`:"";console.error(`drawElements: ${i}${c}`,{args:f,vao:h})}}}drawElementsInstanced(t,e,s,i,r){this.gl.drawElementsInstanced(t,e,s,i,r),a(this.gl)}logInfo(){i()&&console.log(`DrawCalls: ${this._numOfDrawCalls}, Triangles: ${this._numOfTriangles}`)}resetInfo(){i()&&(this._numOfDrawCalls=0,this._numOfTriangles=0)}get capabilities(){return this._capabilities}setViewport(t,e,s,i){s=Math.max(Math.round(s),1),i=Math.max(Math.round(i),1);const a=this._state.viewport;a.x===t&&a.y===e&&a.width===s&&a.height===i||(a.x=t,a.y=e,a.width=s,a.height=i,this.gl.viewport(t,e,s,i))}setViewport4fv(t){this.setViewport(t[0],t[1],t[2],t[3])}restoreViewport({x:t,y:e,width:s,height:i}){this.setViewport(t,e,s,i)}getViewport(){const t=this._state.viewport;return{x:t.x,y:t.y,width:t.width,height:t.height}}useProgram(t){this._state.program!==t&&(this._state.program?.stop(),this._state.program=t,this.gl.useProgram(t?.glName??null))}bindTexture(t,e,s=!1){(e>=this.parameters.maxTextureImageUnits||e<0)&&console.error("Input texture unit is out of range of available units!");const i=this._state.textureUnitMap[e];return null==t?.glName?(null!=i&&(this.setActiveTexture(e,s),this.gl.bindTexture(i.descriptor.target,null)),this._state.textureUnitMap[e]=null,i):s||i!==t?(this.setActiveTexture(e,s),this.gl.bindTexture(t.descriptor.target,t.glName),t.applyChanges(),this._state.textureUnitMap[e]=t,i):(t.isDirty&&(this.setActiveTexture(e,s),t.applyChanges()),i)}unbindTexture(t){if(null!=t)for(let e=0;e<this.parameters.maxTextureImageUnits;e++)this._state.textureUnitMap[e]===t&&(this.bindTexture(null,e),this._state.textureUnitMap[e]=null)}bindFramebuffer(t,e=!1){if(e||this._state.readFramebuffer!==t||this._state.drawFramebuffer!==t){if(this._stateTracker.invalidateDrawBuffers(),null==t)return this.gl.bindFramebuffer(36160,null),void(this._state.readFramebuffer=this._state.drawFramebuffer=null);t.initializeAndBind(36160),this._state.readFramebuffer=t,this._state.drawFramebuffer=t}}bindFramebufferSeparate(t,e,s=!1){const i=36008===e,a=i?this._state.readFramebuffer:this._state.drawFramebuffer;(s||a!==t)&&(null==t?this.gl.bindFramebuffer(e,null):t.initializeAndBind(e),i?this._state.readFramebuffer=t??null:(this._stateTracker.invalidateDrawBuffers(),this._state.drawFramebuffer=t??null))}blitFramebuffer(t,e,s=16384,i=9728,a=0,r=0,n=t.width,l=t.height,h=0,f=0,o=e.width,u=e.height){this.bindFramebufferSeparate(t,36008,!0),this.bindFramebufferSeparate(e,36009,!0),this.gl.blitFramebuffer(a,r,n,l,h,f,o,u,s,i)}bindBuffer(t,e){if(t)switch(e??=t.bufferType,e){case 34962:this._state.vertexBuffer=T(this.gl,t,e,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=T(this.gl,t,e,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=T(this.gl,t,e,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=T(this.gl,t,e,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=T(this.gl,t,e,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=T(this.gl,t,e,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=T(this.gl,t,e,this._state.copyWriteBuffer);break;case 35982:this._state.transformFeedbackBuffer=T(this.gl,t,e,this._state.transformFeedbackBuffer)}}bindRenderbuffer(t){const e=this.gl;t||(e.bindRenderbuffer(e.RENDERBUFFER,null),this._state.renderbuffer=null),this._state.renderbuffer!==t&&(e.bindRenderbuffer(e.RENDERBUFFER,t.glName),this._state.renderbuffer=t)}_getBufferBinding(t,e){if(e>=this.parameters.maxUniformBufferBindings||e<0)return console.error("Uniform buffer binding point is out of range!"),null;const s=35345===t?this._state.uniformBufferBindingPoints:this._state.transformBufferBindingPoints;let i=s[e];return null==i&&(i={buffer:null,offset:0,size:0},s[e]=i),i}bindBufferBase(t,e,s){const i=this._getBufferBinding(t,e);null!=i&&(i.buffer===s&&0===i.offset&&0===i.size||(this.gl.bindBufferBase(t,e,s?s.glName:null),i.buffer=s,i.offset=0,i.size=0))}bindBufferRange(t,e,s,i,a){const r=this._getBufferBinding(t,e);null!=r&&(r.buffer===s&&r.offset===i&&r.size===a||(i%this._parameters.uniformBufferOffsetAlignment===0?(this.gl.bindBufferRange(t,e,s.glName,i,a),r.buffer=s,r.offset=i,r.size=a):console.error("Uniform buffer binding offset is not a multiple of the context offset alignment")))}bindUBO(t,e,s,a){null!=e?(i()&&(a??e.byteLength)>this._parameters.maxUniformBlockSize&&console.error("Attempting to bind more data than the maximum uniform block size"),e.initialize(),void 0!==s&&void 0!==a?this.bindBufferRange(35345,t,e.buffer,s,a):this.bindBufferBase(35345,t,e.buffer)):this.bindBufferBase(35345,t,null)}unbindUBO(t){for(let e=0,s=this._state.uniformBufferBindingPoints.length;e<s;e++){const s=this._state.uniformBufferBindingPoints[e];null!=s&&s.buffer===t.buffer&&this.bindBufferBase(35345,e,null)}}unbindBuffer(t){switch(t){case 34962:this._state.vertexBuffer=T(this.gl,null,t,this._state.vertexBuffer);break;case 34963:this._state.indexBuffer=T(this.gl,null,t,this._state.indexBuffer);break;case 35345:this._state.uniformBuffer=T(this.gl,null,t,this._state.uniformBuffer);break;case 35051:this._state.pixelPackBuffer=T(this.gl,null,t,this._state.pixelPackBuffer);break;case 35052:this._state.pixelUnpackBuffer=T(this.gl,null,t,this._state.pixelUnpackBuffer);break;case 36662:this._state.copyReadBuffer=T(this.gl,null,t,this._state.copyReadBuffer);break;case 36663:this._state.copyWriteBuffer=T(this.gl,null,t,this._state.copyWriteBuffer)}}bindVAO(t,e){if(null==t)return this._state.vertexArrayObject?.unbind(),void(this._state.vertexArrayObject=null);this._state.vertexArrayObject!==t&&(t.bind(e),this._state.vertexArrayObject=t)}bindTransformFeedback(t){const{gl:e}=this;e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,t.glName)}beginTransformFeedback(t,e){if(this._transformFeedbackRequestInfo)throw new Error("Already in a transform feedback request");const{gl:s}=this;s.bindTransformFeedback(s.TRANSFORM_FEEDBACK,t.glName),s.beginTransformFeedback(e),this._transformFeedbackRequestInfo={primitiveType:e}}endTransformFeedback(){if(!this._transformFeedbackRequestInfo)throw new Error("Not in a transform feedback request");const{gl:t}=this;t.endTransformFeedback(),t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null),this._transformFeedbackRequestInfo=null}async clientWaitAsync(t=s(10)){const{gl:i}=this,a=i.fenceSync(37143,0);if(!a)throw new Error("Client wait failed, could not create sync object");let r;this.instanceCounter.increment(u.Sync,a),i.flush();do{await e(t),r=i.clientWaitSync(a,0,0)}while(37147===r);if(this.instanceCounter.decrement(u.Sync,a),i.deleteSync(a),37149===r)throw new Error("Client wait failed")}getBoundFramebufferObject(t=36160){return 36008===t?this._state.readFramebuffer:this._state.drawFramebuffer}temporaryBindFramebufferObject(t,e,s=!1){const i=this.getBoundFramebufferObject();try{this.bindFramebuffer(t,s),e()}finally{this.bindFramebuffer(i,s)}}getBoundVAO(){return this._state.vertexArrayObject}resetState(){this.useProgram(null),this.bindVAO(null),this.bindFramebuffer(null,!0),this.unbindBuffer(34962),this.unbindBuffer(34963),this.unbindBuffer(35345),this._state.uniformBufferBindingPoints.length=0,this.unbindBuffer(35051),this.unbindBuffer(35052),this.unbindBuffer(36662),this.unbindBuffer(36663);for(let t=0;t<this.parameters.maxTextureImageUnits;++t)this.bindTexture(null,t);this.setBlendingEnabled(!1),this.setBlendFunction(1,0),this.setBlendEquation(32774),this.setBlendColor(0,0,0,0),this.setFaceCullingEnabled(!1),this.setCullFace(1029),this.setFrontFace(2305),this.setPolygonOffsetFillEnabled(!1),this.setPolygonOffset(0,0),this.setScissorTestEnabled(!1),this.setScissorRect(0,0,this.gl.canvas.width,this.gl.canvas.height),this.setDepthTestEnabled(!1),this.setDepthFunction(513),this.setDepthRange(0,1),this.setStencilTestEnabled(!1),this.setStencilFunction(519,0,0),this.setStencilOp(7680,7680,7680),this.setClearColor(0,0,0,0),this.setClearDepth(1),this.setClearStencil(0),this.setColorMask(!0,!0,!0,!0),this.setStencilWriteMask(4294967295),this.setDepthWriteEnabled(!0),this.setDrawBuffers([l]),this.setViewport(0,0,this.gl.canvas.width,this.gl.canvas.height)}enforceState(){const{gl:t}=this;t.bindVertexArray(null);for(let s=0;s<this.parameters.maxVertexAttributes;s++)t.disableVertexAttribArray(s);this._state.vertexBuffer?t.bindBuffer(this._state.vertexBuffer.bufferType,this._state.vertexBuffer.glName):t.bindBuffer(34962,null),this._state.indexBuffer?t.bindBuffer(this._state.indexBuffer.bufferType,this._state.indexBuffer.glName):t.bindBuffer(34963,null),this._state.uniformBuffer?t.bindBuffer(this._state.uniformBuffer.bufferType,this._state.uniformBuffer.glName):t.bindBuffer(35345,null);for(let s=0;s<this._parameters.maxUniformBufferBindings;s++){const e=this._state.uniformBufferBindingPoints[s];if(null!=e){const{buffer:i,offset:a,size:r}=e;null!==i?0===a&&0===r?t.bindBufferBase(35345,s,i.glName):t.bindBufferRange(35345,s,i.glName,a,r):t.bindBufferBase(35345,s,null)}}if(this._state.pixelPackBuffer?t.bindBuffer(this._state.pixelPackBuffer.bufferType,this._state.pixelPackBuffer.glName):t.bindBuffer(35051,null),this._state.pixelUnpackBuffer?t.bindBuffer(this._state.pixelUnpackBuffer.bufferType,this._state.pixelUnpackBuffer.glName):t.bindBuffer(35052,null),this._state.copyReadBuffer?t.bindBuffer(this._state.copyReadBuffer.bufferType,this._state.copyReadBuffer.glName):t.bindBuffer(36662,null),this._state.copyWriteBuffer?t.bindBuffer(this._state.copyWriteBuffer.bufferType,this._state.copyWriteBuffer.glName):t.bindBuffer(36663,null),t.bindFramebuffer(36008,null),t.readBuffer(t.BACK),this._state.readFramebuffer&&(t.bindFramebuffer(36008,this._state.readFramebuffer.glName),t.readBuffer(f)),t.bindFramebuffer(36009,this._state.drawFramebuffer?.glName??null),null===this._state.drawFramebuffer){const e=this._state.drawBuffers.defaultFramebuffer;t.drawBuffers(e??[l])}else{const e=this._state.drawBuffers.fbos.get(this._state.drawFramebuffer);t.drawBuffers(e??[f])}if(this._state.vertexArrayObject){const t=this._state.vertexArrayObject;this._state.vertexArrayObject&&(this._state.vertexArrayObject.unbind(),this._state.vertexArrayObject=null),this.bindVAO(t)}t.useProgram(this._state.program?.glName??null),t.blendColor(this._state.blendColor.r,this._state.blendColor.g,this._state.blendColor.b,this._state.blendColor.a),t.bindRenderbuffer(t.RENDERBUFFER,this._state.renderbuffer?.glName??null),!0===this._state.blend?t.enable(this.gl.BLEND):t.disable(this.gl.BLEND),t.blendEquationSeparate(this._state.blendEquation.mode,this._state.blendEquation.modeAlpha),t.blendFuncSeparate(this._state.blendFunction.srcRGB,this._state.blendFunction.dstRGB,this._state.blendFunction.srcAlpha,this._state.blendFunction.dstAlpha),t.clearColor(this._state.clearColor.r,this._state.clearColor.g,this._state.clearColor.b,this._state.clearColor.a),t.clearDepth(this._state.clearDepth),t.clearStencil(this._state.clearStencil),t.colorMask(this._state.colorMask.r,this._state.colorMask.g,this._state.colorMask.b,this._state.colorMask.a),t.cullFace(this._state.cullFace),t.depthFunc(this._state.depthFunction),t.depthRange(this._state.depthRange.zNear,this._state.depthRange.zFar),!0===this._state.depthTest?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),t.depthMask(this._state.depthWrite),t.frontFace(this._state.frontFace),t.lineWidth(1),!0===this._state.faceCulling?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),t.polygonOffset(this._state.polygonOffset[0],this._state.polygonOffset[1]),!0===this._state.polygonOffsetFill?t.enable(t.POLYGON_OFFSET_FILL):t.disable(t.POLYGON_OFFSET_FILL),t.scissor(this._state.scissorRect.x,this._state.scissorRect.y,this._state.scissorRect.width,this._state.scissorRect.height),!0===this._state.scissorTest?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST),t.stencilFunc(this._state.stencilFunction.func,this._state.stencilFunction.ref,this._state.stencilFunction.mask),t.stencilOpSeparate(this._state.stencilOperation.face,this._state.stencilOperation.fail,this._state.stencilOperation.zFail,this._state.stencilOperation.zPass),!0===this._state.stencilTest?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),t.stencilMask(this._state.stencilWriteMask);for(let s=0;s<this.parameters.maxTextureImageUnits;s++){t.activeTexture(o+s),t.bindTexture(3553,null),t.bindTexture(34067,null),t.bindTexture(32879,null),t.bindTexture(35866,null);const e=this._state.textureUnitMap[s];null!=e&&t.bindTexture(e.descriptor.target,e.glName)}t.activeTexture(o+this._state.activeTexture);const e=this._state.viewport;t.viewport(e.x,e.y,e.width,e.height),this.resetInfo()}};function T(t,e,s,i){return e?i!==e&&t.bindBuffer(s,e.glName):t.bindBuffer(s,null),e}function x(t,e){switch(t){case c.POINTS:return 2*e;case c.TRIANGLES:return e/3;case c.TRIANGLE_STRIP:case c.TRIANGLE_FAN:return e-2;default:return 0}}export{F as RenderingContext};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{toConst as e}from"../../core/compilerUtils.js";import t from"../../core/Logger.js";import{disposeMaybe as r}from"../../core/maybe.js";import{baseTypedArrayMemory as s}from"../../core/memoryEstimations.js";import{ResourceType as i}from"./enums.js";import{bindVertexBufferLayout as n}from"./Util.js";import{fromBuffers as o}from"./VertexAttributeLocations.js";const f=()=>t.getLogger("esri.views.webgl.VertexArrayObject");let h=class t{constructor(t,r,s,i){this._context=t,this._indexBuffer=s,this._buffers=r instanceof Map?r:new Map([["geometry",r]]),this._baseInstances=null==i?new Map:"number"==typeof i?new Map([["geometry",i]]):i,this.locations=e(o(this._buffers))}get glName(){return this._glName}get context(){return this._context}get buffers(){return e(this._buffers)}buffer(e="geometry"){return this.buffers.get(e)}get indexBuffer(){return this._indexBuffer}getByteLength(e){return this.buffer(e)?.sizeBytes??0}vertexCount(e){const t=this.buffer(e);return t?t.sizeBytes/t.layout[0].stride:0}get usedMemory(){return Array.from(this._buffers.values()).reduce((e,t)=>e+t.usedMemory,this._indexBuffer?.usedMemory??0+(this._buffers.size+(this._indexBuffer?1:0))*s)}dispose(){this._context?(this._buffers.forEach(e=>e.dispose()),this._buffers.clear(),this._indexBuffer=r(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&f().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(i.VertexArrayObject,this)),this._context=null):this._glName&&f().warn("Leaked WebGL VAO")}bind(e=this.locations){const t=this._context.gl;this._glName?t.bindVertexArray(this._glName):(this._context.instanceCounter.increment(i.VertexArrayObject,this),this._glName=t.createVertexArray(),t.bindVertexArray(this._glName),this._bindLayout(e))}_bindLayout(e){const{_buffers:t,_indexBuffer:r}=this;if(t||f().error("Vertex buffer dictionary is empty!"),t.forEach((t,r)=>n(this._context,e,t,this._baseInstances.get(r)??0)),null!=r){const e=this._context.gl;this._context.gl.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r.glName)}}unbind(){this._context.gl.bindVertexArray(null)}shallowCloneWithBaseInstances(e){return new t(this._context,this._buffers,this._indexBuffer,e)}};export{h as VertexArrayObject};
|
|
5
|
+
import{toConst as e}from"../../core/compilerUtils.js";import t from"../../core/Logger.js";import{disposeMaybe as r}from"../../core/maybe.js";import{baseTypedArrayMemory as s}from"../../core/memoryEstimations.js";import{ResourceType as i}from"./enums.js";import{bindVertexBufferLayout as n}from"./Util.js";import{fromBuffers as o}from"./VertexAttributeLocations.js";const f=()=>t.getLogger("esri.views.webgl.VertexArrayObject");let h=class t{constructor(t,r,s,i,n){this._context=t,this._indexBuffer=s,this._buffers=r instanceof Map?r:new Map([["geometry",r]]),this._baseInstances=null==i?new Map:"number"==typeof i?new Map([["geometry",i]]):i,this.locations=n??e(o(this._buffers))}get glName(){return this._glName}get context(){return this._context}get buffers(){return e(this._buffers)}buffer(e="geometry"){return this.buffers.get(e)}get indexBuffer(){return this._indexBuffer}getByteLength(e){return this.buffer(e)?.sizeBytes??0}vertexCount(e){const t=this.buffer(e);return t?t.sizeBytes/t.layout[0].stride:0}get usedMemory(){return Array.from(this._buffers.values()).reduce((e,t)=>e+t.usedMemory,this._indexBuffer?.usedMemory??0+(this._buffers.size+(this._indexBuffer?1:0))*s)}dispose(){this._context?(this._buffers.forEach(e=>e.dispose()),this._buffers.clear(),this._indexBuffer=r(this._indexBuffer),this.disposeVAOOnly()):(this._glName||this._buffers.size>0)&&f().warn("Leaked WebGL VAO")}disposeVAOOnly(){this._context?(this._context.getBoundVAO()===this&&this._context.bindVAO(null),this._glName&&(this._context.gl.deleteVertexArray(this._glName),this._glName=null,this._context.instanceCounter.decrement(i.VertexArrayObject,this)),this._context=null):this._glName&&f().warn("Leaked WebGL VAO")}bind(e=this.locations){const t=this._context.gl;this._glName?t.bindVertexArray(this._glName):(this._context.instanceCounter.increment(i.VertexArrayObject,this),this._glName=t.createVertexArray(),t.bindVertexArray(this._glName),this._bindLayout(e))}_bindLayout(e){const{_buffers:t,_indexBuffer:r}=this;if(t||f().error("Vertex buffer dictionary is empty!"),t.forEach((t,r)=>n(this._context,e,t,this._baseInstances.get(r)??0)),null!=r){const e=this._context.gl;this._context.gl.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r.glName)}}unbind(){this._context.gl.bindVertexArray(null)}shallowCloneWithBaseInstances(e){return new t(this._context,this._buffers,this._indexBuffer,e)}};export{h as VertexArrayObject};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function
|
|
5
|
+
import{clone as t}from"../../core/lang.js";function e(t,e,i=32774,n=[0,0,0,0]){return{srcRgb:t,srcAlpha:t,dstRgb:e,dstAlpha:e,opRgb:i,opAlpha:i,color:{r:n[0],g:n[1],b:n[2],a:n[3]}}}function i(t,e,i,n,s=32774,l=32774,r=[0,0,0,0]){return{srcRgb:t,srcAlpha:e,dstRgb:i,dstAlpha:n,opRgb:s,opAlpha:l,color:{r:r[0],g:r[1],b:r[2],a:r[3]}}}const n=e(0,771),s=e(1,0),l=e(1,1),r=e(1,771),a=i(770,1,771,771),h=i(0,0,768,1),o={face:1029,mode:2305},_={face:1028,mode:2305},c=t=>2===t?o:1===t?_:null,d={zNear:0,zFar:1},u={r:!0,g:!0,b:!0,a:!0};function f(t){return D.intern(t)}function p(t){return m.intern(t)}function g(t){return C.intern(t)}function v(t){return P.intern(t)}function I(t){return z.intern(t)}function W(t){return j.intern(t)}function S(t){return N.intern(t)}function b(t){return M.intern(t)}function T(t){return E.intern(t)}function w(t){return H.intern(t)}class B{constructor(t,e){this._makeKey=t,this._makeRef=e,this._interns=new Map}intern(t){if(!t)return null;const e=this._makeKey(t),i=this._interns;return i.has(e)||i.set(e,this._makeRef(t)),i.get(e)??null}}function y(t){return"["+t.join(",")+"]"}const D=new B(O,t=>({__tag:"Blending",...t}));function O(t){return t?y([t.srcRgb,t.srcAlpha,t.dstRgb,t.dstAlpha,t.opRgb,t.opAlpha,t.color.r,t.color.g,t.color.b,t.color.a]):null}const m=new B(R,t=>({__tag:"Culling",...t}));function R(t){return t?y([t.face,t.mode]):null}const C=new B(A,t=>({__tag:"PolygonOffset",...t}));function A(t){return t?y([t.factor,t.units]):null}const P=new B(k,t=>({__tag:"DepthTest",...t}));function k(t){return t?y([t.func]):null}const z=new B(F,t=>({__tag:"StencilTest",...t}));function F(t){return t?y([t.function.func,t.function.ref,t.function.mask,t.operation.fail,t.operation.zFail,t.operation.zPass]):null}const j=new B(K,t=>({__tag:"DepthWrite",...t}));function K(t){return t?y([t.zNear,t.zFar]):null}const N=new B(x,t=>({__tag:"ColorWrite",...t}));function x(t){return t?y([t.r,t.g,t.b,t.a]):null}const M=new B(q,t=>({__tag:"StencilWrite",...t}));function q(t){return t?y([t.mask]):null}const E=new B(G,t=>({__tag:"DrawBuffers",...t}));function G(t){return t?y(t.buffers):null}const H=new B(J,t=>({blending:f(t.blending),culling:p(t.culling),polygonOffset:g(t.polygonOffset),depthTest:v(t.depthTest),stencilTest:I(t.stencilTest),depthWrite:W(t.depthWrite),colorWrite:S(t.colorWrite),stencilWrite:b(t.stencilWrite),drawBuffers:T(t.drawBuffers)}));function J(t){return t?y([O(t.blending),R(t.culling),A(t.polygonOffset),k(t.depthTest),F(t.stencilTest),K(t.depthWrite),x(t.colorWrite),q(t.stencilWrite),G(t.drawBuffers)]):null}class L{constructor(t){this._pipelineInvalid=!0,this._blendingInvalid=!0,this._cullingInvalid=!0,this._polygonOffsetInvalid=!0,this._depthTestInvalid=!0,this._stencilTestInvalid=!0,this._depthWriteInvalid=!0,this._colorWriteInvalid=!0,this._stencilWriteInvalid=!0,this._drawBuffersInvalid=!0,this._stateSetters=t}setPipeline(t){(this._pipelineInvalid||t!==this._pipeline)&&(this._setBlending(t.blending),this._setCulling(t.culling),this._setPolygonOffset(t.polygonOffset),this._setDepthTest(t.depthTest),this._setStencilTest(t.stencilTest),this._setDepthWrite(t.depthWrite),this._setColorWrite(t.colorWrite),this._setStencilWrite(t.stencilWrite),this._setDrawBuffers(t.drawBuffers),this._pipeline=t),this._pipelineInvalid=!1}getPipelineState(){return t(this._pipeline)}invalidateBlending(){this._blendingInvalid=!0,this._pipelineInvalid=!0}invalidateCulling(){this._cullingInvalid=!0,this._pipelineInvalid=!0}invalidatePolygonOffset(){this._polygonOffsetInvalid=!0,this._pipelineInvalid=!0}invalidateDepthTest(){this._depthTestInvalid=!0,this._pipelineInvalid=!0}invalidateStencilTest(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDepthWrite(){this._depthWriteInvalid=!0,this._pipelineInvalid=!0}invalidateColorWrite(){this._colorWriteInvalid=!0,this._pipelineInvalid=!0}invalidateStencilWrite(){this._stencilTestInvalid=!0,this._pipelineInvalid=!0}invalidateDrawBuffers(){this._drawBuffersInvalid=!0,this._pipelineInvalid=!0}_setBlending(t){this._blending=this._setSubState(t,this._blending,this._blendingInvalid,this._stateSetters.setBlending),this._blendingInvalid=!1}_setCulling(t){this._culling=this._setSubState(t,this._culling,this._cullingInvalid,this._stateSetters.setCulling),this._cullingInvalid=!1}_setPolygonOffset(t){this._polygonOffset=this._setSubState(t,this._polygonOffset,this._polygonOffsetInvalid,this._stateSetters.setPolygonOffset),this._polygonOffsetInvalid=!1}_setDepthTest(t){this._depthTest=this._setSubState(t,this._depthTest,this._depthTestInvalid,this._stateSetters.setDepthTest),this._depthTestInvalid=!1}_setStencilTest(t){this._stencilTest=this._setSubState(t,this._stencilTest,this._stencilTestInvalid,this._stateSetters.setStencilTest),this._stencilTestInvalid=!1}_setDepthWrite(t){this._depthWrite=this._setSubState(t,this._depthWrite,this._depthWriteInvalid,this._stateSetters.setDepthWrite),this._depthWriteInvalid=!1}_setColorWrite(t){this._colorWrite=this._setSubState(t,this._colorWrite,this._colorWriteInvalid,this._stateSetters.setColorWrite),this._colorWriteInvalid=!1}_setStencilWrite(t){this._stencilWrite=this._setSubState(t,this._stencilWrite,this._stencilWriteInvalid,this._stateSetters.setStencilWrite),this._stencilTestInvalid=!1}_setDrawBuffers(t){this._drawBuffers=this._setSubState(t,this._drawBuffers,this._drawBuffersInvalid,this._stateSetters.setDrawBuffers),this._drawBuffersInvalid=!1}_setSubState(t,e,i,n){return(i||t!==e)&&(n(t),this._pipelineInvalid=!0),t}}export{L as StateTracker,l as add,o as backFaceCullingParams,s as copySource,c as cullingParams,u as defaultColorWrite,d as defaultDepthWrite,n as destinationTimesOneMinusSourceAlpha,_ as frontFaceCullingParams,f as makeBlending,S as makeColorWrite,p as makeCulling,v as makeDepthTest,W as makeDepthWrite,T as makeDrawBuffers,w as makePipelineState,g as makePolygonOffset,I as makeStencilTest,b as makeStencilWrite,h as modulateDestination,r as premultipliedAlpha,i as separateBlendingParams,e as simpleBlendingParams,a as unpremultipliedAlphaToPremultipliedAlpha};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as o}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{property as t,subclass as s}from"../../core/accessorSupport/decorators.js";let p=class extends(e(r)){constructor(o){super(o),this.enabled=!
|
|
5
|
+
import{__decorate as o}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{property as t,subclass as s}from"../../core/accessorSupport/decorators.js";let p=class extends(e(r)){constructor(o){super(o),this.enabled=!1}};o([t({type:Boolean,nonNullable:!0,json:{write:!0}})],p.prototype,"enabled",void 0),p=o([s("esri.webdoc.ips.SmoothingProperties")],p);const i=p;export{i as default};
|