Owns the browser GPU device and loss condition shared by logical Geode contexts. More...
#include "donner/svg/renderer/geode/GeodeNativeRoot.h"
Public Member Functions | |
| GeodeGpuRoot (GeodeGpuRootCapabilities capabilities, std::shared_ptr< gpu::DeviceLostState > lostState, std::shared_ptr< const void > backendHold) | |
| Retain the selected GPU root, its capabilities, and shared device-loss state. | |
| const GeodeGpuRootCapabilities & | capabilities () const |
| Return the selected root's capabilities. | |
| const std::shared_ptr< gpu::DeviceLostState > & | lostState () const |
| Return the shared device-loss state. | |
| bool | hasBackendDevice () const |
| Return whether this root can open runtime devices for its backend. | |
| GeodeGpuRoot (GeodeGpuRootCapabilities capabilities, std::shared_ptr< gpu::DeviceLostState > lostState, std::shared_ptr< gpu::vulkan::VulkanSharedRoot > vulkanRoot=nullptr) | |
| Retains a selected native backend; the external kind is refused, because only an adopted GeodeRuntimeDeviceSource can open its devices. | |
| const GeodeGpuRootCapabilities & | capabilities () const |
| Return the selected root's capabilities. | |
| const std::shared_ptr< gpu::DeviceLostState > & | lostState () const |
| Return the shared device-loss state. | |
| const std::shared_ptr< gpu::vulkan::VulkanSharedRoot > & | vulkanRoot () const |
| Return the retained Vulkan owner; null unless the root is native Vulkan. | |
| bool | hasBackendDevice () const |
| Return whether this root can open runtime devices for its backend. | |
Friends | |
| std::shared_ptr< GeodeGpuRoot > | AdoptRuntimeDeviceSource (std::shared_ptr< GeodeRuntimeDeviceSource > source, const GeodeGpuRootCapabilities &capabilities, std::shared_ptr< gpu::DeviceLostState > lostState) |
Adopts source as a Geode root of kind GpuBackendKind::External. | |
| GeodeRuntimeDevice | CreateGpuDeviceOver (std::shared_ptr< GeodeGpuRoot > root) |
| In WebAssembly builds, opens one runtime device over the browser root, sharing its loss condition. | |
Owns the browser GPU device and loss condition shared by logical Geode contexts.
Retains a native GPU owner and the loss condition shared by logical contexts.
| donner::geode::GeodeGpuRoot::GeodeGpuRoot | ( | GeodeGpuRootCapabilities | capabilities, |
| std::shared_ptr< gpu::DeviceLostState > | lostState, | ||
| std::shared_ptr< const void > | backendHold ) |
Retain the selected GPU root, its capabilities, and shared device-loss state.
| capabilities | Capabilities exposed by the selected root. |
| lostState | Shared loss condition observed by logical devices. |
| backendHold | Opaque shared ownership keeping the backend device alive. |
| donner::geode::GeodeGpuRoot::GeodeGpuRoot | ( | GeodeGpuRootCapabilities | capabilities, |
| std::shared_ptr< gpu::DeviceLostState > | lostState, | ||
| std::shared_ptr< gpu::vulkan::VulkanSharedRoot > | vulkanRoot = nullptr ) |
Retains a selected native backend; the external kind is refused, because only an adopted GeodeRuntimeDeviceSource can open its devices.
| capabilities | Capabilities of the selected native backend. |
| lostState | Non-null loss condition shared by logical devices. |
| vulkanRoot | Shared Vulkan physical owner; null unless the backend is native Vulkan. |
|
friend |
Adopts source as a Geode root of kind GpuBackendKind::External.
The root never selects or names a backend: DONNER_GPU_BACKEND, a caller's backend choice and the platform default all refuse the external kind, so only a holder of a source reaches it.
| source | Opens the runtime devices of every context over the root; must not be null. |
| capabilities | What every device the source opens reports identically. Its backend kind is replaced with the external kind. |
| lostState | Loss condition shared by the root and every device source opens; must not be null. |
source or lostState is null.
|
friend |
In WebAssembly builds, opens one runtime device over the browser root, sharing its loss condition.
Opens one runtime device over root.
Every logical rendering context gets its own, with its own handle tables and submission serials, while all of them share the root's loss condition.
| root | Root to render through; must not be null. |