Editorial review: Update property info to mention GPUTexture as shortcut for default GPUTextureView#41600
Conversation
|
Preview URLs (comment last updated: 2025-10-20 10:00:46) |
| - : 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. |
There was a problem hiding this comment.
Since it's not clear where descriptor comes from, we should add it there and in other places
| - {{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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Description
In Chrome 140+, there are multiple places in WebGPU methods where a
GPUTextureViewwas expected, but now you can specify aGPUTextureas a shorthand, provided a defaultGPUTextureViewis desired (it is equivalent to aGPUTextureViewcreated using a call toGPUTexture.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