Add information on default entryPoint property values#36633
Add information on default entryPoint property values#36633
Conversation
|
Preview URLs
(comment last updated: 2024-11-19 14:51:12) |
| - `entryPoint` | ||
| - `entryPoint` {{optional_inline}} | ||
| - : 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] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
No particular reason; I think you are right. I have updated them to normal paras in the next commit.
| - `entryPoint` {{optional_inline}} | ||
| - : 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Yup, this is correct, good point. I've updated all three similar instances to the suggested form in my next commit.
* 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) ...
Description
In Chrome 121, you can omit the
entryPointproperty values of the compute, fragment, and vertex shader object definitions contained in the configuration objects ofcreateComputePipeline()/createComputePipelineAsync()andcreateRenderPipeline()/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