@luma.gl/engine 9.0.0-beta.5 → 9.0.0-beta.7
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/animation/timeline.d.ts.map +1 -1
- package/dist/animation/timeline.js +3 -3
- package/dist/animation-loop/animation-loop-template.d.ts +1 -1
- package/dist/animation-loop/animation-loop-template.d.ts.map +1 -1
- package/dist/animation-loop/animation-loop-template.js +3 -1
- package/dist/animation-loop/animation-loop.d.ts +2 -2
- package/dist/animation-loop/animation-loop.d.ts.map +1 -1
- package/dist/animation-loop/animation-loop.js +14 -6
- package/dist/animation-loop/animation-props.d.ts +2 -2
- package/dist/animation-loop/animation-props.d.ts.map +1 -1
- package/dist/animation-loop/make-animation-loop.d.ts +2 -2
- package/dist/animation-loop/make-animation-loop.d.ts.map +1 -1
- package/dist/animation-loop/make-animation-loop.js +4 -2
- package/dist/computation.d.ts +95 -0
- package/dist/computation.d.ts.map +1 -0
- package/dist/computation.js +248 -0
- package/dist/debug/copy-texture-to-image.d.ts.map +1 -1
- package/dist/debug/copy-texture-to-image.js +5 -2
- package/dist/debug/debug-framebuffer.d.ts.map +1 -1
- package/dist/debug/debug-framebuffer.js +0 -1
- package/dist/debug/pixel-data-utils.d.ts.map +1 -1
- package/dist/debug/pixel-data-utils.js +2 -1
- package/dist/dist.dev.js +713 -329
- package/dist/geometries/cone-geometry.d.ts +1 -1
- package/dist/geometries/cone-geometry.d.ts.map +1 -1
- package/dist/geometries/cone-geometry.js +1 -1
- package/dist/geometries/cube-geometry.d.ts +1 -1
- package/dist/geometries/cube-geometry.d.ts.map +1 -1
- package/dist/geometries/cube-geometry.js +16 -14
- package/dist/geometries/cylinder-geometry.d.ts +1 -1
- package/dist/geometries/cylinder-geometry.d.ts.map +1 -1
- package/dist/geometries/cylinder-geometry.js +1 -1
- package/dist/geometries/ico-sphere-geometry.d.ts +1 -1
- package/dist/geometries/ico-sphere-geometry.d.ts.map +1 -1
- package/dist/geometries/ico-sphere-geometry.js +1 -1
- package/dist/geometries/plane-geometry.d.ts +1 -1
- package/dist/geometries/plane-geometry.d.ts.map +1 -1
- package/dist/geometries/plane-geometry.js +2 -2
- package/dist/geometries/sphere-geometry.d.ts +1 -1
- package/dist/geometries/sphere-geometry.d.ts.map +1 -1
- package/dist/geometries/sphere-geometry.js +1 -1
- package/dist/geometries/truncated-cone-geometry.d.ts +1 -1
- package/dist/geometries/truncated-cone-geometry.d.ts.map +1 -1
- package/dist/geometries/truncated-cone-geometry.js +1 -1
- package/dist/geometry/geometry-table.d.ts.map +1 -1
- package/dist/geometry/geometry-table.js +3 -0
- package/dist/geometry/geometry.d.ts.map +1 -1
- package/dist/geometry/geometry.js +3 -0
- package/dist/geometry/gpu-geometry.d.ts +1 -1
- package/dist/geometry/gpu-geometry.d.ts.map +1 -1
- package/dist/geometry/gpu-geometry.js +4 -5
- package/dist/index.cjs +661 -291
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +43 -40
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -23
- package/dist/lib/clip-space.d.ts +1 -1
- package/dist/lib/clip-space.d.ts.map +1 -1
- package/dist/lib/clip-space.js +8 -10
- package/dist/lib/pipeline-factory.d.ts +10 -6
- package/dist/lib/pipeline-factory.d.ts.map +1 -1
- package/dist/lib/pipeline-factory.js +47 -22
- package/dist/lib/shader-factory.d.ts +17 -0
- package/dist/lib/shader-factory.d.ts.map +1 -0
- package/dist/lib/shader-factory.js +46 -0
- package/dist/model/model.d.ts +58 -45
- package/dist/model/model.d.ts.map +1 -1
- package/dist/model/model.js +213 -120
- package/dist/scenegraph/group-node.d.ts +1 -1
- package/dist/scenegraph/group-node.d.ts.map +1 -1
- package/dist/scenegraph/group-node.js +10 -5
- package/dist/scenegraph/model-node.d.ts +3 -3
- package/dist/scenegraph/model-node.d.ts.map +1 -1
- package/dist/scenegraph/model-node.js +2 -2
- package/dist/scenegraph/scenegraph-node.d.ts.map +1 -1
- package/dist/shader-inputs.d.ts.map +1 -1
- package/dist/shader-inputs.js +3 -0
- package/dist/transform/buffer-transform.d.ts +1 -1
- package/dist/transform/buffer-transform.d.ts.map +1 -1
- package/dist/transform/buffer-transform.js +7 -6
- package/dist/transform/texture-transform.d.ts +1 -1
- package/dist/transform/texture-transform.d.ts.map +1 -1
- package/dist/transform/texture-transform.js +10 -8
- package/dist.min.js +2 -2
- package/package.json +2 -2
- package/src/animation/timeline.ts +20 -20
- package/src/animation-loop/animation-loop-template.ts +10 -8
- package/src/animation-loop/animation-loop.ts +20 -10
- package/src/animation-loop/animation-props.ts +1 -1
- package/src/animation-loop/make-animation-loop.ts +17 -8
- package/src/computation.ts +346 -0
- package/src/debug/copy-texture-to-image.ts +8 -6
- package/src/debug/debug-framebuffer.ts +16 -3
- package/src/debug/debug-shader-layout.ts +1 -1
- package/src/debug/pixel-data-utils.ts +3 -6
- package/src/geometries/cube-geometry.ts +17 -13
- package/src/geometries/ico-sphere-geometry.ts +1 -1
- package/src/geometries/plane-geometry.ts +1 -1
- package/src/geometries/sphere-geometry.ts +1 -1
- package/src/geometries/truncated-cone-geometry.ts +2 -1
- package/src/geometry/geometry-table.ts +9 -6
- package/src/geometry/geometry-utils.ts +1 -1
- package/src/geometry/geometry.ts +9 -6
- package/src/geometry/gpu-geometry.ts +18 -11
- package/src/index.ts +3 -0
- package/src/lib/clip-space.ts +14 -18
- package/src/lib/pipeline-factory.ts +62 -28
- package/src/lib/shader-factory.ts +57 -0
- package/src/model/model.ts +249 -146
- package/src/scenegraph/group-node.ts +14 -10
- package/src/scenegraph/model-node.ts +2 -2
- package/src/scenegraph/scenegraph-node.ts +2 -2
- package/src/shader-inputs.ts +19 -12
- package/src/transform/buffer-transform.ts +15 -7
- package/src/transform/texture-transform.ts +14 -13
package/dist/index.d.ts
CHANGED
|
@@ -1,41 +1,44 @@
|
|
|
1
|
-
export { Timeline } from
|
|
2
|
-
export { KeyFrames } from
|
|
3
|
-
export type { AnimationProps } from
|
|
4
|
-
export { AnimationLoopTemplate } from
|
|
5
|
-
export type { AnimationLoopProps } from
|
|
6
|
-
export { AnimationLoop } from
|
|
7
|
-
export type { MakeAnimationLoopProps } from
|
|
8
|
-
export { makeAnimationLoop } from
|
|
9
|
-
export type { ModelProps } from
|
|
10
|
-
export { Model } from
|
|
11
|
-
export type { BufferTransformProps } from
|
|
12
|
-
export { BufferTransform } from
|
|
13
|
-
export type { TextureTransformProps } from
|
|
14
|
-
export { TextureTransform } from
|
|
15
|
-
export { PipelineFactory } from
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export
|
|
20
|
-
export {
|
|
21
|
-
export
|
|
22
|
-
export {
|
|
23
|
-
export
|
|
24
|
-
export {
|
|
25
|
-
export
|
|
26
|
-
export {
|
|
27
|
-
export
|
|
28
|
-
export {
|
|
29
|
-
export
|
|
30
|
-
export {
|
|
31
|
-
export
|
|
32
|
-
export {
|
|
33
|
-
export
|
|
34
|
-
export {
|
|
35
|
-
export
|
|
36
|
-
export {
|
|
37
|
-
export
|
|
38
|
-
export {
|
|
39
|
-
export
|
|
40
|
-
export {
|
|
1
|
+
export { Timeline } from "./animation/timeline.js";
|
|
2
|
+
export { KeyFrames } from "./animation/key-frames.js";
|
|
3
|
+
export type { AnimationProps } from "./animation-loop/animation-props.js";
|
|
4
|
+
export { AnimationLoopTemplate } from "./animation-loop/animation-loop-template.js";
|
|
5
|
+
export type { AnimationLoopProps } from "./animation-loop/animation-loop.js";
|
|
6
|
+
export { AnimationLoop } from "./animation-loop/animation-loop.js";
|
|
7
|
+
export type { MakeAnimationLoopProps } from "./animation-loop/make-animation-loop.js";
|
|
8
|
+
export { makeAnimationLoop } from "./animation-loop/make-animation-loop.js";
|
|
9
|
+
export type { ModelProps } from "./model/model.js";
|
|
10
|
+
export { Model } from "./model/model.js";
|
|
11
|
+
export type { BufferTransformProps } from "./transform/buffer-transform.js";
|
|
12
|
+
export { BufferTransform } from "./transform/buffer-transform.js";
|
|
13
|
+
export type { TextureTransformProps } from "./transform/texture-transform.js";
|
|
14
|
+
export { TextureTransform } from "./transform/texture-transform.js";
|
|
15
|
+
export { PipelineFactory } from "./lib/pipeline-factory.js";
|
|
16
|
+
export { ShaderFactory } from "./lib/shader-factory.js";
|
|
17
|
+
export { ClipSpace } from "./lib/clip-space.js";
|
|
18
|
+
export { ScenegraphNode } from "./scenegraph/scenegraph-node.js";
|
|
19
|
+
export { GroupNode } from "./scenegraph/group-node.js";
|
|
20
|
+
export type { ModelNodeProps } from "./scenegraph/model-node.js";
|
|
21
|
+
export { ModelNode } from "./scenegraph/model-node.js";
|
|
22
|
+
export type { GeometryProps } from "./geometry/geometry.js";
|
|
23
|
+
export { Geometry } from "./geometry/geometry.js";
|
|
24
|
+
export type { GPUGeometryProps } from "./geometry/gpu-geometry.js";
|
|
25
|
+
export { GPUGeometry } from "./geometry/gpu-geometry.js";
|
|
26
|
+
export type { ConeGeometryProps } from "./geometries/cone-geometry.js";
|
|
27
|
+
export { ConeGeometry } from "./geometries/cone-geometry.js";
|
|
28
|
+
export type { CubeGeometryProps } from "./geometries/cube-geometry.js";
|
|
29
|
+
export { CubeGeometry } from "./geometries/cube-geometry.js";
|
|
30
|
+
export type { CylinderGeometryProps } from "./geometries/cylinder-geometry.js";
|
|
31
|
+
export { CylinderGeometry } from "./geometries/cylinder-geometry.js";
|
|
32
|
+
export type { IcoSphereGeometryProps } from "./geometries/ico-sphere-geometry.js";
|
|
33
|
+
export { IcoSphereGeometry } from "./geometries/ico-sphere-geometry.js";
|
|
34
|
+
export type { PlaneGeometryProps } from "./geometries/plane-geometry.js";
|
|
35
|
+
export { PlaneGeometry } from "./geometries/plane-geometry.js";
|
|
36
|
+
export type { SphereGeometryProps } from "./geometries/sphere-geometry.js";
|
|
37
|
+
export { SphereGeometry } from "./geometries/sphere-geometry.js";
|
|
38
|
+
export type { TruncatedConeGeometryProps } from "./geometries/truncated-cone-geometry.js";
|
|
39
|
+
export { TruncatedConeGeometry } from "./geometries/truncated-cone-geometry.js";
|
|
40
|
+
export type { ShaderModuleInputs } from "./shader-inputs.js";
|
|
41
|
+
export { ShaderInputs as _ShaderInputs } from "./shader-inputs.js";
|
|
42
|
+
export type { ComputationProps } from "./computation.js";
|
|
43
|
+
export { Computation } from "./computation.js";
|
|
41
44
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,QAAQ,EAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,QAAQ,EAAC,gCAA6B;AAC9C,OAAO,EAAC,SAAS,EAAC,kCAA+B;AACjD,YAAY,EAAC,cAAc,EAAC,4CAAyC;AAErE,OAAO,EAAC,qBAAqB,EAAC,oDAAiD;AAE/E,YAAY,EAAC,kBAAkB,EAAC,2CAAwC;AACxE,OAAO,EAAC,aAAa,EAAC,2CAAwC;AAE9D,YAAY,EAAC,sBAAsB,EAAC,gDAA6C;AACjF,OAAO,EAAC,iBAAiB,EAAC,gDAA6C;AAEvE,YAAY,EAAC,UAAU,EAAC,yBAAsB;AAC9C,OAAO,EAAC,KAAK,EAAC,yBAAsB;AAGpC,YAAY,EAAC,oBAAoB,EAAC,wCAAqC;AACvE,OAAO,EAAC,eAAe,EAAC,wCAAqC;AAC7D,YAAY,EAAC,qBAAqB,EAAC,yCAAsC;AACzE,OAAO,EAAC,gBAAgB,EAAC,yCAAsC;AAE/D,OAAO,EAAC,eAAe,EAAC,kCAA+B;AACvD,OAAO,EAAC,aAAa,EAAC,gCAA6B;AAGnD,OAAO,EAAC,SAAS,EAAC,4BAAyB;AAG3C,OAAO,EAAC,cAAc,EAAC,wCAAqC;AAC5D,OAAO,EAAC,SAAS,EAAC,mCAAgC;AAClD,YAAY,EAAC,cAAc,EAAC,mCAAgC;AAC5D,OAAO,EAAC,SAAS,EAAC,mCAAgC;AAGlD,YAAY,EAAC,aAAa,EAAC,+BAA4B;AACvD,OAAO,EAAC,QAAQ,EAAC,+BAA4B;AAC7C,YAAY,EAAC,gBAAgB,EAAC,mCAAgC;AAC9D,OAAO,EAAC,WAAW,EAAC,mCAAgC;AAGpD,YAAY,EAAC,iBAAiB,EAAC,sCAAmC;AAClE,OAAO,EAAC,YAAY,EAAC,sCAAmC;AACxD,YAAY,EAAC,iBAAiB,EAAC,sCAAmC;AAClE,OAAO,EAAC,YAAY,EAAC,sCAAmC;AACxD,YAAY,EAAC,qBAAqB,EAAC,0CAAuC;AAC1E,OAAO,EAAC,gBAAgB,EAAC,0CAAuC;AAChE,YAAY,EAAC,sBAAsB,EAAC,4CAAyC;AAC7E,OAAO,EAAC,iBAAiB,EAAC,4CAAyC;AACnE,YAAY,EAAC,kBAAkB,EAAC,uCAAoC;AACpE,OAAO,EAAC,aAAa,EAAC,uCAAoC;AAC1D,YAAY,EAAC,mBAAmB,EAAC,wCAAqC;AACtE,OAAO,EAAC,cAAc,EAAC,wCAAqC;AAC5D,YAAY,EAAC,0BAA0B,EAAC,gDAA6C;AACrF,OAAO,EAAC,qBAAqB,EAAC,gDAA6C;AAG3E,YAAY,EAAC,kBAAkB,EAAC,2BAAwB;AACxD,OAAO,EAAC,YAAY,IAAI,aAAa,EAAC,2BAAwB;AAC9D,YAAY,EAAC,gBAAgB,EAAC,yBAAsB;AACpD,OAAO,EAAC,WAAW,EAAC,yBAAsB"}
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
// luma.gl Engine API
|
|
2
2
|
// Animation
|
|
3
|
-
export { Timeline } from
|
|
4
|
-
export { KeyFrames } from
|
|
5
|
-
export { AnimationLoopTemplate } from
|
|
6
|
-
export { AnimationLoop } from
|
|
7
|
-
export { makeAnimationLoop } from
|
|
8
|
-
export { Model } from
|
|
9
|
-
export { BufferTransform } from
|
|
10
|
-
export { TextureTransform } from
|
|
11
|
-
export { PipelineFactory } from
|
|
3
|
+
export { Timeline } from "./animation/timeline.js";
|
|
4
|
+
export { KeyFrames } from "./animation/key-frames.js";
|
|
5
|
+
export { AnimationLoopTemplate } from "./animation-loop/animation-loop-template.js";
|
|
6
|
+
export { AnimationLoop } from "./animation-loop/animation-loop.js";
|
|
7
|
+
export { makeAnimationLoop } from "./animation-loop/make-animation-loop.js";
|
|
8
|
+
export { Model } from "./model/model.js";
|
|
9
|
+
export { BufferTransform } from "./transform/buffer-transform.js";
|
|
10
|
+
export { TextureTransform } from "./transform/texture-transform.js";
|
|
11
|
+
export { PipelineFactory } from "./lib/pipeline-factory.js";
|
|
12
|
+
export { ShaderFactory } from "./lib/shader-factory.js";
|
|
12
13
|
// Utils
|
|
13
|
-
export { ClipSpace } from
|
|
14
|
+
export { ClipSpace } from "./lib/clip-space.js";
|
|
14
15
|
// Scenegraph Core nodes
|
|
15
|
-
export { ScenegraphNode } from
|
|
16
|
-
export { GroupNode } from
|
|
17
|
-
export { ModelNode } from
|
|
18
|
-
export { Geometry } from
|
|
19
|
-
export { GPUGeometry } from
|
|
20
|
-
export { ConeGeometry } from
|
|
21
|
-
export { CubeGeometry } from
|
|
22
|
-
export { CylinderGeometry } from
|
|
23
|
-
export { IcoSphereGeometry } from
|
|
24
|
-
export { PlaneGeometry } from
|
|
25
|
-
export { SphereGeometry } from
|
|
26
|
-
export { TruncatedConeGeometry } from
|
|
27
|
-
export { ShaderInputs as _ShaderInputs } from
|
|
16
|
+
export { ScenegraphNode } from "./scenegraph/scenegraph-node.js";
|
|
17
|
+
export { GroupNode } from "./scenegraph/group-node.js";
|
|
18
|
+
export { ModelNode } from "./scenegraph/model-node.js";
|
|
19
|
+
export { Geometry } from "./geometry/geometry.js";
|
|
20
|
+
export { GPUGeometry } from "./geometry/gpu-geometry.js";
|
|
21
|
+
export { ConeGeometry } from "./geometries/cone-geometry.js";
|
|
22
|
+
export { CubeGeometry } from "./geometries/cube-geometry.js";
|
|
23
|
+
export { CylinderGeometry } from "./geometries/cylinder-geometry.js";
|
|
24
|
+
export { IcoSphereGeometry } from "./geometries/ico-sphere-geometry.js";
|
|
25
|
+
export { PlaneGeometry } from "./geometries/plane-geometry.js";
|
|
26
|
+
export { SphereGeometry } from "./geometries/sphere-geometry.js";
|
|
27
|
+
export { TruncatedConeGeometry } from "./geometries/truncated-cone-geometry.js";
|
|
28
|
+
export { ShaderInputs as _ShaderInputs } from "./shader-inputs.js";
|
|
29
|
+
export { Computation } from "./computation.js";
|
package/dist/lib/clip-space.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clip-space.d.ts","sourceRoot":"","sources":["../../src/lib/clip-space.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"clip-space.d.ts","sourceRoot":"","sources":["../../src/lib/clip-space.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAO,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAC,KAAK,EAAE,UAAU,EAAC,0BAAuB;AAwBjD;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;gBACtB,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,aAAa,GAAG,UAAU,CAAC;CAkBtF"}
|
package/dist/lib/clip-space.js
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
// ClipSpace
|
|
2
2
|
import { glsl } from '@luma.gl/core';
|
|
3
|
-
import { Model } from
|
|
4
|
-
import { Geometry } from
|
|
5
|
-
const CLIPSPACE_VERTEX_SHADER =
|
|
3
|
+
import { Model } from "../model/model.js";
|
|
4
|
+
import { Geometry } from "../geometry/geometry.js";
|
|
5
|
+
const CLIPSPACE_VERTEX_SHADER = `\
|
|
6
6
|
#version 300 es
|
|
7
7
|
in vec2 aClipSpacePosition;
|
|
8
8
|
in vec2 aTexCoord;
|
|
9
9
|
in vec2 aCoordinate;
|
|
10
|
-
|
|
11
10
|
out vec2 position;
|
|
12
11
|
out vec2 coordinate;
|
|
13
12
|
out vec2 uv;
|
|
14
|
-
|
|
15
13
|
void main(void) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
gl_Position = vec4(aClipSpacePosition, 0., 1.);
|
|
15
|
+
position = aClipSpacePosition;
|
|
16
|
+
coordinate = aCoordinate;
|
|
17
|
+
uv = aTexCoord;
|
|
20
18
|
}
|
|
21
19
|
`;
|
|
22
20
|
/* eslint-disable indent, no-multi-spaces */
|
|
@@ -26,7 +24,7 @@ const POSITIONS = [-1, -1, 1, -1, -1, 1, 1, 1];
|
|
|
26
24
|
*/
|
|
27
25
|
export class ClipSpace extends Model {
|
|
28
26
|
constructor(device, opts) {
|
|
29
|
-
const TEX_COORDS = POSITIONS.map(
|
|
27
|
+
const TEX_COORDS = POSITIONS.map(coord => (coord === -1 ? 0 : coord));
|
|
30
28
|
super(device, {
|
|
31
29
|
...opts,
|
|
32
30
|
vs: CLIPSPACE_VERTEX_SHADER,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { RenderPipelineProps } from '@luma.gl/core';
|
|
2
|
-
import { Device, RenderPipeline } from '@luma.gl/core';
|
|
1
|
+
import type { RenderPipelineProps, ComputePipelineProps } from '@luma.gl/core';
|
|
2
|
+
import { Device, RenderPipeline, ComputePipeline } from '@luma.gl/core';
|
|
3
3
|
export type PipelineFactoryProps = RenderPipelineProps;
|
|
4
4
|
/**
|
|
5
5
|
* Efficiently creates / caches pipelines
|
|
@@ -9,12 +9,16 @@ export declare class PipelineFactory {
|
|
|
9
9
|
readonly device: Device;
|
|
10
10
|
private _hashCounter;
|
|
11
11
|
private readonly _hashes;
|
|
12
|
-
private readonly
|
|
13
|
-
private readonly
|
|
12
|
+
private readonly _renderPipelineCache;
|
|
13
|
+
private readonly _computePipelineCache;
|
|
14
|
+
/** Get the singleton default pipeline factory for the specified device */
|
|
14
15
|
static getDefaultPipelineFactory(device: Device): PipelineFactory;
|
|
15
16
|
constructor(device: Device);
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
/** Return a RenderPipeline matching props. Reuses a similar pipeline if already created. */
|
|
18
|
+
createRenderPipeline(props: RenderPipelineProps): RenderPipeline;
|
|
19
|
+
createComputePipeline(props: ComputePipelineProps): ComputePipeline;
|
|
20
|
+
release(pipeline: RenderPipeline | ComputePipeline): void;
|
|
21
|
+
private _hashComputePipeline;
|
|
18
22
|
/** Calculate a hash based on all the inputs for a render pipeline */
|
|
19
23
|
private _hashRenderPipeline;
|
|
20
24
|
private _getHash;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline-factory.d.ts","sourceRoot":"","sources":["../../src/lib/pipeline-factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pipeline-factory.d.ts","sourceRoot":"","sources":["../../src/lib/pipeline-factory.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,mBAAmB,EAAE,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAC,MAAM,EAAE,cAAc,EAAE,eAAe,EAAC,MAAM,eAAe,CAAC;AAEtE,MAAM,MAAM,oBAAoB,GAAG,mBAAmB,CAAC;AAEvD;;GAEG;AACH,qBAAa,eAAe;IAC1B,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAoC;IAEvF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA8B;IACtD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAG9B;IACP,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAG/B;IAEP,0EAA0E;IAC1E,MAAM,CAAC,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe;gBAMrD,MAAM,EAAE,MAAM;IAI1B,4FAA4F;IAC5F,oBAAoB,CAAC,KAAK,EAAE,mBAAmB,GAAG,cAAc;IAkBhE,qBAAqB,CAAC,KAAK,EAAE,oBAAoB,GAAG,eAAe;IAkBnE,OAAO,CAAC,QAAQ,EAAE,cAAc,GAAG,eAAe,GAAG,IAAI;IAYzD,OAAO,CAAC,oBAAoB;IAK5B,qEAAqE;IACrE,OAAO,CAAC,mBAAmB;IAuB3B,OAAO,CAAC,QAAQ;CAMjB"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// luma.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { RenderPipeline, ComputePipeline } from '@luma.gl/core';
|
|
2
5
|
/**
|
|
3
6
|
* Efficiently creates / caches pipelines
|
|
4
7
|
*/
|
|
@@ -7,8 +10,9 @@ export class PipelineFactory {
|
|
|
7
10
|
device;
|
|
8
11
|
_hashCounter = 0;
|
|
9
12
|
_hashes = {};
|
|
10
|
-
|
|
11
|
-
|
|
13
|
+
_renderPipelineCache = {};
|
|
14
|
+
_computePipelineCache = {};
|
|
15
|
+
/** Get the singleton default pipeline factory for the specified device */
|
|
12
16
|
static getDefaultPipelineFactory(device) {
|
|
13
17
|
device._lumaData.defaultPipelineFactory =
|
|
14
18
|
device._lumaData.defaultPipelineFactory || new PipelineFactory(device);
|
|
@@ -17,28 +21,49 @@ export class PipelineFactory {
|
|
|
17
21
|
constructor(device) {
|
|
18
22
|
this.device = device;
|
|
19
23
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
/** Return a RenderPipeline matching props. Reuses a similar pipeline if already created. */
|
|
25
|
+
createRenderPipeline(props) {
|
|
26
|
+
const allProps = { ...RenderPipeline.defaultProps, ...props };
|
|
27
|
+
const hash = this._hashRenderPipeline(allProps);
|
|
28
|
+
if (!this._renderPipelineCache[hash]) {
|
|
29
|
+
const pipeline = this.device.createRenderPipeline({
|
|
30
|
+
...allProps,
|
|
31
|
+
id: allProps.id ? `${allProps.id}-cached` : undefined
|
|
32
|
+
});
|
|
25
33
|
pipeline.hash = hash;
|
|
26
|
-
this.
|
|
27
|
-
this._useCounts[hash] = 0;
|
|
34
|
+
this._renderPipelineCache[hash] = { pipeline, useCount: 0 };
|
|
28
35
|
}
|
|
29
|
-
this.
|
|
30
|
-
return this.
|
|
36
|
+
this._renderPipelineCache[hash].useCount++;
|
|
37
|
+
return this._renderPipelineCache[hash].pipeline;
|
|
38
|
+
}
|
|
39
|
+
createComputePipeline(props) {
|
|
40
|
+
const allProps = { ...ComputePipeline.defaultProps, ...props };
|
|
41
|
+
const hash = this._hashComputePipeline(allProps);
|
|
42
|
+
if (!this._computePipelineCache[hash]) {
|
|
43
|
+
const pipeline = this.device.createComputePipeline({
|
|
44
|
+
...allProps,
|
|
45
|
+
id: allProps.id ? `${allProps.id}-cached` : undefined
|
|
46
|
+
});
|
|
47
|
+
pipeline.hash = hash;
|
|
48
|
+
this._computePipelineCache[hash] = { pipeline, useCount: 0 };
|
|
49
|
+
}
|
|
50
|
+
this._computePipelineCache[hash].useCount++;
|
|
51
|
+
return this._computePipelineCache[hash].pipeline;
|
|
31
52
|
}
|
|
32
53
|
release(pipeline) {
|
|
33
54
|
const hash = pipeline.hash;
|
|
34
|
-
this.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
delete
|
|
55
|
+
const cache = pipeline instanceof ComputePipeline ? this._computePipelineCache : this._renderPipelineCache;
|
|
56
|
+
cache[hash].useCount--;
|
|
57
|
+
if (cache[hash].useCount === 0) {
|
|
58
|
+
cache[hash].pipeline.destroy();
|
|
59
|
+
delete cache[hash];
|
|
39
60
|
}
|
|
40
61
|
}
|
|
41
62
|
// PRIVATE
|
|
63
|
+
_hashComputePipeline(props) {
|
|
64
|
+
const shaderHash = this._getHash(props.shader.source);
|
|
65
|
+
return `${shaderHash}`;
|
|
66
|
+
}
|
|
42
67
|
/** Calculate a hash based on all the inputs for a render pipeline */
|
|
43
68
|
_hashRenderPipeline(props) {
|
|
44
69
|
const vsHash = this._getHash(props.vs.source);
|
|
@@ -48,16 +73,16 @@ export class PipelineFactory {
|
|
|
48
73
|
// const varyingHashes = varyings.map((v) => this._getHash(v));
|
|
49
74
|
const varyingHash = '-'; // `${varyingHashes.join('/')}B${bufferMode}`
|
|
50
75
|
const bufferLayoutHash = this._getHash(JSON.stringify(props.bufferLayout));
|
|
51
|
-
switch (this.device.
|
|
52
|
-
case '
|
|
76
|
+
switch (this.device.type) {
|
|
77
|
+
// case 'webgl':
|
|
78
|
+
// WebGL is more dynamic
|
|
79
|
+
// return `${vsHash}/${fsHash}V${varyingHash}BL${bufferLayoutHash}`;
|
|
80
|
+
default:
|
|
53
81
|
// On WebGPU we need to rebuild the pipeline if topology, parameters or bufferLayout change
|
|
54
82
|
const parameterHash = this._getHash(JSON.stringify(props.parameters));
|
|
55
83
|
// TODO - Can json.stringify() generate different strings for equivalent objects if order of params is different?
|
|
56
84
|
// create a deepHash() to deduplicate?
|
|
57
85
|
return `${vsHash}/${fsHash}V${varyingHash}T${props.topology}P${parameterHash}BL${bufferLayoutHash}`;
|
|
58
|
-
default:
|
|
59
|
-
// WebGL is more dynamic
|
|
60
|
-
return `${vsHash}/${fsHash}V${varyingHash}BL${bufferLayoutHash}`;
|
|
61
86
|
}
|
|
62
87
|
}
|
|
63
88
|
_getHash(key) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Device, Shader, ShaderProps } from '@luma.gl/core';
|
|
2
|
+
/** Manages a cached pool of Shaders for reuse. */
|
|
3
|
+
export declare class ShaderFactory {
|
|
4
|
+
static readonly defaultProps: Required<ShaderProps>;
|
|
5
|
+
readonly device: Device;
|
|
6
|
+
private readonly _cache;
|
|
7
|
+
/** Returns the default ShaderFactory for the given {@link Device}, creating one if necessary. */
|
|
8
|
+
static getDefaultShaderFactory(device: Device): ShaderFactory;
|
|
9
|
+
/** @internal */
|
|
10
|
+
constructor(device: Device);
|
|
11
|
+
/** Requests a {@link Shader} from the cache, creating a new Shader only if necessary. */
|
|
12
|
+
createShader(props: ShaderProps): Shader;
|
|
13
|
+
/** Releases a previously-requested {@link Shader}, destroying it if no users remain. */
|
|
14
|
+
release(shader: Shader): void;
|
|
15
|
+
private _hashShader;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=shader-factory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shader-factory.d.ts","sourceRoot":"","sources":["../../src/lib/shader-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1D,kDAAkD;AAClD,qBAAa,aAAa;IACxB,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,WAAW,CAAC,CAA4B;IAE/E,SAAgB,MAAM,EAAE,MAAM,CAAC;IAE/B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0D;IAEjF,iGAAiG;IACjG,MAAM,CAAC,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa;IAK7D,gBAAgB;gBACJ,MAAM,EAAE,MAAM;IAI1B,yFAAyF;IACzF,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM;IAgBxC,wFAAwF;IACxF,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAc7B,OAAO,CAAC,WAAW;CAGpB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Shader } from '@luma.gl/core';
|
|
2
|
+
/** Manages a cached pool of Shaders for reuse. */
|
|
3
|
+
export class ShaderFactory {
|
|
4
|
+
static defaultProps = { ...Shader.defaultProps };
|
|
5
|
+
device;
|
|
6
|
+
_cache = {};
|
|
7
|
+
/** Returns the default ShaderFactory for the given {@link Device}, creating one if necessary. */
|
|
8
|
+
static getDefaultShaderFactory(device) {
|
|
9
|
+
device._lumaData.defaultShaderFactory ||= new ShaderFactory(device);
|
|
10
|
+
return device._lumaData.defaultShaderFactory;
|
|
11
|
+
}
|
|
12
|
+
/** @internal */
|
|
13
|
+
constructor(device) {
|
|
14
|
+
this.device = device;
|
|
15
|
+
}
|
|
16
|
+
/** Requests a {@link Shader} from the cache, creating a new Shader only if necessary. */
|
|
17
|
+
createShader(props) {
|
|
18
|
+
const key = this._hashShader(props);
|
|
19
|
+
let cacheEntry = this._cache[key];
|
|
20
|
+
if (!cacheEntry) {
|
|
21
|
+
const shader = this.device.createShader({
|
|
22
|
+
...props,
|
|
23
|
+
id: props.id ? `${props.id}-cached` : undefined
|
|
24
|
+
});
|
|
25
|
+
this._cache[key] = cacheEntry = { shader, useCount: 0 };
|
|
26
|
+
}
|
|
27
|
+
cacheEntry.useCount++;
|
|
28
|
+
return cacheEntry.shader;
|
|
29
|
+
}
|
|
30
|
+
/** Releases a previously-requested {@link Shader}, destroying it if no users remain. */
|
|
31
|
+
release(shader) {
|
|
32
|
+
const key = this._hashShader(shader);
|
|
33
|
+
const cacheEntry = this._cache[key];
|
|
34
|
+
if (cacheEntry) {
|
|
35
|
+
cacheEntry.useCount--;
|
|
36
|
+
if (cacheEntry.useCount === 0) {
|
|
37
|
+
delete this._cache[key];
|
|
38
|
+
cacheEntry.shader.destroy();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// PRIVATE
|
|
43
|
+
_hashShader(value) {
|
|
44
|
+
return `${value.stage}:${value.source}`;
|
|
45
|
+
}
|
|
46
|
+
}
|
package/dist/model/model.d.ts
CHANGED
|
@@ -1,33 +1,25 @@
|
|
|
1
1
|
import type { TypedArray, RenderPipelineProps, RenderPipelineParameters } from '@luma.gl/core';
|
|
2
2
|
import type { BufferLayout, VertexArray, TransformFeedback } from '@luma.gl/core';
|
|
3
3
|
import type { AttributeInfo, Binding, UniformValue, PrimitiveTopology } from '@luma.gl/core';
|
|
4
|
-
import { Device, Buffer
|
|
4
|
+
import { Device, Buffer } from '@luma.gl/core';
|
|
5
|
+
import { RenderPipeline, RenderPass, UniformStore } from '@luma.gl/core';
|
|
5
6
|
import type { ShaderModule, PlatformInfo } from '@luma.gl/shadertools';
|
|
6
7
|
import { ShaderAssembler } from '@luma.gl/shadertools';
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import { PipelineFactory } from
|
|
8
|
+
import type { Geometry } from "../geometry/geometry.js";
|
|
9
|
+
import { GPUGeometry } from "../geometry/gpu-geometry.js";
|
|
10
|
+
import { ShaderInputs } from "../shader-inputs.js";
|
|
11
|
+
import { PipelineFactory } from "../lib/pipeline-factory.js";
|
|
12
|
+
import { ShaderFactory } from "../lib/shader-factory.js";
|
|
11
13
|
export type ModelProps = Omit<RenderPipelineProps, 'vs' | 'fs'> & {
|
|
12
14
|
source?: string;
|
|
13
|
-
vs:
|
|
14
|
-
|
|
15
|
-
wgsl?: string;
|
|
16
|
-
} | string | null;
|
|
17
|
-
fs: {
|
|
18
|
-
glsl?: string;
|
|
19
|
-
wgsl?: string;
|
|
20
|
-
} | string | null;
|
|
15
|
+
vs: string | null;
|
|
16
|
+
fs: string | null;
|
|
21
17
|
/** shadertool shader modules (added to shader code) */
|
|
22
18
|
modules?: ShaderModule[];
|
|
23
19
|
/** Shadertool module defines (configures shader code)*/
|
|
24
20
|
defines?: Record<string, string | number | boolean>;
|
|
25
21
|
/** Shader inputs, used to generated uniform buffers and bindings */
|
|
26
22
|
shaderInputs?: ShaderInputs;
|
|
27
|
-
/** pipeline factory to use to create render pipelines. Defaults to default factory for the device */
|
|
28
|
-
pipelineFactory?: PipelineFactory;
|
|
29
|
-
/** Shader assembler. Defaults to the ShaderAssembler.getShaderAssembler() */
|
|
30
|
-
shaderAssembler?: ShaderAssembler;
|
|
31
23
|
/** Parameters that are built into the pipeline */
|
|
32
24
|
parameters?: RenderPipelineParameters;
|
|
33
25
|
/** Geometry */
|
|
@@ -41,11 +33,21 @@ export type ModelProps = Omit<RenderPipelineProps, 'vs' | 'fs'> & {
|
|
|
41
33
|
attributes?: Record<string, Buffer>;
|
|
42
34
|
/** */
|
|
43
35
|
constantAttributes?: Record<string, TypedArray>;
|
|
36
|
+
/** Some applications intentionally supply unused attributes */
|
|
37
|
+
ignoreUnknownAttributes?: boolean;
|
|
44
38
|
/** @internal For use with {@link TransformFeedback}, WebGL only. */
|
|
45
39
|
varyings?: string[];
|
|
46
40
|
transformFeedback?: TransformFeedback;
|
|
47
41
|
/** Mapped uniforms for shadertool modules */
|
|
48
42
|
moduleSettings?: Record<string, Record<string, any>>;
|
|
43
|
+
/** Show shader source in browser? */
|
|
44
|
+
debugShaders?: 'never' | 'errors' | 'warnings' | 'always';
|
|
45
|
+
/** Factory used to create a {@link RenderPipeline}. Defaults to {@link Device} default factory. */
|
|
46
|
+
pipelineFactory?: PipelineFactory;
|
|
47
|
+
/** Factory used to create a {@link Shader}. Defaults to {@link Device} default factory. */
|
|
48
|
+
shaderFactory?: ShaderFactory;
|
|
49
|
+
/** Shader assembler. Defaults to the ShaderAssembler.getShaderAssembler() */
|
|
50
|
+
shaderAssembler?: ShaderAssembler;
|
|
49
51
|
};
|
|
50
52
|
/**
|
|
51
53
|
* v9 Model API
|
|
@@ -59,9 +61,11 @@ export declare class Model {
|
|
|
59
61
|
static defaultProps: Required<ModelProps>;
|
|
60
62
|
readonly device: Device;
|
|
61
63
|
readonly id: string;
|
|
64
|
+
readonly source: string;
|
|
62
65
|
readonly vs: string;
|
|
63
66
|
readonly fs: string;
|
|
64
67
|
readonly pipelineFactory: PipelineFactory;
|
|
68
|
+
readonly shaderFactory: ShaderFactory;
|
|
65
69
|
userData: {
|
|
66
70
|
[key: string]: any;
|
|
67
71
|
};
|
|
@@ -98,27 +102,29 @@ export declare class Model {
|
|
|
98
102
|
/** ShaderInputs instance */
|
|
99
103
|
shaderInputs: ShaderInputs;
|
|
100
104
|
_uniformStore: UniformStore;
|
|
101
|
-
_pipelineNeedsUpdate: string | false;
|
|
102
105
|
_attributeInfos: Record<string, AttributeInfo>;
|
|
103
106
|
_gpuGeometry: GPUGeometry | null;
|
|
104
107
|
private _getModuleUniforms;
|
|
105
108
|
private props;
|
|
109
|
+
_pipelineNeedsUpdate: string | false;
|
|
110
|
+
private _needsRedraw;
|
|
111
|
+
private _destroyed;
|
|
112
|
+
/** "Time" of last draw. Monotonically increasing timestamp */
|
|
113
|
+
_lastDrawTimestamp: number;
|
|
106
114
|
constructor(device: Device, props: ModelProps);
|
|
107
115
|
destroy(): void;
|
|
116
|
+
/** Query redraw status. Clears the status. */
|
|
117
|
+
needsRedraw(): false | string;
|
|
118
|
+
/** Mark the model as needing a redraw */
|
|
119
|
+
setNeedsRedraw(reason: string): void;
|
|
108
120
|
predraw(): void;
|
|
109
|
-
draw(renderPass: RenderPass):
|
|
121
|
+
draw(renderPass: RenderPass): boolean;
|
|
110
122
|
/**
|
|
111
123
|
* Updates the optional geometry
|
|
112
124
|
* Geometry, set topology and bufferLayout
|
|
113
125
|
* @note Can trigger a pipeline rebuild / pipeline cache fetch on WebGPU
|
|
114
126
|
*/
|
|
115
|
-
setGeometry(geometry: GPUGeometry | Geometry):
|
|
116
|
-
/**
|
|
117
|
-
* Updates the optional geometry attributes
|
|
118
|
-
* Geometry, sets several attributes, indexBuffer, and also vertex count
|
|
119
|
-
* @note Can trigger a pipeline rebuild / pipeline cache fetch on WebGPU
|
|
120
|
-
*/
|
|
121
|
-
_setGeometryAttributes(gpuGeometry: GPUGeometry): void;
|
|
127
|
+
setGeometry(geometry: GPUGeometry | Geometry | null): void;
|
|
122
128
|
/**
|
|
123
129
|
* Updates the primitive topology ('triangle-list', 'triangle-strip' etc).
|
|
124
130
|
* @note Triggers a pipeline rebuild / pipeline cache fetch on WebGPU
|
|
@@ -126,7 +132,7 @@ export declare class Model {
|
|
|
126
132
|
setTopology(topology: PrimitiveTopology): void;
|
|
127
133
|
/**
|
|
128
134
|
* Updates the buffer layout.
|
|
129
|
-
* @note Triggers a pipeline rebuild / pipeline cache fetch
|
|
135
|
+
* @note Triggers a pipeline rebuild / pipeline cache fetch
|
|
130
136
|
*/
|
|
131
137
|
setBufferLayout(bufferLayout: BufferLayout[]): void;
|
|
132
138
|
/**
|
|
@@ -146,40 +152,27 @@ export declare class Model {
|
|
|
146
152
|
*/
|
|
147
153
|
setInstanceCount(instanceCount: number): void;
|
|
148
154
|
setShaderInputs(shaderInputs: ShaderInputs): void;
|
|
149
|
-
/**
|
|
150
|
-
* Updates shader module settings (which results in uniforms being set)
|
|
151
|
-
*/
|
|
152
|
-
setShaderModuleProps(props: Record<string, any>): void;
|
|
153
155
|
updateShaderInputs(): void;
|
|
154
|
-
/**
|
|
155
|
-
* @deprecated Updates shader module settings (which results in uniforms being set)
|
|
156
|
-
*/
|
|
157
|
-
updateModuleSettings(props: Record<string, any>): void;
|
|
158
156
|
/**
|
|
159
157
|
* Sets bindings (textures, samplers, uniform buffers)
|
|
160
158
|
*/
|
|
161
159
|
setBindings(bindings: Record<string, Binding>): void;
|
|
162
160
|
/**
|
|
163
|
-
*
|
|
164
|
-
* @deprecated WebGL only, use uniform buffers for portability
|
|
165
|
-
* @param uniforms
|
|
166
|
-
* @returns self for chaining
|
|
161
|
+
* Updates optional transform feedback. WebGL only.
|
|
167
162
|
*/
|
|
168
|
-
|
|
163
|
+
setTransformFeedback(transformFeedback: TransformFeedback | null): void;
|
|
169
164
|
/**
|
|
170
165
|
* Sets the index buffer
|
|
171
166
|
* @todo - how to unset it if we change geometry?
|
|
172
167
|
*/
|
|
173
168
|
setIndexBuffer(indexBuffer: Buffer | null): void;
|
|
174
|
-
/**
|
|
175
|
-
* Updates optional transform feedback. WebGL only.
|
|
176
|
-
*/
|
|
177
|
-
setTransformFeedback(transformFeedback: TransformFeedback | null): void;
|
|
178
169
|
/**
|
|
179
170
|
* Sets attributes (buffers)
|
|
180
171
|
* @note Overrides any attributes previously set with the same name
|
|
181
172
|
*/
|
|
182
|
-
setAttributes(buffers: Record<string, Buffer>,
|
|
173
|
+
setAttributes(buffers: Record<string, Buffer>, options?: {
|
|
174
|
+
ignoreUnknownAttributes?: boolean;
|
|
175
|
+
}): void;
|
|
183
176
|
/**
|
|
184
177
|
* Sets constant attributes
|
|
185
178
|
* @note Overrides any attributes previously set with the same name
|
|
@@ -189,7 +182,27 @@ export declare class Model {
|
|
|
189
182
|
* @param constantAttributes
|
|
190
183
|
*/
|
|
191
184
|
setConstantAttributes(attributes: Record<string, TypedArray>): void;
|
|
185
|
+
/**
|
|
186
|
+
* Sets individual uniforms
|
|
187
|
+
* @deprecated WebGL only, use uniform buffers for portability
|
|
188
|
+
* @param uniforms
|
|
189
|
+
*/
|
|
190
|
+
setUniforms(uniforms: Record<string, UniformValue>): void;
|
|
191
|
+
/**
|
|
192
|
+
* @deprecated Updates shader module settings (which results in uniforms being set)
|
|
193
|
+
*/
|
|
194
|
+
updateModuleSettings(props: Record<string, any>): void;
|
|
195
|
+
/** Get the timestamp of the latest updated bound GPU memory resource (buffer/texture). */
|
|
196
|
+
_getBindingsUpdateTimestamp(): number;
|
|
197
|
+
/**
|
|
198
|
+
* Updates the optional geometry attributes
|
|
199
|
+
* Geometry, sets several attributes, indexBuffer, and also vertex count
|
|
200
|
+
* @note Can trigger a pipeline rebuild / pipeline cache fetch on WebGPU
|
|
201
|
+
*/
|
|
202
|
+
_setGeometryAttributes(gpuGeometry: GPUGeometry): void;
|
|
203
|
+
/** Mark pipeline as needing update */
|
|
192
204
|
_setPipelineNeedsUpdate(reason: string): void;
|
|
205
|
+
/** Update pipeline if needed */
|
|
193
206
|
_updatePipeline(): RenderPipeline;
|
|
194
207
|
/** Throttle draw call logging */
|
|
195
208
|
_lastLogTime: number;
|