VTK  9.4.2
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
18 // in milliseconds
19 static double DefaultTimeout;
20 // We only keep one webgpu Instance around.
21 static wgpu::Instance Instance;
22 // Helps clean up the instance after it is no longer needed.
23 static std::size_t InstanceCount;
24
25 wgpu::RequiredLimits RequiredLimits;
26 std::vector<wgpu::FeatureName> RequiredFeatures;
27
28 static void AddInstanceRef();
29
30 static void ReleaseInstanceRef();
31
32 static wgpu::BackendType ToWGPUBackendType(vtkWebGPUConfiguration::BackendType backend);
33
35
36 static wgpu::PowerPreference ToWGPUPowerPreferenceType(
38
40 WGPURequestAdapterStatus status, WGPUAdapter cAdapter, const char* message, void* userdata);
41
46 void PopulateRequiredLimits(wgpu::Adapter adapter);
47
53
55 WGPURequestDeviceStatus status, WGPUDevice cDevice, const char* message, void* userdata);
56};
57VTK_ABI_NAMESPACE_END
58
59#endif
60// VTK-HeaderTest-Exclude: vtkWebGPUConfigurationInternals.h
void PopulateRequiredFeatures()
Stores the required features for querying the device in the RequiredFeatures vector of this Configura...
static void OnAdapterRequestCompleted(WGPURequestAdapterStatus status, WGPUAdapter cAdapter, const char *message, void *userdata)
static vtkWebGPUConfiguration::BackendType FromWGPUBackendType(wgpu::BackendType backend)
std::vector< wgpu::FeatureName > RequiredFeatures
static void OnDeviceRequestCompleted(WGPURequestDeviceStatus status, WGPUDevice cDevice, const char *message, void *userdata)
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.