wgpu/player
Nicolas Silva 399637e2b8
Bind group layout dedup (#3925)
* Remove generic parameter in compat::Manager.

The code is specific to bind group layout ids and the generic parameter gets in the way.

* Add a test.

The test actually covers wgpu's configuration where deduplication does not require the indirection rather than the new code. I used it to debug the new code with the configuration hard-coded. It's tedious to add a test to cover dedpuplication of bind group layouts for users of wgpu_core to provide their IDs, we can rely on the CTS which has test for that.

* Implement bind group layout deduplication for all configurations

Currently wgpu-core implement bind group layout deduplication only when it creates its own resource IDs. In other words it works for wgpu but not in Firefox.
This PR bridges the gap by allowing an optional indirection in bind group layouts: each BGL may store an ID referring to its "deduplicated" BGL.
When referring to a BGL the rest of the code must make sure to follow the indirection. The exception is command buffer processing which is considered hot code and where we first validate against the provided BGL ID and only follow the indirection if the initial check failed.

The main pain point with this approach is the various places where wgpu-core manually updates reference counts: we have to be careful about following the indirection to track the right BGL.

* Avoid making decisions based on the size of some generic type.
2023-08-25 21:48:22 +02:00
..
src Bind group layout dedup (#3925) 2023-08-25 21:48:22 +02:00
tests Allow specifying minor GLES3 version (#3998) 2023-08-16 11:51:56 -04:00
Cargo.toml Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
README.md Update players readme 2020-11-05 16:58:40 -05:00

wgpu player

This is an application that allows replaying the wgpu workloads recorded elsewhere. It requires the player to be built from the same revision as an application was linking to, or otherwise the data may fail to load.

Launch as:

play <trace-dir>

When built with "winit" feature, it's able to replay the workloads that operate on a swapchain. It renders each frame sequentially, then waits for the user to close the window. When built without "winit", it launches in console mode and can replay any trace that doesn't use swapchains.

Note: replaying is currently restricted to the same backend, as one used for recording a trace. It is straightforward, however, to just replace the backend in RON, since it's serialized as plain text. Valid values are: Vulkan, Metal, Dx12, and Dx11.