src/libANGLE/renderer/wgpu/wgpu_utils.cpp


Log

Author Commit Date CI Message
Liza Burakova bc40362b 2025-02-18T13:24:31 Add line loop emulation for draw arrays Bug: angleproject:383356846 Change-Id: I43f4835e17ecb2401418f77555fd70332612e1bf Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6090912 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Yuly Novikov 91deaea3 2025-02-13T13:57:37 Roll third_party/dawn/ 1eca38fa5..8119dbd27 (1982 commits; 30 trivial rolls) https://dawn.googlesource.com/dawn.git/+log/1eca38fa5236..8119dbd27471 $ git log 1eca38fa5..8119dbd27 --date=short --no-merges --format='%ad %ae %s' 2025-02-12 zhuangxu Set MacOS deployment target to 11.0 when building with CMake 2025-02-12 dsinclair Revert "Remove stale WebGPU Compat CTS expectations" 2025-02-12 rharrison [tint][ir][fuzz] Add missing capability to tint::hlsl::writer::IRFuzzer 2025-02-11 shrekshao [Compat] Remove gles min31 end2end suppressions 2025-02-11 shrekshao [Compat] Fix toggle string for UseBlitForRG11B10UfloatTextureCopy 2025-02-11 rharrison [tint][ir][val] Add operand and result checks for MemberBuiltinCall 2025-02-11 rharrison [tint][ir][val] Check InstructionResult->Instruction is inst 2025-02-11 jrprice [node] Support subgroupMatrixConfigs query in dawn.node 2025-02-11 jrprice [vulkan] Enable subgroup matrix feature 2025-02-11 ynovikov Remove stale WebGPU Compat CTS expectations 2025-02-11 ynovikov Remove stale WebGPU CTS expectations 2025-02-11 dawn-autoroll Roll ANGLE from e746fb068fd3 to 19c5293e1347 (5 revisions) 2025-02-11 jrprice [metal] Enable subgroup matrix feature 2025-02-11 jrprice [dawn] Add SubgroupMatrixConfigs to adapter info 2025-02-11 kylechar Skip setting Vulkan object labels 2025-02-11 dsinclair [spirv-reader][ir] Add derivative operations. 2025-02-11 lehoangquyen D3D11: skip waiting on the fence that is owned by the same queue. 2025-02-11 dawn-autoroll Roll vulkan-deps from cd5e835851d1 to a88fd25a6a0d (8 revisions) 2025-02-11 dsinclair [spirv-reader][ir] Cleanup duplicate argument code. 2025-02-11 jrprice [dawn] Add feature for subgroup matrix extension 2025-02-11 dsinclair [spirv-reader][ir] Add support for `OpAny`. 2025-02-11 dsinclair [spirv-reader][ir] Add support for `OpAll` 2025-02-11 dsinclair [spirv-reader][ir] Add support for `OpBitReverse`. 2025-02-11 cwallez [tint] Make type::BindingArray use ArrayCount 2025-02-11 rharrison [tint][ir][val] Add additional checking to builtin calls 2025-02-11 dsinclair [spirv-reader][ir] Support `OpBitFieldUExtract`. 2025-02-11 lehoangquyen D3D11: return error if D3D feature level < 11.0 2025-02-11 shaoboyan Dawn Native: Setup ClampFragDepth offset in Vulkan Backend 2025-02-10 dawn-autoroll Roll ANGLE from c4caed5f649d to e746fb068fd3 (8 revisions) 2025-02-10 gman Compat: Fixup Device Limits 2025-02-10 dsinclair [spirv-reader][ir] Support `OpBitFieldSExtract`. 2025-02-10 dsinclair [spirv-reader][ir] Support `OpBitFieldInsert`. 2025-02-10 brandon1.jones Add Missing Synchronization For D3D12 Shared Buffers 2025-02-10 ynovikov Skip more textureSample tests on WebGPU CTS compat Android 2025-02-10 cwallez [dawn][frontend] Fix error message when @group > maxBindGroups 2025-02-10 dawn-autoroll Roll SwiftShader from 5017ce3c800e to 720189cae847 (1 revision) 2025-02-10 titouan Include tint fuzzers in high-end fuzzer build. 2025-02-10 dsinclair [spirv-reader][ir] Support `OpBitCount`. 2025-02-10 dawn-autoroll Roll ANGLE from 38aa0780bb36 to c4caed5f649d (28 revisions) 2025-02-10 jrprice [spirv] Require Vulkan Memory Model when fuzzing subgroup matrices 2025-02-10 jwata infra: Add project property to $build/siso 2025-02-10 dawn-autoroll Roll vulkan-deps from b4c8dd090b72 to cd5e835851d1 (1 revision) 2025-02-09 ynovikov Skip textureSample tests on WebGPU CTS compat Android 2025-02-09 dawn-autoroll Roll vulkan-deps from dbe0a14ab512 to b4c8dd090b72 (1 revision) 2025-02-08 ynovikov Remove stale WebGPU Compat CTS expectations 2025-02-08 ynovikov Remove stale WebGPU CTS expectations 2025-02-08 ynovikov Generalize Linux NVIDIA WebGPU CTS expectation 2025-02-07 dawn-autoroll Roll vulkan-deps from c32804ca5a39 to dbe0a14ab512 (9 revisions) 2025-02-07 shrekshao [Compat] fix glsl name collisions between stages for handle 2025-02-07 shrekshao Compat suppress min es31 failure tests (...) 2024-08-15 rharrison [tint][ir][val] Improve checks on Returns 2024-08-15 petermcneeley [tint] Minor follow-up fix for insert before 2024-08-15 dawn-autoroll Roll ANGLE from 2003e06230b1 to 83ca89e58cef (6 revisions) 2024-08-15 dsinclair Allow marking expectations as INVALID. 2024-08-15 bsheedy Suppress additional Linux/NVIDIA failures 2024-08-15 chouinard Generate missing hlsl e2e tests 2024-08-15 petermcneeley [tint] MSL texture array negative integer clamp 2024-08-15 dsinclair Remove the CTS cache code 2024-08-15 amaiorano Generated missing tint e2e tests for ir.dxc.hlsl 2024-08-15 jiawei.shao Tint: Add validations on the type of `clip_distances` 2024-08-15 dawn-autoroll Roll ANGLE from 6fddb18d77a3 to 2003e06230b1 (6 revisions) 2024-08-15 jiawei.shao Tint: Add WGSL extension and built-in variable `clip_distances` 2024-08-15 jiawei.shao Remove `DeviceBase::ForceSetToggleForTesting` 2024-08-15 jiawei.shao Rename `BufferBase::GetUsage` and `BufferBase::GetUsageExternalOnly` 2024-08-15 bsheedy Suppress 16" Macbook failures 2024-08-14 rharrison [tint][ir][val] Check swizzles are well formed 2024-08-14 chouinard [tint] Implement quadSwapX, Y and Diagonal 2024-08-14 amaiorano [hlsl] Emit mip level 0 for storage textures 2024-08-14 amaiorano Regen ir.fxc.hlsl files 2024-08-14 jrprice [benchmark] Add --check-stale option 2024-08-14 dawn-autoroll Roll vulkan-deps from c297ee8a1d20 to 7660e21e64db (3 revisions) 2024-08-14 amaiorano Fix DXC roll 2024-08-14 dawn-autoroll Roll ANGLE from 5967afe70699 to 6fddb18d77a3 (3 revisions) 2024-08-14 dneto [tint] validate clamp const low <= const high when first arg is runtime-eval 2024-08-14 chouinard [tint] Implement quadBroadcast 2024-08-14 dawn-autoroll Roll ANGLE from fdd26da99a12 to 5967afe70699 (6 revisions) 2024-08-14 jrprice [benchmark][msl] Flatten bindings 2024-08-14 jrprice [benchmark] Split generated shaders into multiple lines 2024-08-14 jiawei.shao Don't check adapter nullability in the constructor of DeviceBase 2024-08-14 jrprice [benchmark] Generate map directly 2024-08-14 jrprice [benchmark] Convert SPIR-V when generating header 2024-08-14 jrprice [benchmark] Check in the generated header 2024-08-14 jrprice [benchmark] Remove spv_reader and wgsl_writer deps 2024-08-13 enga Add DeviceGetAdapter and AdapterGetInstance to client_side_commands 2024-08-13 jrprice [benchmark] Don't convert SPIR-V to WGSL at init 2024-08-13 rharrison [tint][ir][val] Check disards in validator 2024-08-13 chouinard [tint] Implement subgroupShuffleXor, Up and Down 2024-08-13 senorblanco Fix texture-only arg in combine samplers transform. 2024-08-13 jrprice [spirv] Remove ast_generate_bindings 2024-08-13 dawn-autoroll Roll vulkan-deps from 77d583f37170 to c297ee8a1d20 (3 revisions) 2024-08-13 jrprice [tint] Remove the quantizeToF16 AST polyfill 2024-08-13 jrprice [spirv] Remove AST backend 2024-08-13 jrprice [loopy] Switch to IR version of SPIR-V backend 2024-08-13 shrekshao [Compat] Use @size attribute for glsl pad struct 2024-08-13 jrprice Reland "[tint][benchmark] Generate depfile for inputs" 2024-08-13 jrprice [spirv] Move E2E expectations to default paths 2024-08-13 jrprice [spirv] Remove AST E2E expectations 2024-08-13 jrprice [tint] Only allow --use-ir with WIP IR backends 2024-08-13 dawn-autoroll Roll ANGLE from f8fc8ac36280 to fdd26da99a12 (4 revisions) 2024-08-13 dawn-autoroll Manual roll vulkan-deps from a5d4d42457c3 to 77d583f37170 (8 revisions) Created with: roll-dep third_party/dawn Bug: angleproject:396213611 Change-Id: I124bbd59dccd14d8609c37ef62ccdd4455897b2c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6270256 Auto-Submit: Yuly Novikov <ynovikov@chromium.org> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang e746fb06 2025-01-23T13:23:30 WebGPU: Implement blending Constant alpha is not handled yet. It needs to be emualted or added to WebGPU. Bug: angleproject:370690274 Change-Id: I5f8402f74ab08345b2f02c18e2d43fa39b2479a7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6194554 Reviewed-by: Liza Burakova <liza@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 9f8d7cc2 2025-01-23T13:27:19 WebGPU: Stream incompatible vertex and index data. Support reading back index and vertex buffers to stream incompatible source data. For now this includes: * Non-multiple-of-4 stride vertex data * Stride not a multiple of the type size * Unsigned byte indices Fix fallback formats so that all GLES formats have a fallback. Fix CopyToFloatVertexData writing the alpha channel as Float32One with a static_cast which converted Float32One (an integer) to a float instead of bit-casting. Bug: angleproject:368602384 Change-Id: I7eb1ba7ad1ec4292060c18de22f5948136cbb0a3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6194556 Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Liza Burakova 40523499 2025-01-29T12:13:45 WebGPU: Emulate line loops for drawElements Bug: angleproject:383356846 Change-Id: I82a6dfad4a1c5d434f029701611e4b61344655f8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6086120 Commit-Queue: Liza Burakova <liza@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 885a8060 2025-01-24T12:27:10 WebGPU: Implement depth/stencil test. Force the compare function to Always when depth or stencil tests are disabled. Bug: angleproject:392604945 Change-Id: I67265b2e5eabe8e9fc3d1222140ee1b6a7c5cefa Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6198040 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org>
Matthew Denton 4a835cf2 2024-11-01T13:31:00 WebGPU: send uniforms to GPU for use in shader Basic uniforms should now be accessible in the shader during a draw call, rather than just via glGetUniform*(). This is unoptimized and creates a new GPU-side copy of all the uniforms, every time any uniform changes. This sets up the bind group layout for a pipeline and sets the bind groups in the renderer pass. Right now these bind groups only contain the default uniform blocks, but in the future will need to contain textures, samplers, and non-default uniform blocks (UBOs). Bug: angleproject:376553328 Change-Id: I50891b81ab2ee374d674213257f76319c0222120 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5980972 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>
Geoff Lang 0b610712 2024-09-20T12:00:17 WebGPU: Sync index buffers, add indexed draw calls Bug: angleproject:368600230 Change-Id: Ibf1c4921635b525b7650e70ce7dc939e2bad2ebb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5828229 Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
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 84492ff3 2024-09-10T13:11:07 Sync vertex attributs in VertexArrayWgpu. This change only sets vertex attributes within VertexArrayWgpu and sets them in the render pipeline description owned by the context. It does not yet set attributes in the output pipeline created in CreatePipeline, as vertex buffers are also not set yet. Bug: angleproject:359823692 Change-Id: I1c3848e15d790026d53d4ab5614b1125f773e06a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5781788 Commit-Queue: Liza Burakova <liza@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
Geoff Lang 8522e835 2024-08-26T20:46:45 WebGPU: Avoid poping error scopes too many times The ErrorScope RAII wrapper would pop the webgpu error scope multiple times if the explicit PopScope funciton was called before the destructor. Bug: angleproject:362191737 Change-Id: I8caa7ab39addf03bc09a7cce517cde800c91653c Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5815568 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org>
Geoff Lang e10e31ed 2024-08-26T12:56:42 WebGPU: Add error handling macros for debugging. Add a ANGLE_WGPU_SCOPED_DEBUG_TRY to create an error scope, execute some commands and pop the scope in builds with assertions enabled. A follow-up with full error handling at frame boundaries is still needed. Bug: angleproject:362191737 Change-Id: I4af9e1587f6d70bf14a3f6435b487e26424624ef Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5813006 Reviewed-by: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Liza Burakova 057bc0f0 2024-08-07T11:38:54 WebGPU: Set multiple parameters in RenderPipelineDesc. This change adds multiple setters to RenderPipelineDesc to set various parameters within the DepthStencilState. Bug: angleproject:42267012 Change-Id: I71eed7195477572295de6575bfa18d2c58ca93de Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5765553 Reviewed-by: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org>
Geoff Lang c5d4c16f 2024-08-02T11:27:56 WebGPU: Initialize all GLES 2 and 3 caps Instead of using the min caps, intialize them with limits from the WebGPU limits struct or values from the spec. Bug: angleproject:357017322 Change-Id: I15597b192d915dad7c3f6bacab048cf09999da6d Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5759280 Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
Geoff Lang 31c0f439 2024-08-02T09:18:33 WebGPU: Centralize caps generation All GL and EGL caps can be generated at display creation time for WebGPU. Move all existing logic into a centralized GenerateCaps function. Bug: angleproject:357017322 Change-Id: I7398d4ee539192d64971023d9a598ac1f11592ad Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5759279 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@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>
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>
Liza Burakova ead98ed9 2024-05-02T14:04:14 Implement basic texture upload. This change modifies ImageHelper's methods to upload textures to fix webgpu API calls, as well as fully implements uploading texture data via TextureWgpu::setImage for RGBA8 formats. Bug: angleproject:8457 Change-Id: I1c5be3d79ad996a709086ca7157cca6229a336ce Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5398002 Reviewed-by: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Liza Burakova 041b0a4d 2024-04-15T13:42:17 Begin initializing caps for webgpu Bug: angleproject:8457 Change-Id: Idde0673297ec675a13bd3e4fd4d220ec47392153 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5391987 Reviewed-by: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Geoff Lang <geofflang@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>
Liza Burakova 0add1163 2024-03-25T11:39:41 Move extent and dimension conversions to wgpu_utils. This change moves some helper methods out of the ImageHelper and wgpu_helpers and into wgpu_utils. Bug: angleproject:8457 Change-Id: I1cc641e4a48eec30519e331b6150e2432d3bc3c4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5392380 Reviewed-by: Matthew Denton <mpdenton@chromium.org> Commit-Queue: Liza Burakova <liza@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Matthew Denton 1bd82319 2024-03-22T05:00:11 Add RenderTargetWgpu Based on RenderTargetMtl without any multisampling support for now. Bug: angleproject:8582 Change-Id: I4c77e747b341f08a0dd88f507e6d805d34a01d24 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5386899 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Liza Burakova <liza@chromium.org> Commit-Queue: Matthew Denton <mpdenton@chromium.org>