|
VTK
9.7.20260913
|
#include <vtkWebGPUProcLoader.h>
vtkWebGPUProcLoader provides C++ integration for runtime WebGPU library loading.
It ensures the proc table is initialized and provides access to WebGPU functions.
This is a singleton: construction and loading are private so that GetInstance() owns the one and only instance.
Definition at line 30 of file vtkWebGPUProcLoader.h.
Public Types | |
| enum | ImplementationType { Unknown = 0 , Dawn , WgpuNative } |
| The implementation behind the loaded library. More... | |
Public Member Functions | |
| ImplementationType | GetImplementation () const |
| Which implementation the loaded library is, as identified by the extension entry points only that implementation declares. | |
| bool | IsLoaded () const |
| Check if a library has been successfully loaded. | |
| const std::string & | GetError () const |
| Get the last error message if Load() failed. | |
| vtkWebGPUProcLoader (const vtkWebGPUProcLoader &)=delete | |
| void | operator= (const vtkWebGPUProcLoader &)=delete |
Static Public Member Functions | |
| static vtkWebGPUProcLoader * | GetInstance () |
| Get the singleton instance (loads on first access). | |
The implementation behind the loaded library.
Implementations disagree on which entry points they actually implement. wgpu-native in particular exports the whole of webgpu.h but leaves a number of bodies as unimplemented!(), which panics and aborts the process rather than returning an error, so a missing symbol cannot be used to detect them.
| Enumerator | |
|---|---|
| Unknown | |
| Dawn | |
| WgpuNative | |
Definition at line 41 of file vtkWebGPUProcLoader.h.
|
delete |
|
inline |
Which implementation the loaded library is, as identified by the extension entry points only that implementation declares.
Definition at line 52 of file vtkWebGPUProcLoader.h.
| bool vtkWebGPUProcLoader::IsLoaded | ( | ) | const |
Check if a library has been successfully loaded.
|
inline |
Get the last error message if Load() failed.
Definition at line 62 of file vtkWebGPUProcLoader.h.
|
static |
Get the singleton instance (loads on first access).
Returns nullptr if load fails.
The library to load is taken from the VTK_WEBGPU_LIBRARY environment variable when it is set; otherwise the names implementations are commonly installed under are tried in turn.
|
delete |