35#ifndef vtkWebGPURenderPipelineCache_h
36#define vtkWebGPURenderPipelineCache_h
40#include "vtkRenderingWebGPUModule.h"
44VTK_ABI_NAMESPACE_BEGIN
75 std::string
GetPipelineKey(WGPURenderPipelineDescriptor* descriptor,
const char* shaderSource);
84 const char* vertexShaderSource,
const char* fragmentShaderSource);
106 const char* fragmentShaderSource);
123 const char* fragmentShaderSource);
139 std::string&
source,
const std::string& search,
const std::string& replace,
bool all);
159 bool PrepareShaderModules(WGPURenderPipelineDescriptor* descriptor,
161 const char* fragmentShaderSource);
164 std::unique_ptr<vtkInternals> Internals;
a simple class to control print indentation
Create a webgpu device for use in rendering and compute pipelines.
WGPURenderPipeline GetRenderPipeline(const std::string &key)
Get a render pipeline associated with the given hash.
static bool Substitute(std::string &source, const std::string &search, const std::string &replace, bool all)
Substitute all occurrences of search with replace in source.
static vtkWebGPURenderPipelineCache * New()
void DestroyRenderPipeline(const std::string &key)
Destroy the render pipeline associated with the given hash.
std::string GetPipelineKey(WGPURenderPipelineDescriptor *descriptor, const char *shaderSource)
Get a unique hash for the given combination of render pipeline descriptor and shader source.
void CreateRenderPipeline(WGPURenderPipelineDescriptor *descriptor, vtkWebGPURenderWindow *wgpuRenderWindow, const char *vertexShaderSource, const char *fragmentShaderSource)
Create a render pipeline for the given combination of render pipeline descriptor and shader source.
std::string GetPipelineKey(WGPURenderPipelineDescriptor *descriptor, const char *vertexShaderSource, const char *fragmentShaderSource)
Get a unique hash for the given combination of render pipeline descriptor and shader source.
void ReleaseGraphicsResources(vtkWindow *window)
Reset the pipeline cache.
void WaitForPendingRenderPipelines()
Wait for every pipeline started by CreateRenderPipelineAsync() to finish compiling and enter the cach...
~vtkWebGPURenderPipelineCache() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void CreateRenderPipeline(WGPURenderPipelineDescriptor *descriptor, vtkWebGPURenderWindow *wgpuRenderWindow, const char *shaderSource)
Create a render pipeline for the given combination of render pipeline descriptor and shader source.
vtkWebGPURenderPipelineCache()
void CreateRenderPipelineAsync(WGPURenderPipelineDescriptor *descriptor, vtkWebGPURenderWindow *wgpuRenderWindow, const char *vertexShaderSource, const char *fragmentShaderSource)
Start creating a render pipeline without waiting for it to be compiled.
window superclass for vtkRenderWindow
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)