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.35k stars 1.83k forks source link

add minimal support for Texture Views in the backend #7937

Closed pixelflinger closed 4 days ago

pixelflinger commented 1 week ago

Texture Views are currently limited to the min/max lod, and it's not allowed to have several views of the same texture in a single shader. Only sampleable textures can have a texture view.

In this CL:

metal: skeleton implementation

vulkan: skeleton implementation

opengl: implementation should be functional. the min/max level is now set when we bind a sampler group. When we create a view we simply duplicate the texture handle and update its min/max lod. We also now keep a ref count of the open gl texture name so that we only destroy it when no more references (i.e. views) are present. The counter is implemented as a Handle<> so it can be shared efficiently.

pixelflinger commented 4 days ago

I created a new PR with ma/descriptor-sets as the base branch