Skip to content

Conversation

@chrisdavidmills
Copy link
Contributor

Description

As of Chrome 135, GPUDevice.createPipelineLayout supports null entries in the bindGroupLayouts array. See https://developer.chrome.com/blog/new-in-webgpu-135#allow_creating_pipeline_layout_with_null_bind_group_layout for details.

This PR adds details for this feature, plus a quick example snippet.

Motivation

Additional details

Related issues and pull requests

@chrisdavidmills chrisdavidmills requested a review from a team as a code owner October 16, 2025 13:21
@chrisdavidmills chrisdavidmills requested review from sideshowbarker and removed request for a team October 16, 2025 13:21
@github-actions github-actions bot added the Content:WebAPI Web API docs label Oct 16, 2025
@chrisdavidmills
Copy link
Contributor Author

cc @beaufortfrancois

@github-actions github-actions bot added the size/s [PR only] 6-50 LoC changed label Oct 16, 2025
@chrisdavidmills chrisdavidmills removed the request for review from sideshowbarker October 16, 2025 13:22
@chrisdavidmills chrisdavidmills changed the title Add details and example for null bindGroupLayouts entries Technical review: Add details and example for null bindGroupLayouts entries Oct 16, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2025

Preview URLs

External URLs (1)

URL: /en-US/docs/Web/API/GPUDevice/createPipelineLayout
Title: GPUDevice: createPipelineLayout() method

(comment last updated: 2025-10-17 13:24:31)

Copy link
Contributor

@beaufortfrancois beaufortfrancois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

In this snippet, we create three bind group layouts, with bind group layout 1 representing fragment data and bind group layout 2 representing vertex data. If we want to create a pipeline that uses only bind group layouts 0 and 2, we can pass `null` for bind group layout 1 and then render without a fragment shader.

```js
const bgl0 = myDevice.createBindGroupLayout({ entries: myGlobalEntries });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: maybe use device to match the example above

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, done.

Copy link
Member

@pepelsbey pepelsbey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thank you :)

@chrisdavidmills chrisdavidmills merged commit a854d5e into mdn:main Oct 17, 2025
8 checks passed
@chrisdavidmills chrisdavidmills deleted the gpupipelinelayout-null-bindgrouplayouts branch October 17, 2025 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants