src/libANGLE/renderer/wgpu/FramebufferWgpu.cpp


Log

Author Commit Date CI Message
Liza Burakova ca2e588b 2024-09-12T14:20:33 WebGPU: Add support for depth/stencil clears This CL also adds helper methods to create webgpu depth/stencil attachments for a render pass descriptor, as well as depth/stencil attachment images. Bug: angleproject:42267012 Change-Id: Iebef99ba34db2e50f56449d0737b3dbb03b90f2e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5750001 Commit-Queue: Liza Burakova <liza@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Liza Burakova 3e4fa128 2024-08-05T16:20:30 Store ImageHelper's queue by mip levels. This change converts ImageHelper's mSubresourceQueue to store a vector of updates for each mip level. This allows updates to be flushed per mip level. This also adds a call in the RenderTargetWgpu to flush updates such that now when a framebuffer is flushing updates to color attachments the associated render target ensures that only updates associated with its mip level are flushed. Bug: angleproject:42267012 Change-Id: I1abdbc842cf18b1bd897037bf11aeea9c6d09e14 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5759469 Reviewed-by: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org>
Geoff Lang 641bc04a 2024-07-30T21:25:44 WebGPU: Use the correct source format for ReadPixels ReadPixels was using the format of the destination buffer which works correctly for RGBA8 -> RGBA/UNSIGNED_BYTE but runs the wrong conversion functions for other formats. Bug: angleproject:356399840 Bug: angleproject:42267090 Change-Id: I7c46add3f643017f454136135afef697847a2383 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5748446 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 8446bbd6 2024-07-30T21:22:50 WebGPU: Remove ASSERT in depth/stencil clears Instead of asserting that we are not clearing depth or stencil, just log an UNIMPLEMENTED and skip the call. This allows many dEQP tests to run without crashing on the ASSERT. Bug: angleproject:356399840 Change-Id: Icfe7a77d7128e679501da42023601217c7b0e6c8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5748445 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 84e54d88 2024-07-22T14:39:22 WebGPU: Add command buffers and renderpass management Add a CommandBuffer class to serialize and replay WebGPU commands. Only Draw and SetPipeline are implemented in this patch. Manage render pass begin and end events due to framebuffer changes and swapping. Handle the color mask dirty bits so that a non-zero color mask will be used. All togther, this is enough to draw a triangle using a hard-coded shader without inputs. Bug: angleproject:0 Change-Id: I0fbf0296563c02c7f0774ad4197b83f4c93c22bb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5731594 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang c4274d54 2024-04-29T11:47:34 WebGPU: Add pipeline creation and caching. Bug: angleproject:342213825 Change-Id: I303f193d30fd6b9820efaefcae64e11042888009 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5497535 Reviewed-by: Liza Burakova <liza@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 85e2e6a9 2024-05-08T12:31:37 WebGPU: Add Window and Pbuffer surfaces. Bug: angleproject:342213844 Change-Id: I58465bdf895b4bab63ec3c74e326c6be4827bf60 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5525974 Reviewed-by: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Shahbaz Youssefi d193d51b 2024-06-17T22:46:08 Replace issue ids post migration to new issue tracker This change replaces anglebug.com/NNNN links. Bug: None Change-Id: I8ac3aec8d2a8a844b3d7b99fc0a6b2be8da31761 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5637912 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
Liza Burakova 657c8c0a 2024-06-04T15:16:20 Add optimization to defer clear calls. This change adds a new SubresourceUpdate struct that will hold either an update for a clear call or a texture upload in an ImageHelper's update queue. It also adds logic to defer clear calls similar to Vulkan's, where clears are deferred if there is not an active render pass. Draw based clears are not yet supported, so the optimization does not handle those yet. Bug: angleproject:8582 Change-Id: I3ee010fa64745871835d53ce0ccb56e3fdd74550 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5554984 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org>
Geoff Lang 394e8767 2024-05-08T15:18:37 WebGPU: Fix accumulating mCurrentColorAttachments. mCurrentColorAttachments was not being cleared so multiple clear operations would have incorrect color attachments. Comparing against the previous RenderPassDescriptor also compared the same color attachment memory since the same scratch buffer was used to generate the new descriptor. Bug: angleproject:8582 Change-Id: I9026007607941b92856728b421bc43812195ca57 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5526978 Reviewed-by: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org>
Liza Burakova 36cd4c1f 2024-05-08T12:27:22 Adding basic readPixels. This change adds to methods in ImageHelper to read texture data. It also implements FramebufferWgpu::readPixels to get the parameters and read the texture data from an ImageHelper that's stored in mRenderTargetCache. Bug: angleproject:8653 Change-Id: I349ed8a0ae3d8d0e187c658f3402c4f8cac23eb8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5441353 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Liza Burakova 1d0ef518 2024-05-07T16:56:43 Fixing glClear tests. This CL makes a few changes to fix up the basic glClear test RGBA8Framebuffer, as well as adding a test that uploads a texture before clearing a RGBA8 framebuffer. It moves the wgpu::RenderPassDescriptor(RPD), as well as helper methods for comparing RPDs from the context to the framebuffer. The color attachments that are created in when FramebufferWgpu::clear is called are also stored in the framebuffer now as well. This CL also changes texture creation to use the RGBA8Unorm format instead of RGBA8Uint format. It also adds the wgpu viewFormats parameter to an ImageHelper. Future formats support is still TBD. Bug: angleproject:8582 Change-Id: Idfc4182eb4d6de8a771f2f91d337564ee71df010 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5503549 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org>
Geoff Lang f4485224 2024-04-05T10:29:23 WebGPU: Implement glBufferData and glBufferSubData Define several usages for WebGPU buffers that map to wgpu buffer usage flags. Maintain a set of buffers by usage and a serial of the one with the most recent data. Defer creation of the buffer as long as possible to take advantage of the WebGPU mapAtCreation flag for data upload. If we ever have to unmap these buffers, staging buffers must be used to upload afterwards. Add some helpers for getting Device and Instance from a gl::Context. Bug: angleproject:8654 Change-Id: Ibb8147119af8a98738fc4d579830a02ccaa1d7c5 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5426813 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org>
Matthew Denton be42f20b 2024-03-22T05:45:46 Start implementing glClear Currently, because both SurfaceWgpu::getAttachmentRenderTarget() and TextureWgpu::getAttachmentRenderTarget() are unimplemented, there is no actual RenderTargetWgpu in the RenderTargetCache to clear. Bug: angleproject:8582 Change-Id: I9ad33c57d533d81178d7d2a802d35b106ece5848 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5388076 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Matthew Denton eacd6acd 2024-03-22T05:38:13 Add RenderTargetCache to FramebufferWgpu ...and update it based on dirty bits. Bug: angleproject:8582 Change-Id: If227392b24b3fc649d48cb1bce1144400cd98d70 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5386900 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Liza Burakova f2c00e8c 2024-01-18T18:36:33 Adding Dawn stub backend to ANGLE Bug: angleproject:8473 Change-Id: I81ea83986e4e566169aa82250b5cfb727985ed01 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5201413 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>