Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add information on default entryPoint property values #36633

Merged
merged 4 commits into from
Nov 20, 2024

Conversation

chrisdavidmills
Copy link
Contributor

Description

In Chrome 121, you can omit the entryPoint property values of the compute, fragment, and vertex shader object definitions contained in the configuration objects of createComputePipeline()/createComputePipelineAsync() and createRenderPipeline()/createRenderPipelineAsync(), provided your shader code contains a single function that the browser can determine as the default entry point.

This PR adds information and validation entries about default entry points to the above pages.

See https://developer.chrome.com/blog/new-in-webgpu-121#default_entry_points_to_shader_modules for evidence of the addition.

Motivation

Additional details

Related issues and pull requests

Project issue: #36354

@chrisdavidmills chrisdavidmills requested a review from a team as a code owner November 3, 2024 16:41
@chrisdavidmills chrisdavidmills requested review from wbamberg and removed request for a team November 3, 2024 16:41
@github-actions github-actions bot added Content:WebAPI Web API docs size/s [PR only] 6-50 LoC changed labels Nov 3, 2024
Copy link
Contributor

github-actions bot commented Nov 3, 2024

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 with nits

- : The name of the function in the `module` that this stage will use to perform its work. The corresponding shader function must have the `@compute` attribute to be identified as this entry point. See [Entry Point Declaration](https://gpuweb.github.io/gpuweb/wgsl/#entry-point-decl) for more information.
> [!NOTE]
Copy link
Collaborator

Choose a reason for hiding this comment

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

What's the reasoning for making this a note? I don't think it needs to be, it works just as well as a paragraph.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No particular reason; I think you are right. I have updated them to normal paras in the next commit.

- : The name of the function in the `module` that this stage will use to perform its work. The corresponding shader function must have the `@compute` attribute to be identified as this entry point. See [Entry Point Declaration](https://gpuweb.github.io/gpuweb/wgsl/#entry-point-decl) for more information.
> [!NOTE]
> You can omit the `entryPoint` property if your shader code contains a single compute shader entry point function — the browser will use this as the default entry point. If `entryPoint` is omitted and the browser cannot determine a default entry point, a {{domxref("GPUValidationError")}} is generated and the resulting {{domxref("GPUComputePipeline")}} will be invalid.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does "a single compute shader entry point function" mean "a single function with the @compute attribute set"? Is it worth saying? It's a little odd (to me) that we use this precise formulation in the previous para, then the more general one here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, this is correct, good point. I've updated all three similar instances to the suggested form in my next commit.

@wbamberg wbamberg added the awaiting response Awaiting for author to address review/feedback label Nov 6, 2024
Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

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

👍 thanks Chris!

@wbamberg wbamberg merged commit dad9fbc into mdn:main Nov 20, 2024
8 checks passed
@chrisdavidmills chrisdavidmills deleted the shader-module-default-entry-points branch November 20, 2024 09:16
wbamberg added a commit to wbamberg/content that referenced this pull request Nov 27, 2024
* origin/xss-guide: (284 commits)
  Add information on default entryPoint property values (mdn#36633)
  Bump husky from 9.1.6 to 9.1.7 (mdn#36863)
  fix(performance): Typo '50ms seconds' (mdn#36861)
  Add spec_url & add note for bcd for `<frequency>` and `<frequency-percentage>` (mdn#36848)
  addresses 36583: summary icon styles (mdn#36691)
  Remove "simple" part 3: change to "basic"  (mdn#36762)
  the default option of a select (mdn#36658)
  docs(css): Add support for `<string>` in `syntax` descriptor of @Property at-rule (mdn#36655)
  Fix parameter syntax for `Navigation.updateCurrentEntry()` (mdn#36852)
  Update CSP source expression reference (mdn#36792)
  chore(http): Refresh headers docs (d-k) (mdn#36075)
  chore(http): Refresh headers r-s (mdn#36590)
  Updated index.md (mdn#36845)
  fix : wrong method name (mdn#36843)
  Remove all redirects to other locales (mdn#36811)
  fix typos (mdn#36837)
  docs: update Accept-Charset status (mdn#36822)
  updateSelection: make more intuitive (mdn#36834)
  updateText: Remove false information (mdn#36832)
  DOMRect instance properties (mdn#36704)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting response Awaiting for author to address review/feedback 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