Search e01
One query across the encyclopedia, books, dictionary, papers, Wikidata and the developer library. Every hit carries its source.
5 results across 6 corpora for GPUDevice: createShaderModule() method.
Developer library 5
WebGPU API
he correct mime type to use for WGSL is `text/wgsl`. To make your shader code available to WebGPU, you have to put it inside a GPUShaderModule via a GPUDevice.createShaderModule() call, passing your shader code as a property inside a descriptor object. For example: ```js const shaderModule = device.createShaderModule({ code: shaders, }); ``` ### Get and configure the canvas context In a render pipeline, we need
GPUShaderModule
thub.io/gpuweb/wgsl/) shader code that can be submitted to the GPU for execution by a pipeline. A `GPUShaderModule` object instance is created using GPUDevice.createShaderModule(). ## Instance properties - label - : A string providing a label that can be used to identify the object, for example in GPUError messages or console warnings. ## Instance methods - getCompilationInfo() - : Returns a Promise that f
GPUDevice
line can be used without any stalling. - createSampler() - : Creates a GPUSampler, which controls how shaders transform and filter texture resource data. - createShaderModule() - : Creates a GPUShaderModule from a string of WGSL source code. - createTexture() - : Creates a GPUTexture in which to store texture data to use in GPU rendering operations. - destroy() - : Destroys the device, preventing further
GPUDevice: createShaderModule() method
WebGPU API The **`createShaderModule()`** method of the GPUDevice interface creates a GPUShaderModule from a string of [WGSL](https://gpuweb.github.io/gpuweb/wgsl/) source code. ## Syntax ```js-nolint createShaderModule(descriptor) ``` ### Parameters - `descriptor` - : An object containing the following properties: - `code` - : A string representing the WGSL source code for the shader module. - `
GPURenderPipeline: getBindGroupLayout() method
ically generate // appropriate bind group layouts const fullscreenQuadPipeline = device.createRenderPipeline({ layout: "auto", vertex: { module: device.createShaderModule({ code: fullscreenTexturedQuadWGSL, }), entryPoint: "vert_main", }, fragment: { module: device.createShaderModule({ code: fullscreenTexturedQuadWGSL, }), entryPoint: "frag_main", targets: [ {