Adds an optional field to WebGPU texture view creation to request a subset of the usage flags from the source texture. By default, texture view usage inherits from the source texture but there are view formats which can be incompatible with the full set of inherited usages. Adding a usage field to texture view creation allows the user request a subset of the source texture's usages that are valid with the view format and specific to their intended usage of the texture view. WebGPU implementations can also optimize the creation of low level resources and improve performance when using views with more specialized usage flags.
This feature has been approved in W3C GPU for the Web WG meetings including participants from Safari and Firefox: https://github.com/gpuweb/gpuweb/wiki/GPU-Web-2024-07-24#createtexture-does-not-validate-viewformats-against-usage-4426
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
None
All platforms will eventually have support. Will immediately be available on Android, Android WebView, ChromeOS, Mac, and Windows, where hardware support is available. Linux is planned to have WebGPU support in the future, so this feature will become available when WebGPU does.
WebGPU/WGSL have a conformance test suite (https://github.com/gpuweb/cts) that is regularly pulled into Chromium and part of the testing of Dawn/Tint in Chromium. While the CTS can be embedded in WPT, the WebGPU team opted to keep it separate in Chromium testing to use a customized harness for robustness and performance. Tests were added in this PR: https://github.com/gpuweb/cts/commit/1746bcbc10a809cbadb3b131675b885ed08d9da5
No milestones specified
Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).
Noneconst texture = device.createTexture({
size: [4, 4],
format: 'rgba8unorm',
usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.STORAGE_BINDING,
viewFormats: ['rgba8unorm-srgb'],
});
const view = texture.createView({
format: 'rgba8unorm-srgb',
});
Can y'all flip the review bits for privacy/security/enterprise/testing/debuggability?
LGTM2
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CA%2BPGBXss7ZTcRh_fWH%2BkfXKZ0usj_fV6u-W8HEuOEST_z6EFog%40mail.gmail.com.
LGTM3
/Danel
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/0040a029-a992-45c7-b31c-16c5e71ed4a3%40chromium.org.