Skip to content

Editorial review: Update property info to mention GPUTexture as shortcut for default GPUTextureView#41600

Merged
chrisdavidmills merged 3 commits intomdn:mainfrom
chrisdavidmills:gputexture-for-default-gputextureview
Oct 20, 2025
Merged

Editorial review: Update property info to mention GPUTexture as shortcut for default GPUTextureView#41600
chrisdavidmills merged 3 commits intomdn:mainfrom
chrisdavidmills:gputexture-for-default-gputextureview

Conversation

@chrisdavidmills
Copy link
Copy Markdown
Contributor

Description

In Chrome 140+, there are multiple places in WebGPU methods where a GPUTextureView was expected, but now you can specify a GPUTexture as a shorthand, provided a default GPUTextureView is desired (it is equivalent to a GPUTextureView created using a call to GPUTexture.createView() with no descriptor specified).

See https://developer.chrome.com/blog/new-in-webgpu-140#shorthand_for_using_texture_where_texture_view_is_used.

This PR updates the content to mention this available alternative value in the appropriate places.

Motivation

Additional details

Related issues and pull requests

@chrisdavidmills chrisdavidmills requested a review from a team as a code owner October 20, 2025 09:08
@chrisdavidmills chrisdavidmills requested review from wbamberg and removed request for a team October 20, 2025 09:08
@github-actions github-actions bot added the Content:WebAPI Web API docs label Oct 20, 2025
@chrisdavidmills chrisdavidmills changed the title Update property info to mention GPUTexture as shortcut for default GPUTextureView Technical review: Update property info to mention GPUTexture as shortcut for default GPUTextureView Oct 20, 2025
@chrisdavidmills
Copy link
Copy Markdown
Contributor Author

cc @beaufortfrancois

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 20, 2025

Preview URLs

(comment last updated: 2025-10-20 10:00:46)

Copy link
Copy Markdown
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 nit

- : A {{domxref("GPUTextureView")}} object representing the texture subresource that will receive the resolved output for this color attachment if `view` is multisampled.
- : An object representing the texture subresource that will receive the resolved output for this color attachment if `view` is multisampled. This can be one of the following:
- {{domxref("GPUTextureView")}}
- {{domxref("GPUTexture")}}: Can be used in place of a `GPUTextureView`, provided a default view is desired. When used in this context, `GPUTexture` is equivalent to a `GPUTextureView` object created using a {{domxref("GPUTexture.createView()")}} call with no `descriptor` object specified.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since it's not clear where descriptor comes from, we should add it there and in other places

Suggested change
- {{domxref("GPUTexture")}}: Can be used in place of a `GPUTextureView`, provided a default view is desired. When used in this context, `GPUTexture` is equivalent to a `GPUTextureView` object created using a {{domxref("GPUTexture.createView()")}} call with no `descriptor` object specified.
- {{domxref("GPUTexture")}}: Can be used in place of a `GPUTextureView`, provided a default view is desired. When used in this context, `GPUTexture` is equivalent to a `GPUTextureView` object created using a {{domxref("GPUTexture.createView(descriptor)")}} call with no `descriptor` object specified.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I agree with that. If you don't know what it means, you can click the link and look at the reference page to find out. We don't tend to write links to method ref pages with arguments specified, even if they have mandatory arguments.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe replacing no descriptor object with no parameter then?

    - {{domxref("GPUTexture")}}: Can be used in place of a `GPUTextureView`, provided a default view is desired. When used in this context, `GPUTexture` is equivalent to a `GPUTextureView` object created using a {{domxref("GPUTexture.createView()")}} call with no parameter specified.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fair, that is more intuitive. I've made the change, although I've used "argument" in place of "parameter". I think this is the more correct term when you are calling the function as opposed to defining it, although most people tend to use them interchangeably.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the size/s [PR only] 6-50 LoC changed label Oct 20, 2025
@chrisdavidmills chrisdavidmills changed the title Technical review: Update property info to mention GPUTexture as shortcut for default GPUTextureView Editorial review: Update property info to mention GPUTexture as shortcut for default GPUTextureView Oct 20, 2025
Copy link
Copy Markdown
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 591a2a2 into mdn:main Oct 20, 2025
7 of 8 checks passed
@chrisdavidmills chrisdavidmills deleted the gputexture-for-default-gputextureview branch October 20, 2025 14:59
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.

4 participants