google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.36k stars 1.84k forks source link

clean-ups to prepare for descriptor set changes #7800

Closed pixelflinger closed 2 months ago

pixelflinger commented 2 months ago

The main goal of this change is to avoid having to select the "per renderable" UBO at execution time. Instead we want the PrimitiveInfo structure to already know which UBO will be used. Concretely, this means that this determination must be done when the RenderPass is created.

When automatic instancing is used, the RenderPass creates a temporary UBO to store the instance info. This UBO's life-time is dictated by both the life-time of the RenderPass and the Executors that where created from it. For this reason we introduce SharedHandle<> to correctly account for the owner's lifetime. This fixes a potential bugs where that handle could have been destroyed and used later; in practice this bug didn't happen however.

A couple other changes: