You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Creating a bind group every frame with 3 binding arrays, each with a maximum count of 50_000 bindings in the bind group layout takes an unreasonable amount of time each frame. Note that I have less than 50 actual bindings in the bind group - the cost is scaling purely based on the bind group layout binding count. Setting it even higher, like 1million, results in insane times like 450ms.
Each frame, create a bind group based on this layout, with a binding array of a small number (<50) of buffers and textures.
Here's a C++ trace captured from Nsight, compressed via 7zip, and then into a zip because github won't let me upload 7z archives. solari__2023_04_25__12_15_53 (2).zip
Apparently the size is neither needed nor validated when we use
partially bound binding arrays. This will allow us to more gracefully
fail on GPUs that support fewer texture bindings than we have images.
For now we're still specifying a fixed limit when creating the bind
group layout because we don't have the code to work based off the device
limits. There is also gfx-rs/wgpu#3729 which
makes it infeasible to specify very large values.
Description
![image](https://user-images.githubusercontent.com/47158642/234339958-39a0f695-9e3f-4dd9-933d-b0bda728cffe.png)
Creating a bind group every frame with 3 binding arrays, each with a maximum count of 50_000 bindings in the bind group layout takes an unreasonable amount of time each frame. Note that I have less than 50 actual bindings in the bind group - the cost is scaling purely based on the bind group layout binding count. Setting it even higher, like 1million, results in insane times like 450ms.
Repro steps
Here's a C++ trace captured from Nsight, compressed via 7zip, and then into a zip because github won't let me upload 7z archives.
solari__2023_04_25__12_15_53 (2).zip
You need to be on a GPU that supports ray tracing. You can also run the code directly via
cargo run --example solari
from here https://github.com/JMS55/bevy/tree/solari, and see the code here https://github.com/JMS55/bevy/tree/solari/crates/bevy_solari/src/scene.Misc
@danchia investigated and found that wgpu/gpu-descriptor was using the FREE_DESCRIPTOR_SET flag, which may be part of the cause https://github.com/zakarumych/gpu-descriptor/blob/413b91137138307afbede5bc918f77bae403493c/gpu-descriptor/src/allocator.rs#L278-L286. I'm not familiar enough with Vulkan to know.
Platform
Windows 11, Ryzen 5 2600,
AdapterInfo { name: "NVIDIA GeForce RTX 3080", vendor: 4318, device: 8710, device_type: DiscreteGpu, driver: "NVIDIA", driver_info: "528.49", backend: Vulkan }
The text was updated successfully, but these errors were encountered: