mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-14 03:11:29 +00:00
This method will return supported usage flags that can be used to create a swap chain. Bug: dawn:1760 Change-Id: I7699c2c4ef7142c6bd06e72239d6e4f9112f15a3 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127440 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Quyen Le <lehoangquyen@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org>
760 B
760 B
Surface Capabilities
The surface-capabilities
feature allows querying a surface's capabilities and creating a swap chain with additional usage flags.
Additional functionality:
- Adds
wgpu::Device::GetSupportedSurfaceUsage(wgpu::Surface)
method for querying the surface's supported usage flags. One or the combination of these flags can be used to create a swap chain.
Example Usage:
wgpu::TextureUsage supportedUsage = device.GetSupportedSurfaceUsage(surface);
wgpu::SwapChainDescriptor desc = {};
// set usage flags.
desc.usage = supportedUsage;
device.CreateSwapChain(surface, &desc);
Notes:
- If this feature is not enabled, only
wgpu::TextureUsage::RenderAttachment
flag is allowed to be used inwgpu::SwapChainDescriptor::usage
.