mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-05-14 19:31:25 +00:00
This CL does the following: * Adds a "transient attachment" bit to texture usage. This bit specifies that the created texture will be used only during this render pass. * Adds a TransientAttachments Feature that gates the usage of transient attachments. * Adds support for transient attachments on Metal, where they're used to create textures as memoryless. * Adds validation tests and an E2T test of the feature. A followup CL will add support in Vulkan. Bug: dawn:1695 Change-Id: I3c7322dd1e4bee113062aae2e0494d292ee8cbc3 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/129080 Commit-Queue: Colin Blundell <blundell@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Kokoro: Kokoro <noreply+kokoro@google.com>
841 B
841 B
Transient Attachments
The transient-attachments
feature allows creation of attachments that allow
render pass operations to stay in tile memory, avoiding VRAM traffic and
potentially avoiding VRAM allocation for the textures.
Example Usage:
wgpu::TextureDescriptor desc;
desc.format = wgpu::TextureFormat::RGBA8Unorm;
desc.size = {1, 1, 1};
desc.usage = wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::TransientAttachment;
auto transientTexture = device.CreateTexture(&desc);
// Can now create views from the texture to serve as transient attachments, e.g.
// as color attachments in a render pipeline.
Notes:
- Only supported usage is wgpu::TextureUsage::RenderAttachment | wgpu::TextureUsage::TransientAttachment
- It is not possible to load from or store to TextureViews that are used as transient attachments