Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. GPUComputePipeline
  4. getBindGroupLayout()

GPUComputePipeline: getBindGroupLayout() method

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

Note: This feature is available inWeb Workers.

ThegetBindGroupLayout() method of theGPUComputePipeline interface returns the pipeline'sGPUBindGroupLayout object with the given index (i.e., included in the originatingGPUDevice.createComputePipeline() orGPUDevice.createComputePipelineAsync() call's pipeline layout).

If theGPUComputePipeline was created withlayout: "auto", this method is the only way to retrieve theGPUBindGroupLayouts generated by the pipeline.

Syntax

js
getBindGroupLayout(index)

Parameters

index

A number representing the index of theGPUBindGroupLayout to return.

Return value

AGPUBindGroupLayout object instance.

Validation

The following criteria must be met when callinggetBindGroupLayout(), otherwise aGPUValidationError is generated and an invalidGPUBindGroupLayout object is returned:

Examples

Note:You can see complete working examples withgetBindGroupLayout() in action in theWebGPU samples.

js
// …// Create a compute pipeline using layout: "auto" to automatically generate// appropriate bind group layoutsconst computePipeline = device.createComputePipeline({  layout: "auto",  compute: {    module: shaderModule,    entryPoint: "main",  },});// Create a bind group with the auto-generated layout from the compute pipelineconst computeBindGroup = device.createBindGroup({  layout: computePipeline.getBindGroupLayout(0),  entries: [    {      binding: 0,      resource: { buffer: storageBuffer },    },  ],});// …

Specifications

Specification
WebGPU
# dom-gpupipelinebase-getbindgrouplayout

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp