@maptalks/gpu 0.117.1 → 0.118.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/maptalksgpu.d.ts +46 -22
- package/dist/maptalksgpu.es.js +21623 -21082
- package/dist/maptalksgpu.es.js.map +1 -1
- package/dist/maptalksgpu.js +3588 -13762
- package/dist/maptalksgpu.js.map +1 -1
- package/dist/transcoders.js +1 -1
- package/package.json +4 -4
package/dist/maptalksgpu.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="@webgpu/types" />
|
|
2
2
|
/*!
|
|
3
|
-
* @maptalks/gpu v0.
|
|
3
|
+
* @maptalks/gpu v0.118.0
|
|
4
4
|
* LICENSE : UNLICENSED
|
|
5
5
|
* (c) 2016-2025 maptalks.com
|
|
6
6
|
*/
|
|
@@ -106,7 +106,6 @@ declare class GraphicsDevice {
|
|
|
106
106
|
context: GPUCanvasContext;
|
|
107
107
|
adapter: GPUAdapter;
|
|
108
108
|
gltfManager?: any;
|
|
109
|
-
_supportedFormats: any;
|
|
110
109
|
constructor(device: GPUDevice, context: GPUCanvasContext, adapter: GPUAdapter);
|
|
111
110
|
hasExtension(extension: any): boolean;
|
|
112
111
|
getCommandEncoder(): GPUCommandEncoder;
|
|
@@ -115,12 +114,19 @@ declare class GraphicsDevice {
|
|
|
115
114
|
getRenderPassEncoder(fbo: GraphicsFramebuffer): GPURenderPassEncoder;
|
|
116
115
|
addCommandBuffer(commandBuffer: GPUCommandBuffer, front: boolean): void;
|
|
117
116
|
submit(): void;
|
|
117
|
+
preserveDrawingBuffer(canvas: any): void;
|
|
118
118
|
buffer(options: any): any;
|
|
119
|
+
elements(options: any): any;
|
|
119
120
|
framebuffer(width: any, height: any): GraphicsFramebuffer;
|
|
120
|
-
texture(
|
|
121
|
+
texture(width: any, height?: any): GraphicsTexture;
|
|
121
122
|
clear(options: any): void;
|
|
122
123
|
read(options: any): any;
|
|
123
124
|
destroy(): void;
|
|
125
|
+
incrDrawCall(): void;
|
|
126
|
+
resetDrawCalls(): void;
|
|
127
|
+
getDrawCalls(): 0;
|
|
128
|
+
_renderToClear(fbo: any): void;
|
|
129
|
+
_getEmptyPipeline(fbo: any): any;
|
|
124
130
|
}
|
|
125
131
|
|
|
126
132
|
declare class GraphicsTexture {
|
|
@@ -135,7 +141,7 @@ declare class GraphicsTexture {
|
|
|
135
141
|
resize(width: any, height: any): void;
|
|
136
142
|
update(config: any): void;
|
|
137
143
|
_updateTexture(): void;
|
|
138
|
-
getView(): GPUTextureView;
|
|
144
|
+
getView(descriptor?: GPUTextureViewDescriptor): GPUTextureView;
|
|
139
145
|
addBindGroup(bindGroup: any): void;
|
|
140
146
|
destroy(): void;
|
|
141
147
|
}
|
|
@@ -349,6 +355,7 @@ declare class Geometry {
|
|
|
349
355
|
getAttrData(activeAttributes: ActiveAttributes): any;
|
|
350
356
|
getREGLData(regl: any, activeAttributes: ActiveAttributes, disableVAO: boolean): AttributeData;
|
|
351
357
|
generateBuffers(device: any): void;
|
|
358
|
+
isBufferGenerated(): boolean;
|
|
352
359
|
getVertexCount(): number;
|
|
353
360
|
getColor0Size(): number;
|
|
354
361
|
/**
|
|
@@ -422,6 +429,7 @@ declare class Material extends Material_base {
|
|
|
422
429
|
set version(v: number);
|
|
423
430
|
get version(): number;
|
|
424
431
|
get propVersion(): number;
|
|
432
|
+
get textureVersion(): number;
|
|
425
433
|
set doubleSided(value: boolean);
|
|
426
434
|
get doubleSided(): boolean;
|
|
427
435
|
getUniforms(device: any): ShaderUniforms;
|
|
@@ -552,6 +560,11 @@ declare class DynamicBuffer {
|
|
|
552
560
|
dispose(): void;
|
|
553
561
|
}
|
|
554
562
|
|
|
563
|
+
type BindGroupResult = {
|
|
564
|
+
bindGroup: GPUBindGroup;
|
|
565
|
+
outdated: boolean;
|
|
566
|
+
uniformTextures?: any;
|
|
567
|
+
};
|
|
555
568
|
declare class BindGroupFormat {
|
|
556
569
|
bytes: number;
|
|
557
570
|
uuid: number;
|
|
@@ -560,7 +573,8 @@ declare class BindGroupFormat {
|
|
|
560
573
|
getShaderUniforms(): any;
|
|
561
574
|
getMeshUniforms(): any;
|
|
562
575
|
_parse(bindGroupMapping: any): void;
|
|
563
|
-
|
|
576
|
+
createFormatBindGroup(device: GraphicsDevice, mesh: Mesh$1, shaderUniforms: ShaderUniforms, layout: GPUBindGroupLayout, shaderBuffer: DynamicBuffer, meshBuffer: DynamicBuffer): BindGroupResult;
|
|
577
|
+
copyTextures(bindGroup: BindGroupResult, props: any): void;
|
|
564
578
|
dispose(): void;
|
|
565
579
|
}
|
|
566
580
|
|
|
@@ -585,6 +599,7 @@ declare class Mesh$1 {
|
|
|
585
599
|
get material(): Material;
|
|
586
600
|
set version(v: number);
|
|
587
601
|
get version(): number;
|
|
602
|
+
get textureVersion(): number;
|
|
588
603
|
get geometry(): Geometry;
|
|
589
604
|
set geometry(geo: Geometry);
|
|
590
605
|
set localTransform(m: mat4);
|
|
@@ -621,8 +636,8 @@ declare class Mesh$1 {
|
|
|
621
636
|
getMemorySize(): number;
|
|
622
637
|
getWorldTransform(): any;
|
|
623
638
|
_meshBuffer: Record<string, DynamicBuffer>;
|
|
624
|
-
writeDynamicBuffer(commandUID:
|
|
625
|
-
getBindGroup(key: any):
|
|
639
|
+
writeDynamicBuffer(commandUID: string, renderProps: any, bindGroupMapping: BindGroupFormat, pool: DynamicBufferPool, dynamicOffsets: DynamicOffsets): DynamicBuffer;
|
|
640
|
+
getBindGroup(key: any): BindGroupResult;
|
|
626
641
|
setBindGroup(key: any, bindGroup: any): this;
|
|
627
642
|
getShaderFnValues(shaderUID: number): GPUBindGroup;
|
|
628
643
|
setShaderFnValues(shaderUID: number, fnValues: any): this;
|
|
@@ -823,13 +838,6 @@ declare function getPosArrayType(max: number): Int8ArrayConstructor | Int16Array
|
|
|
823
838
|
* @param max - max value
|
|
824
839
|
*/
|
|
825
840
|
declare function clamp(n: number, min: number, max: number): number;
|
|
826
|
-
/**
|
|
827
|
-
* 检查当前环境是否支持VAO
|
|
828
|
-
* @english
|
|
829
|
-
* Check if current context supports VAO
|
|
830
|
-
* @param regl regl context
|
|
831
|
-
* @returns
|
|
832
|
-
*/
|
|
833
841
|
declare function isSupportVAO(regl: any): any;
|
|
834
842
|
/**
|
|
835
843
|
* Object.hasOwnProperty的包装方法
|
|
@@ -921,6 +929,7 @@ declare function isPowerOfTwo(value: number): boolean;
|
|
|
921
929
|
declare function resizeToPowerOfTwo(image: HTMLImageElement | NumberArray, width?: number, height?: number): NumberArray | HTMLCanvasElement | HTMLImageElement;
|
|
922
930
|
declare function supportNPOT(regl: any): boolean;
|
|
923
931
|
declare function isTextureDestroyed(texture: any): boolean;
|
|
932
|
+
declare function isTextureLike(texture: any): any;
|
|
924
933
|
|
|
925
934
|
declare const Util_d_clamp: typeof clamp;
|
|
926
935
|
declare const Util_d_defined: typeof defined;
|
|
@@ -946,6 +955,7 @@ declare const Util_d_isPowerOfTwo: typeof isPowerOfTwo;
|
|
|
946
955
|
declare const Util_d_isString: typeof isString;
|
|
947
956
|
declare const Util_d_isSupportVAO: typeof isSupportVAO;
|
|
948
957
|
declare const Util_d_isTextureDestroyed: typeof isTextureDestroyed;
|
|
958
|
+
declare const Util_d_isTextureLike: typeof isTextureLike;
|
|
949
959
|
declare const Util_d_lerp: typeof lerp;
|
|
950
960
|
declare const Util_d_log2: typeof log2;
|
|
951
961
|
declare const Util_d_normalize: typeof normalize;
|
|
@@ -953,7 +963,7 @@ declare const Util_d_resizeToPowerOfTwo: typeof resizeToPowerOfTwo;
|
|
|
953
963
|
declare const Util_d_set: typeof set;
|
|
954
964
|
declare const Util_d_supportNPOT: typeof supportNPOT;
|
|
955
965
|
declare namespace Util_d {
|
|
956
|
-
export { Util_d_clamp as clamp, Util_d_defined as defined, Util_d_extend as extend, Util_d_extendWithoutNil as extendWithoutNil, Util_d_getArrayCtor as getArrayCtor, Util_d_getBufferSize as getBufferSize, Util_d_getPosArrayType as getPosArrayType, Util_d_getSupportedFormats as getSupportedFormats, Util_d_getTexMemorySize as getTexMemorySize, Util_d_getTextureByteWidth as getTextureByteWidth, Util_d_getTextureChannels as getTextureChannels, Util_d_hasOwn as hasOwn, Util_d_hashCode as hashCode, Util_d_interpolate as interpolate, Util_d_isArray as isArray, Util_d_isFunction as isFunction, Util_d_isInStride as isInStride, Util_d_isInterleaved as isInterleaved, Util_d_isNil as isNil, Util_d_isNumber as isNumber, Util_d_isPowerOfTwo as isPowerOfTwo, Util_d_isString as isString, Util_d_isSupportVAO as isSupportVAO, Util_d_isTextureDestroyed as isTextureDestroyed, Util_d_lerp as lerp, Util_d_log2 as log2, Util_d_normalize as normalize, Util_d_resizeToPowerOfTwo as resizeToPowerOfTwo, Util_d_set as set, Util_d_supportNPOT as supportNPOT };
|
|
966
|
+
export { Util_d_clamp as clamp, Util_d_defined as defined, Util_d_extend as extend, Util_d_extendWithoutNil as extendWithoutNil, Util_d_getArrayCtor as getArrayCtor, Util_d_getBufferSize as getBufferSize, Util_d_getPosArrayType as getPosArrayType, Util_d_getSupportedFormats as getSupportedFormats, Util_d_getTexMemorySize as getTexMemorySize, Util_d_getTextureByteWidth as getTextureByteWidth, Util_d_getTextureChannels as getTextureChannels, Util_d_hasOwn as hasOwn, Util_d_hashCode as hashCode, Util_d_interpolate as interpolate, Util_d_isArray as isArray, Util_d_isFunction as isFunction, Util_d_isInStride as isInStride, Util_d_isInterleaved as isInterleaved, Util_d_isNil as isNil, Util_d_isNumber as isNumber, Util_d_isPowerOfTwo as isPowerOfTwo, Util_d_isString as isString, Util_d_isSupportVAO as isSupportVAO, Util_d_isTextureDestroyed as isTextureDestroyed, Util_d_isTextureLike as isTextureLike, Util_d_lerp as lerp, Util_d_log2 as log2, Util_d_normalize as normalize, Util_d_resizeToPowerOfTwo as resizeToPowerOfTwo, Util_d_set as set, Util_d_supportNPOT as supportNPOT };
|
|
957
967
|
}
|
|
958
968
|
|
|
959
969
|
declare function parseRGBE(arrayBuffer: ArrayBufferLike, exposure?: number): {
|
|
@@ -1005,12 +1015,23 @@ declare const _default$1: {
|
|
|
1005
1015
|
};
|
|
1006
1016
|
//# sourceMappingURL=WgslShaderLib.d.ts.map
|
|
1007
1017
|
|
|
1018
|
+
type CommandStruct = {
|
|
1019
|
+
uid: string;
|
|
1020
|
+
layout: GPUBindGroupLayout;
|
|
1021
|
+
pipeline: GPURenderPipeline;
|
|
1022
|
+
vertexInfo: any;
|
|
1023
|
+
bindGroupFormat: BindGroupFormat;
|
|
1024
|
+
bindGroupMapping: any;
|
|
1025
|
+
activeAttributes: ActiveAttributes;
|
|
1026
|
+
};
|
|
1027
|
+
|
|
1008
1028
|
declare class GLShader {
|
|
1009
1029
|
vert: string;
|
|
1010
1030
|
frag: string;
|
|
1011
1031
|
wgslVert: string;
|
|
1012
1032
|
wgslFrag: string;
|
|
1013
1033
|
uid: number;
|
|
1034
|
+
commandId: number;
|
|
1014
1035
|
version: number;
|
|
1015
1036
|
extraCommandProps: any;
|
|
1016
1037
|
name: string;
|
|
@@ -1059,7 +1080,8 @@ declare class GPUShader extends GLShader {
|
|
|
1059
1080
|
vert: any;
|
|
1060
1081
|
frag: any;
|
|
1061
1082
|
};
|
|
1062
|
-
run(deviceOrRegl: any, command:
|
|
1083
|
+
run(deviceOrRegl: any, command: CommandStruct, props: any): any;
|
|
1084
|
+
_checkBindGroupTextures(bindGroup: BindGroupResult, props: any): boolean;
|
|
1063
1085
|
_getCurrentRenderPassEncoder(device: GraphicsDevice): GPURenderPassEncoder;
|
|
1064
1086
|
setFramebuffer(framebuffer: any): this;
|
|
1065
1087
|
dispose(): void;
|
|
@@ -1287,6 +1309,7 @@ declare class SsrPass {
|
|
|
1287
1309
|
_blurUniforms: {
|
|
1288
1310
|
rgbmRange: number;
|
|
1289
1311
|
outputSize: number[];
|
|
1312
|
+
inputSize: number[];
|
|
1290
1313
|
};
|
|
1291
1314
|
getMipmapTexture(): any;
|
|
1292
1315
|
_outputTex: any;
|
|
@@ -1655,6 +1678,7 @@ declare class BoxShadowBlurShader extends QuadShader {
|
|
|
1655
1678
|
|
|
1656
1679
|
declare class ShadowMapShader extends MeshShader {
|
|
1657
1680
|
constructor(defines: any);
|
|
1681
|
+
setDefines(defines: any): void;
|
|
1658
1682
|
filter(mesh: any): any;
|
|
1659
1683
|
}
|
|
1660
1684
|
//# sourceMappingURL=ShadowMapShader.d.ts.map
|
|
@@ -1737,13 +1761,13 @@ declare class FBORayPicking {
|
|
|
1737
1761
|
render(meshes: Mesh[], uniforms: any, once?: boolean): this;
|
|
1738
1762
|
_currentShader: any;
|
|
1739
1763
|
pickAll(x: any, y: any, tolerance: any, uniforms: any, options: any): {
|
|
1740
|
-
meshId:
|
|
1764
|
+
meshId: number;
|
|
1741
1765
|
pickingId: any;
|
|
1742
1766
|
point: number[];
|
|
1743
1767
|
coordinate: any[];
|
|
1744
1768
|
}[];
|
|
1745
1769
|
pick(x: any, y: any, tolerance: any, uniforms: any, options?: {}): {
|
|
1746
|
-
meshId:
|
|
1770
|
+
meshId: number;
|
|
1747
1771
|
pickingId: any;
|
|
1748
1772
|
point: number[];
|
|
1749
1773
|
coordinate: any[];
|
|
@@ -1764,7 +1788,7 @@ declare class FBORayPicking {
|
|
|
1764
1788
|
width?: undefined;
|
|
1765
1789
|
height?: undefined;
|
|
1766
1790
|
} | {
|
|
1767
|
-
meshIds:
|
|
1791
|
+
meshIds: number[];
|
|
1768
1792
|
pickingIds: any[];
|
|
1769
1793
|
coords: any[][];
|
|
1770
1794
|
points: number[][];
|
|
@@ -1783,13 +1807,14 @@ declare class FBORayPicking {
|
|
|
1783
1807
|
_getPickingId(x: any, y: any, width: any, height: any, pixels: any, meshes: any, uniforms: any): any[];
|
|
1784
1808
|
_pickDepth(x: any, y: any, width: any, height: any, pixels: any, meshes: any, uniforms: any): number[];
|
|
1785
1809
|
_packData(data: any, shader: any): {
|
|
1786
|
-
meshId:
|
|
1787
|
-
pickingId:
|
|
1810
|
+
meshId: number;
|
|
1811
|
+
pickingId: number;
|
|
1788
1812
|
};
|
|
1789
1813
|
_clearFbo(framebuffer: any): void;
|
|
1790
1814
|
_getShader(meshes: any, once: any): MeshShader;
|
|
1791
1815
|
_getFBO1(): any;
|
|
1792
1816
|
_fbo1: any;
|
|
1817
|
+
_debugFBO(fbo: any): void;
|
|
1793
1818
|
_getParams(px: any, py: any, tolerance: any, fbo: any): {
|
|
1794
1819
|
px: any;
|
|
1795
1820
|
py: any;
|
|
@@ -2315,7 +2340,6 @@ declare class MapGLRenderer extends renderer.MapAbstractRenderer {
|
|
|
2315
2340
|
|
|
2316
2341
|
declare class MapGPURenderer extends MapGLRenderer {
|
|
2317
2342
|
device: any;
|
|
2318
|
-
gpuDevice: GPUDevice;
|
|
2319
2343
|
drawLayers(layers: Layer[], framestamp: number): boolean;
|
|
2320
2344
|
createContext(): Promise<void>;
|
|
2321
2345
|
isWebGL(): boolean;
|