szeged / webrender

A GPU-based renderer for the web
https://doc.servo.org/webrender/
Mozilla Public License 2.0
45 stars 7 forks source link

Refactor descriptor pools #280

Closed zakorgy closed 5 years ago

zakorgy commented 5 years ago

This PR intends to fix those cases where we run to of descriptors, because we exceed the limit what we set at Device creation. I have changed our descriptor pool logic in the following way: when we hit the descriptor set limit of the current pool, we create a new pool two times larger(4096 max) as the previous one. The reason for doubling the size is that there are cases when we need a huge amount of them (thousands), and we don't want a lot of descriptor pool allocation. After we don't need those extra pools anymore, we delete them during the reset call.