-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathnull-render-pipeline.ts
More file actions
46 lines (38 loc) · 1.17 KB
/
null-render-pipeline.ts
File metadata and controls
46 lines (38 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// luma.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors
import type {RenderPipelineProps, Binding, RenderPass, VertexArray} from '@luma.gl/core';
import {RenderPipeline} from '@luma.gl/core';
import type {NullDevice} from '../null-device';
import {NullShader} from './null-shader';
/** Creates a new render pipeline */
export class NullRenderPipeline extends RenderPipeline {
device: NullDevice;
readonly handle = null;
vs: NullShader;
fs: NullShader;
constructor(device: NullDevice, props: RenderPipelineProps) {
super(device, props);
this.device = device;
this.vs = props.vs as NullShader;
this.fs = props.fs as NullShader;
this.shaderLayout = props.shaderLayout || {
attributes: [],
bindings: [],
uniforms: []
};
}
draw(options: {
renderPass: RenderPass;
vertexArray: VertexArray;
vertexCount?: number;
instanceCount?: number;
bindings?: Record<string, Binding>;
uniforms?: Record<string, unknown>;
}): boolean {
const {renderPass, vertexArray} = options;
vertexArray.bindBeforeRender(renderPass);
vertexArray.unbindAfterRender(renderPass);
return true;
}
}