Interface GPU
interface GPU {
__brand: "GPU";
wgslLanguageFeatures: WGSLLanguageFeatures;
getPreferredCanvasFormat(): GPUTextureFormat;
requestAdapter(options?: GPURequestAdapterOptions): Promise<GPUAdapter>;
}
__brand: "GPU";
wgslLanguageFeatures: WGSLLanguageFeatures;
getPreferredCanvasFormat(): GPUTextureFormat;
requestAdapter(options?: GPURequestAdapterOptions): Promise<GPUAdapter>;
}
Index
Properties
Methods
Methods
getPreferredCanvasFormat
- get
Preferred (): GPUTextureFormatCanvas Format Returns an optimal GPUTextureFormat for displaying 8-bit depth, standard dynamic range content on this system. Must only return GPUTextureFormat#"rgba8unorm" or GPUTextureFormat#"bgra8unorm". The returned value can be passed as the GPUCanvasConfiguration#format to GPUCanvasContext#configure calls on a GPUCanvasContext to ensure the associated canvas is able to display its contents efficiently. Note: Canvases which are not displayed to the screen may or may not benefit from using this format.
Returns GPUTextureFormat
requestAdapter
- request
Adapter (options?): Promise<GPUAdapter> Requests an adapter from the user agent. The user agent chooses whether to return an adapter, and, if so, chooses according to the provided options.
Parameters
Optional
options: GPURequestAdapterOptionsCriteria used to select the adapter.
Returns Promise<GPUAdapter>
Nominal type branding. https://github.com/microsoft/TypeScript/pull/33038