-
Notifications
You must be signed in to change notification settings - Fork 22.5k
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 content for read-write and read-only storageTexture.access #36880
Add content for read-write and read-only storageTexture.access #36880
Conversation
Preview URLs External URLs (1)URL:
(comment last updated: 2024-11-22 09:02:34) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits
- `"read-only"`: Enables WSGL code to read storage textures. | ||
- `"read-write"`: Enables WSGL code to read and write to storage textures. | ||
- `"write-only"`: The default value; Enables WSGL code to write to storage textures. | ||
- `undefined`: Indicates that the entry is not a `storageTexture` type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think undefined
exists: https://gpuweb.github.io/gpuweb/#enumdef-gpustoragetextureaccess
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may have existed at one point, around when I first documented it, but I am not 100% sure. Deleted in my next commit ;-)
- `"write-only"`: The default value; Enables WSGL code to write to storage textures. | ||
- `undefined`: Indicates that the entry is not a `storageTexture` type. | ||
|
||
The `"read-only"` and `"read-write"` values can only be used if the [`"readonly_and_readwrite_storage_textures"`](/en-US/docs/Web/API/WGSLLanguageFeatures#readonly_and_readwrite_storage_textures) WGSL language extension is present in {{domxref("WGSLLanguageFeatures")}}. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also say it generates a GPU validation error when it's not the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done; I've also added a bullet to the "Validation" section.
- `"read-write"`: Enables WSGL code to read and write to storage textures. | ||
- `"write-only"`: The default value; Enables WSGL code to write to storage textures. | ||
|
||
The `"read-only"` and `"read-write"` values can only be used if the [`"readonly_and_readwrite_storage_textures"`](/en-US/docs/Web/API/WGSLLanguageFeatures#readonly_and_readwrite_storage_textures) WGSL language extension is present in {{domxref("WGSLLanguageFeatures")}}. If this is not the case, a {{domxref("GPUValidationError")}} is generated and an invalid {{domxref("GPUBindGroupLayout")}} object is returned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A GPUValidationError is not raised in the content timeline. (https://gpuweb.github.io/gpuweb/#programming-model-timelines). It will be raised later, which means the GPUBindGroupLayout is actually not invalid or valid. It exists.
I would simply remove and an invalid {{domxref("GPUBindGroupLayout")}} object is returned
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, ok, that makes sense. I've made the suggested change, and removed the "Validation" section entry, as it is not relevant there.
This pull request has merge conflicts that must be resolved before it can be merged. |
…_textures-extension
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Description
Chrome 124 supports the
readonly_and_readwrite_storage_textures
language extension (seeWGSLLanguageFeatures
), which allows the"read-write"
and"read-only"
storageTexture.access
types to be set when specifyingstorageTexture
bind group entry types in a bind group layout.This PR adds content that describes the new
access
values to theGPUDevice.createBindGroupLayout
page, and a new, improved "Available features" section that describes the feature and an example showing how to detect the availability of a specific feature to theWGSLLanguageFeatures
page.See https://developer.chrome.com/blog/new-in-webgpu-124#read-only_and_read-write_storage_textures for the data source
Motivation
Additional details
Project issue: #36346.
Related issues and pull requests