Repository navigation
perf(webgpu): sync wgpu fork to upstream trunk; skip per-draw re-validation in finish - #219
Merged
Merged
Conversation
…dation in finish wgpu-core replayed a render pass by re-running the full draw readiness check on every draw (bind group compatibility, late buffer sizes, vertex slots, index format) and re-issuing HAL vertex/index binds even when the same buffers were already bound. For a three.js BatchedMesh pass that is thousands of consecutive draws with no state change in between; for the per-Mesh path it is the same geometry buffers rebound for every mesh. The fork now caches the readiness check per draw family until a non-draw command runs, skips the vertex slot and bind group rebind scans when nothing is dirty, and drops redundant index/vertex rebinds. Headless finish() cost per draw at 13k draws, same session A/B: Metal (M1 Max) batched 63 -> 38 ns per-mesh 240 -> 195 ns Vulkan (Intel/Mesa) batched 66 -> 36 ns per-mesh 405 -> 355 ns The fork is also merged with gfx-rs/wgpu trunk (304 commits): coalesced queue-write barriers, Metal pipeline switches without per-vertex-buffer allocations, Vulkan descriptor pool recovery and transient memory pool, Vulkan dma-buf texture import, Mali robust-image-access fix, deadlock fixes, plus naga fixes. The merge is performance-neutral in interleaved runs. wgpu's own suites pass on the merged tree (120 validation, 65 core unit, 299 Metal GPU tests) and wgpu-hal/core type-check for the Android and iOS targets. canvas-c port: MapMode replaces HostMap and map_async takes the mode and callback directly; get_mapped_range returns a BufferMapping; the two pipeline error enums merged; Surface::configure returns Result and Queue::submit returns Option; BufferUsages/ShaderStages are composed flags; every TextureDescriptor gets texture_binding_view_dimension; the new snorm10-10-10-2 vertex format is mirrored in the enum and TS types.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Without a lockfile, cargo picked lock_api 0.5, whose RawMutex/RawRwLock traits wgpu-sync does not implement.
This was referenced Nov 14, 2026
triniwiz
added a commit
that referenced
this pull request
Nov 14, 2026
…dation in finish (#219) The wgpu fork now reuses the draw readiness check across consecutive draws with no state change and drops redundant vertex/index rebinds. Headless finish() per draw at 13k draws: Metal (M1 Max) batched 63 -> 38 ns per-mesh 240 -> 195 ns Vulkan (Intel/Mesa) batched 66 -> 36 ns per-mesh 405 -> 355 ns The fork is also merged with gfx-rs/wgpu trunk (304 commits), with lock_api capped below 0.5 for wgpu-sync. canvas-c and canvas-napi are ported to the upstream API changes, and the new snorm10-10-10-2 vertex format is exposed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps the wgpu fork, which now:
Skips per-draw re-validation in render pass replay. Consecutive draws with no state change reuse the readiness check, and redundant vertex/index rebinds are dropped. Headless
finish()per draw at 13k draws:Is merged with gfx-rs/wgpu trunk (304 commits). The merge has no measurable performance impact, and wgpu's own test suites pass.
canvas-c is ported to the upstream API changes, and the new
snorm10-10-10-2vertex format is exposed.Fork: https://github.com/triniwiz/wgpu/tree/sync/upstream-trunk (
87e00d492)