webgpuPipelineContext.ts 980 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { IPipelineContext } from '../IPipelineContext';
  2. import { Nullable } from '../../types';
  3. import { WebGPUEngine } from '../webgpuEngine';
  4. /** @hidden */
  5. export class WebGPUPipelineContext implements IPipelineContext {
  6. public engine: WebGPUEngine;
  7. public stages: Nullable<GPURenderPipelineStageDescriptor>;
  8. // public vertexInputDescriptor: GPUVertexAttributeDescriptor[] = [];
  9. public vertexShaderCode: string;
  10. public fragmentShaderCode: string;
  11. public renderPipeline: GPURenderPipeline;
  12. public bindGroupLayouts: (GPUBindGroupLayout | undefined)[];
  13. public onCompiled?: () => void;
  14. public get isAsync() {
  15. return false;
  16. }
  17. public get isReady(): boolean {
  18. if (this.stages) {
  19. return true;
  20. }
  21. return false;
  22. }
  23. public _handlesSpectorRebuildCallback(onCompiled: (program: any) => void): void {
  24. // Nothing to do yet for spector.
  25. }
  26. }