@luma.gl/core
Version:
The luma.gl core Device API
62 lines • 2.16 kB
JavaScript
// luma.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors
import { Resource } from "./resource.js";
/**
* A compiled and linked shader program
*/
export class RenderPipeline extends Resource {
get [Symbol.toStringTag]() {
return 'RenderPipeline';
}
/** The merged layout */
shaderLayout;
/** Buffer map describing buffer interleaving etc */
bufferLayout;
/** The linking status of the pipeline. 'pending' if linking is asynchronous, and on production */
linkStatus = 'pending';
/** The hash of the pipeline */
hash = '';
/** Optional shared backend implementation */
sharedRenderPipeline = null;
/** Whether shader or pipeline compilation/linking is still in progress */
get isPending() {
return (this.linkStatus === 'pending' ||
this.vs.compilationStatus === 'pending' ||
this.fs?.compilationStatus === 'pending');
}
/** Whether shader or pipeline compilation/linking has failed */
get isErrored() {
return (this.linkStatus === 'error' ||
this.vs.compilationStatus === 'error' ||
this.fs?.compilationStatus === 'error');
}
constructor(device, props) {
super(device, props, RenderPipeline.defaultProps);
this.shaderLayout = this.props.shaderLayout;
this.bufferLayout = this.props.bufferLayout || [];
this.sharedRenderPipeline = this.props._sharedRenderPipeline || null;
}
static defaultProps = {
...Resource.defaultProps,
vs: null,
vertexEntryPoint: 'vertexMain',
vsConstants: {},
fs: null,
fragmentEntryPoint: 'fragmentMain',
fsConstants: {},
shaderLayout: null,
bufferLayout: [],
topology: 'triangle-list',
colorAttachmentFormats: undefined,
depthStencilAttachmentFormat: undefined,
parameters: {},
varyings: undefined,
bufferMode: undefined,
disableWarnings: false,
_sharedRenderPipeline: undefined,
bindings: undefined,
bindGroups: undefined
};
}
//# sourceMappingURL=render-pipeline.js.map