@luma.gl/core 9.3.0-alpha.4 → 9.3.0-alpha.8
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/adapter/canvas-context.d.ts +6 -182
- package/dist/adapter/canvas-context.d.ts.map +1 -1
- package/dist/adapter/canvas-context.js +5 -481
- package/dist/adapter/canvas-context.js.map +1 -1
- package/dist/adapter/canvas-observer.d.ts +32 -0
- package/dist/adapter/canvas-observer.d.ts.map +1 -0
- package/dist/adapter/canvas-observer.js +90 -0
- package/dist/adapter/canvas-observer.js.map +1 -0
- package/dist/adapter/canvas-surface.d.ts +150 -0
- package/dist/adapter/canvas-surface.d.ts.map +1 -0
- package/dist/adapter/canvas-surface.js +392 -0
- package/dist/adapter/canvas-surface.js.map +1 -0
- package/dist/adapter/device.d.ts +76 -11
- package/dist/adapter/device.d.ts.map +1 -1
- package/dist/adapter/device.js +180 -9
- package/dist/adapter/device.js.map +1 -1
- package/dist/adapter/luma.js +1 -1
- package/dist/adapter/presentation-context.d.ts +11 -0
- package/dist/adapter/presentation-context.d.ts.map +1 -0
- package/dist/adapter/presentation-context.js +12 -0
- package/dist/adapter/presentation-context.js.map +1 -0
- package/dist/adapter/resources/buffer.d.ts +1 -1
- package/dist/adapter/resources/buffer.d.ts.map +1 -1
- package/dist/adapter/resources/buffer.js +14 -6
- package/dist/adapter/resources/buffer.js.map +1 -1
- package/dist/adapter/resources/command-buffer.d.ts +3 -1
- package/dist/adapter/resources/command-buffer.d.ts.map +1 -1
- package/dist/adapter/resources/command-buffer.js +3 -1
- package/dist/adapter/resources/command-buffer.js.map +1 -1
- package/dist/adapter/resources/command-encoder.d.ts +25 -2
- package/dist/adapter/resources/command-encoder.d.ts.map +1 -1
- package/dist/adapter/resources/command-encoder.js +68 -2
- package/dist/adapter/resources/command-encoder.js.map +1 -1
- package/dist/adapter/resources/compute-pipeline.d.ts +2 -2
- package/dist/adapter/resources/compute-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/fence.d.ts +1 -1
- package/dist/adapter/resources/fence.d.ts.map +1 -1
- package/dist/adapter/resources/fence.js +3 -1
- package/dist/adapter/resources/fence.js.map +1 -1
- package/dist/adapter/resources/framebuffer.d.ts +1 -1
- package/dist/adapter/resources/framebuffer.d.ts.map +1 -1
- package/dist/adapter/resources/query-set.d.ts +17 -1
- package/dist/adapter/resources/query-set.d.ts.map +1 -1
- package/dist/adapter/resources/query-set.js.map +1 -1
- package/dist/adapter/resources/render-pipeline.d.ts +28 -10
- package/dist/adapter/resources/render-pipeline.d.ts.map +1 -1
- package/dist/adapter/resources/render-pipeline.js +21 -2
- package/dist/adapter/resources/render-pipeline.js.map +1 -1
- package/dist/adapter/resources/resource.d.ts +8 -0
- package/dist/adapter/resources/resource.d.ts.map +1 -1
- package/dist/adapter/resources/resource.js +240 -14
- package/dist/adapter/resources/resource.js.map +1 -1
- package/dist/adapter/resources/shared-render-pipeline.d.ts +22 -0
- package/dist/adapter/resources/shared-render-pipeline.d.ts.map +1 -0
- package/dist/adapter/resources/shared-render-pipeline.js +25 -0
- package/dist/adapter/resources/shared-render-pipeline.js.map +1 -0
- package/dist/adapter/resources/texture-view.d.ts +1 -1
- package/dist/adapter/resources/texture-view.d.ts.map +1 -1
- package/dist/adapter/resources/texture.d.ts +82 -15
- package/dist/adapter/resources/texture.d.ts.map +1 -1
- package/dist/adapter/resources/texture.js +186 -33
- package/dist/adapter/resources/texture.js.map +1 -1
- package/dist/adapter/types/attachments.d.ts +1 -1
- package/dist/adapter/types/attachments.d.ts.map +1 -1
- package/dist/adapter/types/buffer-layout.d.ts +1 -1
- package/dist/adapter/types/buffer-layout.d.ts.map +1 -1
- package/dist/adapter/types/parameters.d.ts +3 -1
- package/dist/adapter/types/parameters.d.ts.map +1 -1
- package/dist/adapter/types/parameters.js +1 -0
- package/dist/adapter/types/parameters.js.map +1 -1
- package/dist/adapter/types/shader-layout.d.ts +10 -6
- package/dist/adapter/types/shader-layout.d.ts.map +1 -1
- package/dist/adapter/types/uniforms.d.ts +6 -0
- package/dist/adapter/types/uniforms.d.ts.map +1 -1
- package/dist/adapter-utils/bind-groups.d.ts +9 -0
- package/dist/adapter-utils/bind-groups.d.ts.map +1 -0
- package/dist/adapter-utils/bind-groups.js +41 -0
- package/dist/adapter-utils/bind-groups.js.map +1 -0
- package/dist/adapter-utils/get-attribute-from-layouts.d.ts +2 -2
- package/dist/adapter-utils/get-attribute-from-layouts.d.ts.map +1 -1
- package/dist/adapter-utils/get-attribute-from-layouts.js +6 -6
- package/dist/adapter-utils/get-attribute-from-layouts.js.map +1 -1
- package/dist/dist.dev.js +1934 -415
- package/dist/dist.min.js +6 -6
- package/dist/factories/bind-group-factory.d.ts +20 -0
- package/dist/factories/bind-group-factory.d.ts.map +1 -0
- package/dist/factories/bind-group-factory.js +79 -0
- package/dist/factories/bind-group-factory.js.map +1 -0
- package/dist/factories/core-module-state.d.ts +7 -0
- package/dist/factories/core-module-state.d.ts.map +1 -0
- package/dist/{shadertypes/data-types/shader-types.js → factories/core-module-state.js} +1 -1
- package/dist/factories/core-module-state.js.map +1 -0
- package/dist/factories/pipeline-factory.d.ts +54 -0
- package/dist/factories/pipeline-factory.d.ts.map +1 -0
- package/dist/factories/pipeline-factory.js +270 -0
- package/dist/factories/pipeline-factory.js.map +1 -0
- package/dist/factories/shader-factory.d.ts +20 -0
- package/dist/factories/shader-factory.d.ts.map +1 -0
- package/dist/factories/shader-factory.js +84 -0
- package/dist/factories/shader-factory.js.map +1 -0
- package/dist/index.cjs +1858 -409
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +25 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -9
- package/dist/index.js.map +1 -1
- package/dist/portable/uniform-block.d.ts +1 -1
- package/dist/portable/uniform-block.d.ts.map +1 -1
- package/dist/portable/uniform-buffer-layout.d.ts +20 -15
- package/dist/portable/uniform-buffer-layout.d.ts.map +1 -1
- package/dist/portable/uniform-buffer-layout.js +188 -43
- package/dist/portable/uniform-buffer-layout.js.map +1 -1
- package/dist/portable/uniform-store.d.ts +5 -6
- package/dist/portable/uniform-store.d.ts.map +1 -1
- package/dist/portable/uniform-store.js +6 -3
- package/dist/portable/uniform-store.js.map +1 -1
- package/dist/shadertypes/data-types/data-type-decoder.d.ts +20 -0
- package/dist/shadertypes/data-types/data-type-decoder.d.ts.map +1 -0
- package/dist/shadertypes/data-types/data-type-decoder.js +79 -0
- package/dist/shadertypes/data-types/data-type-decoder.js.map +1 -0
- package/dist/shadertypes/data-types/data-types.d.ts +31 -12
- package/dist/shadertypes/data-types/data-types.d.ts.map +1 -1
- package/dist/{image-utils → shadertypes/image-types}/image-types.d.ts +0 -6
- package/dist/shadertypes/image-types/image-types.d.ts.map +1 -0
- package/dist/shadertypes/image-types/image-types.js.map +1 -0
- package/dist/shadertypes/shader-types/shader-type-decoder.d.ts +41 -0
- package/dist/shadertypes/shader-types/shader-type-decoder.d.ts.map +1 -0
- package/dist/shadertypes/{data-types/decode-shader-types.js → shader-types/shader-type-decoder.js} +43 -4
- package/dist/shadertypes/shader-types/shader-type-decoder.js.map +1 -0
- package/dist/shadertypes/shader-types/shader-types.d.ts +101 -0
- package/dist/shadertypes/shader-types/shader-types.d.ts.map +1 -0
- package/dist/shadertypes/shader-types/shader-types.js +30 -0
- package/dist/shadertypes/shader-types/shader-types.js.map +1 -0
- package/dist/shadertypes/texture-types/pixel-utils.d.ts.map +1 -0
- package/dist/shadertypes/texture-types/pixel-utils.js.map +1 -0
- package/dist/shadertypes/{textures → texture-types}/texture-format-decoder.d.ts +1 -0
- package/dist/shadertypes/texture-types/texture-format-decoder.d.ts.map +1 -0
- package/dist/shadertypes/{textures → texture-types}/texture-format-decoder.js +55 -9
- package/dist/shadertypes/texture-types/texture-format-decoder.js.map +1 -0
- package/dist/shadertypes/texture-types/texture-format-generics.d.ts +34 -0
- package/dist/shadertypes/texture-types/texture-format-generics.d.ts.map +1 -0
- package/dist/shadertypes/texture-types/texture-format-generics.js.map +1 -0
- package/dist/shadertypes/texture-types/texture-format-table.d.ts.map +1 -0
- package/dist/shadertypes/{textures → texture-types}/texture-format-table.js +10 -9
- package/dist/shadertypes/texture-types/texture-format-table.js.map +1 -0
- package/dist/shadertypes/{textures → texture-types}/texture-formats.d.ts +10 -3
- package/dist/shadertypes/texture-types/texture-formats.d.ts.map +1 -0
- package/dist/shadertypes/{textures → texture-types}/texture-formats.js +1 -0
- package/dist/shadertypes/texture-types/texture-formats.js.map +1 -0
- package/dist/shadertypes/{textures → texture-types}/texture-layout.d.ts +1 -1
- package/dist/shadertypes/texture-types/texture-layout.d.ts.map +1 -0
- package/dist/shadertypes/texture-types/texture-layout.js.map +1 -0
- package/dist/shadertypes/vertex-types/vertex-format-decoder.d.ts +24 -0
- package/dist/shadertypes/vertex-types/vertex-format-decoder.d.ts.map +1 -0
- package/dist/shadertypes/vertex-types/vertex-format-decoder.js +106 -0
- package/dist/shadertypes/vertex-types/vertex-format-decoder.js.map +1 -0
- package/dist/shadertypes/vertex-types/vertex-formats.d.ts +50 -0
- package/dist/shadertypes/vertex-types/vertex-formats.d.ts.map +1 -0
- package/dist/shadertypes/vertex-types/vertex-formats.js.map +1 -0
- package/dist/utils/array-equal.d.ts +1 -1
- package/dist/utils/array-equal.d.ts.map +1 -1
- package/dist/utils/array-equal.js +15 -9
- package/dist/utils/array-equal.js.map +1 -1
- package/dist/utils/stats-manager.d.ts.map +1 -1
- package/dist/utils/stats-manager.js +61 -1
- package/dist/utils/stats-manager.js.map +1 -1
- package/package.json +3 -3
- package/src/adapter/canvas-context.ts +7 -623
- package/src/adapter/canvas-observer.ts +130 -0
- package/src/adapter/canvas-surface.ts +521 -0
- package/src/adapter/device.ts +287 -21
- package/src/adapter/presentation-context.ts +16 -0
- package/src/adapter/resources/buffer.ts +13 -5
- package/src/adapter/resources/command-buffer.ts +3 -1
- package/src/adapter/resources/command-encoder.ts +94 -3
- package/src/adapter/resources/compute-pipeline.ts +2 -2
- package/src/adapter/resources/fence.ts +3 -1
- package/src/adapter/resources/framebuffer.ts +1 -1
- package/src/adapter/resources/query-set.ts +17 -1
- package/src/adapter/resources/render-pipeline.ts +52 -16
- package/src/adapter/resources/resource.ts +284 -14
- package/src/adapter/resources/shared-render-pipeline.ts +40 -0
- package/src/adapter/resources/texture-view.ts +1 -1
- package/src/adapter/resources/texture.ts +273 -43
- package/src/adapter/types/attachments.ts +1 -1
- package/src/adapter/types/buffer-layout.ts +1 -1
- package/src/adapter/types/parameters.ts +4 -1
- package/src/adapter/types/shader-layout.ts +15 -9
- package/src/adapter/types/uniforms.ts +12 -0
- package/src/adapter-utils/bind-groups.ts +71 -0
- package/src/adapter-utils/get-attribute-from-layouts.ts +8 -11
- package/src/factories/bind-group-factory.ts +139 -0
- package/src/factories/core-module-state.ts +11 -0
- package/src/factories/pipeline-factory.ts +328 -0
- package/src/factories/shader-factory.ts +103 -0
- package/src/index.ts +54 -26
- package/src/portable/uniform-block.ts +1 -1
- package/src/portable/uniform-buffer-layout.ts +269 -62
- package/src/portable/uniform-store.ts +14 -11
- package/src/shadertypes/data-types/data-type-decoder.ts +105 -0
- package/src/shadertypes/data-types/data-types.ts +100 -48
- package/src/{image-utils → shadertypes/image-types}/image-types.ts +0 -7
- package/src/shadertypes/{data-types/decode-shader-types.ts → shader-types/shader-type-decoder.ts} +88 -14
- package/src/shadertypes/shader-types/shader-types.ts +207 -0
- package/src/shadertypes/{textures → texture-types}/texture-format-decoder.ts +75 -9
- package/src/shadertypes/{textures → texture-types}/texture-format-generics.ts +42 -48
- package/src/shadertypes/{textures → texture-types}/texture-format-table.ts +10 -9
- package/src/shadertypes/{textures → texture-types}/texture-formats.ts +20 -3
- package/src/shadertypes/vertex-types/vertex-format-decoder.ts +131 -0
- package/src/shadertypes/vertex-types/vertex-formats.ts +183 -0
- package/src/utils/array-equal.ts +21 -9
- package/src/utils/stats-manager.ts +76 -2
- package/dist/image-utils/image-types.d.ts.map +0 -1
- package/dist/image-utils/image-types.js.map +0 -1
- package/dist/shadertypes/data-types/decode-shader-types.d.ts +0 -17
- package/dist/shadertypes/data-types/decode-shader-types.d.ts.map +0 -1
- package/dist/shadertypes/data-types/decode-shader-types.js.map +0 -1
- package/dist/shadertypes/data-types/shader-types.d.ts +0 -43
- package/dist/shadertypes/data-types/shader-types.d.ts.map +0 -1
- package/dist/shadertypes/data-types/shader-types.js.map +0 -1
- package/dist/shadertypes/textures/pixel-utils.d.ts.map +0 -1
- package/dist/shadertypes/textures/pixel-utils.js.map +0 -1
- package/dist/shadertypes/textures/texture-format-decoder.d.ts.map +0 -1
- package/dist/shadertypes/textures/texture-format-decoder.js.map +0 -1
- package/dist/shadertypes/textures/texture-format-generics.d.ts +0 -33
- package/dist/shadertypes/textures/texture-format-generics.d.ts.map +0 -1
- package/dist/shadertypes/textures/texture-format-generics.js.map +0 -1
- package/dist/shadertypes/textures/texture-format-table.d.ts.map +0 -1
- package/dist/shadertypes/textures/texture-format-table.js.map +0 -1
- package/dist/shadertypes/textures/texture-formats.d.ts.map +0 -1
- package/dist/shadertypes/textures/texture-formats.js.map +0 -1
- package/dist/shadertypes/textures/texture-layout.d.ts.map +0 -1
- package/dist/shadertypes/textures/texture-layout.js.map +0 -1
- package/dist/shadertypes/vertex-arrays/decode-vertex-format.d.ts +0 -18
- package/dist/shadertypes/vertex-arrays/decode-vertex-format.d.ts.map +0 -1
- package/dist/shadertypes/vertex-arrays/decode-vertex-format.js +0 -100
- package/dist/shadertypes/vertex-arrays/decode-vertex-format.js.map +0 -1
- package/dist/shadertypes/vertex-arrays/vertex-formats.d.ts +0 -27
- package/dist/shadertypes/vertex-arrays/vertex-formats.d.ts.map +0 -1
- package/dist/shadertypes/vertex-arrays/vertex-formats.js.map +0 -1
- package/src/shadertypes/data-types/shader-types.ts +0 -94
- package/src/shadertypes/vertex-arrays/decode-vertex-format.ts +0 -124
- package/src/shadertypes/vertex-arrays/vertex-formats.ts +0 -91
- /package/dist/{image-utils → shadertypes/image-types}/image-types.js +0 -0
- /package/dist/shadertypes/{textures → texture-types}/pixel-utils.d.ts +0 -0
- /package/dist/shadertypes/{textures → texture-types}/pixel-utils.js +0 -0
- /package/dist/shadertypes/{textures → texture-types}/texture-format-generics.js +0 -0
- /package/dist/shadertypes/{textures → texture-types}/texture-format-table.d.ts +0 -0
- /package/dist/shadertypes/{textures → texture-types}/texture-layout.js +0 -0
- /package/dist/shadertypes/{vertex-arrays → vertex-types}/vertex-formats.js +0 -0
- /package/src/shadertypes/{textures → texture-types}/pixel-utils.ts +0 -0
- /package/src/shadertypes/{textures → texture-types}/texture-layout.ts +0 -0
|
@@ -63,17 +63,25 @@ export class Buffer extends Resource {
|
|
|
63
63
|
/** A partial CPU-side copy of the data in this buffer, for debugging purposes */
|
|
64
64
|
debugData = new ArrayBuffer(0);
|
|
65
65
|
/** This doesn't handle partial non-zero offset updates correctly */
|
|
66
|
-
_setDebugData(data,
|
|
67
|
-
|
|
66
|
+
_setDebugData(data, _byteOffset, byteLength) {
|
|
67
|
+
let arrayBufferView = null;
|
|
68
|
+
let arrayBuffer;
|
|
69
|
+
if (ArrayBuffer.isView(data)) {
|
|
70
|
+
arrayBufferView = data;
|
|
71
|
+
arrayBuffer = data.buffer;
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
arrayBuffer = data;
|
|
75
|
+
}
|
|
68
76
|
const debugDataLength = Math.min(data ? data.byteLength : byteLength, Buffer.DEBUG_DATA_MAX_LENGTH);
|
|
69
77
|
if (arrayBuffer === null) {
|
|
70
78
|
this.debugData = new ArrayBuffer(debugDataLength);
|
|
71
79
|
}
|
|
72
|
-
else if (byteOffset === 0 && byteLength === arrayBuffer.byteLength) {
|
|
73
|
-
this.debugData = arrayBuffer.slice(0, debugDataLength);
|
|
74
|
-
}
|
|
75
80
|
else {
|
|
76
|
-
|
|
81
|
+
const sourceByteOffset = Math.min(arrayBufferView?.byteOffset || 0, arrayBuffer.byteLength);
|
|
82
|
+
const availableByteLength = Math.max(0, arrayBuffer.byteLength - sourceByteOffset);
|
|
83
|
+
const copyByteLength = Math.min(debugDataLength, availableByteLength);
|
|
84
|
+
this.debugData = new Uint8Array(arrayBuffer, sourceByteOffset, copyByteLength).slice().buffer;
|
|
77
85
|
}
|
|
78
86
|
}
|
|
79
87
|
static defaultProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer.js","sourceRoot":"","sources":["../../../src/adapter/resources/buffer.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,QAAQ,EAAgB,sBAAmB;AAsBnD,0BAA0B;AAC1B,MAAM,OAAgB,MAAO,SAAQ,QAAqB;IACxD,mBAAmB;IACnB,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC;IACtB,oBAAoB;IACpB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,qBAAqB;IACrB,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,qBAAqB;IACrB,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC;IACzB,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC;IAE9B,cAAc;IACd,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC;IACzB,MAAM,CAAC,QAAQ,GAAG,MAAM,CAAC;IAEzB,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC;QAC/B,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,mDAAmD;IAC1C,KAAK,CAAS;IACvB,iJAAiJ;IACxI,SAAS,CAAiC;IAGnD,sEAAsE;IACtE,eAAe,CAAS;IAExB,YAAY,MAAc,EAAE,KAAkB;QAC5C,MAAM,YAAY,GAAG,EAAC,GAAG,KAAK,EAAC,CAAC;QAEhC,mBAAmB;QACnB,IAAI,CAAC,KAAK,CAAC,KAA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AU,EACnC,MAAM,CAAC,qBAAqB,CAC7B,CAAC;QACF,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;YACzB,IAAI,CAAC,SAAS,GAAG,IAAI,WAAW,CAAC,eAAe,CAAC,CAAC;QACpD,CAAC;aAAM,CAAC;YACN,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,IAAI,CAAC,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;YAC5F,MAAM,mBAAmB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,UAAU,GAAG,gBAAgB,CAAC,CAAC;YACnF,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC;YACtE,IAAI,CAAC,SAAS,GAAG,IAAI,UAAU,CAAC,WAAW,EAAE,gBAAgB,EAAE,cAAc,CAAC,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC;QAChG,CAAC;IACH,CAAC;IAED,MAAM,CAAU,YAAY,GAA0B;QACpD,GAAG,QAAQ,CAAC,YAAY;QACxB,KAAK,EAAE,CAAC,EAAE,oCAAoC;QAC9C,UAAU,EAAE,CAAC;QACb,UAAU,EAAE,CAAC;QACb,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,QAAQ;QACnB,QAAQ,EAAE,SAAU;KACrB,CAAC"}
|
|
@@ -2,7 +2,9 @@ import { Device } from "../device.js";
|
|
|
2
2
|
import { Resource, ResourceProps } from "./resource.js";
|
|
3
3
|
export type CommandBufferProps = ResourceProps & {};
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Represents the finished contents of exactly one CommandEncoder. Backends may store native
|
|
6
|
+
* command buffers or replayable command lists internally, but submission must preserve the same
|
|
7
|
+
* recorded command ordering.
|
|
6
8
|
*/
|
|
7
9
|
export declare abstract class CommandBuffer extends Resource<CommandBufferProps> {
|
|
8
10
|
get [Symbol.toStringTag](): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-buffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/command-buffer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAC,qBAAkB;AACjC,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AAiBnD,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,EAAE,CAAC;AAEpD
|
|
1
|
+
{"version":3,"file":"command-buffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/command-buffer.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,MAAM,EAAC,qBAAkB;AACjC,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AAiBnD,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,EAAE,CAAC;AAEpD;;;;GAIG;AACH,8BAAsB,aAAc,SAAQ,QAAQ,CAAC,kBAAkB,CAAC;IACtE,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAE1C;gBAEW,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,kBAAkB;IAIrD,OAAgB,YAAY,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAExD;CACH"}
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import { Resource } from "./resource.js";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Represents the finished contents of exactly one CommandEncoder. Backends may store native
|
|
7
|
+
* command buffers or replayable command lists internally, but submission must preserve the same
|
|
8
|
+
* recorded command ordering.
|
|
7
9
|
*/
|
|
8
10
|
export class CommandBuffer extends Resource {
|
|
9
11
|
get [Symbol.toStringTag]() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-buffer.js","sourceRoot":"","sources":["../../../src/adapter/resources/command-buffer.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,QAAQ,EAAgB,sBAAmB;AAmBnD
|
|
1
|
+
{"version":3,"file":"command-buffer.js","sourceRoot":"","sources":["../../../src/adapter/resources/command-buffer.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,QAAQ,EAAgB,sBAAmB;AAmBnD;;;;GAIG;AACH,MAAM,OAAgB,aAAc,SAAQ,QAA4B;IACtE,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC;QAC/B,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,YAAY,MAAc,EAAE,KAAyB;QACnD,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACnD,CAAC;IAED,MAAM,CAAU,YAAY,GAAiC;QAC3D,GAAG,QAAQ,CAAC,YAAY;KACzB,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Device } from "../device.js";
|
|
2
2
|
import { Resource, ResourceProps } from "./resource.js";
|
|
3
|
+
import { QuerySet } from "./query-set.js";
|
|
3
4
|
import { Buffer } from "./buffer.js";
|
|
4
5
|
import { Texture } from "./texture.js";
|
|
5
|
-
import { QuerySet } from "./query-set.js";
|
|
6
6
|
import type { RenderPass, RenderPassProps } from "./render-pass.js";
|
|
7
7
|
import type { ComputePass, ComputePassProps } from "./compute-pass.js";
|
|
8
8
|
import type { CommandBuffer, CommandBufferProps } from "./command-buffer.js";
|
|
@@ -88,12 +88,23 @@ export type ClearTextureOptions = {
|
|
|
88
88
|
};
|
|
89
89
|
export type CommandEncoderProps = ResourceProps & {
|
|
90
90
|
measureExecutionTime?: boolean;
|
|
91
|
+
timeProfilingQuerySet?: QuerySet | null;
|
|
92
|
+
};
|
|
93
|
+
type PassWithTimestamps = {
|
|
94
|
+
timestampQuerySet?: QuerySet;
|
|
95
|
+
beginTimestampIndex?: number;
|
|
96
|
+
endTimestampIndex?: number;
|
|
91
97
|
};
|
|
92
98
|
/**
|
|
93
|
-
*
|
|
99
|
+
* Records commands onto a single backend command encoder and can finish them into one command
|
|
100
|
+
* buffer. Resource helpers invoked through a CommandEncoder must record onto that encoder rather
|
|
101
|
+
* than allocating hidden encoders or submitting work eagerly.
|
|
94
102
|
*/
|
|
95
103
|
export declare abstract class CommandEncoder extends Resource<CommandEncoderProps> {
|
|
96
104
|
get [Symbol.toStringTag](): string;
|
|
105
|
+
protected _timeProfilingQuerySet: QuerySet | null;
|
|
106
|
+
protected _timeProfilingSlotCount: number;
|
|
107
|
+
_gpuTimeMs?: number;
|
|
97
108
|
constructor(device: Device, props: CommandEncoderProps);
|
|
98
109
|
/** Completes recording of the commands sequence */
|
|
99
110
|
abstract finish(props?: CommandBufferProps): CommandBuffer;
|
|
@@ -116,6 +127,17 @@ export declare abstract class CommandEncoder extends Resource<CommandEncoderProp
|
|
|
116
127
|
queryCount?: number;
|
|
117
128
|
destinationOffset?: number;
|
|
118
129
|
}): void;
|
|
130
|
+
/**
|
|
131
|
+
* Reads all resolved timestamp pairs on the current profiler query set and caches the sum
|
|
132
|
+
* as milliseconds on this encoder.
|
|
133
|
+
*/
|
|
134
|
+
resolveTimeProfilingQuerySet(): Promise<void>;
|
|
135
|
+
/** Returns the number of query slots consumed by automatic pass profiling on this encoder. */
|
|
136
|
+
getTimeProfilingSlotCount(): number;
|
|
137
|
+
getTimeProfilingQuerySet(): QuerySet | null;
|
|
138
|
+
/** Internal helper for auto-assigning timestamp slots to render/compute passes on this encoder. */
|
|
139
|
+
protected _applyTimeProfilingToPassProps<P extends PassWithTimestamps>(props?: P): P;
|
|
140
|
+
protected _supportsTimestampQueries(): boolean;
|
|
119
141
|
/** Begins a labeled debug group containing subsequent commands */
|
|
120
142
|
abstract pushDebugGroup(groupLabel: string): void;
|
|
121
143
|
/** Ends the labeled debug group most recently started by pushDebugGroup() */
|
|
@@ -124,4 +146,5 @@ export declare abstract class CommandEncoder extends Resource<CommandEncoderProp
|
|
|
124
146
|
abstract insertDebugMarker(markerLabel: string): void;
|
|
125
147
|
static defaultProps: Required<CommandEncoderProps>;
|
|
126
148
|
}
|
|
149
|
+
export {};
|
|
127
150
|
//# sourceMappingURL=command-encoder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-encoder.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/command-encoder.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAC,qBAAkB;AACjC,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AACnD,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"command-encoder.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/command-encoder.ts"],"names":[],"mappings":"AAKA,OAAO,EAAC,MAAM,EAAC,qBAAkB;AACjC,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AACnD,OAAO,EAAC,QAAQ,EAAC,uBAAoB;AACrC,OAAO,EAAC,MAAM,EAAC,oBAAiB;AAChC,OAAO,EAAC,OAAO,EAAC,qBAAkB;AAClC,OAAO,KAAK,EAAC,UAAU,EAAE,eAAe,EAAC,yBAAsB;AAC/D,OAAO,KAAK,EAAC,WAAW,EAAE,gBAAgB,EAAC,0BAAuB;AAClE,OAAO,KAAK,EAAC,aAAa,EAAE,kBAAkB,EAAC,4BAAyB;AAIxE,MAAM,MAAM,yBAAyB,GAAG;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,CAAC,MAAM,EAA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B,yDAAyD;IACzD,QAAQ,CAAC,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;IAMrD,OAAgB,YAAY,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAIzD;CACH"}
|
|
@@ -3,21 +3,87 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import { Resource } from "./resource.js";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Records commands onto a single backend command encoder and can finish them into one command
|
|
7
|
+
* buffer. Resource helpers invoked through a CommandEncoder must record onto that encoder rather
|
|
8
|
+
* than allocating hidden encoders or submitting work eagerly.
|
|
7
9
|
*/
|
|
8
10
|
export class CommandEncoder extends Resource {
|
|
9
11
|
get [Symbol.toStringTag]() {
|
|
10
12
|
return 'CommandEncoder';
|
|
11
13
|
}
|
|
14
|
+
_timeProfilingQuerySet = null;
|
|
15
|
+
_timeProfilingSlotCount = 0;
|
|
16
|
+
_gpuTimeMs;
|
|
12
17
|
constructor(device, props) {
|
|
13
18
|
super(device, props, CommandEncoder.defaultProps);
|
|
19
|
+
this._timeProfilingQuerySet = props.timeProfilingQuerySet ?? null;
|
|
20
|
+
this._timeProfilingSlotCount = 0;
|
|
21
|
+
this._gpuTimeMs = undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Reads all resolved timestamp pairs on the current profiler query set and caches the sum
|
|
25
|
+
* as milliseconds on this encoder.
|
|
26
|
+
*/
|
|
27
|
+
async resolveTimeProfilingQuerySet() {
|
|
28
|
+
this._gpuTimeMs = undefined;
|
|
29
|
+
if (!this._timeProfilingQuerySet) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const pairCount = Math.floor(this._timeProfilingSlotCount / 2);
|
|
33
|
+
if (pairCount <= 0) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const queryCount = pairCount * 2;
|
|
37
|
+
const results = await this._timeProfilingQuerySet.readResults({
|
|
38
|
+
firstQuery: 0,
|
|
39
|
+
queryCount
|
|
40
|
+
});
|
|
41
|
+
let totalDurationNanoseconds = 0n;
|
|
42
|
+
for (let queryIndex = 0; queryIndex < queryCount; queryIndex += 2) {
|
|
43
|
+
totalDurationNanoseconds += results[queryIndex + 1] - results[queryIndex];
|
|
44
|
+
}
|
|
45
|
+
this._gpuTimeMs = Number(totalDurationNanoseconds) / 1e6;
|
|
46
|
+
}
|
|
47
|
+
/** Returns the number of query slots consumed by automatic pass profiling on this encoder. */
|
|
48
|
+
getTimeProfilingSlotCount() {
|
|
49
|
+
return this._timeProfilingSlotCount;
|
|
50
|
+
}
|
|
51
|
+
getTimeProfilingQuerySet() {
|
|
52
|
+
return this._timeProfilingQuerySet;
|
|
53
|
+
}
|
|
54
|
+
/** Internal helper for auto-assigning timestamp slots to render/compute passes on this encoder. */
|
|
55
|
+
_applyTimeProfilingToPassProps(props) {
|
|
56
|
+
const passProps = (props || {});
|
|
57
|
+
if (!this._supportsTimestampQueries() || !this._timeProfilingQuerySet) {
|
|
58
|
+
return passProps;
|
|
59
|
+
}
|
|
60
|
+
if (passProps.timestampQuerySet !== undefined ||
|
|
61
|
+
passProps.beginTimestampIndex !== undefined ||
|
|
62
|
+
passProps.endTimestampIndex !== undefined) {
|
|
63
|
+
return passProps;
|
|
64
|
+
}
|
|
65
|
+
const beginTimestampIndex = this._timeProfilingSlotCount;
|
|
66
|
+
if (beginTimestampIndex + 1 >= this._timeProfilingQuerySet.props.count) {
|
|
67
|
+
return passProps;
|
|
68
|
+
}
|
|
69
|
+
this._timeProfilingSlotCount += 2;
|
|
70
|
+
return {
|
|
71
|
+
...passProps,
|
|
72
|
+
timestampQuerySet: this._timeProfilingQuerySet,
|
|
73
|
+
beginTimestampIndex,
|
|
74
|
+
endTimestampIndex: beginTimestampIndex + 1
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
_supportsTimestampQueries() {
|
|
78
|
+
return this.device.features.has('timestamp-query');
|
|
14
79
|
}
|
|
15
80
|
// TODO - luma.gl has these on the device, should we align with WebGPU API?
|
|
16
81
|
// beginRenderPass(GPURenderPassDescriptor descriptor): GPURenderPassEncoder;
|
|
17
82
|
// beginComputePass(optional GPUComputePassDescriptor descriptor = {}): GPUComputePassEncoder;
|
|
18
83
|
static defaultProps = {
|
|
19
84
|
...Resource.defaultProps,
|
|
20
|
-
measureExecutionTime: undefined
|
|
85
|
+
measureExecutionTime: undefined,
|
|
86
|
+
timeProfilingQuerySet: undefined
|
|
21
87
|
};
|
|
22
88
|
}
|
|
23
89
|
//# sourceMappingURL=command-encoder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-encoder.js","sourceRoot":"","sources":["../../../src/adapter/resources/command-encoder.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAIpC,OAAO,EAAC,QAAQ,EAAgB,sBAAmB;
|
|
1
|
+
{"version":3,"file":"command-encoder.js","sourceRoot":"","sources":["../../../src/adapter/resources/command-encoder.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAIpC,OAAO,EAAC,QAAQ,EAAgB,sBAAmB;AAqInD;;;;GAIG;AACH,MAAM,OAAgB,cAAe,SAAQ,QAA6B;IACxE,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC;QAC/B,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAES,sBAAsB,GAAoB,IAAI,CAAC;IAC/C,uBAAuB,GAAW,CAAC,CAAC;IAC9C,UAAU,CAAU;IAEpB,YAAY,MAAc,EAAE,KAA0B;QACpD,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,cAAc,CAAC,YAAY,CAAC,CAAC;QAClD,IAAI,CAAC,sBAAsB,GAAG,KAAK,CAAC,qBAAqB,IAAI,IAAI,CAAC;QAClE,IAAI,CAAC,uBAAuB,GAAG,CAAC,CAAC;QACjC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAuCD;;;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mBAAmB,KAAK,SAAS;YAC3C,SAAS,CAAC,iBAAiB,KAAK,SAAS,EACzC,CAAC;YACD,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,MAAM,mBAAmB,GAAG,IAAI,CAAC,uBAAuB,CAAC;QACzD,IAAI,mBAAmB,GAAG,CAAC,IAAI,IAAI,CAAC,sBAAsB,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACvE,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,IAAI,CAAC,uBAAuB,IAAI,CAAC,CAAC;QAElC,OAAO;YACL,GAAG,SAAS;YACZ,iBAAiB,EAAE,IAAI,CAAC,sBAAsB;YAC9C,mBAAmB;YACnB,iBAAiB,EAAE,mBAAmB,GAAG,CAAC;SAC3C,CAAC;IACJ,CAAC;IAES,yBAAyB;QACjC,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACrD,CAAC;IASD,2EAA2E;IAC3E,6EAA6E;IAC7E,8FAA8F;IAE9F,MAAM,CAAU,YAAY,GAAkC;QAC5D,GAAG,QAAQ,CAAC,YAAY;QACxB,oBAAoB,EAAE,SAAU;QAChC,qBAAqB,EAAE,SAAU;KAClC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Resource, ResourceProps } from "./resource.js";
|
|
2
|
-
import type { ComputeShaderLayout,
|
|
2
|
+
import type { ComputeShaderLayout, Bindings, BindingsByGroup } from "../types/shader-layout.js";
|
|
3
3
|
import type { Device } from "../device.js";
|
|
4
4
|
import type { Shader } from "./shader.js";
|
|
5
5
|
/**
|
|
@@ -29,7 +29,7 @@ export declare abstract class ComputePipeline extends Resource<ComputePipelinePr
|
|
|
29
29
|
* @todo Use renderpass.setBindings() ?
|
|
30
30
|
* @todo Do we want to expose BindGroups in the API and remove this?
|
|
31
31
|
*/
|
|
32
|
-
abstract setBindings(bindings:
|
|
32
|
+
abstract setBindings(bindings: Bindings | BindingsByGroup): void;
|
|
33
33
|
static defaultProps: Required<ComputePipelineProps>;
|
|
34
34
|
}
|
|
35
35
|
//# sourceMappingURL=compute-pipeline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute-pipeline.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/compute-pipeline.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AACnD,OAAO,KAAK,EAAC,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"compute-pipeline.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/compute-pipeline.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AACnD,OAAO,KAAK,EAAC,mBAAmB,EAAE,QAAQ,EAAE,eAAe,EAAC,kCAA+B;AAC3F,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,KAAK,EAAC,MAAM,EAAC,oBAAiB;AAErC;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,aAAa,GAAG;IACjD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iHAAiH;IACjH,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,+EAA+E;IAC/E,YAAY,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAC3C,CAAC;AAEF;;GAEG;AACH,8BAAsB,eAAgB,SAAQ,QAAQ,CAAC,oBAAoB,CAAC;IAC1E,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAE1C;IAED,IAAI,EAAE,MAAM,CAAM;IAClB,+BAA+B;IAC/B,YAAY,EAAE,mBAAmB,CAAC;gBAEtB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,oBAAoB;IAKvD;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,eAAe,GAAG,IAAI;IAEhE,OAAgB,YAAY,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAM1D;CACH"}
|
|
@@ -4,7 +4,7 @@ export type FenceProps = ResourceProps;
|
|
|
4
4
|
/** Synchronization primitive that resolves when GPU work is completed */
|
|
5
5
|
export declare abstract class Fence extends Resource<FenceProps> {
|
|
6
6
|
static defaultProps: Required<FenceProps>;
|
|
7
|
-
[Symbol.toStringTag]: string;
|
|
7
|
+
get [Symbol.toStringTag](): string;
|
|
8
8
|
/** Promise that resolves when the fence is signaled */
|
|
9
9
|
abstract readonly signaled: Promise<void>;
|
|
10
10
|
constructor(device: Device, props?: FenceProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fence.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/fence.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,EAAC,QAAQ,EAAE,KAAK,aAAa,EAAC,sBAAmB;AAExD,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC;AAEvC,yEAAyE;AACzE,8BAAsB,KAAM,SAAQ,QAAQ,CAAC,UAAU,CAAC;IACtD,OAAgB,YAAY,EAAE,QAAQ,CAAC,UAAU,CAAC,CAEhD;IAEF,CAAC,MAAM,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"fence.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/fence.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,EAAC,QAAQ,EAAE,KAAK,aAAa,EAAC,sBAAmB;AAExD,MAAM,MAAM,UAAU,GAAG,aAAa,CAAC;AAEvC,yEAAyE;AACzE,8BAAsB,KAAM,SAAQ,QAAQ,CAAC,UAAU,CAAC;IACtD,OAAgB,YAAY,EAAE,QAAQ,CAAC,UAAU,CAAC,CAEhD;IAEF,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAE1C;IAED,uDAAuD;IACvD,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;gBAE9B,MAAM,EAAE,MAAM,EAAE,KAAK,GAAE,UAAe;IAIlD,kDAAkD;aAChC,OAAO,IAAI,IAAI;IAEjC,2CAA2C;IAC3C,QAAQ,CAAC,UAAU,IAAI,OAAO;CAC/B"}
|
|
@@ -7,7 +7,9 @@ export class Fence extends Resource {
|
|
|
7
7
|
static defaultProps = {
|
|
8
8
|
...Resource.defaultProps
|
|
9
9
|
};
|
|
10
|
-
[Symbol.toStringTag]
|
|
10
|
+
get [Symbol.toStringTag]() {
|
|
11
|
+
return 'Fence';
|
|
12
|
+
}
|
|
11
13
|
constructor(device, props = {}) {
|
|
12
14
|
super(device, props, Fence.defaultProps);
|
|
13
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fence.js","sourceRoot":"","sources":["../../../src/adapter/resources/fence.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,QAAQ,EAAqB,sBAAmB;AAIxD,yEAAyE;AACzE,MAAM,OAAgB,KAAM,SAAQ,QAAoB;IACtD,MAAM,CAAU,YAAY,GAAyB;QACnD,GAAG,QAAQ,CAAC,YAAY;KACzB,CAAC;IAEF,CAAC,MAAM,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"fence.js","sourceRoot":"","sources":["../../../src/adapter/resources/fence.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,QAAQ,EAAqB,sBAAmB;AAIxD,yEAAyE;AACzE,MAAM,OAAgB,KAAM,SAAQ,QAAoB;IACtD,MAAM,CAAU,YAAY,GAAyB;QACnD,GAAG,QAAQ,CAAC,YAAY;KACzB,CAAC;IAEF,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC;QAC/B,OAAO,OAAO,CAAC;IACjB,CAAC;IAKD,YAAY,MAAc,EAAE,QAAoB,EAAE;QAChD,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;IAC3C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TextureFormatColor, TextureFormatDepthStencil, TextureFormat } from "../../shadertypes/
|
|
1
|
+
import type { TextureFormatColor, TextureFormatDepthStencil, TextureFormat } from "../../shadertypes/texture-types/texture-formats.js";
|
|
2
2
|
import type { Device } from "../device.js";
|
|
3
3
|
import { Resource, ResourceProps } from "./resource.js";
|
|
4
4
|
import { Texture } from "./texture.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"framebuffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/framebuffer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,aAAa,EACd,
|
|
1
|
+
{"version":3,"file":"framebuffer.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/framebuffer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,aAAa,EACd,2DAAwD;AACzD,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AACnD,OAAO,EAAC,OAAO,EAAC,qBAAkB;AAClC,OAAO,EAAC,WAAW,EAAC,0BAAuB;AAG3C,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,CAAC,WAAW,GAAG,OAAO,GAAG,kBAAkB,CAAC,EAAE,CAAC;IAClE,sBAAsB,CAAC,EAAE,CA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CAAC,iBAAiB,IAAI,IAAI;IAE5C,OAAgB,YAAY,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAMtD;CACH"}
|
|
@@ -11,7 +11,8 @@ export type QuerySetProps = ResourceProps & {
|
|
|
11
11
|
/**
|
|
12
12
|
* The type of query set
|
|
13
13
|
* occlusion - query the number of fragment samples that pass all the per-fragment tests for a set of drawing commands, including scissor, sample mask, alpha to coverage, stencil, and depth tests
|
|
14
|
-
* timestamp - query the GPU timestamp counter
|
|
14
|
+
* timestamp - query the GPU timestamp counter. Timestamp queries are available if the
|
|
15
|
+
* `timestamp-query` feature is present.
|
|
15
16
|
*/
|
|
16
17
|
type: 'occlusion' | 'timestamp';
|
|
17
18
|
/** The number of queries managed by the query set */
|
|
@@ -22,5 +23,20 @@ export declare abstract class QuerySet extends Resource<QuerySetProps> {
|
|
|
22
23
|
get [Symbol.toStringTag](): string;
|
|
23
24
|
constructor(device: Device, props: QuerySetProps);
|
|
24
25
|
static defaultProps: Required<QuerySetProps>;
|
|
26
|
+
/**
|
|
27
|
+
* Returns true if the requested result has been captured and can be read without blocking.
|
|
28
|
+
* Backends may implement this conservatively.
|
|
29
|
+
*/
|
|
30
|
+
abstract isResultAvailable(queryIndex?: number): boolean;
|
|
31
|
+
/** Reads query results as 64-bit values. */
|
|
32
|
+
abstract readResults(options?: {
|
|
33
|
+
firstQuery?: number;
|
|
34
|
+
queryCount?: number;
|
|
35
|
+
}): Promise<bigint[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Reads a timestamp duration in milliseconds between a begin and end query index.
|
|
38
|
+
* Portable duration profiling requires adjacent indices that identify one logical pair.
|
|
39
|
+
*/
|
|
40
|
+
abstract readTimestampDuration(beginIndex: number, endIndex: number): Promise<number>;
|
|
25
41
|
}
|
|
26
42
|
//# sourceMappingURL=query-set.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-set.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/query-set.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AAEnD;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG;IAC1C
|
|
1
|
+
{"version":3,"file":"query-set.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/query-set.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,sBAAmB;AAEnD;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG;IAC1C;;;;;OAKG;IACH,IAAI,EAAE,WAAW,GAAG,WAAW,CAAC;IAChC,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,gCAAgC;AAChC,8BAAsB,QAAS,SAAQ,QAAQ,CAAC,aAAa,CAAC;IAC5D,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;gBAEW,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa;IAIhD,OAAgB,YAAY,EAAE,QAAQ,CAAC,aAAa,CAAC,CAInD;IAEF;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO;IAExD,4CAA4C;IAC5C,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAE7F;;;OAGG;IACH,QAAQ,CAAC,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CACtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-set.js","sourceRoot":"","sources":["../../../src/adapter/resources/query-set.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,QAAQ,EAAgB,sBAAmB;
|
|
1
|
+
{"version":3,"file":"query-set.js","sourceRoot":"","sources":["../../../src/adapter/resources/query-set.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,QAAQ,EAAgB,sBAAmB;AAqBnD,gCAAgC;AAChC,MAAM,OAAgB,QAAS,SAAQ,QAAuB;IAC5D,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACtB,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,YAAY,MAAc,EAAE,KAAoB;QAC9C,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,CAAU,YAAY,GAA4B;QACtD,GAAG,QAAQ,CAAC,YAAY;QACxB,IAAI,EAAE,SAAU;QAChB,KAAK,EAAE,SAAU;KAClB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Device } from "../device.js";
|
|
2
|
-
import type { UniformValue } from "../types/uniforms.js";
|
|
3
2
|
import type { PrimitiveTopology, RenderPipelineParameters } from "../types/parameters.js";
|
|
4
|
-
import type { ShaderLayout,
|
|
3
|
+
import type { ShaderLayout, Bindings, BindingsByGroup } from "../types/shader-layout.js";
|
|
5
4
|
import type { BufferLayout } from "../types/buffer-layout.js";
|
|
6
|
-
import type { TextureFormatColor, TextureFormatDepthStencil } from '@luma.gl/core/shadertypes/
|
|
5
|
+
import type { TextureFormatColor, TextureFormatDepthStencil } from '@luma.gl/core/shadertypes/texture-types/texture-formats';
|
|
7
6
|
import type { Shader } from "./shader.js";
|
|
7
|
+
import type { SharedRenderPipeline } from "./shared-render-pipeline.js";
|
|
8
8
|
import type { RenderPass } from "./render-pass.js";
|
|
9
9
|
import { Resource, ResourceProps } from "./resource.js";
|
|
10
10
|
import { VertexArray } from "./vertex-array.js";
|
|
@@ -34,10 +34,18 @@ export type RenderPipelineProps = ResourceProps & {
|
|
|
34
34
|
depthStencilAttachmentFormat?: TextureFormatDepthStencil;
|
|
35
35
|
/** Parameters that are controlled by pipeline */
|
|
36
36
|
parameters?: RenderPipelineParameters;
|
|
37
|
+
/** Transform feedback varyings captured when linking a WebGL render pipeline. WebGL only. */
|
|
38
|
+
varyings?: string[];
|
|
39
|
+
/** Transform feedback buffer mode used when linking a WebGL render pipeline. WebGL only. */
|
|
40
|
+
bufferMode?: number;
|
|
41
|
+
/** Some applications intentionally supply unused attributes and bindings, and want to disable warnings */
|
|
42
|
+
disableWarnings?: boolean;
|
|
43
|
+
/** Internal hook for backend-specific shared pipeline implementations. */
|
|
44
|
+
_sharedRenderPipeline?: SharedRenderPipeline;
|
|
37
45
|
/** Buffers, Textures, Samplers for the shader bindings */
|
|
38
|
-
bindings?:
|
|
39
|
-
/**
|
|
40
|
-
|
|
46
|
+
bindings?: Bindings;
|
|
47
|
+
/** Bindings grouped by bind-group index */
|
|
48
|
+
bindGroups?: BindingsByGroup;
|
|
41
49
|
};
|
|
42
50
|
/**
|
|
43
51
|
* A compiled and linked shader program
|
|
@@ -54,11 +62,13 @@ export declare abstract class RenderPipeline extends Resource<RenderPipelineProp
|
|
|
54
62
|
linkStatus: 'pending' | 'success' | 'error';
|
|
55
63
|
/** The hash of the pipeline */
|
|
56
64
|
hash: string;
|
|
65
|
+
/** Optional shared backend implementation */
|
|
66
|
+
sharedRenderPipeline: SharedRenderPipeline | null;
|
|
67
|
+
/** Whether shader or pipeline compilation/linking is still in progress */
|
|
68
|
+
get isPending(): boolean;
|
|
69
|
+
/** Whether shader or pipeline compilation/linking has failed */
|
|
70
|
+
get isErrored(): boolean;
|
|
57
71
|
constructor(device: Device, props: RenderPipelineProps);
|
|
58
|
-
/** Set bindings (stored on pipeline and set before each call) */
|
|
59
|
-
abstract setBindings(bindings: Record<string, Binding>, options?: {
|
|
60
|
-
disableWarnings?: boolean;
|
|
61
|
-
}): void;
|
|
62
72
|
/** Draw call. Returns false if the draw call was aborted (due to resources still initializing) */
|
|
63
73
|
abstract draw(options: {
|
|
64
74
|
/** Render pass to draw into (targeting screen or framebuffer) */
|
|
@@ -86,6 +96,14 @@ export declare abstract class RenderPipeline extends Resource<RenderPipelineProp
|
|
|
86
96
|
baseVertex?: number;
|
|
87
97
|
/** Transform feedback. WebGL only. */
|
|
88
98
|
transformFeedback?: TransformFeedback;
|
|
99
|
+
/** Bindings applied for this draw (textures, samplers, uniform buffers) */
|
|
100
|
+
bindings?: Bindings;
|
|
101
|
+
/** Bindings grouped by bind-group index */
|
|
102
|
+
bindGroups?: BindingsByGroup;
|
|
103
|
+
/** Optional stable cache keys for backend bind-group reuse */
|
|
104
|
+
_bindGroupCacheKeys?: Partial<Record<number, object>>;
|
|
105
|
+
/** WebGL-only uniforms */
|
|
106
|
+
uniforms?: Record<string, unknown>;
|
|
89
107
|
}): boolean;
|
|
90
108
|
static defaultProps: Required<RenderPipelineProps>;
|
|
91
109
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-pipeline.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/render-pipeline.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"render-pipeline.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/render-pipeline.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,MAAM,EAAC,qBAAkB;AACtC,OAAO,KAAK,EAAC,iBAAiB,EAAE,wBAAwB,EAAC,+BAA4B;AACrF,OAAO,KAAK,EAAC,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAC,kCAA+B;AACpF,OAAO,KAAK,EAAC,YAAY,EAAC,kCAA+B;AACzD,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EAC1B,MAAM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6CAA6C;QAC7C,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,2CAA2C;QAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,uCAAuC;QACvC,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,gCAAgC;QAChC,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,+BAA+B;QAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,kCAAkC;QAClC,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,sCAAsC;QACtC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;QACtC,2EAA2E;QAC3E,QAAQ,CAAC,EAAE,QAAQ,CAAC;QACpB,2CAA2C;QAC3C,UAAU,CAAC,EAAE,eAAe,CAAC;QAC7B,8DAA8D;QAC9D,mBAAmB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QACtD,0BAA0B;QAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,GAAG,OAAO;IAEX,OAAgB,YAAY,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAyBzD;CACH"}
|
|
@@ -17,10 +17,25 @@ export class RenderPipeline extends Resource {
|
|
|
17
17
|
linkStatus = 'pending';
|
|
18
18
|
/** The hash of the pipeline */
|
|
19
19
|
hash = '';
|
|
20
|
+
/** Optional shared backend implementation */
|
|
21
|
+
sharedRenderPipeline = null;
|
|
22
|
+
/** Whether shader or pipeline compilation/linking is still in progress */
|
|
23
|
+
get isPending() {
|
|
24
|
+
return (this.linkStatus === 'pending' ||
|
|
25
|
+
this.vs.compilationStatus === 'pending' ||
|
|
26
|
+
this.fs?.compilationStatus === 'pending');
|
|
27
|
+
}
|
|
28
|
+
/** Whether shader or pipeline compilation/linking has failed */
|
|
29
|
+
get isErrored() {
|
|
30
|
+
return (this.linkStatus === 'error' ||
|
|
31
|
+
this.vs.compilationStatus === 'error' ||
|
|
32
|
+
this.fs?.compilationStatus === 'error');
|
|
33
|
+
}
|
|
20
34
|
constructor(device, props) {
|
|
21
35
|
super(device, props, RenderPipeline.defaultProps);
|
|
22
36
|
this.shaderLayout = this.props.shaderLayout;
|
|
23
37
|
this.bufferLayout = this.props.bufferLayout || [];
|
|
38
|
+
this.sharedRenderPipeline = this.props._sharedRenderPipeline || null;
|
|
24
39
|
}
|
|
25
40
|
static defaultProps = {
|
|
26
41
|
...Resource.defaultProps,
|
|
@@ -36,8 +51,12 @@ export class RenderPipeline extends Resource {
|
|
|
36
51
|
colorAttachmentFormats: undefined,
|
|
37
52
|
depthStencilAttachmentFormat: undefined,
|
|
38
53
|
parameters: {},
|
|
39
|
-
|
|
40
|
-
|
|
54
|
+
varyings: undefined,
|
|
55
|
+
bufferMode: undefined,
|
|
56
|
+
disableWarnings: false,
|
|
57
|
+
_sharedRenderPipeline: undefined,
|
|
58
|
+
bindings: undefined,
|
|
59
|
+
bindGroups: undefined
|
|
41
60
|
};
|
|
42
61
|
}
|
|
43
62
|
//# sourceMappingURL=render-pipeline.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-pipeline.js","sourceRoot":"","sources":["../../../src/adapter/resources/render-pipeline.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAapC,OAAO,EAAC,QAAQ,EAAgB,sBAAmB;
|
|
1
|
+
{"version":3,"file":"render-pipeline.js","sourceRoot":"","sources":["../../../src/adapter/resources/render-pipeline.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,oCAAoC;AAapC,OAAO,EAAC,QAAQ,EAAgB,sBAAmB;AAwDnD;;GAEG;AACH,MAAM,OAAgB,cAAe,SAAQ,QAA6B;IACxE,IAAa,CAAC,MAAM,CAAC,WAAW,CAAC;QAC/B,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAKD,wBAAwB;IACxB,YAA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sBAAsB,EAAE,SAAU;QAClC,4BAA4B,EAAE,SAAU;QAExC,UAAU,EAAE,EAAE;QACd,QAAQ,EAAE,SAAU;QACpB,UAAU,EAAE,SAAU;QACtB,eAAe,EAAE,KAAK;QACtB,qBAAqB,EAAE,SAAU;QACjC,QAAQ,EAAE,SAAU;QACpB,UAAU,EAAE,SAAU;KACvB,CAAC"}
|
|
@@ -33,6 +33,8 @@ export declare abstract class Resource<Props extends ResourceProps> {
|
|
|
33
33
|
destroyed: boolean;
|
|
34
34
|
/** For resources that allocate GPU memory */
|
|
35
35
|
private allocatedBytes;
|
|
36
|
+
/** Stats bucket currently holding the tracked allocation */
|
|
37
|
+
private allocatedBytesName;
|
|
36
38
|
/** Attached resources will be destroyed when this resource is destroyed. Tracks auto-created "sub" resources. */
|
|
37
39
|
private _attachedResources;
|
|
38
40
|
/**
|
|
@@ -71,9 +73,15 @@ export declare abstract class Resource<Props extends ResourceProps> {
|
|
|
71
73
|
protected removeStats(): void;
|
|
72
74
|
/** Called by subclass to track memory allocations */
|
|
73
75
|
protected trackAllocatedMemory(bytes: number, name?: string): void;
|
|
76
|
+
/** Called by subclass to track handle-backed memory allocations separately from owned allocations */
|
|
77
|
+
protected trackReferencedMemory(bytes: number, name?: string): void;
|
|
74
78
|
/** Called by subclass to track memory deallocations */
|
|
75
79
|
protected trackDeallocatedMemory(name?: string): void;
|
|
80
|
+
/** Called by subclass to deallocate handle-backed memory tracked via trackReferencedMemory() */
|
|
81
|
+
protected trackDeallocatedReferencedMemory(name?: string): void;
|
|
76
82
|
/** Called by resource constructor to track object creation */
|
|
77
83
|
private addStats;
|
|
84
|
+
/** Canonical resource name used for stats buckets. */
|
|
85
|
+
protected getStatsName(): string;
|
|
78
86
|
}
|
|
79
87
|
//# sourceMappingURL=resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../src/adapter/resources/resource.ts"],"names":[],"mappings":"AAIA,OAAO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