VTK  9.4.20250306
vtkWebGPUConfigurationInternals.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
3
4#ifndef vtkWebGPUConfigurationInternals_h
5#define vtkWebGPUConfigurationInternals_h
6
8#include "vtk_wgpu.h"
9
10VTK_ABI_NAMESPACE_BEGIN
12{
13public:
14 wgpu::Adapter Adapter;
15 wgpu::Device Device;
16 bool DeviceReady = false;
17 bool Timedout = false;
18
19 // in milliseconds
20 static double DefaultTimeout;
21 // We only keep one webgpu Instance around.
22 static wgpu::Instance Instance;
23 // Helps clean up the instance after it is no longer needed.
24 static std::size_t InstanceCount;
25
26 wgpu::RequiredLimits RequiredLimits;
27 std::vector<wgpu::FeatureName> RequiredFeatures;
28
29 static void AddInstanceRef();
30
31 static void ReleaseInstanceRef();
32
33 static wgpu::BackendType ToWGPUBackendType(vtkWebGPUConfiguration::BackendType backend);
34
36
37 static wgpu::PowerPreference ToWGPUPowerPreferenceType(
39
44 void PopulateRequiredLimits(wgpu::Adapter adapter);
45
51};
52VTK_ABI_NAMESPACE_END
53
54#endif
55// VTK-HeaderTest-Exclude: vtkWebGPUConfigurationInternals.h
void PopulateRequiredFeatures()
Stores the required features for querying the device in the RequiredFeatures vector of this Configura...
static vtkWebGPUConfiguration::BackendType FromWGPUBackendType(wgpu::BackendType backend)
std::vector< wgpu::FeatureName > RequiredFeatures
void PopulateRequiredLimits(wgpu::Adapter adapter)
Stores the required limits needed for querying the device in the RequiredLimits attribute of this Con...
static wgpu::BackendType ToWGPUBackendType(vtkWebGPUConfiguration::BackendType backend)
static wgpu::PowerPreference ToWGPUPowerPreferenceType(vtkWebGPUConfiguration::PowerPreferenceType powerPreference)
PowerPreferenceType
These enums have a one-one correspondence with the webgpu enums.