playcanvas
Version:
PlayCanvas WebGL game engine
79 lines (78 loc) • 2.05 kB
TypeScript
/**
* @import { GraphicsDevice } from '../graphics-device.js'
* @import { Shader } from '../shader.js'
*/
/**
* A WebGPU implementation of the Shader.
*
* @ignore
*/
export class WebgpuShader {
/**
* @param {Shader} shader - The shader.
*/
constructor(shader: Shader);
/**
* Transpiled vertex shader code.
*
* @type {string|null}
*/
_vertexCode: string | null;
/**
* Transpiled fragment shader code.
*
* @type {string|null}
*/
_fragmentCode: string | null;
/**
* Compute shader code.
*
* @type {string|null}
*/
_computeCode: string | null;
/**
* Name of the vertex entry point function.
*/
vertexEntryPoint: string;
/**
* Name of the fragment entry point function.
*/
fragmentEntryPoint: string;
/**
* Name of the compute entry point function.
*/
computeEntryPoint: string;
/** @type {Shader} */
shader: Shader;
computeUniformBufferFormats: any;
computeBindGroupFormat: any;
/**
* Free the WebGPU resources associated with a shader.
*
* @param {Shader} shader - The shader to free.
*/
destroy(shader: Shader): void;
createShaderModule(code: any, shaderType: any): any;
getVertexShaderModule(): any;
getFragmentShaderModule(): any;
getComputeShaderModule(): any;
processGLSL(): void;
processed: any;
processWGSL(): void;
transpile(src: any, shaderType: any, originalSrc: any): any;
get vertexCode(): string;
get fragmentCode(): string;
/**
* Dispose the shader when the context has been lost.
*/
loseContext(): void;
/**
* Restore shader after the context has been obtained.
*
* @param {GraphicsDevice} device - The graphics device.
* @param {Shader} shader - The shader to restore.
*/
restoreContext(device: GraphicsDevice, shader: Shader): void;
}
import type { Shader } from '../shader.js';
import type { GraphicsDevice } from '../graphics-device.js';