VTK  9.4.20250207
vtkWebGPURenderPipelineCache.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
26#ifndef vtkWebGPURenderPipelineCache_h
27#define vtkWebGPURenderPipelineCache_h
28
29#include "vtkObject.h"
30
31#include "vtkRenderingWebGPUModule.h" // for export macro
32#include "vtk_wgpu.h" // for webgpu
33
34VTK_ABI_NAMESPACE_BEGIN
35
37class vtkWindow;
38
39class VTKRENDERINGWEBGPU_EXPORT vtkWebGPURenderPipelineCache : public vtkObject
40{
41public:
44 void PrintSelf(ostream& os, vtkIndent indent) override;
45
50
54 wgpu::RenderPipeline GetRenderPipeline(const std::string& key);
55
59 std::string GetPipelineKey(wgpu::RenderPipelineDescriptor* descriptor, const char* shaderSource);
60
65 void CreateRenderPipeline(wgpu::RenderPipelineDescriptor* descriptor,
66 vtkWebGPURenderer* wgpuRenderer, const char* shaderSource);
67
71 void DestroyRenderPipeline(const std::string& key);
72
73protected:
76
77private:
79 void operator=(const vtkWebGPURenderPipelineCache&) = delete;
80
81 class vtkInternals;
82 std::unique_ptr<vtkInternals> Internals;
83};
84
85VTK_ABI_NAMESPACE_END
86#endif
a simple class to control print indentation
Definition vtkIndent.h:108
abstract base class for most VTK objects
Definition vtkObject.h:162
Class to create and retrieve render pipelines based on a given key.
static vtkWebGPURenderPipelineCache * New()
void DestroyRenderPipeline(const std::string &key)
Destroy the render pipeline associated with the given hash.
~vtkWebGPURenderPipelineCache() override
void ReleaseGraphicsResources(vtkWindow *w)
Reset the pipeline cache.
wgpu::RenderPipeline GetRenderPipeline(const std::string &key)
Get a render pipeline associated with the given hash.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
std::string GetPipelineKey(wgpu::RenderPipelineDescriptor *descriptor, const char *shaderSource)
Get a unique hash for the given combination of render pipeline descriptor and shader source.
void CreateRenderPipeline(wgpu::RenderPipelineDescriptor *descriptor, vtkWebGPURenderer *wgpuRenderer, const char *shaderSource)
Create a render pipeline for the given combination of render pipeline descriptor and shader source.
window superclass for vtkRenderWindow
Definition vtkWindow.h:48