rusticl/platform: make the initialization more explicit
authorKarol Herbst <kherbst@redhat.com>
Mon, 24 Apr 2023 11:01:42 +0000 (13:01 +0200)
committerMarge Bot <emma+marge@anholt.net>
Tue, 25 Apr 2023 04:27:57 +0000 (04:27 +0000)
commit2283e9d155c6ed665d667dbd2e69477eace11162
tree0f4bd776139e6b24083275b61c5d03152e1098bf
parent400847a990033c6d7e0bfab716bce49ec600358d
rusticl/platform: make the initialization more explicit

It's not a lazy loaded type so doing the Once::call_once in every
Platform::get gives us a pointless atomic, which might be slow on some
platforms.

Every application has to call clGetPlatformIDs so we only need to do it
there.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22649>
src/gallium/frontends/rusticl/api/platform.rs
src/gallium/frontends/rusticl/core/platform.rs